guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/21: gnu: json-modern-cxx: Update to 3.9.0.


From: guix-commits
Subject: 01/21: gnu: json-modern-cxx: Update to 3.9.0.
Date: Wed, 29 Jul 2020 18:58:50 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit 295b4f7e17e76d0fea929047287e0e84bdca890b
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Tue Jul 28 18:01:46 2020 +0200

    gnu: json-modern-cxx: Update to 3.9.0.
    
    * gnu/packages/cpp.scm (json-modern-cxx): Update to 3.9.0.
    [arguments]: New field.
    [native-inputs]: Add "json_test_data" origin.
---
 gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 44 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 5f0eae9..5e83bb6 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -246,7 +247,7 @@ as ordering relation.")
 (define-public json-modern-cxx
   (package
     (name "json-modern-cxx")
-    (version "3.7.3")
+    (version "3.9.0")
     (home-page "https://github.com/nlohmann/json";)
     (source
      (origin
@@ -255,7 +256,7 @@ as ordering relation.")
                            (commit (string-append "v" version))))
        (sha256
         (base32
-         "04rry1xzis71z5gj1ylcj8b4li5q18zxhcwaviwvi3hx0frzxl9w"))
+         "06wmbnwbisbq3rqdbmi297hidvq6q8vs6j4z0a9qpr4sm721lwa6"))
        (file-name (git-file-name name version))
        (modules '((guix build utils)))
        (snippet
@@ -278,12 +279,51 @@ as ordering relation.")
                   (string-append
                    "#include <fifo_map/" fifo-map-hpp ">")))))
            #t))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "-DJSON_TestDataDirectory="
+                            (assoc-ref %build-inputs "json_test_data")))
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'fix-pkg-config-install
+                    (lambda _
+                      ;; This phase can be removed for versions >= 3.9.1.
+                      (substitute* "CMakeLists.txt"
+                        ;; Look for the generated .pc in the right place ...
+                        
(("\\$\\{CMAKE_BINARY_DIR\\}/\\$\\{PROJECT_NAME\\}\\.pc")
+                        "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc")
+                        ;; ... and install it to the libdir.
+                        (("DESTINATION lib/pkgconfig")
+                         "DESTINATION \"${CMAKE_INSTALL_LIBDIR}/pkgconfig\""))
+                      #t))
+                  ;; XXX: When tests are enabled, the install phase will cause
+                  ;; a needless rebuild without the given configure flags,
+                  ;; ultimately creating both $out/lib and $out/lib64.  Move
+                  ;; the check phase after install to work around it.
+                  (delete 'check)
+                  (add-after 'install 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (if tests?
+                          ;; Some tests need git and a full checkout, skip 
those.
+                          (invoke "ctest" "-LE" "git_required")
+                          (format #t "test suite not run~%"))
+                      #t)))))
     (native-inputs
      `(("amalgamate" ,amalgamate)
-       ("doctest" ,doctest)))
+       ("doctest" ,doctest)
+       ("json_test_data"
+        ,(let ((version "3.0.0"))
+           (origin
+             (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/nlohmann/json_test_data";)
+                   (commit (string-append "v" version))))
+             (file-name (git-file-name "json_test_data" version))
+             (sha256
+              (base32
+               "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv")))))))
     (inputs
      `(("fifo-map" ,fifo-map)))
-    (build-system cmake-build-system)
     (synopsis "JSON parser and printer library for C++")
     (description "JSON for Modern C++ is a C++ JSON library that provides
 intuitive syntax and trivial integration.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]