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 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>
33 ;;; This file is part of GNU Guix.
35 ;;; GNU Guix is free software; you can redistribute it and/or modify it
36 ;;; under the terms of the GNU General Public License as published by
37 ;;; the Free Software Foundation; either version 3 of the License, or (at
38 ;;; your option) any later version.
40 ;;; GNU Guix is distributed in the hope that it will be useful, but
41 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
42 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 ;;; GNU General Public License for more details.
45 ;;; You should have received a copy of the GNU General Public License
46 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
48 (define-module (gnu packages cpp)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix utils)
53 #:use-module (guix git-download)
54 #:use-module (guix build-system cmake)
55 #:use-module (guix build-system copy)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system meson)
58 #:use-module (guix build-system python)
59 #:use-module (guix modules)
60 #:use-module (guix gexp)
61 #:use-module (gnu packages)
62 #:use-module (gnu packages autotools)
63 #:use-module (gnu packages boost)
64 #:use-module (gnu packages build-tools)
65 #:use-module (gnu packages c)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages code)
68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages crypto)
70 #:use-module (gnu packages curl)
71 #:use-module (gnu packages documentation)
72 #:use-module (gnu packages gcc)
73 #:use-module (gnu packages libevent)
74 #:use-module (gnu packages libunwind)
75 #:use-module (gnu packages linux)
76 #:use-module (gnu packages llvm)
77 #:use-module (gnu packages logging)
78 #:use-module (gnu packages maths)
79 #:use-module (gnu packages onc-rpc)
80 #:use-module (gnu packages perl)
81 #:use-module (gnu packages python)
82 #:use-module (gnu packages python-check)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages popt)
85 #:use-module (gnu packages pretty-print)
86 #:use-module (gnu packages pulseaudio)
87 #:use-module (gnu packages tls)
88 #:use-module (gnu packages web)
89 #:use-module (gnu packages xml)
90 #:use-module (ice-9 match))
93 (let ((commit "79e4adfa2c6e2bfbe63da05cc668eb9ad5596748") (revision "0"))
96 (version (git-version "0.4.6" revision commit))
100 (url "https://github.com/vietjtnguyen/argagg")
102 (file-name (git-file-name name version))
105 "1flkgh524lq3024p7ld5lg743s1v7qnbmgv77578rzmn2rjzr77n"))))
106 (build-system cmake-build-system)
107 (outputs '("out" "doc"))
109 `(#:phases (modify-phases %standard-phases
110 (add-after 'install 'move-doc
111 (lambda* (#:key outputs #:allow-other-keys)
112 (let* ((name ,(package-name argagg)) (out (assoc-ref
115 (doc (assoc-ref outputs "doc")))
116 (mkdir-p (string-append doc "/share/doc"))
118 (string-append out "/share/doc/" name)
119 (string-append doc "/share/doc/" name))))))))
120 (native-inputs (list doxygen))
121 (home-page "https://github.com/vietjtnguyen/argagg")
122 (synopsis "C++11 command line argument parser")
124 "ArgAgg is yet another C++ command line argument/option
125 parser. It was written as a simple and idiomatic alternative to other
126 frameworks like getopt, Boost program options, TCLAP, and others. The goal is
127 to achieve the majority of argument parsing needs in a simple manner with an
129 (license license:expat))))
131 (define-public asmjit
132 (let ((commit "4ec760a3d1f69e32ba460ecd2513f29b8428700b")
136 (version (git-version "0.0.0" revision commit))
142 (url "https://github.com/asmjit/asmjit")
144 (file-name (git-file-name name version))
146 (base32 "0skgccbpamcbg1byawfq5n6jzxgj64hnc7jznvk35nkskaaz1nlb"))))
147 (build-system cmake-build-system)
149 (list #:configure-flags #~(list "-DASMJIT_TEST=TRUE")))
150 (home-page "https://asmjit.com/")
151 (synopsis "Machine code generation for C++")
152 (description "AsmJit is a lightweight library for machine code
153 generation written in C++ language. It can generate machine code for X86 and
154 X86_64 architectures with the support for the whole instruction set from
155 legacy MMX to the newest AVX-512 and AMX. It has a type-safe API that allows
156 C++ compiler to do semantic checks at compile-time even before the assembled
157 code is generated or executed. It also provides an optional register
158 allocator that makes it easy to generate complex code without a significant
159 development effort.")
160 (license license:zlib))))
162 (define-public range-v3
171 (url "https://github.com/ericniebler/range-v3.git")
174 (git-file-name name version))
175 (patches (search-patches "range-v3-build-with-gcc10.patch"))
177 (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
178 (build-system cmake-build-system)
182 #~(list "-DRANGES_NATIVE=OFF")))
184 (list doxygen gcc-9 perl))
187 (synopsis "Range library for C++14/17/20")
188 (description "Range-v3 is an extension of the Standard Template Library that
189 makes its iterators and algorithms more powerful by making them composable.
190 Unlike other range-like solutions which, seek to do away with iterators, in
191 range-v3 ranges are an abstraction layer on top of iterators.")
192 (home-page "https://github.com/ericniebler/range-v3/")
195 ;; Elements of Programming
196 (license:x11-style "file:///LICENSE.txt")
199 ;;; LibC++ (dual-licensed)
205 (define-public c++-gsl
214 (url "https://github.com/microsoft/GSL.git")
216 (string-append "v" version))))
218 (git-file-name name version))
221 "c++-gsl-find-system-gtest.patch"
222 "c++-gsl-move-array-bounds-tests.patch"))
224 (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
225 (build-system cmake-build-system)
227 (list googletest pkg-config))
228 (synopsis "Guidelines Support Library")
229 (description "c++-gsl contains functions and types that are suggested for
230 use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
231 (home-page "https://github.com/microsoft/GSL/")
232 (license license:expat)))
237 ;; As per the c2ffi README: the first three elements are encoding the
238 ;; required Clang/LLVM version, and the last one is the c2ffi revision.
244 (url "https://github.com/rpav/c2ffi")
245 (commit (string-append "v" version))))
246 (file-name (git-file-name name version))
248 (base32 "1qq8dfismd20d9kfxpfvwz07v9mfvd0y7p5r3c92mk2pm4xnmzfy"))
249 (modules '((guix build utils)))
251 '(substitute* "CMakeLists.txt"
252 ;; Guix seems to be packaging LLVM libs separately thus -lLLVM
253 ;; won't work, every used library must be specified explicitly.
254 (("c2ffi PUBLIC clang-cpp LLVM")
255 "c2ffi PUBLIC clang-cpp LLVMCore LLVMSupport LLVMMCParser \
256 LLVMOption LLVMBitReader LLVMProfileData")))))
257 (build-system cmake-build-system)
259 '(;; If LLVM was built without RTTI, we need to also be built without
260 ;; it. See: https://stackoverflow.com/q/11904519
261 #:configure-flags '("-DCMAKE_CXX_FLAGS=-fno-rtti")
263 (modify-phases %standard-phases
265 (lambda* (#:key tests? #:allow-other-keys)
267 (invoke "./bin/c2ffi" "--help")))))))
269 (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
271 (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
272 (home-page "https://github.com/rpav/c2ffi")
273 (synopsis "Clang-based FFI wrapper generator")
275 "@code{c2ffi} is a tool for extracting definitions from C, C++, and
276 Objective C headers for use with foreign function call interfaces. It uses
277 the @code{Clang/LLVM} infrastructure to extract the data, and emits it in
278 various formats, including @code{json}.")
279 (license license:gpl2+)))
281 (define-public libzen
287 ;; Warning: This source has proved unreliable 1 time at least.
288 ;; Consider an alternate source or report upstream if this
290 (uri (string-append "https://mediaarea.net/download/source/"
291 "libzen/" version "/"
292 "libzen_" version ".tar.bz2"))
295 "1rwaxmid9iv65n0y6xlcyxxydsvihjni9ldxpg6pbqz43amp49xx"))))
297 (list autoconf automake libtool))
298 (build-system gnu-build-system)
301 ;; The build scripts are not at the root of the archive.
302 (modify-phases %standard-phases
303 (add-after 'unpack 'pre-configure
305 (chdir "Project/GNU/Library"))))))
306 (home-page "https://github.com/MediaArea/ZenLib")
307 (synopsis "C++ utility library")
308 (description "ZenLib is a C++ utility library. It includes classes for handling
309 strings, configuration, bit streams, threading, translation, and cross-platform
310 operating system functions.")
311 (license license:zlib)))
321 (url "https://github.com/rttrorg/rttr/")
322 (commit (string-append "v" version))))
324 (base32 "1yxad8sj40wi75hny8w6imrsx8wjasjmsipnlq559n4b6kl84ijp"))
325 (file-name (git-file-name name version))))
326 (build-system cmake-build-system)
328 '(;; No check target. Setting test-target to "unit_test" runs it twice.
331 '("-DBUILD_DOCUMENTATION=OFF" "-DBUILD_EXAMPLES=OFF")
333 (modify-phases %standard-phases
334 ;; library_test fails in chroot.
335 (add-after 'unpack 'skip-library-test
337 (substitute* "src/unit_tests/unit_tests.cmake"
338 (("misc/library_test.cpp") ""))
340 (native-inputs (list pkg-config))
341 (home-page "https://github.com/rttrorg/rttr/")
342 (synopsis "C++ Reflection Library")
344 "RTTR stands for Run Time Type Reflection. It describes the ability of a
345 computer program to introspect and modify an object at runtime. It is also
346 the name of the library itself, which is written in C++.")
347 (license license:expat)))
350 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
354 (version (git-version "0.0.0" revision commit))
358 (url "https://github.com/Andersbakken/rct")
362 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
363 (patches (search-patches "rct-add-missing-headers.patch"))
364 (file-name (git-file-name name version))))
365 (build-system cmake-build-system)
368 '("-DWITH_TESTS=ON" ; To run the test suite
369 "-DRCT_RTTI_ENABLED=ON")))
371 (list cppunit pkg-config))
374 (home-page "https://github.com/Andersbakken/rct")
375 (synopsis "C++ library providing Qt-like APIs on top of the STL")
376 (description "Rct is a set of C++ tools that provide nicer (more Qt-like)
377 APIs on top of Standard Template Library (@dfn{STL}) classes.")
378 (license (list license:expat ; cJSON
379 license:bsd-4))))) ; everything else (LICENSE.txt)
381 (define-public dashel
389 (url "https://github.com/aseba-community/dashel")
392 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
393 (file-name (git-file-name name version))))
394 (build-system cmake-build-system)
395 (arguments '(#:tests? #f)) ; no tests
396 (native-inputs (list pkg-config))
397 (home-page "https://github.com/aseba-community/dashel")
398 (synopsis "Data stream helper encapsulation library")
400 "Dashel is a data stream helper encapsulation C++ library. It provides a
401 unified access to TCP/UDP sockets, serial ports, console, and files streams.
402 It also allows a server application to wait for any activity on any
403 combination of these streams.")
404 (license license:bsd-3)))
414 (url "https://github.com/QuantStack/xsimd")
417 (base32 "16b9fdvhhsbs93llbzccgpxjdkj8kfvac3wx0b30i306k5f3maq2"))
418 (file-name (git-file-name name version))))
419 (build-system cmake-build-system)
421 `(#:configure-flags (list "-DBUILD_TESTS=ON")
422 #:test-target "xtest"))
425 (home-page "https://github.com/QuantStack/xsimd")
426 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
428 "xsimd provides a unified means for using @acronym{SIMD, single instruction
429 multiple data} features for library authors. Namely, it enables manipulation of
430 batches of numbers with the same arithmetic operators as for single values.
431 It also provides accelerated implementation of common mathematical functions
432 operating on batches.")
433 (license license:bsd-3)))
435 (define-public google-highway
437 (name "google-highway")
443 (url "https://github.com/google/highway")
445 (file-name (git-file-name name version))
447 (base32 "0iwn7m8f1j7bchwbi5h84nzkzmzqd7byddbr4lh6i6lpd87wny08"))))
448 (build-system cmake-build-system)
450 `(#:configure-flags (list "-DHWY_SYSTEM_GTEST=on")))
453 (home-page "https://github.com/google/highway")
454 (synopsis "SIMD library with runtime dispatch")
455 (description "Highway is a performance-portable, length-agnostic C++
456 library for SIMD (Single Instruction, Multiple Data) with runtime dispatch.")
457 (license license:asl2.0)))
459 (define-public xsmimd-benchmark
462 (name "xsimd-benchmark")
464 `(#:configure-flags (list "-DBUILD_BENCHMARK=ON")
466 #:phases (modify-phases %standard-phases
467 (add-after 'unpack 'remove-march=native
469 (substitute* "benchmark/CMakeLists.txt"
470 (("-march=native") ""))))
472 (lambda* (#:key outputs #:allow-other-keys)
473 ;; Install nothing but the executable.
474 (let ((out (assoc-ref outputs "out")))
475 (install-file "benchmark/benchmark_xsimd"
476 (string-append out "/bin"))))))))
477 (synopsis "Benchmark of the xsimd library")
479 ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor.
480 (properties '((tunable? . #t)))))
482 (define-public chaiscript
490 (url "https://github.com/ChaiScript/ChaiScript")
491 (commit (string-append "v" version))))
492 (file-name (git-file-name name version))
494 (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
495 (build-system cmake-build-system)
496 (home-page "https://chaiscript.com/")
497 (synopsis "Embedded scripting language designed for C++")
499 "ChaiScript is one of the only embedded scripting language designed from
500 the ground up to directly target C++ and take advantage of modern C++
501 development techniques. Being a native C++ application, it has some advantages
502 over existing embedded scripting languages:
505 @item Uses a header-only approach, which makes it easy to integrate with
507 @item Maintains type safety between your C++ application and the user scripts.
508 @item Supports a variety of C++ techniques including callbacks, overloaded
509 functions, class methods, and stl containers.
511 (license license:bsd-3)))
513 (define-public fifo-map
517 (home-page "https://github.com/nlohmann/fifo_map")
522 (commit (string-append "v" version))))
525 "0y59fk6ycrgjln9liwcja3l5j1vxpa5i671bynpbsjlyq5f2560q"))
526 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
527 "fifo-map-fix-flags-for-gcc.patch"))
528 (file-name (git-file-name name version))
529 (modules '((guix build utils)))
530 (snippet '(delete-file-recursively "./test/thirdparty"))))
532 (list catch-framework2-1))
533 (build-system cmake-build-system)
536 (modify-phases %standard-phases
538 (lambda* (#:key tests? #:allow-other-keys)
539 (when tests? (invoke "./unit"))))
541 (lambda* (#:key outputs #:allow-other-keys)
542 (let* ((out (assoc-ref outputs "out"))
543 (inc (string-append out "/include/fifo_map")))
544 (with-directory-excursion "../source"
545 (install-file "src/fifo_map.hpp" inc))))))))
546 (synopsis "FIFO-ordered associative container for C++")
547 (description "Fifo_map is a C++ header only library for associative
548 container which uses the order in which keys were inserted to the container
549 as ordering relation.")
550 (license license:expat)))
552 (define-public json-modern-cxx
554 (name "json-modern-cxx")
556 (home-page "https://github.com/nlohmann/json")
560 (uri (git-reference (url home-page)
561 (commit (string-append "v" version))))
563 (base32 "1f9mi45ilwjc2w92grjc53sw038840bjpn8yjf6wc6bxs2nijfqd"))
564 (file-name (git-file-name name version))
565 (modules '((guix build utils)))
568 ;; Delete bundled software. Preserve doctest_compatibility.h, which
569 ;; is a wrapper library added by this package.
570 (install-file "./test/thirdparty/doctest/doctest_compatibility.h" "/tmp")
571 (for-each delete-file-recursively
572 '("./third_party" "./test/thirdparty"))
573 (install-file "/tmp/doctest_compatibility.h" "./test/thirdparty/doctest")
575 ;; Adjust for the unbundled fifo_map and doctest.
576 (substitute* "./test/thirdparty/doctest/doctest_compatibility.h"
577 (("#include \"doctest\\.h\"")
578 "#include <doctest/doctest.h>"))
579 (with-directory-excursion "test/src"
580 (let ((files (find-files "." "\\.cpp$")))
582 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
584 "#include <fifo_map/" fifo-map-hpp ">")))))))))
585 (build-system cmake-build-system)
588 (list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
589 (string-append "-DJSON_TestDataDirectory="
591 (search-input-directory %build-inputs
592 "json_nlohmann_tests"))))
593 #:phases (modify-phases %standard-phases
595 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
597 ;; Some tests need git and a full checkout, skip those.
598 (invoke "ctest" "-LE" "git_required"
599 "-j" (if parallel-tests?
600 (number->string (parallel-job-count))
602 (format #t "test suite not run~%")))))))
605 (let ((version "3.0.0"))
609 (url "https://github.com/nlohmann/json_test_data")
610 (commit (string-append "v" version))))
611 (file-name (git-file-name "json_test_data" version))
614 "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv"))))))
616 (list doctest fifo-map))
617 (synopsis "JSON parser and printer library for C++")
618 (description "JSON for Modern C++ is a C++ JSON library that provides
619 intuitive syntax and trivial integration.")
620 (license license:expat)))
630 (url "https://github.com/QuantStack/xtl")
634 "134pgvmf9cx5dxs0m0m3qhp3m3r1gl86ic3xax21zc4sdj8sdq46"))
635 (file-name (git-file-name name version))))
637 (list doctest googletest json-modern-cxx))
640 '("-DBUILD_TESTS=ON")
642 (modify-phases %standard-phases
645 (with-directory-excursion "test"
646 (invoke "./test_xtl")))))))
647 (home-page "https://github.com/QuantStack/xtl")
648 (build-system cmake-build-system)
649 (synopsis "C++ template library providing some basic tools")
650 (description "xtl is a C++ header-only template library providing basic
651 tools (containers, algorithms) used by other QuantStack packages.")
652 (license license:bsd-3)))
657 (version "0.20210330")
662 (url "https://github.com/MaskRay/ccls")
665 (base32 "0zzdn7c7a244djqwcsd7rvgclcdacyf9d0vkxpfspl83k2554alf"))
666 (file-name (git-file-name name version))))
667 (build-system cmake-build-system)
669 '(#:tests? #f)) ; no check target
674 (home-page "https://github.com/MaskRay/ccls")
675 (synopsis "C/C++/Objective-C language server")
677 "@code{ccls} is a server implementing the Language Server Protocol (LSP)
678 for C, C++ and Objective-C languages. It uses @code{clang} to perform static
679 code analysis and supports cross references, hierarchies, completion and
680 syntax highlighting. @code{ccls} is derived from @code{cquery} which is not
681 maintained anymore.")
682 (license license:asl2.0)))
684 (define-public concurrentqueue
686 (name "concurrentqueue")
692 (url "https://github.com/cameron314/concurrentqueue/")
693 (commit "3747268264d0fa113e981658a99ceeae4dad05b7")))
694 (file-name (git-file-name name version))
696 (base32 "1n5v7n27llzg7khg1jvi35jrcf9v6adw8gaic9ndxn65dp723ssy"))))
697 (build-system cmake-build-system)
698 (arguments '(#:tests? #false)) ;no check target
699 (home-page "https://github.com/cameron314/concurrentqueue/")
700 (synopsis "Multi-producer, multi-consumer lock-free concurrent queue for C++11")
702 "This package provides a fast multi-producer, multi-consumer lock-free
703 concurrent queue for C++11.")
704 (license license:bsd-2)))
706 (define-public spscqueue
714 (url "https://github.com/rigtorp/SPSCQueue/")
715 (commit (string-append "v" version))))
716 (file-name (git-file-name name version))
718 (base32 "1428cj9x318afvnvnkhg0711iy4czqn86fi7ysgfhw91asa316rc"))))
719 (build-system cmake-build-system)
720 (home-page "https://github.com/rigtorp/SPSCQueue/")
721 (synopsis "Single producer single consumer queue written in C++11")
723 "This package provides a single producer single consumer wait-free and
724 lock-free fixed size queue written in C++11.")
725 (license license:expat)))
727 (define-public gperftools
735 (url "https://github.com/gperftools/gperftools")
736 (commit (string-append "gperftools-" version))))
738 (base32 "0s9qhx940s8q6glc8sw74k5gs8hdhjfigq20zci92qawgm7zsicm"))
739 (file-name (git-file-name name version))))
740 (build-system gnu-build-system)
742 ;; The tests are flaky when run in parallel. For more info:
743 ;; https://bugs.gnu.org/46562
744 '(#:parallel-tests? #f))
746 (list autoconf automake libtool
749 (home-page "https://github.com/gperftools/gperftools")
750 (synopsis "Multi-threaded malloc() and performance analysis tools for C++")
752 "@code{gperftools} is a collection of a high-performance multi-threaded
753 malloc() implementation plus some thread-friendly performance analysis
762 (license license:bsd-3)))
764 (define-public cpp-httplib
765 ;; this package is not graftable, as everything is implemented in a single
774 (url "https://github.com/yhirose/cpp-httplib")
775 (commit (string-append "v" version))))
777 (base32 "0c0gyfbvm34bgrqy9fhfxw1f8nb9zhf063j7xq91k892flb7qm1c"))
778 (file-name (git-file-name name version))))
779 (build-system cmake-build-system)
782 '("-DBUILD_SHARED_LIBS=ON"
783 "-DHTTPLIB_COMPILE=ON"
784 "-DHTTPLIB_REQUIRE_BROTLI=ON"
785 "-DHTTPLIB_REQUIRE_OPENSSL=ON"
786 "-DHTTPLIB_REQUIRE_ZLIB=ON")
788 (modify-phases %standard-phases
789 (add-after 'unpack 'disable-network-tests
793 (substitute* "test/test.cc"
794 (((string-append "\\(" test))
795 (string-append "(DISABLED_" test))))
796 ;; There are tests requiring network access, disable them
797 '("AbsoluteRedirectTest" "BaseAuthTest" "CancelTest"
798 "ChunkedEncodingTest" "ChunkedEncodingTest"
799 "DecodeWithChunkedEncoding" "DefaultHeadersTest"
800 "DigestAuthTest" "HttpsToHttpRedirectTest"
801 "RangeTest" "RedirectTest" "RelativeRedirectTest"
802 "SSLClientTest" "SendAPI" "TooManyRedirectTest" "UrlWithSpace"
803 "YahooRedirectTest" "YahooRedirectTest"))))
805 (lambda* (#:key source tests? #:allow-other-keys)
806 ;; openssl genrsa wants to write a file in the git checkout
808 (with-directory-excursion "../source/test"
809 (invoke "make"))))))))
811 ;; required to build shared lib
814 (list brotli openssl zlib))
815 (home-page "https://github.com/yhirose/cpp-httplib")
816 (synopsis "C++ HTTP/HTTPS server and client library")
817 (description "cpp-httplib is a C++11 single-file cross platform blocking
818 HTTP/HTTPS library, easy to setup. It can also be used as a single-header
820 (license license:expat)))
822 (define-public cpplint
829 ;; Fetch from github instead of pypi, since the test cases are not in
832 (url "https://github.com/cpplint/cpplint")
835 (base32 "13l86aq0h1jga949k79k9x3hw2xqchjc162sclg2f99vz98zcz15"))
836 (file-name (git-file-name name version))))
838 (list #:modules `((srfi srfi-1)
840 ,@%python-build-system-modules)
842 #~(modify-phases (@ (guix build python-build-system) %standard-phases)
843 (add-before 'wrap 'reduce-GUIX_PYTHONPATH
845 ;; Hide the transitive native inputs from GUIX_PYTHONPATH
846 ;; to prevent them from ending up in the run-time closure.
847 ;; See also <https://bugs.gnu.org/25235>.
848 (let ((transitive-native-inputs
849 '#$(match (package-transitive-native-inputs
851 (((labels packages) ...) packages))))
852 ;; Save the original PYTHONPATH because we need it for
854 (setenv "TMP_PYTHONPATH" (getenv "GUIX_PYTHONPATH"))
855 (setenv "GUIX_PYTHONPATH"
857 (filter (lambda (path)
858 (not (any (cut string-prefix? <> path)
859 transitive-native-inputs)))
860 (search-path-as-string->list
861 (getenv "GUIX_PYTHONPATH")))
863 (add-after 'wrap 'reset-GUIX_PYTHONPATH
865 (setenv "GUIX_PYTHONPATH"
866 (getenv "TMP_PYTHONPATH"))))
868 (lambda* (#:key tests? #:allow-other-keys)
870 (invoke "pytest" "-vv")))))))
871 (build-system python-build-system)
873 (list python-coverage
877 python-testfixtures))
878 (home-page "https://github.com/cpplint/cpplint")
879 (synopsis "Static code checker for C++")
880 (description "@code{cpplint} is a command-line tool to check C/C++ files
881 for style issues following Google’s C++ style guide. While Google maintains
882 its own version of the tool, this is a fork that aims to be more responsive
883 and make @code{cpplint} usable in wider contexts.")
884 (license license:bsd-3)))
886 (define-public reproc
894 (url "https://github.com/DaanDeMeyer/reproc")
895 (commit (string-append "v" version))))
896 (file-name (git-file-name name version))
898 (base32 "09xnf8hmld1fk8j33zwlz1qcxnjdx1ncbg62csic9va4m1wc2v1d"))))
899 (build-system cmake-build-system)
903 ;; Build the shared library instead of a static one.
904 #:configure-flags `("-DBUILD_SHARED_LIBS=1")))
907 (synopsis "Process IO library")
908 (description "reproc (Redirected Process) is a C/C++ library that
909 simplifies starting, stopping and communicating with external programs. The
910 main use case is executing command line applications directly from C or C++
911 code and retrieving their output.")
912 (home-page "https://github.com/DaanDeMeyer/reproc")
913 (license license:expat)))
915 (define-public sobjectizer
923 (url "https://github.com/Stiffstream/sobjectizer")
924 (commit (string-append "v." version))))
926 (base32 "0n6smpjkkkw0xab8wcpy3p0dpw2v9sxgwl6azl3am6abmv4mff12"))
927 (file-name (git-file-name name version))))
928 (build-system cmake-build-system)
932 (modify-phases %standard-phases
933 (add-after 'unpack 'change-directory
937 (home-page "https://stiffstream.com/en/products/sobjectizer.html")
938 (synopsis "Cross-platform actor framework for C++")
940 "SObjectizer is a cross-platform \"actor frameworks\" for C++.
941 SObjectizer supports not only the Actor Model but also the Publish-Subscribe
942 Model and CSP-like channels. The goal of SObjectizer is to simplify
943 development of concurrent and multithreaded applications in C++.")
944 (license license:bsd-3)))
946 (define-public tweeny
954 (url "https://github.com/mobius3/tweeny")
955 (commit (string-append "v" version))))
956 (file-name (git-file-name name version))
958 (base32 "1adm4c17pi7xf3kf6sjyxibz5rdg1ka236p72xsm6js4j9gzlbp4"))))
960 '(#:tests? #f)) ;no check target
961 (build-system cmake-build-system)
962 (home-page "https://mobius3.github.io/tweeny/")
963 (synopsis "Modern C++ tweening library")
964 (description "@code{Tweeny} is an inbetweening library designed for the
965 creation of complex animations for games and other beautiful interactive
966 software. It leverages features of modern @code{C++} to empower developers with
967 an intuitive API for declaring tweenings of any type of value, as long as they
968 support arithmetic operations. The goal of @code{Tweeny} is to provide means to
969 create fluid interpolations when animating position, scale, rotation, frames or
970 other values of screen objects, by setting their values as the tween starting
971 point and then, after each tween step, plugging back the result.")
972 (license license:expat)))
974 ;;; This older LTS release is kept for tensorflow.
975 (define-public abseil-cpp-20200923.3
978 (version "20200923.3")
982 (url "https://github.com/abseil/abseil-cpp")
984 (file-name (git-file-name name version))
987 "1p4djhm1f011ficbjjxx3n8428p8481p20j4glpaawnpsi362hkl"))
989 (search-patches "abseil-cpp-fix-strerror_test.patch"))))
990 (build-system cmake-build-system)
992 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
993 "-DABSL_RUN_TESTS=ON"
994 "-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
995 ;; Needed, else we get errors like:
997 ;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o:
998 ;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE'
999 ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so:
1000 ;; error adding symbols: DSO missing from command line
1001 ;; collect2: error: ld returned 1 exit status
1002 "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")
1004 (modify-phases %standard-phases
1005 (add-before 'configure 'remove-gtest-check
1006 ;; The CMakeLists fails to find our googletest for some reason, but
1007 ;; it works nonetheless.
1009 (substitute* "CMakeLists.txt"
1010 (("check_target\\(gtest\\)") "")
1011 (("check_target\\(gtest_main\\)") "")
1012 (("check_target\\(gmock\\)") "")))))))
1015 (home-page "https://abseil.io")
1016 (synopsis "Augmented C++ standard library")
1017 (description "Abseil is a collection of C++ library code designed to
1018 augment the C++ standard library. The Abseil library code is collected from
1019 Google's C++ code base.")
1020 (license license:asl2.0)))
1022 (define-public abseil-cpp
1023 (let ((base abseil-cpp-20200923.3))
1024 (package/inherit base
1026 (version "20220623.0")
1030 (url "https://github.com/abseil/abseil-cpp")
1032 (file-name (git-file-name name version))
1035 "1kyvlpdkkh8spqrdh9yvq2d4ri46hwxljicy3i9mp7mk2rqcnyvj"))))
1037 (substitute-keyword-arguments (package-arguments base)
1038 ((#:configure-flags flags)
1039 `(cons* "-DBUILD_TESTING=ON"
1040 (delete "-DABSL_RUN_TESTS=ON" ,flags))))))))
1042 (define-public pegtl
1049 (url "https://github.com/taocpp/PEGTL")
1051 (file-name (git-file-name name version))
1054 "01adjqqdr9yf4h379jl1x0526kvixfpqk4hdk9mna49qc4s5hpi1"))))
1055 (build-system cmake-build-system)
1056 (home-page "https://github.com/taocpp/PEGTL")
1057 (synopsis "Parsing Expression Grammar template library")
1058 (description "The Parsing Expression Grammar Template Library (PEGTL) is
1059 a zero-dependency C++ header-only parser combinator library for creating
1060 parsers according to a Parsing Expression Grammar (PEG).")
1061 (license license:expat)))
1063 (define-public cxxopts
1070 (url "https://github.com/jarro2783/cxxopts")
1071 (commit (string-append "v" version))))
1072 (file-name (git-file-name name version))
1075 "08x7j168l1xwj0r3rv89cgghmfhsx98lpq35r3vkh504m1pd55a6"))))
1076 (build-system cmake-build-system)
1077 (synopsis "Lightweight C++ command line option parser")
1079 "A lightweight header-only C++ option parser library, supporting the
1080 standard GNU style syntax for options.")
1081 (home-page "https://github.com/jarro2783/cxxopts/wiki")
1082 (license license:expat)))
1084 (define-public folly
1087 (version "2022.04.11.00")
1091 (url "https://github.com/facebook/folly")
1092 (commit (string-append "v" version))))
1093 (file-name (git-file-name name version))
1096 "03c1my66xncn8yvgih4kc7j83ckmjbi2w29hdb28j30ixbn0bsjg"))))
1097 (build-system cmake-build-system)
1099 '(;; Tests must be explicitly enabled
1100 ;;#:configure-flags '("-DBUILD_TESTS=ON")))
1101 ;; Leave tests disabled; see https://github.com/facebook/folly/issues/1456
1104 (list boost gflags glog liburing))
1121 (synopsis "Collection of C++ components complementing the standard library")
1123 "Folly (acronymed loosely after Facebook Open Source Library) is a library
1124 of C++14 components that complements @code{std} and Boost.")
1125 (home-page "https://github.com/facebook/folly/wiki")
1126 ;; 32-bit is not supported: https://github.com/facebook/folly/issues/103
1127 (supported-systems '("aarch64-linux" "x86_64-linux"))
1128 (license license:asl2.0)))
1137 (url "https://github.com/pocoproject/poco")
1138 (commit (string-append "poco-" version "-release"))))
1139 (file-name (git-file-name name version))
1142 "0qkf8vb4qwds6idk9fkw6wjvcdk5k8h77x3gv47l0i4jfl5hwn8b"))))
1143 (build-system cmake-build-system)
1146 #:configure-flags #~(list "-DENABLE_TESTS=ON")
1148 #~(modify-phases %standard-phases
1149 (add-after 'unpack 'disable-problematic-tests
1151 (substitute* (list "Foundation/CMakeLists.txt" ; XXX: fails.
1152 ;; Require network access
1153 "Net/CMakeLists.txt"
1154 "MongoDB/CMakeLists.txt"
1155 "Redis/CMakeLists.txt")
1156 (("ENABLE_TESTS") "FALSE")))))))
1157 (home-page "https://pocoproject.org/")
1158 (synopsis "Portable C++ components")
1159 (description "This package provides a collection of C++ libraries intended
1160 to be useful for building network-based applications.")
1161 (license license:boost1.0)))
1163 (define-public aws-crt-cpp
1165 (name "aws-crt-cpp")
1166 ;; Update only when updating aws-sdk-cpp, and when updating also update
1167 ;; versions of library dependencies linked from from
1168 ;; https://github.com/awslabs/aws-crt-cpp/tree/{aws-crt-cpp commit}/crt
1173 (url "https://github.com/awslabs/aws-crt-cpp")
1174 (commit (string-append "v" version))))
1175 (file-name (git-file-name name version))
1178 "14g8pn7yii1klby7phcw08qnld1qv11vwmbdz8cs3mlpqahxrh4i"))))
1179 (build-system cmake-build-system)
1182 (list "-DBUILD_DEPS=OFF"
1183 "-DBUILD_SHARED_LIBS=ON"
1184 (string-append "-DCMAKE_PREFIX_PATH="
1185 (assoc-ref %build-inputs "aws-c-common"))
1186 "-DENABLE_NET_TESTS=OFF")))
1194 (synopsis "C++ wrapper for Amazon Web Services C libraries")
1195 (description "The AWS Common Runtime (CRT) library provides a C++ wrapper
1196 implementation for the following @acronym{AWS,Amazon Web Services} C libraries:
1197 aws-c-auth, aws-c-cal, aws-c-common, aws-c-compression, aws-c-event-stream,
1198 aws-c-http, aws-c-io, aws-c-mqtt, aws-checksums, and s2n.")
1199 (home-page "https://github.com/awslabs/aws-crt-cpp")
1200 (license license:asl2.0)))
1202 (define-public aws-sdk-cpp
1204 (name "aws-sdk-cpp")
1205 ; When updating also check for a tagged update to aws-crt-cpp from
1206 ; https://github.com/aws/aws-sdk-cpp/tree/main/crt
1211 (url "https://github.com/aws/aws-sdk-cpp")
1213 (file-name (git-file-name name version))
1216 "13qhxsbfn81r7lg382wb4d3xfc4a287ikww5i7whddk5yz0j8384"))))
1217 (build-system cmake-build-system)
1219 '(;; Tests are run during the build phase.
1222 (list "-DBUILD_DEPS=OFF"
1223 "-DBUILD_SHARED_LIBS=ON"
1224 (string-append "-DCMAKE_PREFIX_PATH="
1225 (assoc-ref %build-inputs "aws-c-common")))))
1229 (list curl pulseaudio zlib))
1230 (synopsis "Amazon Web Services SDK for C++")
1232 "The AWS SDK for C++ provides a C++11 interface to the @acronym{AWS,Amazon
1233 Web Services} API. AWS provides on-demand computing infrastructure and software
1234 services including database, analytic, and machine learning technologies.")
1235 (home-page "https://github.com/aws/aws-sdk-cpp")
1236 (license license:asl2.0)))
1238 (define-public libexpected
1240 (name "libexpected")
1246 (url "https://github.com/TartanLlama/expected")
1247 (commit (string-append "v" version))
1248 ;; NOTE: Requires TL_CMAKE from custom
1249 ;; repository. Should not affect reproducibility.
1251 (file-name (git-file-name name version))
1252 ;; NOTE: This patch will be unnecessary on subsequent tags.
1253 (patches (search-patches "libexpected-nofetch.patch"))
1255 (base32 "1ckzfrljzzdw9wf8hvdfjz4wjx5na57iwxc48mbv9rf5067m21a5"))))
1256 (build-system cmake-build-system)
1257 ;; TODO: Clean up install phase.
1260 (modify-phases %standard-phases
1263 (invoke "./tests"))))))
1265 (list catch-framework2))
1266 (synopsis "C++11/14/17 std::expected with functional-style extensions")
1267 (description "@code{std::expected} is proposed as the preferred way to
1268 represent objects which will either have an expected value, or an unexpected
1269 value giving information about why something failed. Unfortunately, chaining
1270 together many computations which may fail can be verbose, as error-checking
1271 code will be mixed in with the actual programming logic. This implementation
1272 provides a number of utilities to make coding with expected cleaner.")
1273 (home-page "https://tl.tartanllama.xyz/")
1274 (license license:cc0)))
1276 (define-public atomic-queue
1278 (name "atomic-queue")
1283 (url "https://github.com/max0x7ba/atomic_queue")
1284 (commit (string-append "v" version))))
1285 (file-name (git-file-name name version))
1288 "0ssff73wlvrsk2nma99dmvm0ijyzfr54jk37kxgpb694r7ajc90l"))))
1289 (build-system meson-build-system)
1291 `(#:configure-flags '("-Dbenchmarks=false")
1293 (modify-phases %standard-phases
1294 ,@(if (%current-target-system)
1295 `(;; boost is a test dependency. We don't run tests when
1296 ;; cross-compiling. Disable all targets that depend on it.
1297 (add-after 'unpack 'do-not-check-for-boost
1299 (substitute* "meson.build"
1300 (("unit_test_framework = [^\n]*" all)
1301 "unit_test_framework = disabler()")))))
1304 (lambda* (#:key tests? #:allow-other-keys)
1306 (invoke "./tests"))))
1308 (lambda* (#:key outputs #:allow-other-keys)
1309 (copy-recursively "../source/include/atomic_queue"
1310 (string-append (assoc-ref outputs "out")
1311 "/include/atomic_queue")))))))
1315 (home-page "https://github.com/max0x7ba/atomic_queue")
1316 (synopsis "C++ lockless queue")
1318 "This package contains a C++11 multiple-producer-multiple-consumer lockless
1319 queues header library based on circular buffer with @code{std::atomic}.")
1320 (license license:expat)))
1322 (define-public magic-enum
1326 (home-page "https://github.com/Neargye/magic_enum")
1331 (commit (string-append "v" version))))
1332 (file-name (git-file-name name version))
1335 "1x47radgsifgz3vn2561mlvf4cq46ii33cpyqf01znm56iirwq89"))))
1336 (build-system cmake-build-system)
1337 (synopsis "C++17 header only library for compile time reflection of enums")
1338 (description "Magic Enum offers static reflection of enums, with
1339 conversions to and from strings, iteration and related functionality.")
1340 (license license:expat)))
1342 (define-public cli11
1350 (url "https://github.com/CLIUtils/CLI11")
1351 (commit (string-append "v" version))))
1352 (file-name (git-file-name name version))
1354 (base32 "0hbch0vk8irgmiaxnfqlqys65v1770rxxdfn3d23m2vqyjh0j9l6"))
1355 (modules '((guix build utils)))
1357 '(begin (delete-file-recursively "extern")
1359 (build-system cmake-build-system)
1362 '("-DCLI11_SINGLE_FILE=OFF"
1363 "-DCLI11_BUILD_EXAMPLES=OFF")
1364 #:imported-modules ,%cmake-build-system-modules
1365 #:modules ((guix build cmake-build-system)
1368 (modify-phases %standard-phases
1369 (add-before 'configure 'no-vendor-gtest
1371 (substitute* "tests/CMakeLists.txt"
1372 ;; We provide our own googletest, so this is not really a
1374 (("message\\(FATAL_ERROR \"You have requested")
1375 "message(TRACE \"You have requested"))
1376 (substitute* "cmake/AddGoogletest.cmake"
1377 (("^add_subdirectory\\(.*googletest.*$") "find_package(GTest REQUIRED)")
1378 (("^set_target_properties\\(gtest gtest_main gmock gmock_main") "")
1379 (("^ PROPERTIES FOLDER \"Extern\"\\)") ""))
1382 (list doxygen googletest))
1383 (synopsis "Command line parser for C++11")
1385 "CLI11 is a command line parser for C++11 and beyond that provides a rich
1386 feature set with a simple and intuitive interface.")
1387 (home-page "https://cliutils.github.io/CLI11/book/")
1388 (license license:bsd-3)))
1397 (url "https://github.com/actor-framework/actor-framework")
1399 (file-name (git-file-name name version))
1402 "055y82044djphpwbazaxsvmb66c2xfdi8vyny8pzdxkdgxfh0vq1"))))
1403 (build-system cmake-build-system)
1406 '("-DCAF_ENABLE_EXAMPLES=OFF")))
1409 (synopsis "C++ implementation of the actor model")
1410 (description "The C++ Actor Framework (CAF) offers a high-level C++17
1411 programming environment using the actor model for concurrent, distributed
1413 (home-page "https://www.actor-framework.org/")
1414 (license license:bsd-3)))
1416 (define-public clipper
1423 (uri (string-append "mirror://sourceforge/polyclipping"
1424 "/clipper_ver" version ".zip"))
1426 (base32 "09q6jc5k7p9y5d75qr2na5d1gm0wly5cjnffh127r04l47c20hx1"))))
1427 (build-system cmake-build-system)
1429 `(#:tests? #f ;no check target
1430 #:phases (modify-phases %standard-phases
1432 (lambda* (#:key source #:allow-other-keys)
1433 (and (invoke "unzip" source)
1436 `(("unzip" ,unzip)))
1437 (home-page "https://sourceforge.net/projects/polyclipping")
1438 (synopsis "Polygon and line clipping and offsetting library")
1440 "The Clipper library performs line & polygon clipping - intersection,
1441 union, difference & exclusive-or, and line & polygon offsetting.
1442 The library is based on Vatti's clipping algorithm.")
1443 (license license:boost1.0)))
1445 (define-public pcg-cpp
1446 (let ((commit "ffd522e7188bef30a00c74dc7eb9de5faff90092")
1450 (version (git-version "0.98.1" revision commit))
1454 (url "https://github.com/imneme/pcg-cpp")
1456 (file-name (git-file-name name version))
1459 "0yxyqaphcc38zilpwpmssrl8ly1v6dimscqk2f4rcv1h22dinnqx"))))
1460 (build-system gnu-build-system)
1462 `(#:test-target "test"
1464 (modify-phases %standard-phases
1465 (delete 'configure))
1466 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1467 (synopsis "C++11 header only library for random number generation")
1468 (description "The Permuted Congruential Generator (PCG) extends the
1469 Linear Congruential Generator (LCG) with a permutation function to increase
1470 output randomness while retaining speed, simplicity, and conciseness.")
1471 (home-page "https://www.pcg-random.org")
1472 (license (list license:expat license:asl2.0))))) ; dual licensed
1474 (define-public libconfini
1481 (url "https://github.com/madmurphy/libconfini")
1483 (file-name (git-file-name name version))
1486 "002lmf1b2phmc6s348k00yx5shrcc7psn3pgqvraxvr6n8g747jx"))))
1487 (build-system gnu-build-system)
1490 (list "--disable-static")
1492 (modify-phases %standard-phases
1494 (lambda _ (invoke "sh" "bootstrap" "--noconfigure"))))))
1496 (list autoconf automake libtool))
1497 (home-page "https://madmurphy.github.io/libconfini/html/index.html")
1498 (synopsis "INI file parser")
1499 (description "@code{libconfini} is an INI file parser library written in
1500 C. It focuses on standardization and parsing exactness and is at ease with
1501 almost every type of file containing key/value pairs.")
1502 (license license:gpl3+)))
1504 (define-public libcutl
1511 "https://www.codesynthesis.com/download/libcutl/"
1512 (version-major+minor version)
1513 "/libcutl-" version ".tar.bz2"))
1516 "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j"))
1517 (modules '((guix build utils)))
1520 ;; Remove bundled sources.
1521 (with-directory-excursion "cutl/details"
1522 (for-each delete-file-recursively
1523 ;; FIXME: Boost_RegEx isn't being detected.
1527 (build-system gnu-build-system)
1529 `(#:configure-flags (list "--disable-static"
1530 ;;"--with-external-boost"
1531 "--with-external-expat")))
1533 (list ;;("boost ,boost)
1535 (home-page "https://www.codesynthesis.com/projects/libcutl/")
1536 (synopsis "C++ utility library with generic and independent components")
1537 (description "libcutl is a C++ utility library. It contains a collection
1538 of generic and independent components such as meta-programming tests, smart
1539 pointers, containers, compiler building blocks, etc.")
1540 (license (list license:expat ;everything except...
1541 license:boost1.0)))) ;...the files under cutl/details/boost
1543 (define-public libxsd-frontend
1545 (name "libxsd-frontend")
1550 (uri (string-append "https://www.codesynthesis.com/download/"
1551 "libxsd-frontend/" (version-major+minor version)
1552 "/libxsd-frontend-" version ".tar.bz2"))
1554 (base32 "1nmzchsvwvn66jpmcx18anzyl1a3l309x1ld4zllrg37ijc31fim"))))
1555 (build-system gnu-build-system)
1557 `(#:test-target "test"
1558 #:imported-modules ((guix build copy-build-system)
1559 ,@%gnu-build-system-modules)
1560 #:modules (((guix build copy-build-system) #:prefix copy:)
1561 (guix build gnu-build-system)
1563 #:make-flags (list (string-append "--include-dir="
1564 (assoc-ref %build-inputs "build")
1567 (modify-phases %standard-phases
1571 (apply (assoc-ref copy:%standard-phases 'install)
1573 '(("xsd-frontend" "include/xsd-frontend"
1574 #:include-regexp ("\\.?xx$"))
1575 ("xsd-frontend" "lib"
1576 #:include-regexp ("\\.so$")))
1581 `(("libcutl" ,libcutl)
1582 ("libxerces-c" ,xerces-c)))
1583 (synopsis "XSD Front-end")
1584 (description "@code{libxsd-frontend} is a compiler frontend for the W3C
1585 XML Schema definition language. It includes a parser, semantic graph types
1586 and a traversal mechanism.")
1587 (home-page "https://www.codesynthesis.com/projects/libxsd-frontend/")
1588 (license license:gpl2+)))
1597 (uri (string-append "https://www.codesynthesis.com/download/"
1598 "cli/" (version-major+minor version)
1599 "/cli-" version ".tar.bz2"))
1601 (base32 "0bg0nsai2q4h3mldpnj0jz4iy4svs0bcfvmq0v0c9cdyknny606g"))))
1602 (build-system gnu-build-system)
1604 `(#:test-target "test"
1605 #:make-flags (list (string-append "--include-dir="
1606 (assoc-ref %build-inputs "build")
1608 (string-append "install_prefix="
1609 (assoc-ref %outputs "out")))
1611 (modify-phases %standard-phases
1612 (add-after 'unpack 'patch
1614 (substitute* (find-files "." "\\.make$")
1616 (string-append (assoc-ref %build-inputs "build")
1617 "/include/build-0.3")))
1618 ;; Add the namespace prefix, to avoid errors such as "error:
1619 ;; ‘iterate_and_dispatch’ was not declared in this scope".
1620 (substitute* (find-files "." "\\.?xx$")
1621 (("add \\(typeid \\(type\\), \\*this\\);" all)
1622 (string-append "traverser_map<B>::" all))
1623 (("iterate_and_dispatch \\(s\\.names_begin.*;" all)
1624 (string-append "edge_dispatcher::" all)))))
1625 (delete 'configure))))
1630 (synopsis "C++ Command Line Interface (CLI) definition language")
1631 (description "@code{cli} is a domain-specific language (DSL) for defining
1632 command line interfaces of C++ programs. It allows you to describe the
1633 options that your program supports, their types, default values, and
1635 (home-page "https://codesynthesis.com/projects/cli/")
1636 (license license:expat)))
1645 (uri (string-append "https://www.codesynthesis.com/download/"
1646 "xsd/" (version-major+minor version)
1647 "/xsd-" version ".tar.bz2"))
1649 (base32 "1hi9ppxd34np8ydv1h0vgc2qpdmgcd1cdzgk30aidv670xjg91fx"))))
1650 (build-system gnu-build-system)
1651 (outputs '("out" "doc")) ;3.8 MiB of doc and examples
1653 `(#:test-target "test"
1654 #:make-flags (list (string-append "--include-dir="
1655 (assoc-ref %build-inputs "build")
1657 (string-append "install_prefix="
1658 (assoc-ref %outputs "out")))
1659 #:phases (modify-phases %standard-phases
1660 (add-after 'install 'move-doc
1661 (lambda* (#:key outputs #:allow-other-keys)
1662 (let ((out (assoc-ref outputs "out"))
1663 (doc (assoc-ref outputs "doc")))
1664 (mkdir-p (string-append doc "/share/doc"))
1665 (rename-file (string-append out "/share/doc/xsd")
1666 (string-append doc "/share/doc/xsd-"
1668 (delete 'configure))))
1672 (list libcutl libnsl libxsd-frontend))
1674 ;; The code XSD generates requires the following library at run time;
1675 ;; propagate it for convenience.
1677 (synopsis "XML Data Binding for C++")
1678 (description "CodeSynthesis XSD (also known as libxsd or xsdcxx) is an XML
1679 Schema to C++ data binding compiler. Provided with an XML instance
1680 specification (XML Schema), it generates C++ classes that represent the given
1681 vocabulary as well as XML parsing and serialization code. The data stored in
1682 XML can then be accessed using types and functions that semantically
1683 correspond to an application domain rather than dealing with the intricacies
1684 of reading and writing XML.")
1685 (home-page "https://codesynthesis.com/projects/xsd/")
1686 ;; Exceptions are made to allow using the generated source files as well
1687 ;; as the libxsd library in free software projects whose license is
1688 ;; incompatible with the GPL v2. Refer to the file named FLOSSE for the
1690 (license license:gpl2+)))
1692 (define-public jsonnet
1700 (url "https://github.com/google/jsonnet")
1701 (commit (string-append "v" version))))
1702 (file-name (git-file-name name version))
1704 (base32 "1ddz14699v5lqx3dh0mb7hfffr6fk5zhmzn3z8yxkqqvriqnciim"))
1705 (modules '((guix build utils)))
1708 (rename-file "third_party/md5" ".md5")
1709 (delete-file-recursively "third_party")
1710 (delete-file-recursively "doc/third_party")
1711 (substitute* '("core/vm.cpp")
1712 (("#include \"json.hpp\"") "#include <nlohmann/json.hpp>"))
1713 (mkdir "third_party")
1714 (rename-file ".md5" "third_party/md5")))))
1715 (build-system cmake-build-system)
1717 `(#:configure-flags '("-DUSE_SYSTEM_GTEST=ON" "-DUSE_SYSTEM_JSON=ON"
1718 "-DBUILD_STATIC_LIBS=OFF")))
1720 (list googletest pkg-config))
1722 (list json-modern-cxx))
1723 (home-page "https://jsonnet.org/")
1724 (synopsis "Data templating language")
1725 (description "Jsonnet is a templating language extending JSON
1726 syntax with variables, conditions, functions and more.")
1727 (license license:asl2.0)))
1729 (define-public simdjson
1736 (url "https://github.com/simdjson/simdjson")
1737 (commit (string-append "v" version))))
1738 (file-name (git-file-name name version))
1741 "05i5jnqd7ngps79cws16ls48gnx08ykkkib3n2hbrdhr1wwrnv7a"))))
1742 (build-system cmake-build-system)
1744 '(#:tests? #f ; tests require downloading dependencies
1746 '("-DBUILD_SHARED_LIBS=ON")))
1747 (synopsis "JSON parser for C++ using SIMD instructions")
1749 "The simdjson library uses commonly available SIMD instructions and
1750 microparallel algorithms to implement a strict JSON parser with UTF-8
1752 (home-page "https://github.com/simdjson/simdjson")
1753 (license license:asl2.0)))
1755 (define-public bloomberg-bde-tools
1756 (let ((commit "094885bd177e0159232d4e6a060a04edb1edd786"))
1758 (name "bloomberg-bde-tools")
1759 ;; Recent releases are not tagged so commit must be used for checkout.
1760 (version "3.97.0.0")
1764 (url "https://github.com/bloomberg/bde-tools")
1766 (file-name (git-file-name name version))
1769 "0mbbai73z8amh23ah3wy35kmy612380yr5wg89mic60qwqmpqb02"))
1772 "bloomberg-bde-tools-fix-install-path.patch"))))
1773 (build-system copy-build-system)
1774 ;; Unable to be an inline dependency of bloomberg-bde due to patch.
1775 (properties '((hidden? . #t)))
1776 (synopsis "Tools for developing and building libraries modeled on BDE")
1778 "This package provides the cmake imports needed to build bloomberg-bde.")
1779 (home-page "https://github.com/bloomberg/bde-tools")
1780 (license license:asl2.0))))
1782 (define-public bloomberg-bde
1783 (let ((commit "b6bcc0e24a5862bf77aea7edd831dedf50e21d64"))
1785 (name "bloomberg-bde")
1786 ;; Recent releases are not tagged so commit must be used for checkout.
1787 (version "3.98.0.0")
1791 (url "https://github.com/bloomberg/bde")
1793 (file-name (git-file-name name version))
1796 "0y3lipi1lj9qazgc935851r2qsx5aq3vvc4y52jq57riyz8wg3ma"))
1799 "bloomberg-bde-cmake-module-path.patch"))
1800 ;;(modules '((guix build utils)))
1803 ;; FIXME: Delete bundled software. The third-party packages
1804 ;; may be patched or modified from upstream sources.
1805 ;;(for-each delete-file-recursively
1806 ;; (list "thirdparty"))
1807 ;; Delete failing tests.
1810 (list "groups/bal/ball/ball_asyncfileobserver.t.cpp"
1811 "groups/bal/ball/ball_fileobserver2.t.cpp"
1812 "groups/bal/ball/ball_recordstringformatter.t.cpp"
1813 "groups/bal/balst/balst_stacktraceutil.t.cpp"
1814 "groups/bdl/bdlmt/bdlmt_eventscheduler.t.cpp"
1815 "groups/bdl/bdlmt/bdlmt_timereventscheduler.t.cpp"
1816 "groups/bdl/bdls/bdls_filesystemutil.t.cpp"
1817 "groups/bsl/bslh/bslh_hashpair.t.cpp"
1818 "groups/bsl/bsls/bsls_platform.t.cpp"
1819 "groups/bsl/bsls/bsls_stackaddressutil.t.cpp"
1820 "groups/bsl/bsls/bsls_stopwatch.t.cpp"
1821 "groups/bsl/bslstl/bslstl_function_invokerutil.t.cpp"))
1823 (build-system cmake-build-system)
1825 `(#:parallel-tests? #f ; Test parallelism may fail inconsistently.
1826 ;; Set UFID to build shared libraries. Flag descriptions can be found at
1827 ;; https://bloomberg.github.io/bde-tools/reference/bde_repo.html#ufid
1828 #:configure-flags ,(match %current-system
1829 ((or "i686-linux" "armhf-linux")
1830 ''("-DUFID=opt_dbg_exc_mt_32_shr_cpp17"))
1832 ''("-DUFID=opt_dbg_exc_mt_64_shr_cpp17")))
1834 (modify-phases %standard-phases
1835 ;; Explicitly build tests separate from the main build.
1836 (add-after 'build 'build-tests
1837 (lambda* (#:key make-flags #:allow-other-keys)
1838 (apply invoke "make" "all.t"
1839 `(,@(if #:parallel-build?
1840 `("-j" ,(number->string (parallel-job-count)))
1844 (list bloomberg-bde-tools pkg-config python))
1845 (synopsis "Foundational C++ libraries used at Bloomberg")
1847 "The BDE Development Environment libraries provide an enhanced
1848 implementation of STL containers, vocabulary types for representing common
1849 concepts (like dates and times), and building blocks for developing
1850 multi-threaded applications and network applications.")
1851 (home-page "https://github.com/bloomberg/bde")
1852 (license license:asl2.0))))
1854 (define-public gulrak-filesystem
1856 (name "gulrak-filesystem")
1861 (url "https://github.com/gulrak/filesystem")
1862 (commit (string-append "v" version))))
1863 (file-name (git-file-name name version))
1866 "0dx1yvbz5rnisymkqap7z0b06ag9fcs6q6l82vgi8caylhkwsqs7"))))
1867 (build-system cmake-build-system)
1868 (synopsis "Header only C++ std::filesystem compatible library")
1869 (description "This package provides a header-only single-file
1870 std::filesystem compatible helper library, based on the C++17 and C++20 specs,
1871 but implemented for C++11, C++14, C++17 or C++20.")
1872 (home-page "https://github.com/gulrak/filesystem")
1873 (license license:expat)))
1875 (define-public cpp-mustache
1877 (name "cpp-mustache")
1882 (url "https://github.com/kainjow/Mustache")
1883 (commit (string-append "v" version))))
1884 (file-name (git-file-name name version))
1887 "0r9rbk6v1wpld2ismfsk2lkhbyv3dkf0p03hkjivbj05qkfhvlbb"))))
1888 (build-system cmake-build-system)
1891 #~(modify-phases %standard-phases
1893 (lambda* (#:key tests? #:allow-other-keys)
1895 (invoke "./mustache"))))
1897 (lambda* (#:key outputs #:allow-other-keys)
1898 (install-file "../source/mustache.hpp"
1899 (string-append (assoc-ref outputs "out")
1901 (home-page "https://github.com/kainjow/Mustache")
1902 (synopsis "Mustache text templates for modern C++")
1903 (description "@code{cpp-mustache} is a Mustache implementation for C++ 11
1904 and above. It is header only and has zero dependencies. It provides a
1905 templated string type for compatibility with any STL-like string (std::string,
1906 std::wstring, etc).")
1907 (license license:boost1.0)))