diff mbox series

[bug#61724,v4,3/7] gnu: nlohmann-json: Improve package style.

Message ID 911d4ae047d69888fe33fde18c832fc536837677.1683475550.git.liliana.prikler@gmail.com
State New
Headers show
Series [bug#61724,v4,1/7] gnu: Rename json-modern-cxx to nlohmann-json. | expand

Commit Message

Liliana Marie Prikler April 28, 2023, 7:55 p.m. UTC
* gnu/package/cpp.scm (nlohmann-json)[source]<snippet>: Fit to 80 chars width.
Use G-Expressions.
[arguments]: Use G-Expressions.
---
 gnu/packages/cpp.scm | 70 +++++++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 33 deletions(-)

Comments

Liliana Marie Prikler May 7, 2023, 4:50 p.m. UTC | #1
Am Freitag, dem 28.04.2023 um 21:55 +0200 schrieb Liliana Marie
Prikler:
> * gnu/package/cpp.scm (nlohmann-json)[source]<snippet>: Fit to 80
> chars width.
> Use G-Expressions.
> [arguments]: Use G-Expressions.
There are no 4..7/7 – those four extra commits come from the functional
C++ packages I also plan to apply next week.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 5c2e6d2425..e797020124 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -610,41 +610,45 @@  (define-public nlohmann-json
        (file-name (git-file-name name version))
        (modules '((guix build utils)))
        (snippet
-        '(begin
-           ;; Delete bundled software.  Preserve doctest_compatibility.h, which
-           ;; is a wrapper library added by this package.
-           (install-file "./tests/thirdparty/doctest/doctest_compatibility.h" "/tmp")
-           (delete-file-recursively "./tests/thirdparty")
-           (install-file "/tmp/doctest_compatibility.h" "./tests/thirdparty/doctest")
-
-           ;; Adjust for the unbundled fifo_map and doctest.
-           (substitute* (find-files "./tests/" "\\.h(pp)?")
-             (("#include \"doctest\\.h\"") "#include <doctest/doctest.h>")
-             (("#include <doctest\\.h>") "#include <doctest/doctest.h>"))
-           (with-directory-excursion "tests/src"
-             (let ((files (find-files "." "\\.cpp$")))
-               (substitute* files
-                 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
-                  (string-append
-                   "#include <fifo_map/" fifo-map-hpp ">")))))))))
+        #~(begin
+            ;; Delete bundled software.  Preserve doctest_compatibility.h, which
+            ;; is a wrapper library added by this package.
+            (install-file "./tests/thirdparty/doctest/doctest_compatibility.h"
+                          "/tmp")
+            (delete-file-recursively "./tests/thirdparty")
+            (install-file "/tmp/doctest_compatibility.h"
+                          "./tests/thirdparty/doctest")
+
+            ;; Adjust for the unbundled fifo_map and doctest.
+            (substitute* (find-files "./tests/" "\\.h(pp)?")
+              (("#include \"doctest\\.h\"") "#include <doctest/doctest.h>")
+              (("#include <doctest\\.h>") "#include <doctest/doctest.h>"))
+            (with-directory-excursion "tests/src"
+              (let ((files (find-files "." "\\.cpp$")))
+                (substitute* files
+                  (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
+                   (string-append
+                    "#include <fifo_map/" fifo-map-hpp ">")))))))))
     (build-system cmake-build-system)
     (arguments
-     '(#:configure-flags
-       (list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
-             (string-append "-DJSON_TestDataDirectory="
-                            (dirname
-                             (search-input-directory %build-inputs
-                                                     "json_nlohmann_tests"))))
-       #:phases (modify-phases %standard-phases
-                  (replace 'check
-                    (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
-                      (if tests?
-                          ;; Some tests need git and a full checkout, skip those.
-                          (invoke "ctest" "-LE" "git_required"
-                                  "-j" (if parallel-tests?
-                                           (number->string (parallel-job-count))
-                                           "1"))
-                          (format #t "test suite not run~%")))))))
+     (list
+      #:configure-flags
+      #~(list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
+              (string-append "-DJSON_TestDataDirectory="
+                             (dirname
+                              (search-input-directory %build-inputs
+                                                      "json_nlohmann_tests"))))
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'check
+            (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+              (if tests?
+                  ;; Some tests need git and a full checkout, skip those.
+                  (invoke "ctest" "-LE" "git_required"
+                          "-j" (if parallel-tests?
+                                   (number->string (parallel-job-count))
+                                   "1"))
+                  (format #t "test suite not run~%")))))))
     (native-inputs
      (list amalgamate
            (let ((version "3.1.0"))