unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Raghav Gururajan via Guix-patches via <guix-patches@gnu.org>
To: 51885@debbugs.gnu.org
Cc: Raghav Gururajan <rg@raghavgururajan.name>, jgart <jgart@dismail.de>
Subject: [bug#51885] [PATCH v2 3/4] gnu: Add json.
Date: Thu,  9 Dec 2021 05:52:11 -0500	[thread overview]
Message-ID: <20211209105212.29412-3-rg@raghavgururajan.name> (raw)
In-Reply-To: <20211209105212.29412-1-rg@raghavgururajan.name>

* gnu/packages/cpp.scm (json): New variable.

Co-authored-by: jgart <jgart@dismail.de>
---
 gnu/packages/cpp.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index a579c47ad9..28705d5bb6 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -77,6 +77,69 @@ (define-module (gnu packages cpp)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml))
 
+(define-public json
+  (package
+    (name "json")
+    (version "3.10.4")
+    (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 "17kxwxl6515s8nb5x7zy69c8qy4gswac66fp15261x1g6sa2jnkx"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1)))
+       (snippet
+        `(begin
+           (delete-file-recursively "third_party")
+           (let ((keep
+                  ;; Custom forks which are incompatible with the ones in Guix.
+                  '("doctest" "fifo_map")))
+             (with-directory-excursion "test/thirdparty"
+               (for-each delete-file-recursively
+                         (lset-difference string=?
+                                          (scandir ".")
+                                          (cons* "." ".." keep)))))
+             #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 'disable-failing-tests
+           (lambda _
+             (substitute* "test/CMakeLists.txt"
+               ;; Requires network connection.
+               (("add_subdirectory\\(cmake_fetch_content\\)") "")))))))
+    (native-inputs
+     `(("json_test_data"
+        ,(origin
+           (method git-fetch)
+           (uri
+            (git-reference
+             (url "https://github.com/nlohmann/json_test_data")
+             (commit "v3.0.0")))
+           (file-name
+            (git-file-name "json_test_data" "3.0.0"))
+           (sha256
+            (base32 "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv"))))
+       ("python" ,python-wrapper)))
+    (home-page "https://json.nlohmann.me/")
+    (synopsis "JSON for C++")
+    (description "@code{json} is a C++ json library for converting to and from
+C++ data structures.  It's design goals emphasize intuitive syntax, trivial
+integration via a single header file, and serious test coverage involving all of
+the codebase.")
+    (license license:expat)))
+
 (define-public argagg
   (let ((commit "79e4adfa2c6e2bfbe63da05cc668eb9ad5596748")
         (revision "0"))
-- 
2.34.0





  parent reply	other threads:[~2021-12-09 10:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 23:58 [bug#51885] Blacksmith - Rowhammer Fuzzer Raghav Gururajan via Guix-patches via
2021-11-28  0:55 ` [bug#51885] [PATCH 1/2] gnu: Add asmjit jgart via Guix-patches via
2021-11-28  0:55   ` [bug#51885] [PATCH 2/2] gnu: Add argagg jgart via Guix-patches via
2021-11-28  1:01 ` [bug#51885] Guix Meetup Nov 27 2021: asmjit and argagg jgart via Guix-patches via
2021-12-01  4:29 ` [bug#51885] [PATCH 1/4] gnu: Add asmjit Raghav Gururajan via Guix-patches via
2021-12-01  4:29   ` [bug#51885] [PATCH 2/4] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-01  4:29   ` [bug#51885] [PATCH 3/4] gnu: Add json Raghav Gururajan via Guix-patches via
2021-12-01  4:29   ` [bug#51885] [PATCH 4/4] gnu: Add blacksmith Raghav Gururajan via Guix-patches via
2021-12-09 10:52 ` [bug#51885] [PATCH v2 1/4] gnu: Add asmjit Raghav Gururajan via Guix-patches via
2021-12-09 10:52   ` [bug#51885] [PATCH v2 2/4] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-09 10:52   ` Raghav Gururajan via Guix-patches via [this message]
2021-12-09 10:57     ` [bug#51885] [PATCH v2 3/4] gnu: Add json Nicolò Balzarotti
2021-12-09 13:26       ` Raghav Gururajan via Guix-patches via
2021-12-09 10:52   ` [bug#51885] [PATCH v2 4/4] gnu: Add blacksmith Raghav Gururajan via Guix-patches via
2021-12-09 13:16 ` [bug#51885] [PATCH v3 1/3] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-09 13:16   ` [bug#51885] [PATCH v3 2/3] gnu: Add json Raghav Gururajan via Guix-patches via
2021-12-09 13:23 ` [bug#51885] [PATCH v4 1/3] gnu: Add asmjit Raghav Gururajan via Guix-patches via
2021-12-09 13:23   ` [bug#51885] [PATCH v4 2/3] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-09 13:23   ` [bug#51885] [PATCH v4 3/3] gnu: Add blacksmith Raghav Gururajan via Guix-patches via
2021-12-09 13:30 ` [bug#51885] [PATCH v5 1/3] gnu: Add asmjit Raghav Gururajan via Guix-patches via
2021-12-09 13:30   ` [bug#51885] [PATCH v5 2/3] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-09 13:30   ` [bug#51885] [PATCH v5 3/3] gnu: Add blacksmith Raghav Gururajan via Guix-patches via
2021-12-09 13:36 ` [bug#51885] [PATCH v6 1/3] gnu: Add asmjit Raghav Gururajan via Guix-patches via
2021-12-09 13:36   ` [bug#51885] [PATCH v6 2/3] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-09 13:36   ` [bug#51885] [PATCH v6 3/3] gnu: Add blacksmith Raghav Gururajan via Guix-patches via
2021-12-09 13:45 ` [bug#51885] [PATCH v7 1/3] gnu: Add asmjit Raghav Gururajan via Guix-patches via
2021-12-09 13:45   ` [bug#51885] [PATCH v7 2/3] gnu: Add argagg Raghav Gururajan via Guix-patches via
2021-12-09 13:45   ` [bug#51885] [PATCH v7 3/3] gnu: Add blacksmith Raghav Gururajan via Guix-patches via
2022-01-14  9:00 ` bug#51885: Blacksmith - Rowhammer Fuzzer Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211209105212.29412-3-rg@raghavgururajan.name \
    --to=guix-patches@gnu.org \
    --cc=51885@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    --cc=rg@raghavgururajan.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).