1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
3 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
5 ;;; Copyright © 2018, 2021 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2019, 2020, 2022 Mathieu Othacehe <m.othacehe@gmail.com>
7 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
8 ;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
9 ;;; Copyright © 2020, 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
10 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
11 ;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
13 ;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
14 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
15 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
16 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
17 ;;; Copyright © 2020-2022 Greg Hogan <code@greghogan.com>
18 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
19 ;;; Copyright © 2020 Milkey Mouse <milkeymouse@meme.institute>
20 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
21 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
22 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
23 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
24 ;;; Copyright © 2021 Nikolay Korotkiy <sikmir@disroot.org>
25 ;;; Copyright © 2021 jgart <jgart@dismail.de>
26 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
27 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent@protonmail.com>
28 ;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
29 ;;; Copyright © 2022 muradm <mail@muradm.net>
30 ;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name>
31 ;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
32 ;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
33 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
34 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
36 ;;; This file is part of GNU Guix.
38 ;;; GNU Guix is free software; you can redistribute it and/or modify it
39 ;;; under the terms of the GNU General Public License as published by
40 ;;; the Free Software Foundation; either version 3 of the License, or (at
41 ;;; your option) any later version.
43 ;;; GNU Guix is distributed in the hope that it will be useful, but
44 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 ;;; GNU General Public License for more details.
48 ;;; You should have received a copy of the GNU General Public License
49 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
51 (define-module (gnu packages cpp)
52 #:use-module ((guix licenses) #:prefix license:)
53 #:use-module (guix packages)
54 #:use-module (guix download)
55 #:use-module (guix utils)
56 #:use-module (guix git-download)
57 #:use-module (guix build-system cmake)
58 #:use-module (guix build-system copy)
59 #:use-module (guix build-system gnu)
60 #:use-module (guix build-system meson)
61 #:use-module (guix build-system python)
62 #:use-module (guix build-system scons)
63 #:use-module (guix modules)
64 #:use-module (guix gexp)
65 #:use-module (gnu packages)
66 #:use-module (gnu packages autotools)
67 #:use-module (gnu packages boost)
68 #:use-module (gnu packages build-tools)
69 #:use-module (gnu packages c)
70 #:use-module (gnu packages check)
71 #:use-module (gnu packages code)
72 #:use-module (gnu packages compression)
73 #:use-module (gnu packages crypto)
74 #:use-module (gnu packages curl)
75 #:use-module (gnu packages documentation)
76 #:use-module (gnu packages gcc)
77 #:use-module (gnu packages libevent)
78 #:use-module (gnu packages libunwind)
79 #:use-module (gnu packages linux)
80 #:use-module (gnu packages llvm)
81 #:use-module (gnu packages logging)
82 #:use-module (gnu packages maths)
83 #:use-module (gnu packages onc-rpc)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages python)
86 #:use-module (gnu packages python-check)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages popt)
89 #:use-module (gnu packages pretty-print)
90 #:use-module (gnu packages pulseaudio)
91 #:use-module (gnu packages tls)
92 #:use-module (gnu packages web)
93 #:use-module (gnu packages xml)
94 #:use-module (ice-9 match))
97 (let ((commit "79e4adfa2c6e2bfbe63da05cc668eb9ad5596748") (revision "0"))
100 (version (git-version "0.4.6" revision commit))
104 (url "https://github.com/vietjtnguyen/argagg")
106 (file-name (git-file-name name version))
109 "1flkgh524lq3024p7ld5lg743s1v7qnbmgv77578rzmn2rjzr77n"))))
110 (build-system cmake-build-system)
111 (outputs '("out" "doc"))
113 `(#:phases (modify-phases %standard-phases
114 (add-after 'install 'move-doc
115 (lambda* (#:key outputs #:allow-other-keys)
116 (let* ((name ,(package-name argagg)) (out (assoc-ref
119 (doc (assoc-ref outputs "doc")))
120 (mkdir-p (string-append doc "/share/doc"))
122 (string-append out "/share/doc/" name)
123 (string-append doc "/share/doc/" name))))))))
124 (native-inputs (list doxygen))
125 (home-page "https://github.com/vietjtnguyen/argagg")
126 (synopsis "C++11 command line argument parser")
128 "ArgAgg is yet another C++ command line argument/option
129 parser. It was written as a simple and idiomatic alternative to other
130 frameworks like getopt, Boost program options, TCLAP, and others. The goal is
131 to achieve the majority of argument parsing needs in a simple manner with an
133 (license license:expat))))
135 (define-public asmjit
136 (let ((commit "4ec760a3d1f69e32ba460ecd2513f29b8428700b")
140 (version (git-version "0.0.0" revision commit))
146 (url "https://github.com/asmjit/asmjit")
148 (file-name (git-file-name name version))
150 (base32 "0skgccbpamcbg1byawfq5n6jzxgj64hnc7jznvk35nkskaaz1nlb"))))
151 (build-system cmake-build-system)
153 (list #:configure-flags #~(list "-DASMJIT_TEST=TRUE")))
154 (home-page "https://asmjit.com/")
155 (synopsis "Machine code generation for C++")
156 (description "AsmJit is a lightweight library for machine code
157 generation written in C++ language. It can generate machine code for X86 and
158 X86_64 architectures with the support for the whole instruction set from
159 legacy MMX to the newest AVX-512 and AMX. It has a type-safe API that allows
160 C++ compiler to do semantic checks at compile-time even before the assembled
161 code is generated or executed. It also provides an optional register
162 allocator that makes it easy to generate complex code without a significant
163 development effort.")
164 (license license:zlib))))
166 (define-public range-v3
175 (url "https://github.com/ericniebler/range-v3.git")
178 (git-file-name name version))
179 (patches (search-patches "range-v3-build-with-gcc10.patch"))
181 (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
182 (build-system cmake-build-system)
186 #~(list "-DRANGES_NATIVE=OFF")))
188 (list doxygen gcc-9 perl))
191 (synopsis "Range library for C++14/17/20")
192 (description "Range-v3 is an extension of the Standard Template Library that
193 makes its iterators and algorithms more powerful by making them composable.
194 Unlike other range-like solutions which, seek to do away with iterators, in
195 range-v3 ranges are an abstraction layer on top of iterators.")
196 (home-page "https://github.com/ericniebler/range-v3/")
199 ;; Elements of Programming
200 (license:x11-style "file:///LICENSE.txt")
203 ;;; LibC++ (dual-licensed)
209 (define-public c++-gsl
218 (url "https://github.com/microsoft/GSL.git")
220 (string-append "v" version))))
222 (git-file-name name version))
225 "c++-gsl-find-system-gtest.patch"
226 "c++-gsl-move-array-bounds-tests.patch"))
228 (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
229 (build-system cmake-build-system)
231 (list googletest pkg-config))
232 (synopsis "Guidelines Support Library")
233 (description "c++-gsl contains functions and types that are suggested for
234 use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
235 (home-page "https://github.com/microsoft/GSL/")
236 (license license:expat)))
241 ;; As per the c2ffi README: the first three elements are encoding the
242 ;; required Clang/LLVM version, and the last one is the c2ffi revision.
248 (url "https://github.com/rpav/c2ffi")
249 (commit (string-append "v" version))))
250 (file-name (git-file-name name version))
252 (base32 "1qq8dfismd20d9kfxpfvwz07v9mfvd0y7p5r3c92mk2pm4xnmzfy"))
253 (modules '((guix build utils)))
255 '(substitute* "CMakeLists.txt"
256 ;; Guix seems to be packaging LLVM libs separately thus -lLLVM
257 ;; won't work, every used library must be specified explicitly.
258 (("c2ffi PUBLIC clang-cpp LLVM")
259 "c2ffi PUBLIC clang-cpp LLVMCore LLVMSupport LLVMMCParser \
260 LLVMOption LLVMBitReader LLVMProfileData")))))
261 (build-system cmake-build-system)
263 '(;; If LLVM was built without RTTI, we need to also be built without
264 ;; it. See: https://stackoverflow.com/q/11904519
265 #:configure-flags '("-DCMAKE_CXX_FLAGS=-fno-rtti")
267 (modify-phases %standard-phases
269 (lambda* (#:key tests? #:allow-other-keys)
271 (invoke "./bin/c2ffi" "--help")))))))
273 (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
275 (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
276 (home-page "https://github.com/rpav/c2ffi")
277 (synopsis "Clang-based FFI wrapper generator")
279 "@code{c2ffi} is a tool for extracting definitions from C, C++, and
280 Objective C headers for use with foreign function call interfaces. It uses
281 the @code{Clang/LLVM} infrastructure to extract the data, and emits it in
282 various formats, including @code{json}.")
283 (license license:gpl2+)))
285 (define-public libzen
291 ;; Warning: This source has proved unreliable 1 time at least.
292 ;; Consider an alternate source or report upstream if this
294 (uri (string-append "https://mediaarea.net/download/source/"
295 "libzen/" version "/"
296 "libzen_" version ".tar.bz2"))
299 "1rwaxmid9iv65n0y6xlcyxxydsvihjni9ldxpg6pbqz43amp49xx"))))
301 (list autoconf automake libtool))
302 (build-system gnu-build-system)
305 ;; The build scripts are not at the root of the archive.
306 (modify-phases %standard-phases
307 (add-after 'unpack 'pre-configure
309 (chdir "Project/GNU/Library"))))))
310 (home-page "https://github.com/MediaArea/ZenLib")
311 (synopsis "C++ utility library")
312 (description "ZenLib is a C++ utility library. It includes classes for handling
313 strings, configuration, bit streams, threading, translation, and cross-platform
314 operating system functions.")
315 (license license:zlib)))
325 (url "https://github.com/rttrorg/rttr/")
326 (commit (string-append "v" version))))
328 (base32 "1yxad8sj40wi75hny8w6imrsx8wjasjmsipnlq559n4b6kl84ijp"))
329 (file-name (git-file-name name version))))
330 (build-system cmake-build-system)
332 '(;; No check target. Setting test-target to "unit_test" runs it twice.
335 '("-DBUILD_DOCUMENTATION=OFF" "-DBUILD_EXAMPLES=OFF")
337 (modify-phases %standard-phases
338 ;; library_test fails in chroot.
339 (add-after 'unpack 'skip-library-test
341 (substitute* "src/unit_tests/unit_tests.cmake"
342 (("misc/library_test.cpp") ""))
344 (native-inputs (list pkg-config))
345 (home-page "https://github.com/rttrorg/rttr/")
346 (synopsis "C++ Reflection Library")
348 "RTTR stands for Run Time Type Reflection. It describes the ability of a
349 computer program to introspect and modify an object at runtime. It is also
350 the name of the library itself, which is written in C++.")
351 (license license:expat)))
354 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
358 (version (git-version "0.0.0" revision commit))
362 (url "https://github.com/Andersbakken/rct")
366 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
367 (patches (search-patches "rct-add-missing-headers.patch"))
368 (file-name (git-file-name name version))))
369 (build-system cmake-build-system)
372 '("-DWITH_TESTS=ON" ; To run the test suite
373 "-DRCT_RTTI_ENABLED=ON")))
375 (list cppunit pkg-config))
378 (home-page "https://github.com/Andersbakken/rct")
379 (synopsis "C++ library providing Qt-like APIs on top of the STL")
380 (description "Rct is a set of C++ tools that provide nicer (more Qt-like)
381 APIs on top of Standard Template Library (@dfn{STL}) classes.")
382 (license (list license:expat ; cJSON
383 license:bsd-4))))) ; everything else (LICENSE.txt)
385 (define-public dashel
393 (url "https://github.com/aseba-community/dashel")
396 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
397 (file-name (git-file-name name version))))
398 (build-system cmake-build-system)
399 (arguments '(#:tests? #f)) ; no tests
400 (native-inputs (list pkg-config))
401 (home-page "https://github.com/aseba-community/dashel")
402 (synopsis "Data stream helper encapsulation library")
404 "Dashel is a data stream helper encapsulation C++ library. It provides a
405 unified access to TCP/UDP sockets, serial ports, console, and files streams.
406 It also allows a server application to wait for any activity on any
407 combination of these streams.")
408 (license license:bsd-3)))
418 (url "https://github.com/QuantStack/xsimd")
421 (base32 "1fcy0djwpwvls6yqxqa82s4l4gvwkqkr8i8bibbb3dm0lqvhnw52"))
422 (file-name (git-file-name name version))))
423 (build-system cmake-build-system)
425 `(#:configure-flags (list "-DBUILD_TESTS=ON")
426 #:test-target "xtest"))
429 (home-page "https://github.com/xtensor-stack/xsimd")
430 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
432 "xsimd provides a unified means for using @acronym{SIMD, single instruction
433 multiple data} features for library authors. Namely, it enables manipulation of
434 batches of numbers with the same arithmetic operators as for single values.
435 It also provides accelerated implementation of common mathematical functions
436 operating on batches.")
437 (license license:bsd-3)))
439 (define-public google-highway
441 (name "google-highway")
447 (url "https://github.com/google/highway")
449 (file-name (git-file-name name version))
451 (base32 "1dxv61ag0pl5nl6ql4k83k4i95937nhl98img8gz9fx76cpw6z08"))))
452 (build-system cmake-build-system)
454 `(#:configure-flags (list "-DHWY_SYSTEM_GTEST=on")))
457 (home-page "https://github.com/google/highway")
458 (synopsis "SIMD library with runtime dispatch")
459 (description "Highway is a performance-portable, length-agnostic C++
460 library for SIMD (Single Instruction, Multiple Data) with runtime dispatch.")
461 (license license:asl2.0)))
463 (define-public xsimd-benchmark
466 (name "xsimd-benchmark")
468 `(#:configure-flags (list "-DBUILD_BENCHMARK=ON" "-DBUILD_EXAMPLES=ON")
470 #:phases (modify-phases %standard-phases
471 (add-after 'unpack 'remove-march=native
473 (substitute* "benchmark/CMakeLists.txt"
474 (("-march=native") ""))))
476 (lambda* (#:key outputs #:allow-other-keys)
477 ;; Install nothing but the executables.
478 (let ((out (assoc-ref outputs "out")))
479 (install-file "benchmark/benchmark_xsimd"
480 (string-append out "/bin"))
481 (install-file "examples/mandelbrot"
482 (string-append out "/bin"))))))))
483 (synopsis "Benchmark of the xsimd library")
485 ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor.
486 (properties '((tunable? . #t)))))
488 (define-public chaiscript
496 (url "https://github.com/ChaiScript/ChaiScript")
497 (commit (string-append "v" version))))
498 (file-name (git-file-name name version))
500 (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
501 (build-system cmake-build-system)
502 (home-page "https://chaiscript.com/")
503 (synopsis "Embedded scripting language designed for C++")
505 "ChaiScript is one of the only embedded scripting language designed from
506 the ground up to directly target C++ and take advantage of modern C++
507 development techniques. Being a native C++ application, it has some advantages
508 over existing embedded scripting languages:
511 @item Uses a header-only approach, which makes it easy to integrate with
513 @item Maintains type safety between your C++ application and the user scripts.
514 @item Supports a variety of C++ techniques including callbacks, overloaded
515 functions, class methods, and stl containers.
517 (license license:bsd-3)))
519 (define-public fifo-map
523 (home-page "https://github.com/nlohmann/fifo_map")
528 (commit (string-append "v" version))))
531 "0y59fk6ycrgjln9liwcja3l5j1vxpa5i671bynpbsjlyq5f2560q"))
532 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
533 "fifo-map-fix-flags-for-gcc.patch"))
534 (file-name (git-file-name name version))
535 (modules '((guix build utils)))
536 (snippet '(delete-file-recursively "./test/thirdparty"))))
539 (build-system cmake-build-system)
542 (modify-phases %standard-phases
544 (lambda* (#:key tests? #:allow-other-keys)
545 (when tests? (invoke "./unit"))))
547 (lambda* (#:key outputs #:allow-other-keys)
548 (let* ((out (assoc-ref outputs "out"))
549 (inc (string-append out "/include/fifo_map")))
550 (with-directory-excursion "../source"
551 (install-file "src/fifo_map.hpp" inc))))))))
552 (synopsis "FIFO-ordered associative container for C++")
553 (description "Fifo_map is a C++ header only library for associative
554 container which uses the order in which keys were inserted to the container
555 as ordering relation.")
556 (license license:expat)))
558 (define-public json-dto
565 (url "https://github.com/Stiffstream/json_dto")
566 (commit (string-append "v." version))))
567 (file-name (git-file-name name version))
570 "0wr1srp08fr2mv4fmnqr626pwiw60svn6wkvy2xg7j080mgwb3ml"))))
571 (build-system cmake-build-system)
574 #:configure-flags #~(list "-DJSON_DTO_INSTALL_SAMPLES=OFF")
576 #~(modify-phases %standard-phases
577 (add-after 'unpack 'change-directory
580 (native-inputs (list catch2))
581 (propagated-inputs (list rapidjson)) ;#include'd
582 (home-page "https://github.com/Stiffstream/json_dto")
583 (synopsis "JSON to C++ structures conversion library")
584 (description "@code{json_dto} library is a small header-only helper for
585 converting data between JSON representation and C++ structs. DTO stands for
586 data transfer object.")
587 (license license:bsd-3)))
589 (define-public json-modern-cxx
591 (name "json-modern-cxx")
593 (home-page "https://github.com/nlohmann/json")
597 (uri (git-reference (url home-page)
598 (commit (string-append "v" version))))
600 (base32 "1f9mi45ilwjc2w92grjc53sw038840bjpn8yjf6wc6bxs2nijfqd"))
601 (file-name (git-file-name name version))
602 (modules '((guix build utils)))
605 ;; Delete bundled software. Preserve doctest_compatibility.h, which
606 ;; is a wrapper library added by this package.
607 (install-file "./test/thirdparty/doctest/doctest_compatibility.h" "/tmp")
608 (for-each delete-file-recursively
609 '("./third_party" "./test/thirdparty"))
610 (install-file "/tmp/doctest_compatibility.h" "./test/thirdparty/doctest")
612 ;; Adjust for the unbundled fifo_map and doctest.
613 (substitute* "./test/thirdparty/doctest/doctest_compatibility.h"
614 (("#include \"doctest\\.h\"")
615 "#include <doctest/doctest.h>"))
616 (with-directory-excursion "test/src"
617 (let ((files (find-files "." "\\.cpp$")))
619 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
621 "#include <fifo_map/" fifo-map-hpp ">")))))))))
622 (build-system cmake-build-system)
625 (list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
626 (string-append "-DJSON_TestDataDirectory="
628 (search-input-directory %build-inputs
629 "json_nlohmann_tests"))))
630 #:phases (modify-phases %standard-phases
632 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
634 ;; Some tests need git and a full checkout, skip those.
635 (invoke "ctest" "-LE" "git_required"
636 "-j" (if parallel-tests?
637 (number->string (parallel-job-count))
639 (format #t "test suite not run~%")))))))
642 (let ((version "3.0.0"))
646 (url "https://github.com/nlohmann/json_test_data")
647 (commit (string-append "v" version))))
648 (file-name (git-file-name "json_test_data" version))
651 "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv"))))))
653 (list doctest fifo-map))
654 (synopsis "JSON parser and printer library for C++")
655 (description "JSON for Modern C++ is a C++ JSON library that provides
656 intuitive syntax and trivial integration.")
657 (license license:expat)))
667 (url "https://github.com/QuantStack/xtl")
671 "134pgvmf9cx5dxs0m0m3qhp3m3r1gl86ic3xax21zc4sdj8sdq46"))
672 (file-name (git-file-name name version))))
674 (list doctest googletest json-modern-cxx))
677 '("-DBUILD_TESTS=ON")
679 (modify-phases %standard-phases
682 (with-directory-excursion "test"
683 (invoke "./test_xtl")))))))
684 (home-page "https://github.com/QuantStack/xtl")
685 (build-system cmake-build-system)
686 (synopsis "C++ template library providing some basic tools")
687 (description "xtl is a C++ header-only template library providing basic
688 tools (containers, algorithms) used by other QuantStack packages.")
689 (license license:bsd-3)))
694 (version "0.20220729")
699 (url "https://github.com/MaskRay/ccls")
702 (base32 "0cp534n7afl0rrr778cc0bnd8w091qmyqdpp5k1jh4wxla9s09br"))
703 (file-name (git-file-name name version))))
704 (build-system cmake-build-system)
706 '(#:tests? #f)) ; no check target
711 (home-page "https://github.com/MaskRay/ccls")
712 (synopsis "C/C++/Objective-C language server")
714 "@code{ccls} is a server implementing the Language Server Protocol (LSP)
715 for C, C++ and Objective-C languages. It uses @code{clang} to perform static
716 code analysis and supports cross references, hierarchies, completion and
717 syntax highlighting. @code{ccls} is derived from @code{cquery} which is not
718 maintained anymore.")
719 (license license:asl2.0)))
721 (define-public concurrentqueue
723 (name "concurrentqueue")
729 (url "https://github.com/cameron314/concurrentqueue/")
730 (commit "3747268264d0fa113e981658a99ceeae4dad05b7")))
731 (file-name (git-file-name name version))
733 (base32 "1n5v7n27llzg7khg1jvi35jrcf9v6adw8gaic9ndxn65dp723ssy"))))
734 (build-system cmake-build-system)
735 (arguments '(#:tests? #false)) ;no check target
736 (home-page "https://github.com/cameron314/concurrentqueue/")
737 (synopsis "Multi-producer, multi-consumer lock-free concurrent queue for C++11")
739 "This package provides a fast multi-producer, multi-consumer lock-free
740 concurrent queue for C++11.")
741 (license license:bsd-2)))
743 (define-public spscqueue
751 (url "https://github.com/rigtorp/SPSCQueue/")
752 (commit (string-append "v" version))))
753 (file-name (git-file-name name version))
755 (base32 "1428cj9x318afvnvnkhg0711iy4czqn86fi7ysgfhw91asa316rc"))))
756 (build-system cmake-build-system)
757 (home-page "https://github.com/rigtorp/SPSCQueue/")
758 (synopsis "Single producer single consumer queue written in C++11")
760 "This package provides a single producer single consumer wait-free and
761 lock-free fixed size queue written in C++11.")
762 (license license:expat)))
764 (define-public gperftools
772 (url "https://github.com/gperftools/gperftools")
773 (commit (string-append "gperftools-" version))))
775 (base32 "0s9qhx940s8q6glc8sw74k5gs8hdhjfigq20zci92qawgm7zsicm"))
776 (file-name (git-file-name name version))))
777 (build-system gnu-build-system)
779 ;; The tests are flaky when run in parallel. For more info:
780 ;; https://bugs.gnu.org/46562
781 '(#:parallel-tests? #f))
783 (list autoconf automake libtool
786 (home-page "https://github.com/gperftools/gperftools")
787 (synopsis "Multi-threaded malloc() and performance analysis tools for C++")
789 "@code{gperftools} is a collection of a high-performance multi-threaded
790 malloc() implementation plus some thread-friendly performance analysis
799 (license license:bsd-3)))
801 (define-public cpp-httplib
802 ;; this package is not graftable, as everything is implemented in a single
811 (url "https://github.com/yhirose/cpp-httplib")
812 (commit (string-append "v" version))))
814 (base32 "0c0gyfbvm34bgrqy9fhfxw1f8nb9zhf063j7xq91k892flb7qm1c"))
815 (file-name (git-file-name name version))))
816 (build-system cmake-build-system)
819 '("-DBUILD_SHARED_LIBS=ON"
820 "-DHTTPLIB_COMPILE=ON"
821 "-DHTTPLIB_REQUIRE_BROTLI=ON"
822 "-DHTTPLIB_REQUIRE_OPENSSL=ON"
823 "-DHTTPLIB_REQUIRE_ZLIB=ON")
825 (modify-phases %standard-phases
826 (add-after 'unpack 'disable-network-tests
830 (substitute* "test/test.cc"
831 (((string-append "\\(" test))
832 (string-append "(DISABLED_" test))))
833 ;; There are tests requiring network access, disable them
834 '("AbsoluteRedirectTest" "BaseAuthTest" "CancelTest"
835 "ChunkedEncodingTest" "ChunkedEncodingTest"
836 "DecodeWithChunkedEncoding" "DefaultHeadersTest"
837 "DigestAuthTest" "HttpsToHttpRedirectTest"
838 "RangeTest" "RedirectTest" "RelativeRedirectTest"
839 "SSLClientTest" "SendAPI" "TooManyRedirectTest" "UrlWithSpace"
840 "YahooRedirectTest" "YahooRedirectTest"))))
842 (lambda* (#:key source tests? #:allow-other-keys)
843 ;; openssl genrsa wants to write a file in the git checkout
845 (with-directory-excursion "../source/test"
846 (invoke "make"))))))))
848 ;; required to build shared lib
851 (list brotli openssl zlib))
852 (home-page "https://github.com/yhirose/cpp-httplib")
853 (synopsis "C++ HTTP/HTTPS server and client library")
854 (description "cpp-httplib is a C++11 single-file cross platform blocking
855 HTTP/HTTPS library, easy to setup. It can also be used as a single-header
857 (license license:expat)))
859 (define-public cpplint
866 ;; Fetch from github instead of pypi, since the test cases are not in
869 (url "https://github.com/cpplint/cpplint")
872 (base32 "13l86aq0h1jga949k79k9x3hw2xqchjc162sclg2f99vz98zcz15"))
873 (file-name (git-file-name name version))))
875 (list #:modules `((srfi srfi-1)
877 ,@%python-build-system-modules)
879 #~(modify-phases (@ (guix build python-build-system) %standard-phases)
880 (add-before 'wrap 'reduce-GUIX_PYTHONPATH
882 ;; Hide the transitive native inputs from GUIX_PYTHONPATH
883 ;; to prevent them from ending up in the run-time closure.
884 ;; See also <https://bugs.gnu.org/25235>.
885 (let ((transitive-native-inputs
886 '#$(match (package-transitive-native-inputs
888 (((labels packages) ...) packages))))
889 ;; Save the original PYTHONPATH because we need it for
891 (setenv "TMP_PYTHONPATH" (getenv "GUIX_PYTHONPATH"))
892 (setenv "GUIX_PYTHONPATH"
894 (filter (lambda (path)
895 (not (any (cut string-prefix? <> path)
896 transitive-native-inputs)))
897 (search-path-as-string->list
898 (getenv "GUIX_PYTHONPATH")))
900 (add-after 'wrap 'reset-GUIX_PYTHONPATH
902 (setenv "GUIX_PYTHONPATH"
903 (getenv "TMP_PYTHONPATH"))))
905 (lambda* (#:key tests? #:allow-other-keys)
907 (invoke "pytest" "-vv")))))))
908 (build-system python-build-system)
910 (list python-coverage
914 python-testfixtures))
915 (home-page "https://github.com/cpplint/cpplint")
916 (synopsis "Static code checker for C++")
917 (description "@code{cpplint} is a command-line tool to check C/C++ files
918 for style issues following Google’s C++ style guide. While Google maintains
919 its own version of the tool, this is a fork that aims to be more responsive
920 and make @code{cpplint} usable in wider contexts.")
921 (license license:bsd-3)))
923 (define-public reproc
931 (url "https://github.com/DaanDeMeyer/reproc")
932 (commit (string-append "v" version))))
933 (file-name (git-file-name name version))
935 (base32 "09xnf8hmld1fk8j33zwlz1qcxnjdx1ncbg62csic9va4m1wc2v1d"))))
936 (build-system cmake-build-system)
940 ;; Build the shared library instead of a static one.
941 #:configure-flags `("-DBUILD_SHARED_LIBS=1")))
944 (synopsis "Process IO library")
945 (description "reproc (Redirected Process) is a C/C++ library that
946 simplifies starting, stopping and communicating with external programs. The
947 main use case is executing command line applications directly from C or C++
948 code and retrieving their output.")
949 (home-page "https://github.com/DaanDeMeyer/reproc")
950 (license license:expat)))
952 (define-public sobjectizer
960 (url "https://github.com/Stiffstream/sobjectizer")
961 (commit (string-append "v." version))))
963 (base32 "0n6smpjkkkw0xab8wcpy3p0dpw2v9sxgwl6azl3am6abmv4mff12"))
964 (file-name (git-file-name name version))))
965 (build-system cmake-build-system)
969 (modify-phases %standard-phases
970 (add-after 'unpack 'change-directory
974 (home-page "https://stiffstream.com/en/products/sobjectizer.html")
975 (synopsis "Cross-platform actor framework for C++")
977 "SObjectizer is a cross-platform \"actor frameworks\" for C++.
978 SObjectizer supports not only the Actor Model but also the Publish-Subscribe
979 Model and CSP-like channels. The goal of SObjectizer is to simplify
980 development of concurrent and multithreaded applications in C++.")
981 (license license:bsd-3)))
983 (define-public tweeny
991 (url "https://github.com/mobius3/tweeny")
992 (commit (string-append "v" version))))
993 (file-name (git-file-name name version))
995 (base32 "1adm4c17pi7xf3kf6sjyxibz5rdg1ka236p72xsm6js4j9gzlbp4"))))
997 '(#:tests? #f)) ;no check target
998 (build-system cmake-build-system)
999 (home-page "https://mobius3.github.io/tweeny/")
1000 (synopsis "Modern C++ tweening library")
1001 (description "@code{Tweeny} is an inbetweening library designed for the
1002 creation of complex animations for games and other beautiful interactive
1003 software. It leverages features of modern @code{C++} to empower developers with
1004 an intuitive API for declaring tweenings of any type of value, as long as they
1005 support arithmetic operations. The goal of @code{Tweeny} is to provide means to
1006 create fluid interpolations when animating position, scale, rotation, frames or
1007 other values of screen objects, by setting their values as the tween starting
1008 point and then, after each tween step, plugging back the result.")
1009 (license license:expat)))
1011 ;;; This older LTS release is kept for tensorflow.
1012 (define-public abseil-cpp-20200923.3
1015 (version "20200923.3")
1019 (url "https://github.com/abseil/abseil-cpp")
1021 (file-name (git-file-name name version))
1024 "1p4djhm1f011ficbjjxx3n8428p8481p20j4glpaawnpsi362hkl"))
1026 (search-patches "abseil-cpp-fix-strerror_test.patch"))))
1027 (build-system cmake-build-system)
1029 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
1030 "-DABSL_RUN_TESTS=ON"
1031 "-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
1032 ;; Needed, else we get errors like:
1034 ;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o:
1035 ;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE'
1036 ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so:
1037 ;; error adding symbols: DSO missing from command line
1038 ;; collect2: error: ld returned 1 exit status
1039 "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")
1041 (modify-phases %standard-phases
1042 (add-before 'configure 'remove-gtest-check
1043 ;; The CMakeLists fails to find our googletest for some reason, but
1044 ;; it works nonetheless.
1046 (substitute* "CMakeLists.txt"
1047 (("check_target\\(gtest\\)") "")
1048 (("check_target\\(gtest_main\\)") "")
1049 (("check_target\\(gmock\\)") "")))))))
1052 (home-page "https://abseil.io")
1053 (synopsis "Augmented C++ standard library")
1054 (description "Abseil is a collection of C++ library code designed to
1055 augment the C++ standard library. The Abseil library code is collected from
1056 Google's C++ code base.")
1057 (license license:asl2.0)))
1059 (define-public abseil-cpp
1060 (let ((base abseil-cpp-20200923.3))
1064 (version "20220623.1")
1068 (url "https://github.com/abseil/abseil-cpp")
1070 (file-name (git-file-name name version))
1073 "0vxh2a74g4s45yr8kdjqnzl64k10qdlc0hbnn987a4cnwdj4bp9r"))))
1075 (substitute-keyword-arguments (package-arguments base)
1076 ((#:configure-flags flags)
1077 `(cons* "-DBUILD_TESTING=ON"
1078 (delete "-DABSL_RUN_TESTS=ON" ,flags))))))))
1080 (define-public abseil-cpp-cxxstd17
1081 (let ((base abseil-cpp))
1083 (package/inherit base
1085 (substitute-keyword-arguments (package-arguments base)
1086 ((#:configure-flags flags)
1087 #~(cons* "-DCMAKE_CXX_STANDARD=17" #$flags))))))))
1089 (define-public pegtl
1096 (url "https://github.com/taocpp/PEGTL")
1098 (file-name (git-file-name name version))
1101 "01adjqqdr9yf4h379jl1x0526kvixfpqk4hdk9mna49qc4s5hpi1"))))
1102 (build-system cmake-build-system)
1103 (home-page "https://github.com/taocpp/PEGTL")
1104 (synopsis "Parsing Expression Grammar template library")
1105 (description "The Parsing Expression Grammar Template Library (PEGTL) is
1106 a zero-dependency C++ header-only parser combinator library for creating
1107 parsers according to a Parsing Expression Grammar (PEG).")
1108 (license license:expat)))
1110 (define-public cxxopts
1117 (url "https://github.com/jarro2783/cxxopts")
1118 (commit (string-append "v" version))))
1119 (file-name (git-file-name name version))
1122 "08x7j168l1xwj0r3rv89cgghmfhsx98lpq35r3vkh504m1pd55a6"))))
1123 (build-system cmake-build-system)
1124 (synopsis "Lightweight C++ command line option parser")
1126 "A lightweight header-only C++ option parser library, supporting the
1127 standard GNU style syntax for options.")
1128 (home-page "https://github.com/jarro2783/cxxopts/wiki")
1129 (license license:expat)))
1131 (define-public folly
1134 (version "2022.10.31.00")
1138 (url "https://github.com/facebook/folly")
1139 (commit (string-append "v" version))))
1140 (file-name (git-file-name name version))
1143 "06r9xnj8ilghc0vv6r17k5apl3w19iwd76nr02svnv96c74bz2aa"))))
1144 (build-system cmake-build-system)
1146 '(;; Tests must be explicitly enabled
1147 ;;#:configure-flags '("-DBUILD_TESTS=ON")))
1148 ;; Leave tests disabled; see https://github.com/facebook/folly/issues/1456
1151 (list boost gflags glog liburing))
1168 (synopsis "Collection of C++ components complementing the standard library")
1170 "Folly (acronymed loosely after Facebook Open Source Library) is a library
1171 of C++14 components that complements @code{std} and Boost.")
1172 (home-page "https://github.com/facebook/folly/wiki")
1173 ;; 32-bit is not supported: https://github.com/facebook/folly/issues/103
1174 (supported-systems '("aarch64-linux" "x86_64-linux"))
1175 (license license:asl2.0)))
1184 (url "https://github.com/pocoproject/poco")
1185 (commit (string-append "poco-" version "-release"))))
1186 (file-name (git-file-name name version))
1189 "0qkf8vb4qwds6idk9fkw6wjvcdk5k8h77x3gv47l0i4jfl5hwn8b"))))
1190 (build-system cmake-build-system)
1193 #:configure-flags #~(list "-DENABLE_TESTS=ON")
1195 #~(modify-phases %standard-phases
1196 (add-after 'unpack 'disable-problematic-tests
1198 (substitute* (list "Foundation/CMakeLists.txt" ; XXX: fails.
1199 ;; Require network access
1200 "Net/CMakeLists.txt"
1201 "MongoDB/CMakeLists.txt"
1202 "Redis/CMakeLists.txt")
1203 (("ENABLE_TESTS") "FALSE")))))))
1204 (home-page "https://pocoproject.org/")
1205 (synopsis "Portable C++ components")
1206 (description "This package provides a collection of C++ libraries intended
1207 to be useful for building network-based applications.")
1208 (license license:boost1.0)))
1210 (define-public aws-crt-cpp
1212 (name "aws-crt-cpp")
1213 ;; Update only when updating aws-sdk-cpp, and when updating also update
1214 ;; versions of library dependencies linked from from
1215 ;; https://github.com/awslabs/aws-crt-cpp/tree/{aws-crt-cpp commit}/crt
1220 (url "https://github.com/awslabs/aws-crt-cpp")
1221 (commit (string-append "v" version))))
1222 (file-name (git-file-name name version))
1225 "14g8pn7yii1klby7phcw08qnld1qv11vwmbdz8cs3mlpqahxrh4i"))))
1226 (build-system cmake-build-system)
1229 (list "-DBUILD_DEPS=OFF"
1230 "-DBUILD_SHARED_LIBS=ON"
1231 (string-append "-DCMAKE_PREFIX_PATH="
1232 (assoc-ref %build-inputs "aws-c-common"))
1233 "-DENABLE_NET_TESTS=OFF")))
1241 (synopsis "C++ wrapper for Amazon Web Services C libraries")
1242 (description "The AWS Common Runtime (CRT) library provides a C++ wrapper
1243 implementation for the following @acronym{AWS,Amazon Web Services} C libraries:
1244 aws-c-auth, aws-c-cal, aws-c-common, aws-c-compression, aws-c-event-stream,
1245 aws-c-http, aws-c-io, aws-c-mqtt, aws-checksums, and s2n.")
1246 (home-page "https://github.com/awslabs/aws-crt-cpp")
1247 (license license:asl2.0)))
1249 (define-public aws-sdk-cpp
1251 (name "aws-sdk-cpp")
1252 ; When updating also check for a tagged update to aws-crt-cpp from
1253 ; https://github.com/aws/aws-sdk-cpp/tree/main/crt
1258 (url "https://github.com/aws/aws-sdk-cpp")
1260 (file-name (git-file-name name version))
1263 "13qhxsbfn81r7lg382wb4d3xfc4a287ikww5i7whddk5yz0j8384"))))
1264 (build-system cmake-build-system)
1266 '(;; Tests are run during the build phase.
1269 (list "-DBUILD_DEPS=OFF"
1270 "-DBUILD_SHARED_LIBS=ON"
1271 (string-append "-DCMAKE_PREFIX_PATH="
1272 (assoc-ref %build-inputs "aws-c-common")))))
1276 (list curl pulseaudio zlib))
1277 (synopsis "Amazon Web Services SDK for C++")
1279 "The AWS SDK for C++ provides a C++11 interface to the @acronym{AWS,Amazon
1280 Web Services} API. AWS provides on-demand computing infrastructure and software
1281 services including database, analytic, and machine learning technologies.")
1282 (home-page "https://github.com/aws/aws-sdk-cpp")
1283 (license license:asl2.0)))
1285 (define-public libexpected
1287 (name "libexpected")
1293 (url "https://github.com/TartanLlama/expected")
1294 (commit (string-append "v" version))
1295 ;; NOTE: Requires TL_CMAKE from custom
1296 ;; repository. Should not affect reproducibility.
1298 (file-name (git-file-name name version))
1299 ;; NOTE: This patch will be unnecessary on subsequent tags.
1300 (patches (search-patches "libexpected-nofetch.patch"))
1302 (base32 "1ckzfrljzzdw9wf8hvdfjz4wjx5na57iwxc48mbv9rf5067m21a5"))))
1303 (build-system cmake-build-system)
1304 ;; TODO: Clean up install phase.
1307 (modify-phases %standard-phases
1310 (invoke "./tests"))))))
1313 (synopsis "C++11/14/17 std::expected with functional-style extensions")
1314 (description "@code{std::expected} is proposed as the preferred way to
1315 represent objects which will either have an expected value, or an unexpected
1316 value giving information about why something failed. Unfortunately, chaining
1317 together many computations which may fail can be verbose, as error-checking
1318 code will be mixed in with the actual programming logic. This implementation
1319 provides a number of utilities to make coding with expected cleaner.")
1320 (home-page "https://tl.tartanllama.xyz/")
1321 (license license:cc0)))
1323 (define-public atomic-queue
1325 (name "atomic-queue")
1330 (url "https://github.com/max0x7ba/atomic_queue")
1331 (commit (string-append "v" version))))
1332 (file-name (git-file-name name version))
1335 "0ssff73wlvrsk2nma99dmvm0ijyzfr54jk37kxgpb694r7ajc90l"))))
1336 (build-system meson-build-system)
1338 `(#:configure-flags '("-Dbenchmarks=false")
1340 (modify-phases %standard-phases
1341 ,@(if (%current-target-system)
1342 `(;; boost is a test dependency. We don't run tests when
1343 ;; cross-compiling. Disable all targets that depend on it.
1344 (add-after 'unpack 'do-not-check-for-boost
1346 (substitute* "meson.build"
1347 (("unit_test_framework = [^\n]*" all)
1348 "unit_test_framework = disabler()")))))
1351 (lambda* (#:key tests? #:allow-other-keys)
1353 (invoke "./tests"))))
1355 (lambda* (#:key outputs #:allow-other-keys)
1356 (copy-recursively "../source/include/atomic_queue"
1357 (string-append (assoc-ref outputs "out")
1358 "/include/atomic_queue")))))))
1362 (home-page "https://github.com/max0x7ba/atomic_queue")
1363 (synopsis "C++ lockless queue")
1365 "This package contains a C++11 multiple-producer-multiple-consumer lockless
1366 queues header library based on circular buffer with @code{std::atomic}.")
1367 (license license:expat)))
1369 (define-public magic-enum
1373 (home-page "https://github.com/Neargye/magic_enum")
1378 (commit (string-append "v" version))))
1379 (file-name (git-file-name name version))
1382 "1x47radgsifgz3vn2561mlvf4cq46ii33cpyqf01znm56iirwq89"))))
1383 (build-system cmake-build-system)
1384 (synopsis "C++17 header only library for compile time reflection of enums")
1385 (description "Magic Enum offers static reflection of enums, with
1386 conversions to and from strings, iteration and related functionality.")
1387 (license license:expat)))
1389 (define-public cli11
1397 (url "https://github.com/CLIUtils/CLI11")
1398 (commit (string-append "v" version))))
1399 (file-name (git-file-name name version))
1401 (base32 "0hbch0vk8irgmiaxnfqlqys65v1770rxxdfn3d23m2vqyjh0j9l6"))
1402 (modules '((guix build utils)))
1404 '(begin (delete-file-recursively "extern")
1406 (build-system cmake-build-system)
1409 '("-DCLI11_SINGLE_FILE=OFF"
1410 "-DCLI11_BUILD_EXAMPLES=OFF")
1411 #:imported-modules ,%cmake-build-system-modules
1412 #:modules ((guix build cmake-build-system)
1415 (modify-phases %standard-phases
1416 (add-before 'configure 'no-vendor-gtest
1418 (substitute* "tests/CMakeLists.txt"
1419 ;; We provide our own googletest, so this is not really a
1421 (("message\\(FATAL_ERROR \"You have requested")
1422 "message(TRACE \"You have requested"))
1423 (substitute* "cmake/AddGoogletest.cmake"
1424 (("^add_subdirectory\\(.*googletest.*$") "find_package(GTest REQUIRED)")
1425 (("^set_target_properties\\(gtest gtest_main gmock gmock_main") "")
1426 (("^ PROPERTIES FOLDER \"Extern\"\\)") ""))
1429 (list doxygen googletest))
1430 (synopsis "Command line parser for C++11")
1432 "CLI11 is a command line parser for C++11 and beyond that provides a rich
1433 feature set with a simple and intuitive interface.")
1434 (home-page "https://cliutils.github.io/CLI11/book/")
1435 (license license:bsd-3)))
1444 (url "https://github.com/actor-framework/actor-framework")
1446 (file-name (git-file-name name version))
1449 "055y82044djphpwbazaxsvmb66c2xfdi8vyny8pzdxkdgxfh0vq1"))))
1450 (build-system cmake-build-system)
1453 '("-DCAF_ENABLE_EXAMPLES=OFF")))
1456 (synopsis "C++ implementation of the actor model")
1457 (description "The C++ Actor Framework (CAF) offers a high-level C++17
1458 programming environment using the actor model for concurrent, distributed
1460 (home-page "https://www.actor-framework.org/")
1461 (license license:bsd-3)))
1463 (define-public clipper
1470 (uri (string-append "mirror://sourceforge/polyclipping"
1471 "/clipper_ver" version ".zip"))
1473 (base32 "09q6jc5k7p9y5d75qr2na5d1gm0wly5cjnffh127r04l47c20hx1"))))
1474 (build-system cmake-build-system)
1476 `(#:tests? #f ;no check target
1477 #:phases (modify-phases %standard-phases
1479 (lambda* (#:key source #:allow-other-keys)
1480 (and (invoke "unzip" source)
1483 `(("unzip" ,unzip)))
1484 (home-page "https://sourceforge.net/projects/polyclipping")
1485 (synopsis "Polygon and line clipping and offsetting library")
1487 "The Clipper library performs line & polygon clipping - intersection,
1488 union, difference & exclusive-or, and line & polygon offsetting.
1489 The library is based on Vatti's clipping algorithm.")
1490 (license license:boost1.0)))
1492 (define-public pcg-cpp
1493 (let ((commit "ffd522e7188bef30a00c74dc7eb9de5faff90092")
1497 (version (git-version "0.98.1" revision commit))
1501 (url "https://github.com/imneme/pcg-cpp")
1503 (file-name (git-file-name name version))
1506 "0yxyqaphcc38zilpwpmssrl8ly1v6dimscqk2f4rcv1h22dinnqx"))))
1507 (build-system gnu-build-system)
1509 `(#:test-target "test"
1511 (modify-phases %standard-phases
1512 (delete 'configure))
1513 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1514 (synopsis "C++11 header only library for random number generation")
1515 (description "The Permuted Congruential Generator (PCG) extends the
1516 Linear Congruential Generator (LCG) with a permutation function to increase
1517 output randomness while retaining speed, simplicity, and conciseness.")
1518 (home-page "https://www.pcg-random.org")
1519 (license (list license:expat license:asl2.0))))) ; dual licensed
1521 (define-public libconfini
1528 (url "https://github.com/madmurphy/libconfini")
1530 (file-name (git-file-name name version))
1533 "002lmf1b2phmc6s348k00yx5shrcc7psn3pgqvraxvr6n8g747jx"))))
1534 (build-system gnu-build-system)
1537 (list "--disable-static")
1539 (modify-phases %standard-phases
1541 (lambda _ (invoke "sh" "bootstrap" "--noconfigure"))))))
1543 (list autoconf automake libtool))
1544 (home-page "https://madmurphy.github.io/libconfini/html/index.html")
1545 (synopsis "INI file parser")
1546 (description "@code{libconfini} is an INI file parser library written in
1547 C. It focuses on standardization and parsing exactness and is at ease with
1548 almost every type of file containing key/value pairs.")
1549 (license license:gpl3+)))
1551 (define-public libcutl
1558 "https://www.codesynthesis.com/download/libcutl/"
1559 (version-major+minor version)
1560 "/libcutl-" version ".tar.bz2"))
1563 "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j"))
1564 (modules '((guix build utils)))
1567 ;; Remove bundled sources.
1568 (with-directory-excursion "cutl/details"
1569 (for-each delete-file-recursively
1570 ;; FIXME: Boost_RegEx isn't being detected.
1574 (build-system gnu-build-system)
1576 `(#:configure-flags (list "--disable-static"
1577 ;;"--with-external-boost"
1578 "--with-external-expat")))
1580 (list ;;("boost ,boost)
1582 (home-page "https://www.codesynthesis.com/projects/libcutl/")
1583 (synopsis "C++ utility library with generic and independent components")
1584 (description "libcutl is a C++ utility library. It contains a collection
1585 of generic and independent components such as meta-programming tests, smart
1586 pointers, containers, compiler building blocks, etc.")
1587 (license (list license:expat ;everything except...
1588 license:boost1.0)))) ;...the files under cutl/details/boost
1590 (define-public libxsd-frontend
1592 (name "libxsd-frontend")
1597 (uri (string-append "https://www.codesynthesis.com/download/"
1598 "libxsd-frontend/" (version-major+minor version)
1599 "/libxsd-frontend-" version ".tar.bz2"))
1601 (base32 "1nmzchsvwvn66jpmcx18anzyl1a3l309x1ld4zllrg37ijc31fim"))))
1602 (build-system gnu-build-system)
1604 `(#:test-target "test"
1605 #:imported-modules ((guix build copy-build-system)
1606 ,@%gnu-build-system-modules)
1607 #:modules (((guix build copy-build-system) #:prefix copy:)
1608 (guix build gnu-build-system)
1610 #:make-flags (list (string-append "--include-dir="
1611 (assoc-ref %build-inputs "build")
1614 (modify-phases %standard-phases
1618 (apply (assoc-ref copy:%standard-phases 'install)
1620 '(("xsd-frontend" "include/xsd-frontend"
1621 #:include-regexp ("\\.?xx$"))
1622 ("xsd-frontend" "lib"
1623 #:include-regexp ("\\.so$")))
1628 `(("libcutl" ,libcutl)
1629 ("libxerces-c" ,xerces-c)))
1630 (synopsis "XSD Front-end")
1631 (description "@code{libxsd-frontend} is a compiler frontend for the W3C
1632 XML Schema definition language. It includes a parser, semantic graph types
1633 and a traversal mechanism.")
1634 (home-page "https://www.codesynthesis.com/projects/libxsd-frontend/")
1635 (license license:gpl2+)))
1644 (uri (string-append "https://www.codesynthesis.com/download/"
1645 "cli/" (version-major+minor version)
1646 "/cli-" version ".tar.bz2"))
1648 (base32 "0bg0nsai2q4h3mldpnj0jz4iy4svs0bcfvmq0v0c9cdyknny606g"))))
1649 (build-system gnu-build-system)
1651 `(#:test-target "test"
1652 #:make-flags (list (string-append "--include-dir="
1653 (assoc-ref %build-inputs "build")
1655 (string-append "install_prefix="
1656 (assoc-ref %outputs "out")))
1658 (modify-phases %standard-phases
1659 (add-after 'unpack 'patch
1661 (substitute* (find-files "." "\\.make$")
1663 (string-append (assoc-ref %build-inputs "build")
1664 "/include/build-0.3")))
1665 ;; Add the namespace prefix, to avoid errors such as "error:
1666 ;; ‘iterate_and_dispatch’ was not declared in this scope".
1667 (substitute* (find-files "." "\\.?xx$")
1668 (("add \\(typeid \\(type\\), \\*this\\);" all)
1669 (string-append "traverser_map<B>::" all))
1670 (("iterate_and_dispatch \\(s\\.names_begin.*;" all)
1671 (string-append "edge_dispatcher::" all)))))
1672 (delete 'configure))))
1677 (synopsis "C++ Command Line Interface (CLI) definition language")
1678 (description "@code{cli} is a domain-specific language (DSL) for defining
1679 command line interfaces of C++ programs. It allows you to describe the
1680 options that your program supports, their types, default values, and
1682 (home-page "https://codesynthesis.com/projects/cli/")
1683 (license license:expat)))
1692 (uri (string-append "https://www.codesynthesis.com/download/"
1693 "xsd/" (version-major+minor version)
1694 "/xsd-" version ".tar.bz2"))
1696 (base32 "1hi9ppxd34np8ydv1h0vgc2qpdmgcd1cdzgk30aidv670xjg91fx"))))
1697 (build-system gnu-build-system)
1698 (outputs '("out" "doc")) ;3.8 MiB of doc and examples
1700 `(#:test-target "test"
1701 #:make-flags (list (string-append "--include-dir="
1702 (assoc-ref %build-inputs "build")
1704 (string-append "install_prefix="
1705 (assoc-ref %outputs "out")))
1706 #:phases (modify-phases %standard-phases
1707 (add-after 'install 'move-doc
1708 (lambda* (#:key outputs #:allow-other-keys)
1709 (let ((out (assoc-ref outputs "out"))
1710 (doc (assoc-ref outputs "doc")))
1711 (mkdir-p (string-append doc "/share/doc"))
1712 (rename-file (string-append out "/share/doc/xsd")
1713 (string-append doc "/share/doc/xsd-"
1715 (delete 'configure))))
1719 (list libcutl libnsl libxsd-frontend))
1721 ;; The code XSD generates requires the following library at run time;
1722 ;; propagate it for convenience.
1724 (synopsis "XML Data Binding for C++")
1725 (description "CodeSynthesis XSD (also known as libxsd or xsdcxx) is an XML
1726 Schema to C++ data binding compiler. Provided with an XML instance
1727 specification (XML Schema), it generates C++ classes that represent the given
1728 vocabulary as well as XML parsing and serialization code. The data stored in
1729 XML can then be accessed using types and functions that semantically
1730 correspond to an application domain rather than dealing with the intricacies
1731 of reading and writing XML.")
1732 (home-page "https://codesynthesis.com/projects/xsd/")
1733 ;; Exceptions are made to allow using the generated source files as well
1734 ;; as the libxsd library in free software projects whose license is
1735 ;; incompatible with the GPL v2. Refer to the file named FLOSSE for the
1737 (license license:gpl2+)))
1739 (define-public jsonnet
1747 (url "https://github.com/google/jsonnet")
1748 (commit (string-append "v" version))))
1749 (file-name (git-file-name name version))
1751 (base32 "1ddz14699v5lqx3dh0mb7hfffr6fk5zhmzn3z8yxkqqvriqnciim"))
1752 (modules '((guix build utils)))
1755 (rename-file "third_party/md5" ".md5")
1756 (delete-file-recursively "third_party")
1757 (delete-file-recursively "doc/third_party")
1758 (substitute* '("core/vm.cpp")
1759 (("#include \"json.hpp\"") "#include <nlohmann/json.hpp>"))
1760 (mkdir "third_party")
1761 (rename-file ".md5" "third_party/md5")))))
1762 (build-system cmake-build-system)
1764 `(#:configure-flags '("-DUSE_SYSTEM_GTEST=ON" "-DUSE_SYSTEM_JSON=ON"
1765 "-DBUILD_STATIC_LIBS=OFF")))
1767 (list googletest pkg-config))
1769 (list json-modern-cxx))
1770 (home-page "https://jsonnet.org/")
1771 (synopsis "Data templating language")
1772 (description "Jsonnet is a templating language extending JSON
1773 syntax with variables, conditions, functions and more.")
1774 (license license:asl2.0)))
1776 (define-public simdjson
1783 (url "https://github.com/simdjson/simdjson")
1784 (commit (string-append "v" version))))
1785 (file-name (git-file-name name version))
1788 "05i5jnqd7ngps79cws16ls48gnx08ykkkib3n2hbrdhr1wwrnv7a"))))
1789 (build-system cmake-build-system)
1791 '(#:tests? #f ; tests require downloading dependencies
1793 '("-DBUILD_SHARED_LIBS=ON")))
1794 (synopsis "JSON parser for C++ using SIMD instructions")
1796 "The simdjson library uses commonly available SIMD instructions and
1797 microparallel algorithms to implement a strict JSON parser with UTF-8
1799 (home-page "https://github.com/simdjson/simdjson")
1800 (license license:asl2.0)))
1802 (define-public bloomberg-bde-tools
1803 (let ((commit "094885bd177e0159232d4e6a060a04edb1edd786"))
1805 (name "bloomberg-bde-tools")
1806 ;; Recent releases are not tagged so commit must be used for checkout.
1807 (version "3.97.0.0")
1811 (url "https://github.com/bloomberg/bde-tools")
1813 (file-name (git-file-name name version))
1816 "0mbbai73z8amh23ah3wy35kmy612380yr5wg89mic60qwqmpqb02"))
1819 "bloomberg-bde-tools-fix-install-path.patch"))))
1820 (build-system copy-build-system)
1821 ;; Unable to be an inline dependency of bloomberg-bde due to patch.
1822 (properties '((hidden? . #t)))
1823 (synopsis "Tools for developing and building libraries modeled on BDE")
1825 "This package provides the cmake imports needed to build bloomberg-bde.")
1826 (home-page "https://github.com/bloomberg/bde-tools")
1827 (license license:asl2.0))))
1829 (define-public bloomberg-bde
1830 (let ((commit "b6bcc0e24a5862bf77aea7edd831dedf50e21d64"))
1832 (name "bloomberg-bde")
1833 ;; Recent releases are not tagged so commit must be used for checkout.
1834 (version "3.98.0.0")
1838 (url "https://github.com/bloomberg/bde")
1840 (file-name (git-file-name name version))
1843 "0y3lipi1lj9qazgc935851r2qsx5aq3vvc4y52jq57riyz8wg3ma"))
1846 "bloomberg-bde-cmake-module-path.patch"))
1847 ;;(modules '((guix build utils)))
1850 ;; FIXME: Delete bundled software. The third-party packages
1851 ;; may be patched or modified from upstream sources.
1852 ;;(for-each delete-file-recursively
1853 ;; (list "thirdparty"))
1854 ;; Delete failing tests.
1857 (list "groups/bal/ball/ball_asyncfileobserver.t.cpp"
1858 "groups/bal/ball/ball_fileobserver2.t.cpp"
1859 "groups/bal/ball/ball_recordstringformatter.t.cpp"
1860 "groups/bal/balst/balst_stacktraceutil.t.cpp"
1861 "groups/bdl/bdlmt/bdlmt_eventscheduler.t.cpp"
1862 "groups/bdl/bdlmt/bdlmt_timereventscheduler.t.cpp"
1863 "groups/bdl/bdls/bdls_filesystemutil.t.cpp"
1864 "groups/bsl/bslh/bslh_hashpair.t.cpp"
1865 "groups/bsl/bsls/bsls_platform.t.cpp"
1866 "groups/bsl/bsls/bsls_stackaddressutil.t.cpp"
1867 "groups/bsl/bsls/bsls_stopwatch.t.cpp"
1868 "groups/bsl/bslstl/bslstl_function_invokerutil.t.cpp"))
1870 (build-system cmake-build-system)
1872 `(#:parallel-tests? #f ; Test parallelism may fail inconsistently.
1873 ;; Set UFID to build shared libraries. Flag descriptions can be found at
1874 ;; https://bloomberg.github.io/bde-tools/reference/bde_repo.html#ufid
1875 #:configure-flags ,(match %current-system
1876 ((or "i686-linux" "armhf-linux")
1877 ''("-DUFID=opt_dbg_exc_mt_32_shr_cpp17"))
1879 ''("-DUFID=opt_dbg_exc_mt_64_shr_cpp17")))
1881 (modify-phases %standard-phases
1882 ;; Explicitly build tests separate from the main build.
1883 (add-after 'build 'build-tests
1884 (lambda* (#:key make-flags #:allow-other-keys)
1885 (apply invoke "make" "all.t"
1886 `(,@(if #:parallel-build?
1887 `("-j" ,(number->string (parallel-job-count)))
1891 (list bloomberg-bde-tools pkg-config python))
1892 (synopsis "Foundational C++ libraries used at Bloomberg")
1894 "The BDE Development Environment libraries provide an enhanced
1895 implementation of STL containers, vocabulary types for representing common
1896 concepts (like dates and times), and building blocks for developing
1897 multi-threaded applications and network applications.")
1898 (home-page "https://github.com/bloomberg/bde")
1899 (license license:asl2.0))))
1901 (define-public gulrak-filesystem
1903 (name "gulrak-filesystem")
1908 (url "https://github.com/gulrak/filesystem")
1909 (commit (string-append "v" version))))
1910 (file-name (git-file-name name version))
1913 "0dx1yvbz5rnisymkqap7z0b06ag9fcs6q6l82vgi8caylhkwsqs7"))))
1914 (build-system cmake-build-system)
1915 (synopsis "Header only C++ std::filesystem compatible library")
1916 (description "This package provides a header-only single-file
1917 std::filesystem compatible helper library, based on the C++17 and C++20 specs,
1918 but implemented for C++11, C++14, C++17 or C++20.")
1919 (home-page "https://github.com/gulrak/filesystem")
1920 (license license:expat)))
1922 (define-public cpp-mustache
1924 (name "cpp-mustache")
1929 (url "https://github.com/kainjow/Mustache")
1930 (commit (string-append "v" version))))
1931 (file-name (git-file-name name version))
1934 "0r9rbk6v1wpld2ismfsk2lkhbyv3dkf0p03hkjivbj05qkfhvlbb"))))
1935 (build-system cmake-build-system)
1938 #~(modify-phases %standard-phases
1940 (lambda* (#:key tests? #:allow-other-keys)
1942 (invoke "./mustache"))))
1944 (lambda* (#:key outputs #:allow-other-keys)
1945 (install-file "../source/mustache.hpp"
1946 (string-append (assoc-ref outputs "out")
1948 (home-page "https://github.com/kainjow/Mustache")
1949 (synopsis "Mustache text templates for modern C++")
1950 (description "@code{cpp-mustache} is a Mustache implementation for C++ 11
1951 and above. It is header only and has zero dependencies. It provides a
1952 templated string type for compatibility with any STL-like string (std::string,
1953 std::wstring, etc).")
1954 (license license:boost1.0)))
1956 (define-public crc32c
1963 (url "https://github.com/google/crc32c")
1965 (file-name (git-file-name name version))
1968 "0966lyy3w5cnrs0c0fkma4hga51k54hns72l4n76944awqssap7j"))
1969 (patches (search-patches "crc32c-unbundle-googletest.patch"))))
1970 (build-system cmake-build-system)
1972 (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
1973 "-DCRC32C_BUILD_BENCHMARKS=OFF"
1974 "-DCRC32C_USE_GLOG=OFF"
1976 "-DCRC32C_BUILD_TESTS="
1977 ;; TODO: perhaps infer #:tests?
1978 (if #$(%current-target-system)
1980 (native-inputs (list googletest))
1981 (home-page "https://github.com/google/crc32c")
1982 (synopsis "Cyclic redundancy check")
1984 "This package provides architecture-specific implementations of the
1985 CRC32C algorithm, which is specified in RFC 3720, section 12.1.")
1986 (license license:bsd-3)))
1988 (define fast-float-test-files
1989 (let ((commit "97a0b2e638feb479387554cf253e346500541e7e"))
1993 (url (string-append "https://github.com/fastfloat"
1994 "/supplemental_test_files.git"))
1995 (commit "97a0b2e638feb479387554cf253e346500541e7e")))
1996 (file-name (string-append "fast-float-test-files-"
1997 (string-take commit 8)))
2000 "0dxbiyzyh7i847i89ablfzypfc3ckhm7f74w98jsh73v1mppmxlf")))))
2002 (define-public fast-float
2009 (url "https://github.com/fastfloat/fast_float")
2010 (commit (string-append "v" version))))
2011 (file-name (git-file-name name version))
2014 "0z3rxxd0pwvw70dbnv63rm67biw829vdqf50y16isxm6g3sbrz8g"))))
2015 (build-system cmake-build-system)
2018 #:configure-flags #~(list "-DFASTFLOAT_TEST=ON"
2019 "-DSYSTEM_DOCTEST=ON")
2021 #~(modify-phases %standard-phases
2022 (add-after 'unpack 'patch-cmake-tests
2023 (lambda* (#:key inputs native-inputs #:allow-other-keys)
2024 (substitute* "tests/CMakeLists.txt"
2025 (("FetchContent_GetProperties\\(supplemental_test_files.*")
2027 (("if\\(NOT supplemental_test_files_POPULATED.*")
2029 "set(supplemental_test_files_BINARY_DIR "
2030 (search-input-directory (or native-inputs inputs)
2032 ")\nif(0)\n"))))))))
2033 (native-inputs (list doctest fast-float-test-files))
2034 (home-page "https://github.com/fastfloat/fast_float")
2035 (synopsis "Floating point number parser for C++")
2036 (description "@code{fast_float} is a header-only C++ library for parsing
2037 floating point numbers from strings. It implements the C++ from_chars
2038 functions for the float and double types.")
2039 (license (list license:asl2.0 license:expat)))) ; dual licensed
2041 (define-public pocketfft-cpp
2042 (let ((commit "daa8bb18327bc5c7d22c69428c25cf5dc64167d3")
2045 (name "pocketfft-cpp")
2046 (version (git-version "0" revision commit))
2050 (url "https://github.com/mreineck/pocketfft")
2052 (file-name (git-file-name name version))
2055 "1dbkkqkmkxgmz1qjpsqzic5ig3qw1pqndbb3dvjc7xq5f2rdzyq1"))
2056 (patches (search-patches
2057 "pocketfft-cpp-prefer-preprocessor-if.patch"))))
2058 (build-system copy-build-system)
2061 #:install-plan #~'(("pocketfft_hdronly.h" "include/"))))
2062 (home-page "https://github.com/mreineck/pocketfft")
2063 (synopsis "C++11 header-only Fast Fourier Transform library")
2064 (description "This package provides a single-header C++11 library for
2065 computing Fast Fourier transformations. It supports multidimensional arrays,
2066 different floating point sizes and complex transformations.")
2067 (license license:bsd-3))))
2069 (define-public sajson
2070 (let ((commit "ec644013e34f9984a3cc9ba568cab97a391db9cd")
2074 (version (git-version "1.0" revision commit))
2078 (url "https://github.com/chadaustin/sajson")
2080 (file-name (git-file-name name version))
2082 (search-patches "sajson-build-with-gcc10.patch"))
2085 "0fjag27w7gvkc5pdhq3ad7yc09rabpzahndw1sgsg04ipznidmmq"))
2086 (modules '((guix build utils)))
2087 (snippet '(delete-file-recursively "third-party"))))
2088 (build-system scons-build-system)
2092 #~(modify-phases %standard-phases
2093 (add-after 'unpack 'disable-other-builds
2095 (substitute* "SConstruct"
2096 (("for name, tools in builds:")
2097 "for name, tools in [('opt', [gcc, opt])]:"))))
2098 (add-after 'unpack 'use-external-unittest-cpp
2100 (substitute* "SConscript"
2101 (("unittestpp_env\\.Library") "_dummy = ")
2102 (("test_env = env.Clone\\(tools=\\[unittestpp, sajson\\]\\)")
2104 "test_env = env.Clone(tools=[sajson])\n"
2105 "test_env.Append(CPPPATH='"
2106 (search-input-directory %build-inputs "/include/UnitTest++")
2108 (string-append #$(this-package-native-input "unittest-cpp")
2110 "', LIBS=['UnitTest++'])")))))
2112 (lambda* (#:key tests? #:allow-other-keys #:rest args)
2114 (apply (assoc-ref %standard-phases 'build)
2117 (lambda* (#:key tests? #:allow-other-keys)
2119 (invoke "build/opt/test")
2120 (invoke "build/opt/test_unsorted"))))
2123 (let ((out (string-append #$output "/include")))
2124 (install-file "include/sajson.h" out)
2125 (install-file "include/sajson_ostream.h" out)))))))
2126 (native-inputs (list unittest-cpp))
2127 (home-page "https://github.com/chadaustin/sajson")
2128 (synopsis "C++11 header-only, in-place JSON parser")
2129 (description "@code{sajson} is an in-place JSON parser with support for
2130 parsing with only a single memory allocation.")
2131 (license license:expat))))
2133 (define-public sajson-for-gemmi
2134 (package/inherit sajson
2135 (name "sajson-for-gemmi")
2137 (inherit (package-source sajson))
2140 "sajson-for-gemmi-numbers-as-strings.patch")
2141 (origin-patches (package-source sajson))))))
2143 (substitute-keyword-arguments (package-arguments sajson)
2144 ;; This is a modified version used in gemmi, in which numbers are kept
2145 ;; as strings. Building the tests fails with the modification.
2146 ((#:tests? _ #f) #f)))
2147 (properties '((hidden? . #t)))))
2149 (define-public optionparser
2151 (name "optionparser")
2156 (string-append "mirror://sourceforge/optionparser/"
2157 "optionparser-" version ".tar.gz"))
2160 "04gfxrdzwacaynb8scsz6rr7nh64n6yk6w9dh2qdhrxw4caqr0dk"))))
2161 (outputs '("out" "doc"))
2162 (build-system gnu-build-system)
2166 #~(modify-phases %standard-phases
2168 (add-before 'build 'chdir
2169 (lambda _ (chdir "src")))
2171 (lambda* (#:key tests? #:allow-other-keys)
2174 (invoke "./example_arg")
2175 (invoke "./testparse")
2176 (invoke "./testprintusage")
2177 (invoke "./testodr")
2178 (invoke "./example")))))
2181 (install-file "optionparser.h"
2182 (string-append #$output "/include"))))
2183 (add-after 'install 'install-doc
2187 (string-append #$output:doc "/share/doc/optionparser/html")))))))
2188 (native-inputs (list doxygen))
2189 (home-page "https://optionparser.sourceforge.net/")
2190 (synopsis "Header-only C++ library to parse command line options")
2191 (description "This package provides a header-only C++ library to parse
2192 command line options. It supports the short and long option formats of
2193 getopt(), getopt_long() and getopt_long_only().")
2194 (license license:expat)))
2196 (define-public safeint
2200 (home-page "https://github.com/dcleblanc/SafeInt")
2206 (file-name (git-file-name name version))
2209 "01d2dpdhyw3lghmamknb6g39w2gg0sv53pgxlrs2la8h694z6x7s"))))
2210 (build-system cmake-build-system)
2212 (list #:phases #~(modify-phases %standard-phases
2215 (let ((include-dir (string-append #$output
2217 (with-directory-excursion "../source"
2218 (install-file "SafeInt.hpp" include-dir)
2219 (install-file "safe_math.h" include-dir)
2220 (install-file "safe_math_impl.h" include-dir)))))
2221 (add-after 'install 'install-doc
2223 (let ((doc-dir (string-append #$output
2224 "/share/doc/safeint")))
2225 (with-directory-excursion "../source"
2226 (install-file "helpfile.md" doc-dir))))))))
2227 (synopsis "C and C++ library for managing integer overflows")
2229 "SafeInt is a class library for C++ that manages integer overflows. It
2230 also includes a C library that checks casting, multiplication, division,
2231 addition and subtraction for all combinations of signed and unsigned 32-bit and
2233 (license license:expat)))