From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2FbjOJLgsWFZcAAAgWs5BA (envelope-from ) for ; Thu, 09 Dec 2021 11:55:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KJWpNJLgsWHhawAAB5/wlQ (envelope-from ) for ; Thu, 09 Dec 2021 10:55:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BDDC72FB92 for ; Thu, 9 Dec 2021 11:55:14 +0100 (CET) Received: from localhost ([::1]:52156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvH4z-00029N-PC for larch@yhetil.org; Thu, 09 Dec 2021 05:55:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvH3q-0000U6-DG for guix-patches@gnu.org; Thu, 09 Dec 2021 05:54:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvH3q-0007PR-5B for guix-patches@gnu.org; Thu, 09 Dec 2021 05:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mvH3q-0002hd-4S for guix-patches@gnu.org; Thu, 09 Dec 2021 05:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51885] [PATCH v2 3/4] gnu: Add json. Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Dec 2021 10:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51885 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 51885@debbugs.gnu.org Cc: Raghav Gururajan , jgart Received: via spool by 51885-submit@debbugs.gnu.org id=B51885.163904719010309 (code B ref 51885); Thu, 09 Dec 2021 10:54:02 +0000 Received: (at 51885) by debbugs.gnu.org; 9 Dec 2021 10:53:10 +0000 Received: from localhost ([127.0.0.1]:42548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvH30-0002gD-3X for submit@debbugs.gnu.org; Thu, 09 Dec 2021 05:53:10 -0500 Received: from out2.migadu.com ([188.165.223.204]:16342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvH2y-0002g5-3W for 51885@debbugs.gnu.org; Thu, 09 Dec 2021 05:53:08 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1639047187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fammCkomjTQMfaI4GSPrqtkLGtixc+4svxr8sx+QCmM=; b=cifeD1NyN0Yli+xAJz/BQ//2InTNhyFAOZxT6q+AnynBV9k3YNWYCOb4ILgmgTO4s+0LUq 6aQSzlCLStv6oGW4p8HDlxfBltkYYjNfrtDQeF0vE1/GukynRBe57EmioPML11hVlRhr1e wjNOlBDG/7vPHTYDCK30tq+CtmBIVdlO/2H8mLL7XJwqLJCJSWGM2jB4nRBXngPZ5+AkfH CfTEASTL5AEFJBnK8Zkz4A3ng660j4c5HlF2NnTqD5tueMh5VzMJ2PYSKNJsFZyxOlruKK ZNV+dYK6MxKZ29ripf7CQVY1I7PVqQQpUNBi9JV/V1J4Y9rzWV0MmHkMAXCL1g== Date: Thu, 9 Dec 2021 05:52:11 -0500 Message-Id: <20211209105212.29412-3-rg@raghavgururajan.name> In-Reply-To: <20211209105212.29412-1-rg@raghavgururajan.name> References: <20211209105212.29412-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Raghav Gururajan X-ACL-Warn: , Raghav Gururajan via Guix-patches From: Raghav Gururajan via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: BDDC72FB92 X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: mSFmtKTgw80T * gnu/packages/cpp.scm (json): New variable. Co-authored-by: jgart --- 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