diff options
| author | bdunahu <bdunahu@operationnull.com> | 2026-04-23 19:54:32 -0400 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-05-29 20:40:42 +0200 |
| commit | 0853a1671f74f9869ca6c75d6086092354783a99 (patch) | |
| tree | 51c1b4c82f60da9f47e1d6a97d78af268f1c7286 /gnu/packages/cpp.scm | |
| parent | 54d29defe0979636abe06e712d1adabb1d17f795 (diff) | |
gnu: Add nlohmann-json-no-char8-t.
* gnu/packages/patches/nlohmann_json_fix_char8_t.patch: New file.
* gnu/local.mk: (dist_patch_DATA): Register it.
* gnu/packages/cpp.scm (nlohmann-json-no-char8-t): New variable.
Change-Id: I8b47d345cd82718d1a2bd40009c480aca7c2c5b3
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu/packages/cpp.scm')
| -rw-r--r-- | gnu/packages/cpp.scm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 40d16fc5dc7..d2a86bfc97a 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm | |||
| @@ -1434,6 +1434,9 @@ data transfer object.") | |||
| 1434 | (define-public nlohmann-json | 1434 | (define-public nlohmann-json |
| 1435 | (package | 1435 | (package |
| 1436 | (name "nlohmann-json") | 1436 | (name "nlohmann-json") |
| 1437 | ;; XXX: Merge related package `nlohmann-json-no-char8-t' back into here when | ||
| 1438 | ;; updating from 3.12.0, as the unique patch it applies will already be | ||
| 1439 | ;; incorporated in. | ||
| 1437 | (version "3.12.0") | 1440 | (version "3.12.0") |
| 1438 | (home-page "https://github.com/nlohmann/json") | 1441 | (home-page "https://github.com/nlohmann/json") |
| 1439 | (source | 1442 | (source |
| @@ -1507,6 +1510,46 @@ intuitive syntax and trivial integration.") | |||
| 1507 | (define-deprecated-package json-modern-cxx | 1510 | (define-deprecated-package json-modern-cxx |
| 1508 | nlohmann-json) | 1511 | nlohmann-json) |
| 1509 | 1512 | ||
| 1513 | (define-public nlohmann-json-no-char8-t | ||
| 1514 | (package | ||
| 1515 | ;; XXX: Version 3.12.0 does not work without char8_t support. | ||
| 1516 | ;; OpenRCT2 compiles with -fno-char8_t, and thus requires this patch. | ||
| 1517 | ;; See https://github.com/nlohmann/json/pull/4736 | ||
| 1518 | (inherit nlohmann-json) | ||
| 1519 | (name "nlohmann-json-no-char8-t") | ||
| 1520 | (version "3.12.0") | ||
| 1521 | (source | ||
| 1522 | (origin | ||
| 1523 | (method git-fetch) | ||
| 1524 | (uri (git-reference (url "https://github.com/nlohmann/json") | ||
| 1525 | (commit (string-append "v" version)))) | ||
| 1526 | (sha256 | ||
| 1527 | (base32 "09nqq56ighr3lghhn3fs399lkllghz717j0xyp87x0giw86ayh3h")) | ||
| 1528 | (file-name (git-file-name name version)) | ||
| 1529 | (modules '((guix build utils))) | ||
| 1530 | (snippet | ||
| 1531 | #~(begin | ||
| 1532 | ;; Delete bundled software. Preserve doctest_compatibility.h, which | ||
| 1533 | ;; is a wrapper library added by this package. | ||
| 1534 | (install-file "./tests/thirdparty/doctest/doctest_compatibility.h" | ||
| 1535 | "/tmp") | ||
| 1536 | (delete-file-recursively "./tests/thirdparty") | ||
| 1537 | (install-file "/tmp/doctest_compatibility.h" | ||
| 1538 | "./tests/thirdparty/doctest") | ||
| 1539 | |||
| 1540 | ;; Adjust for the unbundled fifo_map and doctest. | ||
| 1541 | (substitute* (find-files "./tests/" "\\.h(pp)?") | ||
| 1542 | (("#include \"doctest\\.h\"") "#include <doctest/doctest.h>") | ||
| 1543 | (("#include <doctest\\.h>") "#include <doctest/doctest.h>")) | ||
| 1544 | (with-directory-excursion "tests/src" | ||
| 1545 | (let ((files (find-files "." "\\.cpp$"))) | ||
| 1546 | (substitute* files | ||
| 1547 | (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp) | ||
| 1548 | (string-append | ||
| 1549 | "#include <fifo_map/" fifo-map-hpp ">"))))))) | ||
| 1550 | (patches | ||
| 1551 | (search-patches "nlohmann_json_fix_char8_t.patch")))))) | ||
| 1552 | |||
| 1510 | (define-public jthread | 1553 | (define-public jthread |
| 1511 | (let ((commit "0fa8d394254886c555d6faccd0a3de819b7d47f8") | 1554 | (let ((commit "0fa8d394254886c555d6faccd0a3de819b7d47f8") |
| 1512 | (revision "0")) | 1555 | (revision "0")) |
