gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / cpp.scm
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>
21
22 ;;;
23 ;;; This file is part of GNU Guix.
24 ;;;
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.
29 ;;;
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.
34 ;;;
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/>.
37
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))
74
75 (define-public range-v3
76 (package
77 (name "range-v3")
78 (version "0.11.0")
79 (source
80 (origin
81 (method git-fetch)
82 (uri
83 (git-reference
84 (url "https://github.com/ericniebler/range-v3.git")
85 (commit version)))
86 (file-name
87 (git-file-name name version))
88 (sha256
89 (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
90 (build-system cmake-build-system)
91 (native-inputs
92 `(("doxygen" ,doxygen)
93 ("perl" ,perl)))
94 (inputs
95 `(("boost" ,boost)))
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/")
102 (license
103 (list
104 ;; Elements of Programming
105 (license:x11-style "file:///LICENSE.txt")
106 ;; SGI STL
107 license:sgifreeb2.0
108 ;;; LibC++ (dual-licensed)
109 license:expat
110 license:ncsa
111 ;; Others
112 license:boost1.0))))
113
114 (define-public c++-gsl
115 (package
116 (name "c++-gsl")
117 (version "3.1.0")
118 (source
119 (origin
120 (method git-fetch)
121 (uri
122 (git-reference
123 (url "https://github.com/microsoft/GSL.git")
124 (commit
125 (string-append "v" version))))
126 (file-name
127 (git-file-name name version))
128 (patches
129 (search-patches
130 "c++-gsl-find-system-gtest.patch"))
131 (sha256
132 (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
133 (build-system cmake-build-system)
134 (native-inputs
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)))
142
143 (define-public libzen
144 (package
145 (name "libzen")
146 (version "0.4.38")
147 (source (origin
148 (method url-fetch)
149 ;; Warning: This source has proved unreliable 1 time at least.
150 ;; Consider an alternate source or report upstream if this
151 ;; happens again.
152 (uri (string-append "https://mediaarea.net/download/source/"
153 "libzen/" version "/"
154 "libzen_" version ".tar.bz2"))
155 (sha256
156 (base32
157 "1nkygc17sndznpcf71fdrhwpm8z9a3hc9csqlafwswh49axhfkjr"))))
158 (native-inputs
159 `(("autoconf" ,autoconf)
160 ("automake" ,automake)
161 ("libtool" ,libtool)))
162 (build-system gnu-build-system)
163 (arguments
164 '(#:phases
165 ;; The build scripts are not at the root of the archive.
166 (modify-phases %standard-phases
167 (add-after 'unpack 'pre-configure
168 (lambda _
169 (chdir "Project/GNU/Library")
170 #t)))))
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)))
177
178 (define-public rttr
179 (package
180 (name "rttr")
181 (version "0.9.6")
182 (source
183 (origin
184 (method git-fetch)
185 (uri (git-reference
186 (url "https://github.com/rttrorg/rttr/")
187 (commit (string-append "v" version))))
188 (sha256
189 (base32 "1yxad8sj40wi75hny8w6imrsx8wjasjmsipnlq559n4b6kl84ijp"))
190 (file-name (git-file-name name version))))
191 (build-system cmake-build-system)
192 (arguments
193 '(;; No check target. Setting test-target to "unit_test" runs it twice.
194 #:tests? #f
195 #:configure-flags
196 '("-DBUILD_DOCUMENTATION=OFF" "-DBUILD_EXAMPLES=OFF")
197 #:phases
198 (modify-phases %standard-phases
199 ;; library_test fails in chroot.
200 (add-after 'unpack 'skip-library-test
201 (lambda _
202 (substitute* "src/unit_tests/unit_tests.cmake"
203 (("misc/library_test.cpp") ""))
204 #t)))))
205 (native-inputs `(("pkg-config" ,pkg-config)))
206 (home-page "https://github.com/rttrorg/rttr/")
207 (synopsis "C++ Reflection Library")
208 (description
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)))
213
214 (define-public rct
215 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
216 (revision "2"))
217 (package
218 (name "rct")
219 (version (git-version "0.0.0" revision commit))
220 (source (origin
221 (method git-fetch)
222 (uri (git-reference
223 (url "https://github.com/Andersbakken/rct")
224 (commit commit)))
225 (sha256
226 (base32
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)
231 (arguments
232 '(#:configure-flags
233 '("-DWITH_TESTS=ON" ; To run the test suite
234 "-DRCT_RTTI_ENABLED=ON")))
235 (native-inputs
236 `(("cppunit" ,cppunit)
237 ("pkg-config" ,pkg-config)))
238 (inputs
239 `(("openssl" ,openssl)
240 ("zlib" ,zlib)))
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)
247
248 (define-public dashel
249 (package
250 (name "dashel")
251 (version "1.3.3")
252 (source
253 (origin
254 (method git-fetch)
255 (uri (git-reference
256 (url "https://github.com/aseba-community/dashel")
257 (commit version)))
258 (sha256
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")
266 (description
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)))
272
273 (define-public xsimd
274 (package
275 (name "xsimd")
276 (version "7.4.10")
277 (source
278 (origin
279 (method git-fetch)
280 (uri (git-reference
281 (url "https://github.com/QuantStack/xsimd")
282 (commit version)))
283 (sha256
284 (base32 "097yvxrxdldi5s5m4nsxv8f4gwv9xj42mqig98a1z3hkjj1j2gn5"))
285 (file-name (git-file-name name version))))
286 (build-system cmake-build-system)
287 (arguments
288 `(#:configure-flags (list "-DBUILD_TESTS=ON")
289 #:test-target "xtest"))
290 (native-inputs
291 `(("googletest" ,googletest)))
292 (home-page "https://github.com/QuantStack/xsimd")
293 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
294 (description
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)))
301
302 (define-public chaiscript
303 (package
304 (name "chaiscript")
305 (version "6.1.0")
306 (source
307 (origin
308 (method git-fetch)
309 (uri (git-reference
310 (url "https://github.com/ChaiScript/ChaiScript")
311 (commit (string-append "v" version))))
312 (file-name (git-file-name name version))
313 (sha256
314 (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
315 (build-system cmake-build-system)
316 (home-page "https://chaiscript.com/")
317 (synopsis "Embedded scripting language designed for C++")
318 (description
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:
323
324 @enumerate
325 @item Uses a header-only approach, which makes it easy to integrate with
326 existing projects.
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.
330 @end enumerate\n")
331 (license license:bsd-3)))
332
333 (define-public fifo-map
334 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
335 (revision "0")
336 (version (git-version "1.1.1" revision commit)))
337 (package
338 (name "fifo-map")
339 (version version)
340 (home-page "https://github.com/nlohmann/fifo_map")
341 (source (origin
342 (method git-fetch)
343 (uri (git-reference
344 (url home-page)
345 (commit commit)))
346 (sha256
347 (base32
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"))))
354 (native-inputs
355 `(("catch2" ,catch-framework2-1)))
356 (build-system cmake-build-system)
357 (arguments
358 `(#:phases
359 (modify-phases %standard-phases
360 (replace 'check
361 (lambda _
362 (invoke "./unit")))
363 (replace 'install
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)
370 #t)))))))
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))))
376
377 (define-public json-modern-cxx
378 (package
379 (name "json-modern-cxx")
380 (version "3.9.1")
381 (home-page "https://github.com/nlohmann/json")
382 (source
383 (origin
384 (method git-fetch)
385 (uri (git-reference (url home-page)
386 (commit (string-append "v" version))))
387 (sha256
388 (base32 "0ar4mzp53lskxw3vdzw07f47njcshl3lwid9jfq6l7yx6ds2nyjc"))
389 (file-name (git-file-name name version))
390 (modules '((guix build utils)))
391 (snippet
392 '(begin
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")
399
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$")))
406 (substitute* files
407 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
408 (string-append
409 "#include <fifo_map/" fifo-map-hpp ">")))))
410 #t))))
411 (build-system cmake-build-system)
412 (arguments
413 '(#:configure-flags
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.
422 (delete 'check)
423 (add-after 'install 'check
424 (lambda* (#:key tests? #:allow-other-keys)
425 (if tests?
426 ;; Some tests need git and a full checkout, skip those.
427 (invoke "ctest" "-LE" "git_required")
428 (format #t "test suite not run~%"))
429 #t)))))
430 (native-inputs
431 `(("amalgamate" ,amalgamate)
432 ("doctest" ,doctest)
433 ("json_test_data"
434 ,(let ((version "3.0.0"))
435 (origin
436 (method git-fetch)
437 (uri (git-reference
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))
441 (sha256
442 (base32
443 "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv")))))))
444 (inputs
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)))
450
451 (define-public nlohmann-json-cpp
452 (deprecated-package "nlohmann-json-cpp" json-modern-cxx))
453
454 (define-public xtl
455 (package
456 (name "xtl")
457 (version "0.6.23")
458 (source (origin
459 (method git-fetch)
460 (uri
461 (git-reference
462 (url "https://github.com/QuantStack/xtl")
463 (commit version)))
464 (sha256
465 (base32
466 "1kd9zl4h6nrsg29hq13vwp4zhfj8sa90vj40726lpw6vxz48k4di"))
467 (file-name (git-file-name name version))))
468 (native-inputs
469 `(("googletest" ,googletest)
470 ("json-modern-cxx" ,json-modern-cxx)))
471 (arguments
472 `(#:configure-flags
473 '("-DBUILD_TESTS=ON")
474 #:phases
475 (modify-phases %standard-phases
476 (replace 'check
477 (lambda* _
478 (with-directory-excursion "test"
479 (invoke "./test_xtl")
480 #t))))))
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)))
487
488 (define-public ccls
489 (package
490 (name "ccls")
491 (version "0.20201219")
492 (source
493 (origin
494 (method git-fetch)
495 (uri (git-reference
496 (url "https://github.com/MaskRay/ccls")
497 (commit version)))
498 (sha256
499 (base32 "0nkg92rgb1x6scpiwdamfrd1ag87j7ajxyn5qi861r916m5mh9m8"))
500 (file-name (git-file-name name version))))
501 (build-system cmake-build-system)
502 (arguments
503 '(#:tests? #f)) ; no check target
504 (inputs
505 `(("rapidjson" ,rapidjson)))
506 (native-inputs
507 `(("clang" ,clang)
508 ("llvm" ,llvm)))
509 (home-page "https://github.com/MaskRay/ccls")
510 (synopsis "C/C++/Objective-C language server")
511 (description
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)))
518
519 (define-public gperftools
520 (package
521 (name "gperftools")
522 (version "2.8.1")
523 (source
524 (origin
525 (method git-fetch)
526 (uri (git-reference
527 (url "https://github.com/gperftools/gperftools")
528 (commit (string-append "gperftools-" version))))
529 (sha256
530 (base32 "19bj2vlsbfwq7m826v2ccqg47kd7cb5vcz1yw2x0v5qzhaxbakk1"))
531 (file-name (git-file-name name version))))
532 (build-system gnu-build-system)
533 (arguments
534 ;; The tests are flaky when run in parallel. For more info:
535 ;; https://bugs.gnu.org/46562
536 '(#:parallel-tests? #f))
537 (native-inputs
538 `(("autoconf" ,autoconf)
539 ("automake" ,automake)
540 ("libtool" ,libtool)
541 ;; For tests.
542 ("perl" ,perl)))
543 (home-page "https://github.com/gperftools/gperftools")
544 (synopsis "Multi-threaded malloc() and performance analysis tools for C++")
545 (description
546 "@code{gperftools} is a collection of a high-performance multi-threaded
547 malloc() implementation plus some thread-friendly performance analysis
548 tools:
549
550 @itemize
551 @item tcmalloc,
552 @item heap profiler,
553 @item heap checker,
554 @item CPU checker.
555 @end itemize\n")
556 (license license:bsd-3)))
557
558 (define-public cpplint
559 (package
560 (name "cpplint")
561 (version "1.4.5")
562 (source
563 (origin
564 (method git-fetch)
565 ;; Fetch from github instead of pypi, since the test cases are not in
566 ;; the pypi archive.
567 (uri (git-reference
568 (url "https://github.com/cpplint/cpplint")
569 (commit version)))
570 (sha256
571 (base32 "1yzcxqx0186sh80p0ydl9z0ld51fn2cdpz9hmhrp15j53g9ira7c"))
572 (file-name (git-file-name name version))))
573 (arguments
574 `(#:phases
575 (modify-phases %standard-phases
576 (add-before 'check 'use-later-pytest
577 (lambda _
578 (substitute* "test-requirements"
579 (("pytest.*") "pytest\n"))
580 #t)))))
581 (build-system python-build-system)
582 (native-inputs
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)))
593
594 (define-public reproc
595 (package
596 (name "reproc")
597 (version "14.1.0")
598 (source
599 (origin
600 (method git-fetch)
601 (uri (git-reference
602 (url "https://github.com/DaanDeMeyer/reproc")
603 (commit (string-append "v" version))))
604 (file-name (git-file-name name version))
605 (sha256
606 (base32
607 "1n71wb50qv2dmhjgw7azx5gigbrp19l2n3d41g9p05l5l0y1qg0q"))))
608 (build-system cmake-build-system)
609 (arguments
610 ;; No tests.
611 `(#:tests? #f
612 ;; Enable building of shared library.
613 #:configure-flags `("-DBUILD_SHARED_LIBS=1")))
614 (native-inputs
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)))
623
624 (define-public sobjectizer
625 (package
626 (name "sobjectizer")
627 (version "5.6.1")
628 (source
629 (origin
630 (method git-fetch)
631 (uri (git-reference
632 (url "https://github.com/Stiffstream/sobjectizer")
633 (commit (string-append "v." version))))
634 (sha256
635 (base32 "0jfai7sqxnnjkms38krm7mssj5l79nb3pllkbyj4j581a7l5j6l5"))
636 (file-name (git-file-name name version))))
637 (build-system cmake-build-system)
638 (arguments
639 `(#:tests? #f
640 #:phases
641 (modify-phases %standard-phases
642 (add-after 'unpack 'change-directory
643 (lambda _
644 (chdir "dev")
645 #t)))))
646 (home-page "https://stiffstream.com/en/products/sobjectizer.html")
647 (synopsis "Cross-platform actor framework for C++")
648 (description
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)))
654
655 (define-public tweeny
656 (package
657 (name "tweeny")
658 (version "3")
659 (source
660 (origin
661 (method git-fetch)
662 (uri (git-reference
663 (url "https://github.com/mobius3/tweeny")
664 (commit (string-append "v" version))))
665 (file-name (git-file-name name version))
666 (sha256
667 (base32 "1adm4c17pi7xf3kf6sjyxibz5rdg1ka236p72xsm6js4j9gzlbp4"))))
668 (arguments
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)))
682
683 (define-public abseil-cpp
684 (package
685 (name "abseil-cpp")
686 (version "20200923.3")
687 (source (origin
688 (method git-fetch)
689 (uri (git-reference
690 (url "https://github.com/abseil/abseil-cpp")
691 (commit version)))
692 (file-name (git-file-name name version))
693 (sha256
694 (base32
695 "1p4djhm1f011ficbjjxx3n8428p8481p20j4glpaawnpsi362hkl"))
696 ;; Remove after next googletest release and update.
697 (patches
698 (search-patches
699 "abseil-cpp-fix-gtest.patch"
700 "abseil-cpp-fix-strerror_test.patch"))))
701 (build-system cmake-build-system)
702 (arguments
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:
707 ;;
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")
714 #:phases
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.
719 (lambda _
720 (substitute* "CMakeLists.txt"
721 (("check_target\\(gtest\\)") "")
722 (("check_target\\(gtest_main\\)") "")
723 (("check_target\\(gmock\\)") "")))))))
724 (native-inputs
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)))
732
733 (define-public pegtl
734 (package
735 (name "pegtl")
736 (version "2.8.3")
737 (source (origin
738 (method git-fetch)
739 (uri (git-reference
740 (url "https://github.com/taocpp/PEGTL")
741 (commit version)))
742 (file-name (git-file-name name version))
743 (sha256
744 (base32
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)))
753
754 (define-public cxxopts
755 (package
756 (name "cxxopts")
757 (version "2.2.1")
758 (source (origin
759 (method git-fetch)
760 (uri (git-reference
761 (url "https://github.com/jarro2783/cxxopts")
762 (commit (string-append "v" version))))
763 (file-name (git-file-name name version))
764 (sha256
765 (base32
766 "0d3y747lsh1wkalc39nxd088rbypxigm991lk3j91zpn56whrpha"))))
767 (build-system cmake-build-system)
768 (synopsis "Lightweight C++ command line option parser")
769 (description
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)))
774
775 (define-public folly
776 (package
777 (name "folly")
778 (version "2021.01.25.00")
779 (source (origin
780 (method git-fetch)
781 (uri (git-reference
782 (url "https://github.com/facebook/folly")
783 (commit (string-append "v" version))))
784 (file-name (git-file-name name version))
785 (sha256
786 (base32
787 "14dl1g6vf7mc90mcync5h2lp14fwcx8n9h91pmiq6rfgv1fjjrwz"))))
788 (build-system cmake-build-system)
789 (arguments
790 '(;; Tests must be explicitly enabled
791 ;;#:configure-flags '("-DBUILD_TESTS=ON")))
792 ;; Leave tests disabled; see https://github.com/facebook/folly/issues/1456
793 #:tests? #f))
794 (propagated-inputs
795 `(("boost" ,boost)
796 ("gflags" ,gflags)
797 ("glog" ,glog)
798 ("liburing" ,liburing)))
799 (inputs
800 `(("bzip2" ,bzip2)
801 ("double-conversion" ,double-conversion)
802 ("fmt" ,fmt)
803 ("libaio" ,libaio)
804 ("libevent" ,libevent)
805 ("libiberty" ,libiberty)
806 ("libsodium" ,libsodium)
807 ("libunwind" ,libunwind)
808 ("lz4" ,lz4)
809 ("openssl" ,openssl)
810 ("snappy" ,snappy)
811 ("zlib" ,zlib)
812 ("zstd" ,zstd "lib")))
813 (native-inputs
814 `(("googletest" ,googletest)))
815 (synopsis "Collection of C++ components complementing the standard library")
816 (description
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)))
823
824 (define-public aws-sdk-cpp
825 (package
826 (name "aws-sdk-cpp")
827 (version "1.8.159")
828 (source (origin
829 (method git-fetch)
830 (uri (git-reference
831 (url "https://github.com/aws/aws-sdk-cpp")
832 (commit version)))
833 (file-name (git-file-name name version))
834 (sha256
835 (base32
836 "0jpfv9x82nq7hcix9in7qgrc8009dwpg6gr96hlgmcvqrqckd2r9"))))
837 (build-system cmake-build-system)
838 (arguments
839 '(;; Tests are run during the build phase.
840 #:tests? #f
841 #:configure-flags
842 '("-DBUILD_SHARED_LIBS=ON"
843 "-DBUILD_DEPS=OFF")))
844 (propagated-inputs
845 `(("aws-c-common" ,aws-c-common)
846 ("aws-c-event-stream" ,aws-c-event-stream)))
847 (inputs
848 `(("aws-checksums" ,aws-checksums)
849 ("curl" ,curl)
850 ("openssl" ,openssl)
851 ("zlib" ,zlib)))
852 (synopsis "Amazon Web Services SDK for C++")
853 (description
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)))
859
860 (define-public libexpected
861 (package
862 (name "libexpected")
863 (version "1.0.0")
864 (source
865 (origin
866 (method git-fetch)
867 (uri (git-reference
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.
872 (recursive? #t)))
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"))
876 (sha256
877 (base32 "1ckzfrljzzdw9wf8hvdfjz4wjx5na57iwxc48mbv9rf5067m21a5"))))
878 (build-system cmake-build-system)
879 ;; TODO: Clean up install phase.
880 (arguments
881 `(#:phases
882 (modify-phases %standard-phases
883 (replace 'check
884 (lambda _
885 (invoke "./tests"))))))
886 (native-inputs
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)))
897
898 (define-public magic-enum
899 (package
900 (name "magic-enum")
901 (version "0.7.2")
902 (home-page "https://github.com/Neargye/magic_enum")
903 (source (origin
904 (method git-fetch)
905 (uri (git-reference
906 (url home-page)
907 (commit (string-append "v" version))))
908 (file-name (git-file-name name version))
909 (sha256
910 (base32
911 "07j5zdf3vkliwrcv6k663k35akn7qp23794sz2mnvkj9hbv9s8cx"))))
912 (build-system cmake-build-system)
913 (native-inputs
914 `(("gcc" ,gcc-9)))
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)))
919
920 (define-public cli11
921 (package
922 (name "cli11")
923 (version "1.9.1")
924 (source
925 (origin
926 (method git-fetch)
927 (uri (git-reference
928 (url "https://github.com/CLIUtils/CLI11")
929 (commit (string-append "v" version))))
930 (file-name (git-file-name name version))
931 (sha256
932 (base32 "0hbch0vk8irgmiaxnfqlqys65v1770rxxdfn3d23m2vqyjh0j9l6"))
933 (modules '((guix build utils)))
934 (snippet
935 '(begin (delete-file-recursively "extern")
936 #t))))
937 (build-system cmake-build-system)
938 (arguments
939 `(#:configure-flags
940 '("-DCLI11_SINGLE_FILE=OFF"
941 "-DCLI11_BUILD_EXAMPLES=OFF")
942 #:imported-modules ,%cmake-build-system-modules
943 #:modules ((guix build cmake-build-system)
944 (guix build utils))
945 #:phases
946 (modify-phases %standard-phases
947 (add-before 'configure 'no-vendor-gtest
948 (lambda _
949 (substitute* "tests/CMakeLists.txt"
950 ;; We provide our own googletest, so this is not really a
951 ;; problem.
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\"\\)") ""))
958 #t)))))
959 (native-inputs
960 `(("doxygen" ,doxygen)
961 ("googletest" ,googletest)))
962 (synopsis "Command line parser for C++11")
963 (description
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)))
968
969 (define-public caf
970 (package
971 (name "caf")
972 (version "0.18.0")
973 (source (origin
974 (method git-fetch)
975 (uri (git-reference
976 (url "https://github.com/actor-framework/actor-framework")
977 (commit version)))
978 (file-name (git-file-name name version))
979 (sha256
980 (base32
981 "1c3spd6vm1h9qhlk5c4fdwi6nbqx5vwz2zvv6qp0rj1hx6xpq3cx"))))
982 (build-system cmake-build-system)
983 (arguments
984 '(#:configure-flags
985 '("-DCAF_ENABLE_EXAMPLES=OFF")))
986 (inputs
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
991 computation.")
992 (home-page "https://www.actor-framework.org/")
993 (license license:bsd-3)))
994
995 (define-public pcg-cpp
996 (let ((commit "5b5cac8d61339e810c5dbb4692d868a1d7ca1b2d")
997 (revision "1"))
998 (package
999 (name "pcg-cpp")
1000 (version (git-version "0.98.1" revision commit))
1001 (source (origin
1002 (method git-fetch)
1003 (uri (git-reference
1004 (url "https://github.com/imneme/pcg-cpp")
1005 (commit commit)))
1006 (file-name (git-file-name name version))
1007 (sha256
1008 (base32
1009 "1s9dcd4iydlc1xj9m6f7c52nlyx99klk043sk7arqy6kp7gdaa33"))))
1010 (build-system gnu-build-system)
1011 (arguments
1012 `(#:test-target "test"
1013 #:phases
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
1023
1024 (define-public libcutl
1025 (package
1026 (name "libcutl")
1027 (version "1.10.0")
1028 (source (origin
1029 (method url-fetch)
1030 (uri (string-append
1031 "https://www.codesynthesis.com/download/libcutl/"
1032 (version-major+minor version)
1033 "/libcutl-" version ".tar.bz2"))
1034 (sha256
1035 (base32
1036 "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j"))
1037 (modules '((guix build utils)))
1038 (snippet
1039 '(begin
1040 ;; Remove bundled sources.
1041 (with-directory-excursion "cutl/details"
1042 (for-each delete-file-recursively
1043 ;; FIXME: Boost_RegEx isn't being detected.
1044 (list
1045 ;;"boost"
1046 "expat")))))))
1047 (build-system gnu-build-system)
1048 (arguments
1049 `(#:configure-flags (list "--disable-static"
1050 ;;"--with-external-boost"
1051 "--with-external-expat")))
1052 (inputs
1053 `(;;("boost ,boost)
1054 ("expat" ,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
1062
1063 (define-public libxsd-frontend
1064 (package
1065 (name "libxsd-frontend")
1066 (version "2.0.0")
1067 (source
1068 (origin
1069 (method url-fetch)
1070 (uri (string-append "https://www.codesynthesis.com/download/"
1071 "libxsd-frontend/" (version-major+minor version)
1072 "/libxsd-frontend-" version ".tar.bz2"))
1073 (sha256
1074 (base32 "1nmzchsvwvn66jpmcx18anzyl1a3l309x1ld4zllrg37ijc31fim"))))
1075 (build-system gnu-build-system)
1076 (arguments
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)
1082 (guix build utils))
1083 #:make-flags (list (string-append "--include-dir="
1084 (assoc-ref %build-inputs "build")
1085 "/include/"))
1086 #:phases
1087 (modify-phases %standard-phases
1088 (delete 'configure)
1089 (replace 'install
1090 (lambda args
1091 (apply (assoc-ref copy:%standard-phases 'install)
1092 #:install-plan
1093 '(("xsd-frontend" "include/xsd-frontend"
1094 #:include-regexp ("\\.?xx$"))
1095 ("xsd-frontend" "lib"
1096 #:include-regexp ("\\.so$")))
1097 args))))))
1098 (native-inputs
1099 `(("build" ,build)))
1100 (inputs
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+)))
1109
1110 (define-public cli
1111 (package
1112 (name "cli")
1113 (version "1.1.0")
1114 (source
1115 (origin
1116 (method url-fetch)
1117 (uri (string-append "https://www.codesynthesis.com/download/"
1118 "cli/" (version-major+minor version)
1119 "/cli-" version ".tar.bz2"))
1120 (sha256
1121 (base32 "0bg0nsai2q4h3mldpnj0jz4iy4svs0bcfvmq0v0c9cdyknny606g"))))
1122 (build-system gnu-build-system)
1123 (arguments
1124 `(#:test-target "test"
1125 #:make-flags (list (string-append "--include-dir="
1126 (assoc-ref %build-inputs "build")
1127 "/include")
1128 (string-append "install_prefix="
1129 (assoc-ref %outputs "out")))
1130 #:phases
1131 (modify-phases %standard-phases
1132 (add-after 'unpack 'patch
1133 (lambda _
1134 (substitute* (find-files "." "\\.make$")
1135 (("build-0\\.3")
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))))
1146 (native-inputs
1147 `(("build" ,build)))
1148 (inputs
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
1154 documentation.")
1155 (home-page "https://codesynthesis.com/projects/cli/")
1156 (license license:expat)))
1157
1158 (define-public xsd
1159 (package
1160 (name "xsd")
1161 (version "4.0.0")
1162 (source
1163 (origin
1164 (method url-fetch)
1165 (uri (string-append "https://www.codesynthesis.com/download/"
1166 "xsd/" (version-major+minor version)
1167 "/xsd-" version ".tar.bz2"))
1168 (sha256
1169 (base32 "1hi9ppxd34np8ydv1h0vgc2qpdmgcd1cdzgk30aidv670xjg91fx"))))
1170 (build-system gnu-build-system)
1171 (outputs '("out" "doc")) ;3.8 MiB of doc and examples
1172 (arguments
1173 `(#:test-target "test"
1174 #:make-flags (list (string-append "--include-dir="
1175 (assoc-ref %build-inputs "build")
1176 "/include/")
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-"
1187 ,version)))))
1188 (delete 'configure))))
1189 (native-inputs
1190 `(("build" ,build)
1191 ("cli" ,cli)))
1192 (inputs
1193 `(("libcutl" ,libcutl)
1194 ("libnsl" ,libnsl)
1195 ("libxsd-frontend" ,libxsd-frontend)))
1196 (propagated-inputs
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
1212 ;; details.
1213 (license license:gpl2+)))