[PATCH] gnu: Add nlohmann-json.

  • Done
  • quality assurance status badge
Details
3 participants
  • jgart
  • Liliana Marie Prikler
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
jgart
Severity
normal
Merged with
J
(address . guix-patches@gnu.org)(name . jgart)(address . jgart@dismail.de)
20230221064023.11660-1-jgart@dismail.de
* gnu/packages/web.scm (nlohmann-json): New variable.
---
gnu/packages/web.scm | 48 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)

Toggle diff (68 lines)
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 <cage-dev@twistfold.it>
;;; Copyright © 2022 Pradana Aumars <paumars@courrier.dev>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
-;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2022, 2023 jgart <jgart@dismail.de>
;;; Copyright © 2023 Paul A. Patience <paul@apatience.com>
;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
@@ -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
J
[PATCH v2] gnu: Add nlohmann-json.
(address . 61672@debbugs.gnu.org)(name . jgart)(address . jgart@dismail.de)
20230221064354.12168-1-jgart@dismail.de
* gnu/packages/web.scm (nlohmann-json): New variable.

v2 just rebases the history


---
gnu/packages/web.scm | 48 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)

Toggle diff (68 lines)
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 <cage-dev@twistfold.it>
;;; Copyright © 2022 Pradana Aumars <paumars@courrier.dev>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
-;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2022, 2023 jgart <jgart@dismail.de>
;;; Copyright © 2023 Paul A. Patience <paul@apatience.com>
;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
@@ -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
L
L
Liliana Marie Prikler wrote on 21 Feb 2023 09:49
122413e3fb84b2aa4087a7f7c4d553f2ad496585.camel@ist.tugraz.at
Am Dienstag, dem 21.02.2023 um 07:43 +0100 schrieb jgart:
Toggle quote (1 lines)
> * gnu/packages/web.scm (nlohmann-json): New variable.
Note, that json-modern-cxx is already defined in gnu/packages/cpp.scm.
I'd suggest renaming it, deprecating the old name and then updating it.

Cheers
J
6affead6f2fd00c5c2ecb858f26697f2@dismail.de
hi lilyp,

Toggle quote (2 lines)
> Note, that json-modern-cxx is already defined in gnu/packages/cpp.scm.

Oh didn't realize. Thanks! I'll send an update today.

all best,

jgart
L
L
Liliana Marie Prikler wrote on 23 Feb 2023 18:57
Re: [PATCH 1/3] gnu: Add nlohmann-json.
(address . control@debbugs.gnu.org)
3fe4ac9696ec9c962e4a120ca1292ab4fc0e7b70.camel@gmail.com
merge 61672 61724
thanks

Hi jgart,

Am Donnerstag, dem 23.02.2023 um 06:11 +0100 schrieb jgart:
Toggle quote (32 lines)
> * gnu/packages/cpp.scm (nlohmann-json): New variable.
> ---
>  gnu/packages/cpp.scm | 98 +++++++++++++++++-------------------------
> --
>  1 file changed, 37 insertions(+), 61 deletions(-)
>
> diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
> index ed6ae69198..7091459d97 100644
> --- a/gnu/packages/cpp.scm
> +++ b/gnu/packages/cpp.scm
> @@ -22,7 +22,7 @@
>  ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
>  ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
>  ;;; Copyright © 2021 Nikolay Korotkiy <sikmir@disroot.org>
> -;;; Copyright © 2021 jgart <jgart@dismail.de>
> +;;; Copyright © 2021, 2023 jgart <jgart@dismail.de>
>  ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
>  ;;; Copyright © 2021 Disseminate Dissent
> <disseminatedissent@protonmail.com>
>  ;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
> @@ -595,74 +595,50 @@ (define-public json-dto
>  data transfer object.")
>      (license license:bsd-3)))
>  
> -(define-public json-modern-cxx
> +(define-public nlohmann-json
>    (package
> -    (name "json-modern-cxx")
> -    (version "3.10.5")
> -    (home-page "https://github.com/nlohmann/json")
> +    (name "nlohmann-json")
> +    (version "3.11.2")
Perform one logical change at a time:
1. Updating is a logical change.
2. Renaming and adjusting dependant packages is a logical change.
When adding a deprecated alias, it should be done in the same commit as
the rename (2).

The order of commits between (1) and (2) doesn't matter.

Cheers
?