Subject: bug#61672: closed (Re: [bug#61724] [PATCH v4 1/7] gnu: Rename json-modern-cxx to nlohmann-json.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 14 May 2023 10:25:02 +0000

Your bug report

#61724: [PATCH] gnu: Add nlohmann-json.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61724: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61724
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#61724] [PATCH v4 1/7] gnu: Rename json-modern-cxx to nlohmann-json.
From: Liliana Marie Prikler <[email-masked]>
To: Simon Tournier <[email-masked]>, [email-masked]
Date: Sun, 14 May 2023 12:24:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Am Donnerstag, dem 11.05.2023 um 20:48 +0200 schrieb Liliana Marie
Prikler:
> Am Donnerstag, dem 11.05.2023 um 14:53 +0200 schrieb Simon Tournier:
> > Hi,
> > 
> > On jeu., 27 avril 2023 at 20:57, Liliana Marie Prikler
> > <[email-masked]> wrote:
> > 
> > > diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-
> > > tools.scm
> > > index 33d91e6043..fb2deaa384 100644
> > > --- a/gnu/packages/build-tools.scm
> > > +++ b/gnu/packages/build-tools.scm
> > > @@ -148,7 +148,7 @@ (define-public bear
> > >       `(("c-ares" ,c-ares)
> > >         ("fmt" ,fmt-8)
> > >         ("grpc" ,grpc)
> > > -       ("json-modern-cxx" ,json-modern-cxx)
> > > +       ("nlohmann-json" ,json-modern-cxx)
> > 
> > Typo, I guess.  Instead,
> > 
> >  +       ("nlohmann-json" ,nlohmann-json)
> Indeed, I missed the /g in my sed.  Will fix.
And pushed with said fix.

Thanks

Subject: [PATCH] gnu: Add nlohmann-json.
From: jgart <[email-masked]>
To: [email-masked]
Cc: jgart <[email-masked]>
Date: Tue, 21 Feb 2023 07:40:23 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/web.scm (nlohmann-json): New variable.
---
 gnu/packages/web.scm | 48 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 98db004482..e2f9dddf06 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -58,7 +58,7 @@
 ;;; Copyright © 2022 cage <[email-masked]>
 ;;; Copyright © 2022 Pradana Aumars <[email-masked]>
 ;;; Copyright © 2022 Petr Hodina <[email-masked]>
-;;; Copyright © 2022 jgart <[email-masked]>
+;;; Copyright © 2022, 2023 jgart <[email-masked]>
 ;;; Copyright © 2023 Paul A. Patience <[email-masked]>
 ;;; Copyright © 2022 Bruno Victal <[email-masked]>
 ;;; Copyright © 2023 David Thompson <[email-masked]>
@@ -1109,6 +1109,52 @@ (define-public jansson
 data.")
     (license license:expat)))
 
+(define-public nlohmann-json
+  (package
+    (name "nlohmann-json")
+    (version "3.11.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/nlohmann/json")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0g6rfsbkvrxmacchz4kbr741yybj7mls3r4hgyfdd3pdbqhn2is9"))))
+    (build-system cmake-build-system)
+    (arguments
+      (list #:out-of-source? #t
+            #:configure-flags
+            #~(list "-DJSON_FastTests=ON"
+                    "-DJSON_MultipleHeaders=ON"
+                    "-DJSON_BuildTests=ON"
+                    (string-append "-DJSON_TestDataDirectory="
+                                   #$(this-package-native-input "json-test-data")))
+            #:phases
+            #~(modify-phases %standard-phases
+                (replace 'check
+                  (lambda* (#:key tests? #:allow-other-keys)
+                    ;; Skip tests that require git or modify “installed files”.
+                    (when tests?
+                      (invoke "make" "ARGS=-LE 'not_reproducible|git_required' --verbose")))))))
+    (native-inputs
+      `(("json-test-data"
+         ,(origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/nlohmann/json_test_data")
+                  (commit "v3.1.0")))
+            (sha256
+             (base32 "0nbirc428qx0lpi940p7y24fzdjbwl6xig3h5rdbihyymmdzhvbc"))
+            (file-name (git-file-name "vis-test" version))))))
+    (home-page "https://json.nlohmann.me/")
+    (synopsis "JSON for Modern C++")
+    (description "This package provides a JSON implementation with an
+intuitive syntax for C++, a single include header file, and with a
+codebase that has 100% code coverage.")
+    (license license:expat)))
+
 (define-public json-c
   (package
     (name "json-c")
-- 
2.39.1