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 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2019, 2020 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 Nicolò Balzarotti <nicolo@nixo.xyz>
10 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
11 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
13 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
14 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
15 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
16 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
17 ;;; Copyright © 2020, 2021 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>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages cpp)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix utils)
43 #:use-module (guix git-download)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system python)
47 #:use-module (guix modules)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages build-tools)
52 #:use-module (gnu packages c)
53 #:use-module (gnu packages check)
54 #:use-module (gnu packages code)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages crypto)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages gcc)
60 #:use-module (gnu packages libevent)
61 #:use-module (gnu packages libunwind)
62 #:use-module (gnu packages linux)
63 #:use-module (gnu packages llvm)
64 #:use-module (gnu packages logging)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages onc-rpc)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages popt)
70 #:use-module (gnu packages pretty-print)
71 #:use-module (gnu packages tls)
72 #:use-module (gnu packages web)
73 #:use-module (gnu packages xml))
75 (define-public range-v3
84 (url "https://github.com/ericniebler/range-v3.git")
87 (git-file-name name version))
89 (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
90 (build-system cmake-build-system)
92 `(("doxygen" ,doxygen)
96 (synopsis "Range library for C++14/17/20")
97 (description "Range-v3 is an extension of the Standard Template Library that
98 makes its iterators and algorithms more powerful by making them composable.
99 Unlike other range-like solutions which, seek to do away with iterators, in
100 range-v3 ranges are an abstraction layer on top of iterators.")
101 (home-page "https://github.com/ericniebler/range-v3/")
104 ;; Elements of Programming
105 (license:x11-style "file:///LICENSE.txt")
108 ;;; LibC++ (dual-licensed)
114 (define-public c++-gsl
123 (url "https://github.com/microsoft/GSL.git")
125 (string-append "v" version))))
127 (git-file-name name version))
130 "c++-gsl-find-system-gtest.patch"))
132 (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
133 (build-system cmake-build-system)
135 `(("googletest" ,googletest)
136 ("pkg-config" ,pkg-config)))
137 (synopsis "Guidelines Support Library")
138 (description "c++-gsl contains functions and types that are suggested for
139 use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
140 (home-page "https://github.com/microsoft/GSL/")
141 (license license:expat)))
143 (define-public libzen
149 ;; Warning: This source has proved unreliable 1 time at least.
150 ;; Consider an alternate source or report upstream if this
152 (uri (string-append "https://mediaarea.net/download/source/"
153 "libzen/" version "/"
154 "libzen_" version ".tar.bz2"))
157 "1nkygc17sndznpcf71fdrhwpm8z9a3hc9csqlafwswh49axhfkjr"))))
159 `(("autoconf" ,autoconf)
160 ("automake" ,automake)
161 ("libtool" ,libtool)))
162 (build-system gnu-build-system)
165 ;; The build scripts are not at the root of the archive.
166 (modify-phases %standard-phases
167 (add-after 'unpack 'pre-configure
169 (chdir "Project/GNU/Library")
171 (home-page "https://github.com/MediaArea/ZenLib")
172 (synopsis "C++ utility library")
173 (description "ZenLib is a C++ utility library. It includes classes for handling
174 strings, configuration, bit streams, threading, translation, and cross-platform
175 operating system functions.")
176 (license license:zlib)))
186 (url "https://github.com/rttrorg/rttr/")
187 (commit (string-append "v" version))))
189 (base32 "1yxad8sj40wi75hny8w6imrsx8wjasjmsipnlq559n4b6kl84ijp"))
190 (file-name (git-file-name name version))))
191 (build-system cmake-build-system)
193 '(;; No check target. Setting test-target to "unit_test" runs it twice.
196 '("-DBUILD_DOCUMENTATION=OFF" "-DBUILD_EXAMPLES=OFF")
198 (modify-phases %standard-phases
199 ;; library_test fails in chroot.
200 (add-after 'unpack 'skip-library-test
202 (substitute* "src/unit_tests/unit_tests.cmake"
203 (("misc/library_test.cpp") ""))
205 (native-inputs `(("pkg-config" ,pkg-config)))
206 (home-page "https://github.com/rttrorg/rttr/")
207 (synopsis "C++ Reflection Library")
209 "RTTR stands for Run Time Type Reflection. It describes the ability of a
210 computer program to introspect and modify an object at runtime. It is also
211 the name of the library itself, which is written in C++.")
212 (license license:expat)))
215 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
219 (version (git-version "0.0.0" revision commit))
223 (url "https://github.com/Andersbakken/rct")
227 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
228 (patches (search-patches "rct-add-missing-headers.patch"))
229 (file-name (git-file-name name version))))
230 (build-system cmake-build-system)
233 '("-DWITH_TESTS=ON" ; To run the test suite
234 "-DRCT_RTTI_ENABLED=ON")))
236 `(("cppunit" ,cppunit)
237 ("pkg-config" ,pkg-config)))
239 `(("openssl" ,openssl)
241 (home-page "https://github.com/Andersbakken/rct")
242 (synopsis "C++ library providing Qt-like APIs on top of the STL")
243 (description "Rct is a set of C++ tools that provide nicer (more Qt-like)
244 APIs on top of Standard Template Library (@dfn{STL}) classes.")
245 (license (list license:expat ; cJSON
246 license:bsd-4))))) ; everything else (LICENSE.txt)
248 (define-public dashel
256 (url "https://github.com/aseba-community/dashel")
259 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
260 (file-name (git-file-name name version))))
261 (build-system cmake-build-system)
262 (arguments '(#:tests? #f)) ; no tests
263 (native-inputs `(("pkg-config" ,pkg-config)))
264 (home-page "https://github.com/aseba-community/dashel")
265 (synopsis "Data stream helper encapsulation library")
267 "Dashel is a data stream helper encapsulation C++ library. It provides a
268 unified access to TCP/UDP sockets, serial ports, console, and files streams.
269 It also allows a server application to wait for any activity on any
270 combination of these streams.")
271 (license license:bsd-3)))
281 (url "https://github.com/QuantStack/xsimd")
284 (base32 "097yvxrxdldi5s5m4nsxv8f4gwv9xj42mqig98a1z3hkjj1j2gn5"))
285 (file-name (git-file-name name version))))
286 (build-system cmake-build-system)
288 `(#:configure-flags (list "-DBUILD_TESTS=ON")
289 #:test-target "xtest"))
291 `(("googletest" ,googletest)))
292 (home-page "https://github.com/QuantStack/xsimd")
293 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
295 "xsimd provides a unified means for using @acronym{SIMD, single instruction
296 multiple data} features for library authors. Namely, it enables manipulation of
297 batches of numbers with the same arithmetic operators as for single values.
298 It also provides accelerated implementation of common mathematical functions
299 operating on batches.")
300 (license license:bsd-3)))
302 (define-public chaiscript
310 (url "https://github.com/ChaiScript/ChaiScript")
311 (commit (string-append "v" version))))
312 (file-name (git-file-name name version))
314 (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
315 (build-system cmake-build-system)
316 (home-page "https://chaiscript.com/")
317 (synopsis "Embedded scripting language designed for C++")
319 "ChaiScript is one of the only embedded scripting language designed from
320 the ground up to directly target C++ and take advantage of modern C++
321 development techniques. Being a native C++ application, it has some advantages
322 over existing embedded scripting languages:
325 @item Uses a header-only approach, which makes it easy to integrate with
327 @item Maintains type safety between your C++ application and the user scripts.
328 @item Supports a variety of C++ techniques including callbacks, overloaded
329 functions, class methods, and stl containers.
331 (license license:bsd-3)))
333 (define-public fifo-map
334 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
336 (version (git-version "1.1.1" revision commit)))
340 (home-page "https://github.com/nlohmann/fifo_map")
348 "0pi77b75kp0l7z454ihcd14nzpi3nc5m4nyjbsgy5f9bw3676196"))
349 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
350 "fifo-map-fix-flags-for-gcc.patch"))
351 (file-name (git-file-name name version))
352 (modules '((guix build utils)))
353 (snippet '(delete-file-recursively "./test/thirdparty"))))
355 `(("catch2" ,catch-framework2-1)))
356 (build-system cmake-build-system)
359 (modify-phases %standard-phases
364 (lambda* (#:key outputs #:allow-other-keys)
365 (let* ((out (assoc-ref outputs "out"))
366 (inc (string-append out "/include/fifo_map")))
367 (with-directory-excursion
368 (string-append "../" ,name "-" ,version "-checkout")
369 (install-file "src/fifo_map.hpp" inc)
371 (synopsis "FIFO-ordered associative container for C++")
372 (description "Fifo_map is a C++ header only library for associative
373 container which uses the order in which keys were inserted to the container
374 as ordering relation.")
375 (license license:expat))))
377 (define-public json-modern-cxx
379 (name "json-modern-cxx")
381 (home-page "https://github.com/nlohmann/json")
385 (uri (git-reference (url home-page)
386 (commit (string-append "v" version))))
388 (base32 "0ar4mzp53lskxw3vdzw07f47njcshl3lwid9jfq6l7yx6ds2nyjc"))
389 (file-name (git-file-name name version))
390 (modules '((guix build utils)))
393 ;; Delete bundled software. Preserve doctest_compatibility.h, which
394 ;; is a wrapper library added by this package.
395 (install-file "./test/thirdparty/doctest/doctest_compatibility.h" "/tmp")
396 (for-each delete-file-recursively
397 '("./third_party" "./test/thirdparty" "./benchmarks/thirdparty"))
398 (install-file "/tmp/doctest_compatibility.h" "./test/thirdparty/doctest")
400 ;; Adjust for the unbundled fifo_map and doctest.
401 (substitute* "./test/thirdparty/doctest/doctest_compatibility.h"
402 (("#include \"doctest\\.h\"")
403 "#include <doctest/doctest.h>"))
404 (with-directory-excursion "test/src"
405 (let ((files (find-files "." "\\.cpp$")))
407 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
409 "#include <fifo_map/" fifo-map-hpp ">")))))
411 (build-system cmake-build-system)
414 (list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
415 (string-append "-DJSON_TestDataDirectory="
416 (assoc-ref %build-inputs "json_test_data")))
417 #:phases (modify-phases %standard-phases
418 ;; XXX: When tests are enabled, the install phase will cause
419 ;; a needless rebuild without the given configure flags,
420 ;; ultimately creating both $out/lib and $out/lib64. Move
421 ;; the check phase after install to work around it.
423 (add-after 'install 'check
424 (lambda* (#:key tests? #:allow-other-keys)
426 ;; Some tests need git and a full checkout, skip those.
427 (invoke "ctest" "-LE" "git_required")
428 (format #t "test suite not run~%"))
431 `(("amalgamate" ,amalgamate)
434 ,(let ((version "3.0.0"))
438 (url "https://github.com/nlohmann/json_test_data")
439 (commit (string-append "v" version))))
440 (file-name (git-file-name "json_test_data" version))
443 "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv")))))))
445 `(("fifo-map" ,fifo-map)))
446 (synopsis "JSON parser and printer library for C++")
447 (description "JSON for Modern C++ is a C++ JSON library that provides
448 intuitive syntax and trivial integration.")
449 (license license:expat)))
451 (define-public nlohmann-json-cpp
452 (deprecated-package "nlohmann-json-cpp" json-modern-cxx))
462 (url "https://github.com/QuantStack/xtl")
466 "1kd9zl4h6nrsg29hq13vwp4zhfj8sa90vj40726lpw6vxz48k4di"))
467 (file-name (git-file-name name version))))
469 `(("googletest" ,googletest)
470 ("json-modern-cxx" ,json-modern-cxx)))
473 '("-DBUILD_TESTS=ON")
475 (modify-phases %standard-phases
478 (with-directory-excursion "test"
479 (invoke "./test_xtl")
481 (home-page "https://github.com/QuantStack/xtl")
482 (build-system cmake-build-system)
483 (synopsis "C++ template library providing some basic tools")
484 (description "xtl is a C++ header-only template library providing basic
485 tools (containers, algorithms) used by other QuantStack packages.")
486 (license license:bsd-3)))
491 (version "0.20201219")
496 (url "https://github.com/MaskRay/ccls")
499 (base32 "0nkg92rgb1x6scpiwdamfrd1ag87j7ajxyn5qi861r916m5mh9m8"))
500 (file-name (git-file-name name version))))
501 (build-system cmake-build-system)
503 '(#:tests? #f)) ; no check target
505 `(("rapidjson" ,rapidjson)))
509 (home-page "https://github.com/MaskRay/ccls")
510 (synopsis "C/C++/Objective-C language server")
512 "@code{ccls} is a server implementing the Language Server Protocol (LSP)
513 for C, C++ and Objective-C languages. It uses @code{clang} to perform static
514 code analysis and supports cross references, hierarchies, completion and
515 syntax highlighting. @code{ccls} is derived from @code{cquery} which is not
516 maintained anymore.")
517 (license license:asl2.0)))
519 (define-public gperftools
527 (url "https://github.com/gperftools/gperftools")
528 (commit (string-append "gperftools-" version))))
530 (base32 "19bj2vlsbfwq7m826v2ccqg47kd7cb5vcz1yw2x0v5qzhaxbakk1"))
531 (file-name (git-file-name name version))))
532 (build-system gnu-build-system)
534 ;; The tests are flaky when run in parallel. For more info:
535 ;; https://bugs.gnu.org/46562
536 '(#:parallel-tests? #f))
538 `(("autoconf" ,autoconf)
539 ("automake" ,automake)
543 (home-page "https://github.com/gperftools/gperftools")
544 (synopsis "Multi-threaded malloc() and performance analysis tools for C++")
546 "@code{gperftools} is a collection of a high-performance multi-threaded
547 malloc() implementation plus some thread-friendly performance analysis
556 (license license:bsd-3)))
558 (define-public cpplint
565 ;; Fetch from github instead of pypi, since the test cases are not in
568 (url "https://github.com/cpplint/cpplint")
571 (base32 "1yzcxqx0186sh80p0ydl9z0ld51fn2cdpz9hmhrp15j53g9ira7c"))
572 (file-name (git-file-name name version))))
575 (modify-phases %standard-phases
576 (add-before 'check 'use-later-pytest
578 (substitute* "test-requirements"
579 (("pytest.*") "pytest\n"))
581 (build-system python-build-system)
583 `(("python-pytest" ,python-pytest)
584 ("python-pytest-cov" ,python-pytest-cov)
585 ("python-pytest-runner" ,python-pytest-runner)))
586 (home-page "https://github.com/cpplint/cpplint")
587 (synopsis "Static code checker for C++")
588 (description "@code{cpplint} is a command-line tool to check C/C++ files
589 for style issues following Google’s C++ style guide. While Google maintains
590 it's own version of the tool, this is a fork that aims to be more responsive
591 and make @code{cpplint} usable in wider contexts.")
592 (license license:bsd-3)))
594 (define-public reproc
602 (url "https://github.com/DaanDeMeyer/reproc")
603 (commit (string-append "v" version))))
604 (file-name (git-file-name name version))
607 "1n71wb50qv2dmhjgw7azx5gigbrp19l2n3d41g9p05l5l0y1qg0q"))))
608 (build-system cmake-build-system)
612 ;; Enable building of shared library.
613 #:configure-flags `("-DBUILD_SHARED_LIBS=1")))
615 `(("pkg-config" ,pkg-config)))
616 (synopsis "Process IO library")
617 (description "reproc (Redirected Process) is a C/C++ library that
618 simplifies starting, stopping and communicating with external programs. The
619 main use case is executing command line applications directly from C or C++
620 code and retrieving their output.")
621 (home-page "https://github.com/DaanDeMeyer/reproc")
622 (license license:expat)))
624 (define-public sobjectizer
632 (url "https://github.com/Stiffstream/sobjectizer")
633 (commit (string-append "v." version))))
635 (base32 "0jfai7sqxnnjkms38krm7mssj5l79nb3pllkbyj4j581a7l5j6l5"))
636 (file-name (git-file-name name version))))
637 (build-system cmake-build-system)
641 (modify-phases %standard-phases
642 (add-after 'unpack 'change-directory
646 (home-page "https://stiffstream.com/en/products/sobjectizer.html")
647 (synopsis "Cross-platform actor framework for C++")
649 "SObjectizer is a cross-platform \"actor frameworks\" for C++.
650 SObjectizer supports not only the Actor Model but also the Publish-Subscribe
651 Model and CSP-like channels. The goal of SObjectizer is to simplify
652 development of concurrent and multithreaded applications in C++.")
653 (license license:bsd-3)))
655 (define-public tweeny
663 (url "https://github.com/mobius3/tweeny")
664 (commit (string-append "v" version))))
665 (file-name (git-file-name name version))
667 (base32 "1adm4c17pi7xf3kf6sjyxibz5rdg1ka236p72xsm6js4j9gzlbp4"))))
669 '(#:tests? #f)) ;no check target
670 (build-system cmake-build-system)
671 (home-page "https://mobius3.github.io/tweeny/")
672 (synopsis "Modern C++ tweening library")
673 (description "@code{Tweeny} is an inbetweening library designed for the
674 creation of complex animations for games and other beautiful interactive
675 software. It leverages features of modern @code{C++} to empower developers with
676 an intuitive API for declaring tweenings of any type of value, as long as they
677 support arithmetic operations. The goal of @code{Tweeny} is to provide means to
678 create fluid interpolations when animating position, scale, rotation, frames or
679 other values of screen objects, by setting their values as the tween starting
680 point and then, after each tween step, plugging back the result.")
681 (license license:expat)))
683 (define-public abseil-cpp
686 (version "20200923.3")
690 (url "https://github.com/abseil/abseil-cpp")
692 (file-name (git-file-name name version))
695 "1p4djhm1f011ficbjjxx3n8428p8481p20j4glpaawnpsi362hkl"))
696 ;; Remove after next googletest release and update.
699 "abseil-cpp-fix-gtest.patch"
700 "abseil-cpp-fix-strerror_test.patch"))))
701 (build-system cmake-build-system)
703 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
704 "-DABSL_RUN_TESTS=ON"
705 "-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
706 ;; Needed, else we get errors like:
708 ;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o:
709 ;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE'
710 ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so:
711 ;; error adding symbols: DSO missing from command line
712 ;; collect2: error: ld returned 1 exit status
713 "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")
715 (modify-phases %standard-phases
716 (add-before 'configure 'remove-gtest-check
717 ;; The CMakeLists fails to find our googletest for some reason, but
718 ;; it works nonetheless.
720 (substitute* "CMakeLists.txt"
721 (("check_target\\(gtest\\)") "")
722 (("check_target\\(gtest_main\\)") "")
723 (("check_target\\(gmock\\)") "")))))))
725 `(("googletest" ,googletest)))
726 (home-page "https://abseil.io")
727 (synopsis "Augmented C++ standard library")
728 (description "Abseil is a collection of C++ library code designed to
729 augment the C++ standard library. The Abseil library code is collected from
730 Google's C++ code base.")
731 (license license:asl2.0)))
740 (url "https://github.com/taocpp/PEGTL")
742 (file-name (git-file-name name version))
745 "17crgjfdx55imi2dqnz6xpvsxq07390yfgkz5nd2g77ydkvq9db3"))))
746 (build-system cmake-build-system)
747 (home-page "https://github.com/taocpp/PEGTL")
748 (synopsis "Parsing Expression Grammar template library")
749 (description "The Parsing Expression Grammar Template Library (PEGTL) is
750 a zero-dependency C++ header-only parser combinator library for creating
751 parsers according to a Parsing Expression Grammar (PEG).")
752 (license license:expat)))
754 (define-public cxxopts
761 (url "https://github.com/jarro2783/cxxopts")
762 (commit (string-append "v" version))))
763 (file-name (git-file-name name version))
766 "0d3y747lsh1wkalc39nxd088rbypxigm991lk3j91zpn56whrpha"))))
767 (build-system cmake-build-system)
768 (synopsis "Lightweight C++ command line option parser")
770 "A lightweight header-only C++ option parser library, supporting the
771 standard GNU style syntax for options.")
772 (home-page "https://github.com/jarro2783/cxxopts/wiki")
773 (license license:expat)))
778 (version "2021.01.25.00")
782 (url "https://github.com/facebook/folly")
783 (commit (string-append "v" version))))
784 (file-name (git-file-name name version))
787 "14dl1g6vf7mc90mcync5h2lp14fwcx8n9h91pmiq6rfgv1fjjrwz"))))
788 (build-system cmake-build-system)
790 '(;; Tests must be explicitly enabled
791 ;;#:configure-flags '("-DBUILD_TESTS=ON")))
792 ;; Leave tests disabled; see https://github.com/facebook/folly/issues/1456
798 ("liburing" ,liburing)))
801 ("double-conversion" ,double-conversion)
804 ("libevent" ,libevent)
805 ("libiberty" ,libiberty)
806 ("libsodium" ,libsodium)
807 ("libunwind" ,libunwind)
812 ("zstd" ,zstd "lib")))
814 `(("googletest" ,googletest)))
815 (synopsis "Collection of C++ components complementing the standard library")
817 "Folly (acronymed loosely after Facebook Open Source Library) is a library
818 of C++14 components that complements @code{std} and Boost.")
819 (home-page "https://github.com/facebook/folly/wiki")
820 ;; 32-bit is not supported: https://github.com/facebook/folly/issues/103
821 (supported-systems '("aarch64-linux" "x86_64-linux"))
822 (license license:asl2.0)))
824 (define-public aws-sdk-cpp
831 (url "https://github.com/aws/aws-sdk-cpp")
833 (file-name (git-file-name name version))
836 "0jpfv9x82nq7hcix9in7qgrc8009dwpg6gr96hlgmcvqrqckd2r9"))))
837 (build-system cmake-build-system)
839 '(;; Tests are run during the build phase.
842 '("-DBUILD_SHARED_LIBS=ON"
843 "-DBUILD_DEPS=OFF")))
845 `(("aws-c-common" ,aws-c-common)
846 ("aws-c-event-stream" ,aws-c-event-stream)))
848 `(("aws-checksums" ,aws-checksums)
852 (synopsis "Amazon Web Services SDK for C++")
854 "The AWS SDK for C++ provides a C++11 interface to the @acronym{AWS,Amazon
855 Web Services} API. AWS provides on-demand computing infrastructure and software
856 services including database, analytic, and machine learning technologies.")
857 (home-page "https://github.com/aws/aws-sdk-cpp")
858 (license license:asl2.0)))
860 (define-public libexpected
868 (url "https://github.com/TartanLlama/expected")
869 (commit (string-append "v" version))
870 ;; NOTE: Requires TL_CMAKE from custom
871 ;; repository. Should not affect reproducibility.
873 (file-name (git-file-name name version))
874 ;; NOTE: This patch will be unnecessary on subsequent tags.
875 (patches (search-patches "libexpected-nofetch.patch"))
877 (base32 "1ckzfrljzzdw9wf8hvdfjz4wjx5na57iwxc48mbv9rf5067m21a5"))))
878 (build-system cmake-build-system)
879 ;; TODO: Clean up install phase.
882 (modify-phases %standard-phases
885 (invoke "./tests"))))))
887 `(("catch2" ,catch-framework2)))
888 (synopsis "C++11/14/17 std::expected with functional-style extensions")
889 (description "@code{std::expected} is proposed as the preferred way to
890 represent objects which will either have an expected value, or an unexpected
891 value giving information about why something failed. Unfortunately, chaining
892 together many computations which may fail can be verbose, as error-checking
893 code will be mixed in with the actual programming logic. This implementation
894 provides a number of utilities to make coding with expected cleaner.")
895 (home-page "https://tl.tartanllama.xyz/")
896 (license license:cc0)))
898 (define-public magic-enum
902 (home-page "https://github.com/Neargye/magic_enum")
907 (commit (string-append "v" version))))
908 (file-name (git-file-name name version))
911 "07j5zdf3vkliwrcv6k663k35akn7qp23794sz2mnvkj9hbv9s8cx"))))
912 (build-system cmake-build-system)
915 (synopsis "C++17 header only library for compile time reflection of enums")
916 (description "Magic Enum offers static reflection of enums, with
917 conversions to and from strings, iteration and related functionality.")
918 (license license:expat)))
928 (url "https://github.com/CLIUtils/CLI11")
929 (commit (string-append "v" version))))
930 (file-name (git-file-name name version))
932 (base32 "0hbch0vk8irgmiaxnfqlqys65v1770rxxdfn3d23m2vqyjh0j9l6"))
933 (modules '((guix build utils)))
935 '(begin (delete-file-recursively "extern")
937 (build-system cmake-build-system)
940 '("-DCLI11_SINGLE_FILE=OFF"
941 "-DCLI11_BUILD_EXAMPLES=OFF")
942 #:imported-modules ,%cmake-build-system-modules
943 #:modules ((guix build cmake-build-system)
946 (modify-phases %standard-phases
947 (add-before 'configure 'no-vendor-gtest
949 (substitute* "tests/CMakeLists.txt"
950 ;; We provide our own googletest, so this is not really a
952 (("message\\(FATAL_ERROR \"You have requested")
953 "message(TRACE \"You have requested"))
954 (substitute* "cmake/AddGoogletest.cmake"
955 (("^add_subdirectory\\(.*googletest.*$") "find_package(GTest REQUIRED)")
956 (("^set_target_properties\\(gtest gtest_main gmock gmock_main") "")
957 (("^ PROPERTIES FOLDER \"Extern\"\\)") ""))
960 `(("doxygen" ,doxygen)
961 ("googletest" ,googletest)))
962 (synopsis "Command line parser for C++11")
964 "CLI11 is a command line parser for C++11 and beyond that provides a rich
965 feature set with a simple and intuitive interface.")
966 (home-page "https://cliutils.github.io/CLI11/book/")
967 (license license:bsd-3)))
976 (url "https://github.com/actor-framework/actor-framework")
978 (file-name (git-file-name name version))
981 "1c3spd6vm1h9qhlk5c4fdwi6nbqx5vwz2zvv6qp0rj1hx6xpq3cx"))))
982 (build-system cmake-build-system)
985 '("-DCAF_ENABLE_EXAMPLES=OFF")))
987 `(("openssl" ,openssl)))
988 (synopsis "C++ implementation of the actor model")
989 (description "The C++ Actor Framework (CAF) offers a high-level C++17
990 programming environment using the actor model for concurrent, distributed
992 (home-page "https://www.actor-framework.org/")
993 (license license:bsd-3)))
995 (define-public pcg-cpp
996 (let ((commit "5b5cac8d61339e810c5dbb4692d868a1d7ca1b2d")
1000 (version (git-version "0.98.1" revision commit))
1004 (url "https://github.com/imneme/pcg-cpp")
1006 (file-name (git-file-name name version))
1009 "1s9dcd4iydlc1xj9m6f7c52nlyx99klk043sk7arqy6kp7gdaa33"))))
1010 (build-system gnu-build-system)
1012 `(#:test-target "test"
1014 (modify-phases %standard-phases
1015 (delete 'configure))
1016 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1017 (synopsis "C++11 header only library for random number generation")
1018 (description "The Permuted Congruential Generator (PCG) extends the
1019 Linear Congruential Generator (LCG) with a permutation function to increase
1020 output randomness while retaining speed, simplicity, and conciseness.")
1021 (home-page "https://www.pcg-random.org")
1022 (license (list license:expat license:asl2.0))))) ; dual licensed
1024 (define-public libcutl
1031 "https://www.codesynthesis.com/download/libcutl/"
1032 (version-major+minor version)
1033 "/libcutl-" version ".tar.bz2"))
1036 "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j"))
1037 (modules '((guix build utils)))
1040 ;; Remove bundled sources.
1041 (with-directory-excursion "cutl/details"
1042 (for-each delete-file-recursively
1043 ;; FIXME: Boost_RegEx isn't being detected.
1047 (build-system gnu-build-system)
1049 `(#:configure-flags (list "--disable-static"
1050 ;;"--with-external-boost"
1051 "--with-external-expat")))
1055 (home-page "https://www.codesynthesis.com/projects/libcutl/")
1056 (synopsis "C++ utility library with generic and independent components")
1057 (description "libcutl is a C++ utility library. It contains a collection
1058 of generic and independent components such as meta-programming tests, smart
1059 pointers, containers, compiler building blocks, etc.")
1060 (license (list license:expat ;everything except...
1061 license:boost1.0)))) ;...the files under cutl/details/boost
1063 (define-public libxsd-frontend
1065 (name "libxsd-frontend")
1070 (uri (string-append "https://www.codesynthesis.com/download/"
1071 "libxsd-frontend/" (version-major+minor version)
1072 "/libxsd-frontend-" version ".tar.bz2"))
1074 (base32 "1nmzchsvwvn66jpmcx18anzyl1a3l309x1ld4zllrg37ijc31fim"))))
1075 (build-system gnu-build-system)
1077 `(#:test-target "test"
1078 #:imported-modules ((guix build copy-build-system)
1079 ,@%gnu-build-system-modules)
1080 #:modules (((guix build copy-build-system) #:prefix copy:)
1081 (guix build gnu-build-system)
1083 #:make-flags (list (string-append "--include-dir="
1084 (assoc-ref %build-inputs "build")
1087 (modify-phases %standard-phases
1091 (apply (assoc-ref copy:%standard-phases 'install)
1093 '(("xsd-frontend" "include/xsd-frontend"
1094 #:include-regexp ("\\.?xx$"))
1095 ("xsd-frontend" "lib"
1096 #:include-regexp ("\\.so$")))
1099 `(("build" ,build)))
1101 `(("libcutl" ,libcutl)
1102 ("libxerces-c" ,xerces-c)))
1103 (synopsis "XSD Front-end")
1104 (description "@code{libxsd-frontend} is a compiler frontend for the W3C
1105 XML Schema definition language. It includes a parser, semantic graph types
1106 and a traversal mechanism.")
1107 (home-page "https://www.codesynthesis.com/projects/libxsd-frontend/")
1108 (license license:gpl2+)))
1117 (uri (string-append "https://www.codesynthesis.com/download/"
1118 "cli/" (version-major+minor version)
1119 "/cli-" version ".tar.bz2"))
1121 (base32 "0bg0nsai2q4h3mldpnj0jz4iy4svs0bcfvmq0v0c9cdyknny606g"))))
1122 (build-system gnu-build-system)
1124 `(#:test-target "test"
1125 #:make-flags (list (string-append "--include-dir="
1126 (assoc-ref %build-inputs "build")
1128 (string-append "install_prefix="
1129 (assoc-ref %outputs "out")))
1131 (modify-phases %standard-phases
1132 (add-after 'unpack 'patch
1134 (substitute* (find-files "." "\\.make$")
1136 (string-append (assoc-ref %build-inputs "build")
1137 "/include/build-0.3")))
1138 ;; Add the namespace prefix, to avoid errors such as "error:
1139 ;; ‘iterate_and_dispatch’ was not declared in this scope".
1140 (substitute* (find-files "." "\\.?xx$")
1141 (("add \\(typeid \\(type\\), \\*this\\);" all)
1142 (string-append "traverser_map<B>::" all))
1143 (("iterate_and_dispatch \\(s\\.names_begin.*;" all)
1144 (string-append "edge_dispatcher::" all)))))
1145 (delete 'configure))))
1147 `(("build" ,build)))
1149 `(("libcutl" ,libcutl)))
1150 (synopsis "C++ Command Line Interface (CLI) definition language")
1151 (description "@code{cli} is a domain-specific language (DSL) for defining
1152 command line interfaces of C++ programs. It allows you to describe the
1153 options that your program supports, their types, default values, and
1155 (home-page "https://codesynthesis.com/projects/cli/")
1156 (license license:expat)))
1165 (uri (string-append "https://www.codesynthesis.com/download/"
1166 "xsd/" (version-major+minor version)
1167 "/xsd-" version ".tar.bz2"))
1169 (base32 "1hi9ppxd34np8ydv1h0vgc2qpdmgcd1cdzgk30aidv670xjg91fx"))))
1170 (build-system gnu-build-system)
1171 (outputs '("out" "doc")) ;3.8 MiB of doc and examples
1173 `(#:test-target "test"
1174 #:make-flags (list (string-append "--include-dir="
1175 (assoc-ref %build-inputs "build")
1177 (string-append "install_prefix="
1178 (assoc-ref %outputs "out")))
1179 #:phases (modify-phases %standard-phases
1180 (add-after 'install 'move-doc
1181 (lambda* (#:key outputs #:allow-other-keys)
1182 (let ((out (assoc-ref outputs "out"))
1183 (doc (assoc-ref outputs "doc")))
1184 (mkdir-p (string-append doc "/share/doc"))
1185 (rename-file (string-append out "/share/doc/xsd")
1186 (string-append doc "/share/doc/xsd-"
1188 (delete 'configure))))
1193 `(("libcutl" ,libcutl)
1195 ("libxsd-frontend" ,libxsd-frontend)))
1197 ;; The code XSD generates requires the following library at run time;
1198 ;; propagate it for convenience.
1199 `(("xerces-c" ,xerces-c)))
1200 (synopsis "XML Data Binding for C++")
1201 (description "CodeSynthesis XSD (also known as libxsd or xsdcxx) is an XML
1202 Schema to C++ data binding compiler. Provided with an XML instance
1203 specification (XML Schema), it generates C++ classes that represent the given
1204 vocabulary as well as XML parsing and serialization code. The data stored in
1205 XML can then be accessed using types and functions that semantically
1206 correspond to an application domain rather than dealing with the intricacies
1207 of reading and writing XML.")
1208 (home-page "https://codesynthesis.com/projects/xsd/")
1209 ;; Exceptions are made to allow using the generated source files as well
1210 ;; as the libxsd library in free software projects whose license is
1211 ;; incompatible with the GPL v2. Refer to the file named FLOSSE for the
1213 (license license:gpl2+)))