gnu: Remove ".git" from "https://github/…/….git".
[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>
17ce0d45
EJ
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages cpp)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
e8b40974
FT
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
17ce0d45 35 #:use-module (guix build-system gnu)
7e08be71 36 #:use-module (guix build-system python)
17ce0d45 37 #:use-module (gnu packages)
e8b40974
FT
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages check)
e3c0676a 40 #:use-module (gnu packages code)
e8b40974 41 #:use-module (gnu packages compression)
e3c0676a 42 #:use-module (gnu packages llvm)
cdc81cce 43 #:use-module (gnu packages perl)
e8b40974 44 #:use-module (gnu packages pkg-config)
8da3513f
MO
45 #:use-module (gnu packages tls)
46 #:use-module (gnu packages web))
17ce0d45
EJ
47
48(define-public libzen
49 (package
50 (name "libzen")
d8cf1b32 51 (version "0.4.38")
17ce0d45
EJ
52 (source (origin
53 (method url-fetch)
c0588f98
PN
54 ;; Warning: This source has proved unreliable 1 time at least.
55 ;; Consider an alternate source or report upstream if this
56 ;; happens again.
17ce0d45 57 (uri (string-append "https://mediaarea.net/download/source/"
d8cf1b32
TGR
58 "libzen/" version "/"
59 "libzen_" version ".tar.bz2"))
17ce0d45
EJ
60 (sha256
61 (base32
d8cf1b32 62 "1nkygc17sndznpcf71fdrhwpm8z9a3hc9csqlafwswh49axhfkjr"))))
17ce0d45
EJ
63 (native-inputs
64 `(("autoconf" ,autoconf)
65 ("automake" ,automake)
66 ("libtool" ,libtool)))
67 (build-system gnu-build-system)
68 (arguments
69 '(#:phases
d8cf1b32 70 ;; The build scripts are not at the root of the archive.
17ce0d45 71 (modify-phases %standard-phases
d10092b8 72 (add-after 'unpack 'pre-configure
17ce0d45 73 (lambda _
c0588f98
PN
74 (chdir "Project/GNU/Library")
75 #t)))))
17ce0d45
EJ
76 (home-page "https://github.com/MediaArea/ZenLib")
77 (synopsis "C++ utility library")
78 (description "ZenLib is a C++ utility library. It includes classes for handling
79strings, configuration, bit streams, threading, translation, and cross-platform
80operating system functions.")
81 (license license:zlib)))
e8b40974
FT
82
83(define-public rct
84 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
1e72a23d 85 (revision "2"))
e8b40974
FT
86 (package
87 (name "rct")
1e72a23d 88 (version (git-version "0.0.0" revision commit))
e8b40974
FT
89 (source (origin
90 (method git-fetch)
91 (uri (git-reference
1e72a23d 92 (url "https://github.com/Andersbakken/rct")
e8b40974
FT
93 (commit commit)))
94 (sha256
95 (base32
96 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
a893dc2f 97 (patches (search-patches "rct-add-missing-headers.patch"))
e8b40974
FT
98 (file-name (git-file-name name version))))
99 (build-system cmake-build-system)
100 (arguments
101 '(#:configure-flags
a893dc2f
FT
102 '("-DWITH_TESTS=ON" ; To run the test suite
103 "-DRCT_RTTI_ENABLED=ON")))
e8b40974
FT
104 (native-inputs
105 `(("cppunit" ,cppunit)
bad12e83
LF
106 ("pkg-config" ,pkg-config)))
107 (inputs
108 `(("openssl" ,openssl)
e8b40974 109 ("zlib" ,zlib)))
1e72a23d 110 (home-page "https://github.com/Andersbakken/rct")
e8b40974
FT
111 (synopsis "C++ library providing Qt-like APIs on top of the STL")
112 (description "Rct is a set of C++ tools that provide nicer (more Qt-like)
113 APIs on top of Standard Template Library (@dfn{STL}) classes.")
114 (license (list license:expat ; cJSON
115 license:bsd-4))))) ; everything else (LICENSE.txt)
27031358
LC
116
117(define-public dashel
118 (package
119 (name "dashel")
120 (version "1.3.3")
6d42b87f
TGR
121 (source
122 (origin
123 (method git-fetch)
124 (uri (git-reference
b0e7b699 125 (url "https://github.com/aseba-community/dashel")
6d42b87f
TGR
126 (commit version)))
127 (sha256
128 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
129 (file-name (git-file-name name version))))
27031358 130 (build-system cmake-build-system)
6d42b87f 131 (arguments '(#:tests? #f)) ; no tests
27031358 132 (native-inputs `(("pkg-config" ,pkg-config)))
6d42b87f 133 (home-page "https://github.com/aseba-community/dashel")
27031358
LC
134 (synopsis "Data stream helper encapsulation library")
135 (description
136 "Dashel is a data stream helper encapsulation C++ library. It provides a
137unified access to TCP/UDP sockets, serial ports, console, and files streams.
138It also allows a server application to wait for any activity on any
139combination of these streams.")
140 (license license:bsd-3)))
655ca713
FT
141
142(define-public xsimd
143 (package
144 (name "xsimd")
7f5c1233 145 (version "7.2.3")
e8211364
TGR
146 (source
147 (origin
148 (method git-fetch)
149 (uri (git-reference
b0e7b699 150 (url "https://github.com/QuantStack/xsimd")
e8211364
TGR
151 (commit version)))
152 (sha256
7f5c1233 153 (base32 "1ny2qin1j4h35mljivh8z52kwdyjxf4yxlzb8j52ji91v2ccc88j"))
e8211364 154 (file-name (git-file-name name version))))
655ca713
FT
155 (build-system cmake-build-system)
156 (arguments
7f5c1233
TGR
157 `(#:configure-flags (list "-DBUILD_TESTS=ON")
158 #:test-target "xtest"))
655ca713
FT
159 (native-inputs
160 `(("googletest" ,googletest)))
e8211364 161 (home-page "https://github.com/QuantStack/xsimd")
655ca713
FT
162 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
163 (description "xsimd provides a unified means for using SIMD features for
164library authors. Namely, it enables manipulation of batches of numbers with
165the same arithmetic operators as for single values. It also provides
166accelerated implementation of common mathematical functions operating on
167batches.")
168 (license license:bsd-3)))
385357c0
FT
169
170(define-public fifo-map
171 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
172 (revision "0")
173 (version (git-version "1.1.1" revision commit)))
174 (package
175 (name "fifo-map")
176 (version version)
177 (home-page "https://github.com/nlohmann/fifo_map")
178 (source (origin
179 (method git-fetch)
180 (uri (git-reference
181 (url home-page)
182 (commit commit)))
183 (sha256
184 (base32
185 "0pi77b75kp0l7z454ihcd14nzpi3nc5m4nyjbsgy5f9bw3676196"))
186 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
187 "fifo-map-fix-flags-for-gcc.patch"))
188 (file-name (git-file-name name version))
189 (modules '((guix build utils)))
190 (snippet '(delete-file-recursively "./test/thirdparty"))))
191 (native-inputs
8aa59a54 192 `(("catch2" ,catch-framework2-1)))
385357c0
FT
193 (build-system cmake-build-system)
194 (arguments
195 `(#:phases
196 (modify-phases %standard-phases
197 (replace 'check
198 (lambda _
199 (invoke "./unit")))
200 (replace 'install
201 (lambda* (#:key outputs #:allow-other-keys)
202 (let* ((out (assoc-ref outputs "out"))
203 (inc (string-append out "/include/fifo_map")))
204 (with-directory-excursion
205 (string-append "../" ,name "-" ,version "-checkout")
206 (install-file "src/fifo_map.hpp" inc)
207 #t)))))))
208 (synopsis "FIFO-ordered associative container for C++")
209 (description "Fifo_map is a C++ header only library for associative
210container which uses the order in which keys were inserted to the container
211as ordering relation.")
212 (license license:expat))))
e3c0676a
FT
213
214(define-public json-modern-cxx
215 (package
216 (name "json-modern-cxx")
813fa6e2 217 (version "3.7.3")
8f22bf9e 218 (home-page "https://github.com/nlohmann/json")
e3c0676a
FT
219 (source
220 (origin
8f22bf9e
MB
221 (method git-fetch)
222 (uri (git-reference (url home-page)
223 (commit (string-append "v" version))))
e3c0676a
FT
224 (sha256
225 (base32
813fa6e2 226 "04rry1xzis71z5gj1ylcj8b4li5q18zxhcwaviwvi3hx0frzxl9w"))
8f22bf9e 227 (file-name (git-file-name name version))
e3c0676a
FT
228 (modules '((guix build utils)))
229 (snippet
230 '(begin
ff97c862
MB
231 ;; Delete bundled software. Preserve doctest_compatibility.h, which
232 ;; is a wrapper library added by this package.
233 (install-file "./test/thirdparty/doctest/doctest_compatibility.h" "/tmp")
234 (for-each delete-file-recursively
235 '("./third_party" "./test/thirdparty" "./benchmarks/thirdparty"))
236 (install-file "/tmp/doctest_compatibility.h" "./test/thirdparty/doctest")
237
238 ;; Adjust for the unbundled fifo_map and doctest.
239 (substitute* "./test/thirdparty/doctest/doctest_compatibility.h"
240 (("#include \"doctest\\.h\"")
241 "#include <doctest/doctest.h>"))
e3c0676a 242 (with-directory-excursion "test/src"
ff97c862 243 (let ((files (find-files "." "\\.cpp$")))
e3c0676a
FT
244 (substitute* files
245 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
246 (string-append
8f22bf9e
MB
247 "#include <fifo_map/" fifo-map-hpp ">")))))
248 #t))))
e3c0676a 249 (native-inputs
ff97c862
MB
250 `(("amalgamate" ,amalgamate)
251 ("doctest" ,doctest)))
e3c0676a 252 (inputs
ff97c862 253 `(("fifo-map" ,fifo-map)))
e3c0676a
FT
254 (build-system cmake-build-system)
255 (synopsis "JSON parser and printer library for C++")
256 (description "JSON for Modern C++ is a C++ JSON library that provides
cfcfc6ab 257intuitive syntax and trivial integration.")
e3c0676a 258 (license license:expat)))
6f3c8506 259
936aa052
MB
260(define-public nlohmann-json-cpp
261 (deprecated-package "nlohmann-json-cpp" json-modern-cxx))
262
6f3c8506
FT
263(define-public xtl
264 (package
265 (name "xtl")
f020c7cc 266 (version "0.6.13")
6f3c8506 267 (source (origin
0bb41aec
KK
268 (method git-fetch)
269 (uri
270 (git-reference
b0e7b699 271 (url "https://github.com/QuantStack/xtl")
0bb41aec 272 (commit version)))
6f3c8506
FT
273 (sha256
274 (base32
f020c7cc 275 "0py70lm2i3sxzpgca2cic8zfn6dn18q837h76a5fchl2c0kpxm91"))
0bb41aec 276 (file-name (git-file-name name version))))
6f3c8506
FT
277 (native-inputs
278 `(("googletest" ,googletest)
279 ("json-modern-cxx" ,json-modern-cxx)))
280 (arguments
281 `(#:configure-flags
282 '("-DBUILD_TESTS=ON")
283 #:phases
284 (modify-phases %standard-phases
285 (replace 'check
286 (lambda* _
287 (with-directory-excursion "test"
288 (invoke "./test_xtl")
289 #t))))))
290 (home-page "https://github.com/QuantStack/xtl")
291 (build-system cmake-build-system)
292 (synopsis "C++ template library providing some basic tools")
293 (description "xtl is a C++ header-only template library providing basic
294tools (containers, algorithms) used by other QuantStack packages.")
295 (license license:bsd-3)))
8da3513f
MO
296
297(define-public ccls
298 (package
299 (name "ccls")
abd90f63 300 (version "0.20190823.6")
8da3513f
MO
301 (source
302 (origin
303 (method git-fetch)
304 (uri (git-reference
305 (url "https://github.com/MaskRay/ccls")
306 (commit version)))
307 (sha256
abd90f63 308 (base32 "11h5nwk4qqshf3i8yr4bxpnvmidrhkzd0zxhf1xqv8cv6r08k47f"))
8da3513f
MO
309 (file-name (git-file-name name version))))
310 (build-system cmake-build-system)
311 (arguments
abd90f63 312 '(#:tests? #f)) ; no check target
1171c4b3
BG
313 (inputs
314 `(("rapidjson" ,rapidjson)))
2c82d4ad 315 (native-inputs
1171c4b3
BG
316 `(("clang" ,clang)
317 ("llvm" ,llvm)))
8da3513f
MO
318 (home-page "https://github.com/MaskRay/ccls")
319 (synopsis "C/C++/Objective-C language server")
320 (description
321 "@code{ccls} is a server implementing the Language Server Protocol (LSP)
322for C, C++ and Objective-C languages. It uses @code{clang} to perform static
323code analysis and supports cross references, hierarchies, completion and
324syntax highlighting. @code{ccls} is derived from @code{cquery} which is not
325maintained anymore.")
326 (license license:asl2.0)))
cdc81cce
PN
327
328(define-public gperftools
329 (package
330 (name "gperftools")
4ec610af 331 (version "2.8")
cdc81cce
PN
332 (source
333 (origin
334 (method git-fetch)
335 (uri (git-reference
336 (url "https://github.com/gperftools/gperftools")
337 (commit (string-append "gperftools-" version))))
338 (sha256
4ec610af 339 (base32 "1rnc53kaxlljgbpsff906vdsry9jl9gcvcnmxgkprwzxq1wipyd0"))
cdc81cce
PN
340 (file-name (git-file-name name version))))
341 (build-system gnu-build-system)
342 (native-inputs
343 `(("autoconf" ,autoconf)
344 ("automake" ,automake)
345 ("libtool" ,libtool)
4ec610af 346 ;; For tests.
cdc81cce
PN
347 ("perl" ,perl)))
348 (home-page "https://github.com/gperftools/gperftools")
349 (synopsis "Multi-threaded malloc() and performance analysis tools for C++")
350 (description
351 "@code{gperftools} is a collection of a high-performance multi-threaded
352malloc() implementation plus some thread-friendly performance analysis
353tools:
354
355@itemize
356@item tcmalloc,
357@item heap profiler,
358@item heap checker,
359@item CPU checker.
360@end itemize\n")
361 (license license:bsd-3)))
7e08be71
MO
362
363(define-public cpplint
364 (package
365 (name "cpplint")
6c25b00d 366 (version "1.4.5")
7e08be71
MO
367 (source
368 (origin
369 (method git-fetch)
370 ;; Fetch from github instead of pypi, since the test cases are not in
371 ;; the pypi archive.
372 (uri (git-reference
373 (url "https://github.com/cpplint/cpplint")
374 (commit version)))
375 (sha256
6c25b00d 376 (base32 "1yzcxqx0186sh80p0ydl9z0ld51fn2cdpz9hmhrp15j53g9ira7c"))
7e08be71 377 (file-name (git-file-name name version))))
6c25b00d
MO
378 (arguments
379 `(#:phases
380 (modify-phases %standard-phases
381 (add-before 'check 'use-later-pytest
382 (lambda _
383 (substitute* "test-requirements"
384 (("pytest.*") "pytest\n"))
385 #t)))))
7e08be71 386 (build-system python-build-system)
6c25b00d
MO
387 (native-inputs
388 `(("python-pytest" ,python-pytest)
389 ("python-pytest-cov" ,python-pytest-cov)
390 ("python-pytest-runner" ,python-pytest-runner)))
7e08be71
MO
391 (home-page "https://github.com/cpplint/cpplint")
392 (synopsis "Static code checker for C++")
393 (description "@code{cpplint} is a command-line tool to check C/C++ files
394for style issues following Google’s C++ style guide. While Google maintains
395it's own version of the tool, this is a fork that aims to be more responsive
396and make @code{cpplint} usable in wider contexts.")
397 (license license:bsd-3)))
27bcdfcd
JW
398
399(define-public sobjectizer
400 (package
401 (name "sobjectizer")
402 (version "5.6.1")
403 (source
404 (origin
405 (method git-fetch)
406 (uri (git-reference
b0e7b699 407 (url "https://github.com/Stiffstream/sobjectizer")
27bcdfcd
JW
408 (commit (string-append "v." version))))
409 (sha256
410 (base32 "0jfai7sqxnnjkms38krm7mssj5l79nb3pllkbyj4j581a7l5j6l5"))
411 (file-name (git-file-name name version))))
412 (build-system cmake-build-system)
413 (arguments
414 `(#:tests? #f
415 #:phases
416 (modify-phases %standard-phases
417 (add-after 'unpack 'change-directory
418 (lambda _
419 (chdir "dev")
420 #t)))))
421 (home-page "https://stiffstream.com/en/products/sobjectizer.html")
422 (synopsis "Cross-platform actor framework for C++")
423 (description
424 "SObjectizer is a cross-platform \"actor frameworks\" for C++.
425SObjectizer supports not only the Actor Model but also the Publish-Subscribe
426Model and CSP-like channels. The goal of SObjectizer is to simplify
427development of concurrent and multithreaded applications in C++.")
428 (license license:bsd-3)))
999f1f0b 429
430(define-public tweeny
431 (package
432 (name "tweeny")
433 (version "3")
434 (source
435 (origin
436 (method git-fetch)
437 (uri (git-reference
b0e7b699 438 (url "https://github.com/mobius3/tweeny")
999f1f0b 439 (commit (string-append "v" version))))
440 (file-name (git-file-name name version))
441 (sha256
442 (base32 "1adm4c17pi7xf3kf6sjyxibz5rdg1ka236p72xsm6js4j9gzlbp4"))))
443 (arguments
444 '(#:tests? #f)) ;no check target
445 (build-system cmake-build-system)
446 (home-page "https://mobius3.github.io/tweeny/")
447 (synopsis "Modern C++ tweening library")
448 (description "@code{Tweeny} is an inbetweening library designed for the
449creation of complex animations for games and other beautiful interactive
450software. It leverages features of modern @code{C++} to empower developers with
451an intuitive API for declaring tweenings of any type of value, as long as they
452support arithmetic operations. The goal of @code{Tweeny} is to provide means to
453create fluid interpolations when animating position, scale, rotation, frames or
454other values of screen objects, by setting their values as the tween starting
455point and then, after each tween step, plugging back the result.")
456 (license license:expat)))
33aa372e
RJ
457
458(define-public abseil-cpp
459 (package
460 (name "abseil-cpp")
6dcc1710 461 (version "20200225.2")
33aa372e
RJ
462 (source (origin
463 (method git-fetch)
464 (uri (git-reference
b0e7b699 465 (url "https://github.com/abseil/abseil-cpp")
33aa372e
RJ
466 (commit version)))
467 (file-name (git-file-name name version))
468 (sha256
469 (base32
6dcc1710 470 "0dwxg54pv6ihphbia0iw65r64whd7v8nm4wwhcz219642cgpv54y"))))
33aa372e
RJ
471 (build-system cmake-build-system)
472 (arguments
473 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
474 "-DABSL_RUN_TESTS=ON"
475 ;; Needed, else we get errors like:
476 ;;
477 ;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o:
478 ;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE'
87bf5680 479 ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so:
33aa372e
RJ
480 ;; error adding symbols: DSO missing from command line
481 ;; collect2: error: ld returned 1 exit status
482 "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")
483 #:phases
484 (modify-phases %standard-phases
485 (add-before 'configure 'remove-gtest-check
486 ;; The CMakeLists fails to find our googletest for some reason, but
487 ;; it works nonetheless.
488 (lambda _
489 (substitute* "CMakeLists.txt"
490 (("check_target\\(gtest\\)") "")
491 (("check_target\\(gtest_main\\)") "")
492 (("check_target\\(gmock\\)") "")))))))
493 (native-inputs
494 `(("googletest" ,googletest)))
495 (home-page "https://abseil.io")
496 (synopsis "Augmented C++ standard library")
497 (description "Abseil is a collection of C++ library code designed to
498augment the C++ standard library. The Abseil library code is collected from
499Google's C++ code base.")
500 (license license:asl2.0)))
741d2226
BW
501
502(define-public pegtl
503 (package
504 (name "pegtl")
505 (version "2.8.3")
506 (source (origin
507 (method git-fetch)
508 (uri (git-reference
b0e7b699 509 (url "https://github.com/taocpp/PEGTL")
741d2226
BW
510 (commit version)))
511 (file-name (git-file-name name version))
512 (sha256
513 (base32
514 "17crgjfdx55imi2dqnz6xpvsxq07390yfgkz5nd2g77ydkvq9db3"))))
515 (build-system cmake-build-system)
516 (home-page "https://github.com/taocpp/PEGTL")
517 (synopsis "Parsing Expression Grammar template library")
518 (description "The Parsing Expression Grammar Template Library (PEGTL) is
519a zero-dependency C++ header-only parser combinator library for creating
520parsers according to a Parsing Expression Grammar (PEG).")
521 (license license:expat)))