gnu: cli11: Remove (guix utils) dependency.
[jackhill/guix/guix.git] / gnu / packages / cpp.scm
CommitLineData
17ce0d45
EJ
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
f020c7cc 3;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
e8b40974 4;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
27031358 5;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
6c25b00d 6;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
cdc81cce 7;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
27bcdfcd 8;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
999f1f0b 9;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
33aa372e 10;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
8b19fa51 11;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
741d2226 12;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
26407098 13;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
295b4f7e 14;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
697e54b2 15;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
24e37fbb 16;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
4d8837c1 17;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
b995cc8b 18;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
f129ca0b 19;;; Copyright © 2020 Milkey Mouse <milkeymouse@meme.institute>
17ce0d45
EJ
20;;;
21;;; This file is part of GNU Guix.
22;;;
23;;; GNU Guix is free software; you can redistribute it and/or modify it
24;;; under the terms of the GNU General Public License as published by
25;;; the Free Software Foundation; either version 3 of the License, or (at
26;;; your option) any later version.
27;;;
28;;; GNU Guix is distributed in the hope that it will be useful, but
29;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31;;; GNU General Public License for more details.
32;;;
33;;; You should have received a copy of the GNU General Public License
34;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36(define-module (gnu packages cpp)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
e8b40974
FT
40 #:use-module (guix git-download)
41 #:use-module (guix build-system cmake)
17ce0d45 42 #:use-module (guix build-system gnu)
7e08be71 43 #:use-module (guix build-system python)
f129ca0b 44 #:use-module (guix modules)
17ce0d45 45 #:use-module (gnu packages)
e8b40974 46 #:use-module (gnu packages autotools)
5b548a1e 47 #:use-module (gnu packages boost)
5686f5d7 48 #:use-module (gnu packages c)
e8b40974 49 #:use-module (gnu packages check)
e3c0676a 50 #:use-module (gnu packages code)
e8b40974 51 #:use-module (gnu packages compression)
5b548a1e 52 #:use-module (gnu packages crypto)
5686f5d7 53 #:use-module (gnu packages curl)
a5f4d390 54 #:use-module (gnu packages documentation)
5b548a1e
GH
55 #:use-module (gnu packages gcc)
56 #:use-module (gnu packages libevent)
57 #:use-module (gnu packages libunwind)
58 #:use-module (gnu packages linux)
e3c0676a 59 #:use-module (gnu packages llvm)
5b548a1e
GH
60 #:use-module (gnu packages logging)
61 #:use-module (gnu packages maths)
cdc81cce 62 #:use-module (gnu packages perl)
e8b40974 63 #:use-module (gnu packages pkg-config)
5b548a1e
GH
64 #:use-module (gnu packages popt)
65 #:use-module (gnu packages pretty-print)
8da3513f
MO
66 #:use-module (gnu packages tls)
67 #:use-module (gnu packages web))
17ce0d45 68
a5f4d390
RG
69(define-public range-v3
70 (package
71 (name "range-v3")
72 (version "0.11.0")
73 (source
74 (origin
75 (method git-fetch)
76 (uri
77 (git-reference
78 (url "https://github.com/ericniebler/range-v3.git")
79 (commit version)))
80 (file-name
81 (git-file-name name version))
82 (sha256
83 (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
84 (build-system cmake-build-system)
85 (native-inputs
86 `(("doxygen" ,doxygen)
87 ("perl" ,perl)))
88 (inputs
89 `(("boost" ,boost)))
90 (synopsis "Range library for C++14/17/20")
91 (description "Range-v3 is an extension of the Standard Template Library that
92makes its iterators and algorithms more powerful by making them composable.
93Unlike other range-like solutions which, seek to do away with iterators, in
94range-v3 ranges are an abstration layer on top of iterators.")
95 (home-page "https://github.com/ericniebler/range-v3/")
96 (license
97 (list
98 ;; Elements of Programming
99 (license:x11-style "file:///LICENSE.txt")
100 ;; SGI STL
101 license:sgifreeb2.0
102 ;;; LibC++ (dual-licensed)
103 license:expat
104 license:ncsa
105 ;; Others
106 license:boost1.0))))
107
6bacfa63
RG
108(define-public c++-gsl
109 (package
110 (name "c++-gsl")
111 (version "3.1.0")
112 (source
113 (origin
114 (method git-fetch)
115 (uri
116 (git-reference
117 (url "https://github.com/microsoft/GSL.git")
118 (commit
119 (string-append "v" version))))
120 (file-name
121 (git-file-name name version))
122 (patches
123 (search-patches
124 "c++-gsl-find-system-gtest.patch"))
125 (sha256
126 (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
127 (build-system cmake-build-system)
128 (native-inputs
129 `(("googletest" ,googletest)
130 ("pkg-config" ,pkg-config)))
131 (synopsis "Guidelines Support Library")
132 (description "c++-gsl contains functions and types that are suggested for
133use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
134 (home-page "https://github.com/microsoft/GSL/")
135 (license license:expat)))
136
17ce0d45
EJ
137(define-public libzen
138 (package
139 (name "libzen")
d8cf1b32 140 (version "0.4.38")
17ce0d45
EJ
141 (source (origin
142 (method url-fetch)
c0588f98
PN
143 ;; Warning: This source has proved unreliable 1 time at least.
144 ;; Consider an alternate source or report upstream if this
145 ;; happens again.
17ce0d45 146 (uri (string-append "https://mediaarea.net/download/source/"
d8cf1b32
TGR
147 "libzen/" version "/"
148 "libzen_" version ".tar.bz2"))
17ce0d45
EJ
149 (sha256
150 (base32
d8cf1b32 151 "1nkygc17sndznpcf71fdrhwpm8z9a3hc9csqlafwswh49axhfkjr"))))
17ce0d45
EJ
152 (native-inputs
153 `(("autoconf" ,autoconf)
154 ("automake" ,automake)
155 ("libtool" ,libtool)))
156 (build-system gnu-build-system)
157 (arguments
158 '(#:phases
d8cf1b32 159 ;; The build scripts are not at the root of the archive.
17ce0d45 160 (modify-phases %standard-phases
d10092b8 161 (add-after 'unpack 'pre-configure
17ce0d45 162 (lambda _
c0588f98
PN
163 (chdir "Project/GNU/Library")
164 #t)))))
17ce0d45
EJ
165 (home-page "https://github.com/MediaArea/ZenLib")
166 (synopsis "C++ utility library")
167 (description "ZenLib is a C++ utility library. It includes classes for handling
168strings, configuration, bit streams, threading, translation, and cross-platform
169operating system functions.")
170 (license license:zlib)))
e8b40974 171
697e54b2
MR
172(define-public rttr
173 (package
174 (name "rttr")
175 (version "0.9.6")
176 (source
177 (origin
178 (method git-fetch)
179 (uri (git-reference
180 (url "https://github.com/rttrorg/rttr/")
181 (commit (string-append "v" version))))
182 (sha256
183 (base32 "1yxad8sj40wi75hny8w6imrsx8wjasjmsipnlq559n4b6kl84ijp"))
184 (file-name (git-file-name name version))))
185 (build-system cmake-build-system)
186 (arguments
187 '(;; No check target. Setting test-target to "unit_test" runs it twice.
188 #:tests? #f
189 #:configure-flags
190 '("-DBUILD_DOCUMENTATION=OFF" "-DBUILD_EXAMPLES=OFF")
191 #:phases
192 (modify-phases %standard-phases
193 ;; library_test fails in chroot.
194 (add-after 'unpack 'skip-library-test
195 (lambda _
196 (substitute* "src/unit_tests/unit_tests.cmake"
197 (("misc/library_test.cpp") ""))
198 #t)))))
199 (native-inputs `(("pkg-config" ,pkg-config)))
200 (home-page "https://github.com/rttrorg/rttr/")
201 (synopsis "C++ Reflection Library")
202 (description
203 "RTTR stands for Run Time Type Reflection. It describes the ability of a
204computer program to introspect and modify an object at runtime. It is also
205the name of the library itself, which is written in C++.")
206 (license license:expat)))
207
e8b40974
FT
208(define-public rct
209 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
1e72a23d 210 (revision "2"))
e8b40974
FT
211 (package
212 (name "rct")
1e72a23d 213 (version (git-version "0.0.0" revision commit))
e8b40974
FT
214 (source (origin
215 (method git-fetch)
216 (uri (git-reference
1e72a23d 217 (url "https://github.com/Andersbakken/rct")
e8b40974
FT
218 (commit commit)))
219 (sha256
220 (base32
221 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
a893dc2f 222 (patches (search-patches "rct-add-missing-headers.patch"))
e8b40974
FT
223 (file-name (git-file-name name version))))
224 (build-system cmake-build-system)
225 (arguments
226 '(#:configure-flags
a893dc2f
FT
227 '("-DWITH_TESTS=ON" ; To run the test suite
228 "-DRCT_RTTI_ENABLED=ON")))
e8b40974
FT
229 (native-inputs
230 `(("cppunit" ,cppunit)
bad12e83
LF
231 ("pkg-config" ,pkg-config)))
232 (inputs
233 `(("openssl" ,openssl)
e8b40974 234 ("zlib" ,zlib)))
1e72a23d 235 (home-page "https://github.com/Andersbakken/rct")
e8b40974
FT
236 (synopsis "C++ library providing Qt-like APIs on top of the STL")
237 (description "Rct is a set of C++ tools that provide nicer (more Qt-like)
238 APIs on top of Standard Template Library (@dfn{STL}) classes.")
239 (license (list license:expat ; cJSON
240 license:bsd-4))))) ; everything else (LICENSE.txt)
27031358
LC
241
242(define-public dashel
243 (package
244 (name "dashel")
245 (version "1.3.3")
6d42b87f
TGR
246 (source
247 (origin
248 (method git-fetch)
249 (uri (git-reference
b0e7b699 250 (url "https://github.com/aseba-community/dashel")
6d42b87f
TGR
251 (commit version)))
252 (sha256
253 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
254 (file-name (git-file-name name version))))
27031358 255 (build-system cmake-build-system)
6d42b87f 256 (arguments '(#:tests? #f)) ; no tests
27031358 257 (native-inputs `(("pkg-config" ,pkg-config)))
6d42b87f 258 (home-page "https://github.com/aseba-community/dashel")
27031358
LC
259 (synopsis "Data stream helper encapsulation library")
260 (description
261 "Dashel is a data stream helper encapsulation C++ library. It provides a
262unified access to TCP/UDP sockets, serial ports, console, and files streams.
263It also allows a server application to wait for any activity on any
264combination of these streams.")
265 (license license:bsd-3)))
655ca713
FT
266
267(define-public xsimd
268 (package
269 (name "xsimd")
902e944e 270 (version "7.4.9")
e8211364
TGR
271 (source
272 (origin
273 (method git-fetch)
274 (uri (git-reference
b0e7b699 275 (url "https://github.com/QuantStack/xsimd")
e8211364
TGR
276 (commit version)))
277 (sha256
902e944e 278 (base32 "11by8gbshm4vv6flqp0ihff8c6nmbaqq7ms93b38rrq68bigcply"))
e8211364 279 (file-name (git-file-name name version))))
655ca713
FT
280 (build-system cmake-build-system)
281 (arguments
7f5c1233
TGR
282 `(#:configure-flags (list "-DBUILD_TESTS=ON")
283 #:test-target "xtest"))
655ca713
FT
284 (native-inputs
285 `(("googletest" ,googletest)))
e8211364 286 (home-page "https://github.com/QuantStack/xsimd")
655ca713 287 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
c7e8bfe2
TGR
288 (description
289 "xsimd provides a unified means for using @acronym{SIMD, single instruction
290multiple data} features for library authors. Namely, it enables manipulation of
291batches of numbers with the same arithmetic operators as for single values.
292It also provides accelerated implementation of common mathematical functions
293operating on batches.")
655ca713 294 (license license:bsd-3)))
385357c0 295
26407098
VM
296(define-public chaiscript
297 (package
298 (name "chaiscript")
299 (version "6.1.0")
300 (source
301 (origin
302 (method git-fetch)
303 (uri (git-reference
304 (url "https://github.com/ChaiScript/ChaiScript")
305 (commit (string-append "v" version))))
306 (file-name (git-file-name name version))
307 (sha256
308 (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
309 (build-system cmake-build-system)
310 (home-page "https://chaiscript.com/")
311 (synopsis "Embedded scripting language designed for C++")
312 (description
313 "ChaiScript is one of the only embedded scripting language designed from
314the ground up to directly target C++ and take advantage of modern C++
315development techniques. Being a native C++ application, it has some advantages
316over existing embedded scripting languages:
317
318@enumerate
319@item Uses a header-only approach, which makes it easy to integrate with
320existing projects.
321@item Maintains type safety between your C++ application and the user scripts.
322@item Supports a variety of C++ techniques including callbacks, overloaded
323functions, class methods, and stl containers.
324@end enumerate\n")
325 (license license:bsd-3)))
326
385357c0
FT
327(define-public fifo-map
328 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
329 (revision "0")
330 (version (git-version "1.1.1" revision commit)))
331 (package
332 (name "fifo-map")
333 (version version)
334 (home-page "https://github.com/nlohmann/fifo_map")
335 (source (origin
336 (method git-fetch)
337 (uri (git-reference
338 (url home-page)
339 (commit commit)))
340 (sha256
341 (base32
342 "0pi77b75kp0l7z454ihcd14nzpi3nc5m4nyjbsgy5f9bw3676196"))
343 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
344 "fifo-map-fix-flags-for-gcc.patch"))
345 (file-name (git-file-name name version))
346 (modules '((guix build utils)))
347 (snippet '(delete-file-recursively "./test/thirdparty"))))
348 (native-inputs
8aa59a54 349 `(("catch2" ,catch-framework2-1)))
385357c0
FT
350 (build-system cmake-build-system)
351 (arguments
352 `(#:phases
353 (modify-phases %standard-phases
354 (replace 'check
355 (lambda _
356 (invoke "./unit")))
357 (replace 'install
358 (lambda* (#:key outputs #:allow-other-keys)
359 (let* ((out (assoc-ref outputs "out"))
360 (inc (string-append out "/include/fifo_map")))
361 (with-directory-excursion
362 (string-append "../" ,name "-" ,version "-checkout")
363 (install-file "src/fifo_map.hpp" inc)
364 #t)))))))
365 (synopsis "FIFO-ordered associative container for C++")
366 (description "Fifo_map is a C++ header only library for associative
367container which uses the order in which keys were inserted to the container
368as ordering relation.")
369 (license license:expat))))
e3c0676a
FT
370
371(define-public json-modern-cxx
372 (package
373 (name "json-modern-cxx")
7b403575 374 (version "3.9.1")
8f22bf9e 375 (home-page "https://github.com/nlohmann/json")
e3c0676a
FT
376 (source
377 (origin
8f22bf9e
MB
378 (method git-fetch)
379 (uri (git-reference (url home-page)
380 (commit (string-append "v" version))))
e3c0676a 381 (sha256
7b403575 382 (base32 "0ar4mzp53lskxw3vdzw07f47njcshl3lwid9jfq6l7yx6ds2nyjc"))
8f22bf9e 383 (file-name (git-file-name name version))
e3c0676a
FT
384 (modules '((guix build utils)))
385 (snippet
386 '(begin
ff97c862
MB
387 ;; Delete bundled software. Preserve doctest_compatibility.h, which
388 ;; is a wrapper library added by this package.
389 (install-file "./test/thirdparty/doctest/doctest_compatibility.h" "/tmp")
390 (for-each delete-file-recursively
391 '("./third_party" "./test/thirdparty" "./benchmarks/thirdparty"))
392 (install-file "/tmp/doctest_compatibility.h" "./test/thirdparty/doctest")
393
394 ;; Adjust for the unbundled fifo_map and doctest.
395 (substitute* "./test/thirdparty/doctest/doctest_compatibility.h"
396 (("#include \"doctest\\.h\"")
397 "#include <doctest/doctest.h>"))
e3c0676a 398 (with-directory-excursion "test/src"
ff97c862 399 (let ((files (find-files "." "\\.cpp$")))
e3c0676a
FT
400 (substitute* files
401 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
402 (string-append
8f22bf9e
MB
403 "#include <fifo_map/" fifo-map-hpp ">")))))
404 #t))))
295b4f7e
MB
405 (build-system cmake-build-system)
406 (arguments
407 '(#:configure-flags
f2089be3
PN
408 (list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
409 (string-append "-DJSON_TestDataDirectory="
295b4f7e
MB
410 (assoc-ref %build-inputs "json_test_data")))
411 #:phases (modify-phases %standard-phases
295b4f7e
MB
412 ;; XXX: When tests are enabled, the install phase will cause
413 ;; a needless rebuild without the given configure flags,
414 ;; ultimately creating both $out/lib and $out/lib64. Move
415 ;; the check phase after install to work around it.
416 (delete 'check)
417 (add-after 'install 'check
418 (lambda* (#:key tests? #:allow-other-keys)
419 (if tests?
420 ;; Some tests need git and a full checkout, skip those.
421 (invoke "ctest" "-LE" "git_required")
422 (format #t "test suite not run~%"))
423 #t)))))
e3c0676a 424 (native-inputs
ff97c862 425 `(("amalgamate" ,amalgamate)
295b4f7e
MB
426 ("doctest" ,doctest)
427 ("json_test_data"
428 ,(let ((version "3.0.0"))
429 (origin
430 (method git-fetch)
431 (uri (git-reference
432 (url "https://github.com/nlohmann/json_test_data")
433 (commit (string-append "v" version))))
434 (file-name (git-file-name "json_test_data" version))
435 (sha256
436 (base32
437 "0nzsjzlvk14dazwh7k2jb1dinb0pv9jbx5jsyn264wvva0y7daiv")))))))
e3c0676a 438 (inputs
ff97c862 439 `(("fifo-map" ,fifo-map)))
e3c0676a
FT
440 (synopsis "JSON parser and printer library for C++")
441 (description "JSON for Modern C++ is a C++ JSON library that provides
cfcfc6ab 442intuitive syntax and trivial integration.")
e3c0676a 443 (license license:expat)))
6f3c8506 444
936aa052
MB
445(define-public nlohmann-json-cpp
446 (deprecated-package "nlohmann-json-cpp" json-modern-cxx))
447
6f3c8506
FT
448(define-public xtl
449 (package
450 (name "xtl")
75abc3bc 451 (version "0.6.23")
6f3c8506 452 (source (origin
0bb41aec
KK
453 (method git-fetch)
454 (uri
455 (git-reference
b0e7b699 456 (url "https://github.com/QuantStack/xtl")
0bb41aec 457 (commit version)))
6f3c8506
FT
458 (sha256
459 (base32
75abc3bc 460 "1kd9zl4h6nrsg29hq13vwp4zhfj8sa90vj40726lpw6vxz48k4di"))
0bb41aec 461 (file-name (git-file-name name version))))
6f3c8506
FT
462 (native-inputs
463 `(("googletest" ,googletest)
464 ("json-modern-cxx" ,json-modern-cxx)))
465 (arguments
466 `(#:configure-flags
467 '("-DBUILD_TESTS=ON")
468 #:phases
469 (modify-phases %standard-phases
470 (replace 'check
471 (lambda* _
472 (with-directory-excursion "test"
473 (invoke "./test_xtl")
474 #t))))))
475 (home-page "https://github.com/QuantStack/xtl")
476 (build-system cmake-build-system)
477 (synopsis "C++ template library providing some basic tools")
478 (description "xtl is a C++ header-only template library providing basic
479tools (containers, algorithms) used by other QuantStack packages.")
480 (license license:bsd-3)))
8da3513f
MO
481
482(define-public ccls
483 (package
484 (name "ccls")
b995cc8b 485 (version "0.20201025")
8da3513f
MO
486 (source
487 (origin
488 (method git-fetch)
489 (uri (git-reference
490 (url "https://github.com/MaskRay/ccls")
491 (commit version)))
492 (sha256
b995cc8b
BG
493 (base32
494 "13v00q1bz8g0ckw1sv0zyicbc44irc00vhwxdv3vvwlvylm7s21p"))
8da3513f
MO
495 (file-name (git-file-name name version))))
496 (build-system cmake-build-system)
497 (arguments
abd90f63 498 '(#:tests? #f)) ; no check target
1171c4b3
BG
499 (inputs
500 `(("rapidjson" ,rapidjson)))
2c82d4ad 501 (native-inputs
1171c4b3
BG
502 `(("clang" ,clang)
503 ("llvm" ,llvm)))
8da3513f
MO
504 (home-page "https://github.com/MaskRay/ccls")
505 (synopsis "C/C++/Objective-C language server")
506 (description
507 "@code{ccls} is a server implementing the Language Server Protocol (LSP)
508for C, C++ and Objective-C languages. It uses @code{clang} to perform static
509code analysis and supports cross references, hierarchies, completion and
510syntax highlighting. @code{ccls} is derived from @code{cquery} which is not
511maintained anymore.")
512 (license license:asl2.0)))
cdc81cce
PN
513
514(define-public gperftools
515 (package
516 (name "gperftools")
7cd0247e 517 (version "2.8.1")
cdc81cce
PN
518 (source
519 (origin
520 (method git-fetch)
521 (uri (git-reference
522 (url "https://github.com/gperftools/gperftools")
523 (commit (string-append "gperftools-" version))))
524 (sha256
7cd0247e 525 (base32 "19bj2vlsbfwq7m826v2ccqg47kd7cb5vcz1yw2x0v5qzhaxbakk1"))
cdc81cce
PN
526 (file-name (git-file-name name version))))
527 (build-system gnu-build-system)
7cd0247e
GH
528 (arguments
529 ;; The tests are flaky when run in parallel. For more info:
530 ;; https://bugs.gnu.org/46562
531 '(#:parallel-tests? #f))
cdc81cce
PN
532 (native-inputs
533 `(("autoconf" ,autoconf)
534 ("automake" ,automake)
535 ("libtool" ,libtool)
4ec610af 536 ;; For tests.
cdc81cce
PN
537 ("perl" ,perl)))
538 (home-page "https://github.com/gperftools/gperftools")
539 (synopsis "Multi-threaded malloc() and performance analysis tools for C++")
540 (description
541 "@code{gperftools} is a collection of a high-performance multi-threaded
542malloc() implementation plus some thread-friendly performance analysis
543tools:
544
545@itemize
546@item tcmalloc,
547@item heap profiler,
548@item heap checker,
549@item CPU checker.
550@end itemize\n")
551 (license license:bsd-3)))
7e08be71
MO
552
553(define-public cpplint
554 (package
555 (name "cpplint")
6c25b00d 556 (version "1.4.5")
7e08be71
MO
557 (source
558 (origin
559 (method git-fetch)
560 ;; Fetch from github instead of pypi, since the test cases are not in
561 ;; the pypi archive.
562 (uri (git-reference
563 (url "https://github.com/cpplint/cpplint")
564 (commit version)))
565 (sha256
6c25b00d 566 (base32 "1yzcxqx0186sh80p0ydl9z0ld51fn2cdpz9hmhrp15j53g9ira7c"))
7e08be71 567 (file-name (git-file-name name version))))
6c25b00d
MO
568 (arguments
569 `(#:phases
570 (modify-phases %standard-phases
571 (add-before 'check 'use-later-pytest
572 (lambda _
573 (substitute* "test-requirements"
574 (("pytest.*") "pytest\n"))
575 #t)))))
7e08be71 576 (build-system python-build-system)
6c25b00d
MO
577 (native-inputs
578 `(("python-pytest" ,python-pytest)
579 ("python-pytest-cov" ,python-pytest-cov)
580 ("python-pytest-runner" ,python-pytest-runner)))
7e08be71
MO
581 (home-page "https://github.com/cpplint/cpplint")
582 (synopsis "Static code checker for C++")
583 (description "@code{cpplint} is a command-line tool to check C/C++ files
584for style issues following Google’s C++ style guide. While Google maintains
585it's own version of the tool, this is a fork that aims to be more responsive
586and make @code{cpplint} usable in wider contexts.")
587 (license license:bsd-3)))
27bcdfcd 588
24e37fbb
AT
589(define-public reproc
590 (package
591 (name "reproc")
592 (version "14.1.0")
593 (source
594 (origin
595 (method git-fetch)
596 (uri (git-reference
597 (url "https://github.com/DaanDeMeyer/reproc")
598 (commit (string-append "v" version))))
599 (file-name (git-file-name name version))
600 (sha256
601 (base32
602 "1n71wb50qv2dmhjgw7azx5gigbrp19l2n3d41g9p05l5l0y1qg0q"))))
603 (build-system cmake-build-system)
604 (arguments
605 ;; No tests.
606 `(#:tests? #f
607 ;; Enable building of shared library.
608 #:configure-flags `("-DBUILD_SHARED_LIBS=1")))
609 (native-inputs
610 `(("pkg-config" ,pkg-config)))
611 (synopsis "Process IO library")
612 (description "reproc (Redirected Process) is a C/C++ library that
613simplifies starting, stopping and communicating with external programs. The
614main use case is executing command line applications directly from C or C++
615code and retrieving their output.")
616 (home-page "https://github.com/DaanDeMeyer/reproc")
617 (license license:expat)))
618
27bcdfcd
JW
619(define-public sobjectizer
620 (package
621 (name "sobjectizer")
622 (version "5.6.1")
623 (source
624 (origin
625 (method git-fetch)
626 (uri (git-reference
b0e7b699 627 (url "https://github.com/Stiffstream/sobjectizer")
27bcdfcd
JW
628 (commit (string-append "v." version))))
629 (sha256
630 (base32 "0jfai7sqxnnjkms38krm7mssj5l79nb3pllkbyj4j581a7l5j6l5"))
631 (file-name (git-file-name name version))))
632 (build-system cmake-build-system)
633 (arguments
634 `(#:tests? #f
635 #:phases
636 (modify-phases %standard-phases
637 (add-after 'unpack 'change-directory
638 (lambda _
639 (chdir "dev")
640 #t)))))
641 (home-page "https://stiffstream.com/en/products/sobjectizer.html")
642 (synopsis "Cross-platform actor framework for C++")
643 (description
644 "SObjectizer is a cross-platform \"actor frameworks\" for C++.
645SObjectizer supports not only the Actor Model but also the Publish-Subscribe
646Model and CSP-like channels. The goal of SObjectizer is to simplify
647development of concurrent and multithreaded applications in C++.")
648 (license license:bsd-3)))
999f1f0b 649
650(define-public tweeny
651 (package
652 (name "tweeny")
653 (version "3")
654 (source
655 (origin
656 (method git-fetch)
657 (uri (git-reference
b0e7b699 658 (url "https://github.com/mobius3/tweeny")
999f1f0b 659 (commit (string-append "v" version))))
660 (file-name (git-file-name name version))
661 (sha256
662 (base32 "1adm4c17pi7xf3kf6sjyxibz5rdg1ka236p72xsm6js4j9gzlbp4"))))
663 (arguments
664 '(#:tests? #f)) ;no check target
665 (build-system cmake-build-system)
666 (home-page "https://mobius3.github.io/tweeny/")
667 (synopsis "Modern C++ tweening library")
668 (description "@code{Tweeny} is an inbetweening library designed for the
669creation of complex animations for games and other beautiful interactive
670software. It leverages features of modern @code{C++} to empower developers with
671an intuitive API for declaring tweenings of any type of value, as long as they
672support arithmetic operations. The goal of @code{Tweeny} is to provide means to
673create fluid interpolations when animating position, scale, rotation, frames or
674other values of screen objects, by setting their values as the tween starting
675point and then, after each tween step, plugging back the result.")
676 (license license:expat)))
33aa372e
RJ
677
678(define-public abseil-cpp
679 (package
680 (name "abseil-cpp")
6dcc1710 681 (version "20200225.2")
33aa372e
RJ
682 (source (origin
683 (method git-fetch)
684 (uri (git-reference
b0e7b699 685 (url "https://github.com/abseil/abseil-cpp")
33aa372e
RJ
686 (commit version)))
687 (file-name (git-file-name name version))
688 (sha256
689 (base32
6dcc1710 690 "0dwxg54pv6ihphbia0iw65r64whd7v8nm4wwhcz219642cgpv54y"))))
33aa372e
RJ
691 (build-system cmake-build-system)
692 (arguments
693 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
694 "-DABSL_RUN_TESTS=ON"
695 ;; Needed, else we get errors like:
696 ;;
697 ;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o:
698 ;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE'
87bf5680 699 ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so:
33aa372e
RJ
700 ;; error adding symbols: DSO missing from command line
701 ;; collect2: error: ld returned 1 exit status
702 "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")
703 #:phases
704 (modify-phases %standard-phases
705 (add-before 'configure 'remove-gtest-check
706 ;; The CMakeLists fails to find our googletest for some reason, but
707 ;; it works nonetheless.
708 (lambda _
709 (substitute* "CMakeLists.txt"
710 (("check_target\\(gtest\\)") "")
711 (("check_target\\(gtest_main\\)") "")
712 (("check_target\\(gmock\\)") "")))))))
713 (native-inputs
714 `(("googletest" ,googletest)))
715 (home-page "https://abseil.io")
716 (synopsis "Augmented C++ standard library")
717 (description "Abseil is a collection of C++ library code designed to
718augment the C++ standard library. The Abseil library code is collected from
719Google's C++ code base.")
720 (license license:asl2.0)))
741d2226
BW
721
722(define-public pegtl
723 (package
724 (name "pegtl")
725 (version "2.8.3")
726 (source (origin
727 (method git-fetch)
728 (uri (git-reference
b0e7b699 729 (url "https://github.com/taocpp/PEGTL")
741d2226
BW
730 (commit version)))
731 (file-name (git-file-name name version))
732 (sha256
733 (base32
734 "17crgjfdx55imi2dqnz6xpvsxq07390yfgkz5nd2g77ydkvq9db3"))))
735 (build-system cmake-build-system)
736 (home-page "https://github.com/taocpp/PEGTL")
737 (synopsis "Parsing Expression Grammar template library")
738 (description "The Parsing Expression Grammar Template Library (PEGTL) is
739a zero-dependency C++ header-only parser combinator library for creating
740parsers according to a Parsing Expression Grammar (PEG).")
741 (license license:expat)))
469e6aae
GH
742
743(define-public cxxopts
744 (package
745 (name "cxxopts")
746 (version "2.2.1")
747 (source (origin
748 (method git-fetch)
749 (uri (git-reference
750 (url "https://github.com/jarro2783/cxxopts")
751 (commit (string-append "v" version))))
752 (file-name (git-file-name name version))
753 (sha256
754 (base32
755 "0d3y747lsh1wkalc39nxd088rbypxigm991lk3j91zpn56whrpha"))))
756 (build-system cmake-build-system)
757 (synopsis "Lightweight C++ command line option parser")
758 (description
759 "A lightweight header-only C++ option parser library, supporting the
760standard GNU style syntax for options.")
761 (home-page "https://github.com/jarro2783/cxxopts/wiki")
762 (license license:expat)))
5b548a1e
GH
763
764(define-public folly
765 (package
766 (name "folly")
4d8837c1 767 (version "2021.01.25.00")
5b548a1e
GH
768 (source (origin
769 (method git-fetch)
770 (uri (git-reference
771 (url "https://github.com/facebook/folly")
772 (commit (string-append "v" version))))
773 (file-name (git-file-name name version))
774 (sha256
775 (base32
4d8837c1 776 "14dl1g6vf7mc90mcync5h2lp14fwcx8n9h91pmiq6rfgv1fjjrwz"))))
5b548a1e
GH
777 (build-system cmake-build-system)
778 (arguments
779 '(;; Tests must be explicitly enabled
780 ;;#:configure-flags '("-DBUILD_TESTS=ON")))
781 ;; Leave tests disabled; see https://github.com/facebook/folly/issues/1456
782 #:tests? #f))
783 (propagated-inputs
784 `(("boost" ,boost)
785 ("gflags" ,gflags)
786 ("glog" ,glog)
787 ("liburing" ,liburing)))
788 (inputs
789 `(("bzip2" ,bzip2)
790 ("double-conversion" ,double-conversion)
791 ("fmt" ,fmt)
792 ("libaio" ,libaio)
793 ("libevent" ,libevent)
794 ("libiberty" ,libiberty)
795 ("libsodium" ,libsodium)
796 ("libunwind" ,libunwind)
797 ("lz4" ,lz4)
798 ("openssl" ,openssl)
799 ("snappy" ,snappy)
800 ("zlib" ,zlib)
801 ("zstd" ,zstd "lib")))
802 (native-inputs
803 `(("googletest" ,googletest)))
804 (synopsis "Collection of C++ components complementing the standard library")
805 (description
806 "Folly (acronymed loosely after Facebook Open Source Library) is a library
807of C++14 components that complements @code{std} and Boost.")
808 (home-page "https://github.com/facebook/folly/wiki")
809 ;; 32-bit is not supported: https://github.com/facebook/folly/issues/103
810 (supported-systems '("aarch64-linux" "x86_64-linux"))
811 (license license:asl2.0)))
937bc584 812
5686f5d7
GH
813(define-public aws-sdk-cpp
814 (package
815 (name "aws-sdk-cpp")
816 (version "1.8.102")
817 (source (origin
818 (method git-fetch)
819 (uri (git-reference
820 (url "https://github.com/aws/aws-sdk-cpp")
821 (commit version)))
822 (file-name (git-file-name name version))
823 (sha256
824 (base32
825 "1w8x2vakg5ngjyyg08n4g3dqy8wqnz0k3gkrlqrh460s2pvdivba"))))
826 (build-system cmake-build-system)
827 (arguments
828 '(;; Tests are run during the build phase.
829 #:tests? #f
830 #:configure-flags
831 '("-DBUILD_SHARED_LIBS=OFF"
832 "-DBUILD_DEPS=OFF")))
833 (propagated-inputs
834 `(("aws-c-common" ,aws-c-common)
835 ("aws-c-event-stream" ,aws-c-event-stream)))
836 (inputs
837 `(("aws-checksums" ,aws-checksums)
838 ("curl" ,curl)
839 ("openssl" ,openssl)
840 ("zlib" ,zlib)))
841 (synopsis "Amazon Web Services SDK for C++")
842 (description
843 "The AWS SDK for C++ provides a C++11 interface to the @acronym{AWS,Amazon
844Web Services} API. AWS provides on-demand computing infrastructure and software
845services including database, analytic, and machine learning technologies.")
846 (home-page "https://github.com/aws/aws-sdk-cpp")
847 (license license:asl2.0)))
848
937bc584
BG
849(define-public libexpected
850 (package
851 (name "libexpected")
852 (version "1.0.0")
853 (source
854 (origin
855 (method git-fetch)
856 (uri (git-reference
857 (url "https://github.com/TartanLlama/expected")
858 (commit (string-append "v" version))
859 ;; NOTE: Requires TL_CMAKE from custom
860 ;; repository. Should not affect reproducibility.
861 (recursive? #t)))
862 (file-name (git-file-name name version))
863 ;; NOTE: This patch will be unnecessary on subsequent tags.
864 (patches (search-patches "libexpected-nofetch.patch"))
865 (sha256
866 (base32 "1ckzfrljzzdw9wf8hvdfjz4wjx5na57iwxc48mbv9rf5067m21a5"))))
867 (build-system cmake-build-system)
868 ;; TODO: Clean up install phase.
869 (arguments
870 `(#:phases
871 (modify-phases %standard-phases
872 (replace 'check
873 (lambda _
874 (invoke "./tests"))))))
875 (native-inputs
876 `(("catch2" ,catch-framework2)))
877 (synopsis "C++11/14/17 std::expected with functional-style extensions")
878 (description "@code{std::expected} is proposed as the preferred way to
879represent objects which will either have an expected value, or an unexpected
880value giving information about why something failed. Unfortunately, chaining
881together many computations which may fail can be verbose, as error-checking
882code will be mixed in with the actual programming logic. This implementation
883provides a number of utilities to make coding with expected cleaner.")
884 (home-page "https://tl.tartanllama.xyz/")
885 (license license:cc0)))
944aebb4
A
886
887(define-public magic-enum
888 (package
889 (name "magic-enum")
890 (version "0.7.2")
891 (home-page "https://github.com/Neargye/magic_enum")
892 (source (origin
893 (method git-fetch)
894 (uri (git-reference
895 (url home-page)
896 (commit (string-append "v" version))))
578856fd 897 (file-name (git-file-name name version))
944aebb4
A
898 (sha256
899 (base32
900 "07j5zdf3vkliwrcv6k663k35akn7qp23794sz2mnvkj9hbv9s8cx"))))
901 (build-system cmake-build-system)
902 (native-inputs
903 `(("gcc" ,gcc-9)))
904 (synopsis "C++17 header only library for compile time reflection of enums")
905 (description "Magic Enum offers static reflection of enums, with
906conversions to and from strings, iteration and related functionality.")
907 (license license:expat)))
f129ca0b
MM
908
909(define-public cli11
910 (package
911 (name "cli11")
912 (version "1.9.1")
913 (source
914 (origin
915 (method git-fetch)
916 (uri (git-reference
917 (url "https://github.com/CLIUtils/CLI11")
918 (commit (string-append "v" version))))
919 (file-name (git-file-name name version))
920 (sha256
921 (base32 "0hbch0vk8irgmiaxnfqlqys65v1770rxxdfn3d23m2vqyjh0j9l6"))
922 (modules '((guix build utils)))
923 (snippet
924 '(begin (delete-file-recursively "extern")
925 #t))))
926 (build-system cmake-build-system)
927 (arguments
928 `(#:configure-flags
929 '("-DCLI11_SINGLE_FILE=OFF"
930 "-DCLI11_BUILD_EXAMPLES=OFF")
b4f28584
MO
931 #:imported-modules ,%cmake-build-system-modules
932 #:modules ((guix build cmake-build-system)
933 (guix build utils))
f129ca0b
MM
934 #:phases
935 (modify-phases %standard-phases
936 (add-before 'configure 'no-vendor-gtest
937 (lambda _
f129ca0b 938 (substitute* "tests/CMakeLists.txt"
b4f28584
MO
939 ;; We provide our own googletest, so this is not really a
940 ;; problem.
941 (("message\\(FATAL_ERROR \"You have requested")
942 "message(TRACE \"You have requested"))
f129ca0b
MM
943 (substitute* "cmake/AddGoogletest.cmake"
944 (("^add_subdirectory\\(.*googletest.*$") "find_package(GTest REQUIRED)")
945 (("^set_target_properties\\(gtest gtest_main gmock gmock_main") "")
946 (("^ PROPERTIES FOLDER \"Extern\"\\)") ""))
947 #t)))))
948 (native-inputs
949 `(("doxygen" ,doxygen)
950 ("googletest" ,googletest)))
951 (synopsis "Command line parser for C++11")
952 (description
953 "CLI11 is a command line parser for C++11 and beyond that provides a rich
954feature set with a simple and intuitive interface.")
955 (home-page "https://cliutils.github.io/CLI11/book/")
956 (license license:bsd-3)))