gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts.
[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, 2019, 2020 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 ;;;
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)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages code)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages llvm)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages tls)
46 #:use-module (gnu packages web))
47
48 (define-public libzen
49 (package
50 (name "libzen")
51 (version "0.4.38")
52 (source (origin
53 (method url-fetch)
54 ;; Warning: This source has proved unreliable 1 time at least.
55 ;; Consider an alternate source or report upstream if this
56 ;; happens again.
57 (uri (string-append "https://mediaarea.net/download/source/"
58 "libzen/" version "/"
59 "libzen_" version ".tar.bz2"))
60 (sha256
61 (base32
62 "1nkygc17sndznpcf71fdrhwpm8z9a3hc9csqlafwswh49axhfkjr"))))
63 (native-inputs
64 `(("autoconf" ,autoconf)
65 ("automake" ,automake)
66 ("libtool" ,libtool)))
67 (build-system gnu-build-system)
68 (arguments
69 '(#:phases
70 ;; The build scripts are not at the root of the archive.
71 (modify-phases %standard-phases
72 (add-after 'unpack 'pre-configure
73 (lambda _
74 (chdir "Project/GNU/Library")
75 #t)))))
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
79 strings, configuration, bit streams, threading, translation, and cross-platform
80 operating system functions.")
81 (license license:zlib)))
82
83 (define-public rct
84 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
85 (revision "2"))
86 (package
87 (name "rct")
88 (version (git-version "0.0.0" revision commit))
89 (source (origin
90 (method git-fetch)
91 (uri (git-reference
92 (url "https://github.com/Andersbakken/rct")
93 (commit commit)))
94 (sha256
95 (base32
96 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
97 (patches (search-patches "rct-add-missing-headers.patch"))
98 (file-name (git-file-name name version))))
99 (build-system cmake-build-system)
100 (arguments
101 '(#:configure-flags
102 '("-DWITH_TESTS=ON" ; To run the test suite
103 "-DRCT_RTTI_ENABLED=ON")))
104 (native-inputs
105 `(("cppunit" ,cppunit)
106 ("pkg-config" ,pkg-config)))
107 (inputs
108 `(("openssl" ,openssl)
109 ("zlib" ,zlib)))
110 (home-page "https://github.com/Andersbakken/rct")
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)
116
117 (define-public dashel
118 (package
119 (name "dashel")
120 (version "1.3.3")
121 (source
122 (origin
123 (method git-fetch)
124 (uri (git-reference
125 (url "https://github.com/aseba-community/dashel.git")
126 (commit version)))
127 (sha256
128 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
129 (file-name (git-file-name name version))))
130 (build-system cmake-build-system)
131 (arguments '(#:tests? #f)) ; no tests
132 (native-inputs `(("pkg-config" ,pkg-config)))
133 (home-page "https://github.com/aseba-community/dashel")
134 (synopsis "Data stream helper encapsulation library")
135 (description
136 "Dashel is a data stream helper encapsulation C++ library. It provides a
137 unified access to TCP/UDP sockets, serial ports, console, and files streams.
138 It also allows a server application to wait for any activity on any
139 combination of these streams.")
140 (license license:bsd-3)))
141
142 (define-public xsimd
143 (package
144 (name "xsimd")
145 (version "7.2.3")
146 (source
147 (origin
148 (method git-fetch)
149 (uri (git-reference
150 (url "https://github.com/QuantStack/xsimd.git")
151 (commit version)))
152 (sha256
153 (base32 "1ny2qin1j4h35mljivh8z52kwdyjxf4yxlzb8j52ji91v2ccc88j"))
154 (file-name (git-file-name name version))))
155 (build-system cmake-build-system)
156 (arguments
157 `(#:configure-flags (list "-DBUILD_TESTS=ON")
158 #:test-target "xtest"))
159 (native-inputs
160 `(("googletest" ,googletest)))
161 (home-page "https://github.com/QuantStack/xsimd")
162 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
163 (description "xsimd provides a unified means for using SIMD features for
164 library authors. Namely, it enables manipulation of batches of numbers with
165 the same arithmetic operators as for single values. It also provides
166 accelerated implementation of common mathematical functions operating on
167 batches.")
168 (license license:bsd-3)))
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
192 `(("catch2" ,catch-framework2-1)))
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
210 container which uses the order in which keys were inserted to the container
211 as ordering relation.")
212 (license license:expat))))
213
214 (define-public json-modern-cxx
215 (package
216 (name "json-modern-cxx")
217 (version "3.7.3")
218 (home-page "https://github.com/nlohmann/json")
219 (source
220 (origin
221 (method git-fetch)
222 (uri (git-reference (url home-page)
223 (commit (string-append "v" version))))
224 (sha256
225 (base32
226 "04rry1xzis71z5gj1ylcj8b4li5q18zxhcwaviwvi3hx0frzxl9w"))
227 (file-name (git-file-name name version))
228 (modules '((guix build utils)))
229 (snippet
230 '(begin
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>"))
242 (with-directory-excursion "test/src"
243 (let ((files (find-files "." "\\.cpp$")))
244 (substitute* files
245 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
246 (string-append
247 "#include <fifo_map/" fifo-map-hpp ">")))))
248 #t))))
249 (native-inputs
250 `(("amalgamate" ,amalgamate)
251 ("doctest" ,doctest)))
252 (inputs
253 `(("fifo-map" ,fifo-map)))
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
257 intuitive syntax and trivial integration.")
258 (license license:expat)))
259
260 (define-public nlohmann-json-cpp
261 (deprecated-package "nlohmann-json-cpp" json-modern-cxx))
262
263 (define-public xtl
264 (package
265 (name "xtl")
266 (version "0.6.13")
267 (source (origin
268 (method git-fetch)
269 (uri
270 (git-reference
271 (url "https://github.com/QuantStack/xtl.git")
272 (commit version)))
273 (sha256
274 (base32
275 "0py70lm2i3sxzpgca2cic8zfn6dn18q837h76a5fchl2c0kpxm91"))
276 (file-name (git-file-name name version))))
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
294 tools (containers, algorithms) used by other QuantStack packages.")
295 (license license:bsd-3)))
296
297 (define-public ccls
298 (package
299 (name "ccls")
300 (version "0.20190823.6")
301 (source
302 (origin
303 (method git-fetch)
304 (uri (git-reference
305 (url "https://github.com/MaskRay/ccls")
306 (commit version)))
307 (sha256
308 (base32 "11h5nwk4qqshf3i8yr4bxpnvmidrhkzd0zxhf1xqv8cv6r08k47f"))
309 (file-name (git-file-name name version))))
310 (build-system cmake-build-system)
311 (arguments
312 '(#:tests? #f)) ; no check target
313 (inputs
314 `(("rapidjson" ,rapidjson)))
315 (native-inputs
316 `(("clang" ,clang)
317 ("llvm" ,llvm)))
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)
322 for C, C++ and Objective-C languages. It uses @code{clang} to perform static
323 code analysis and supports cross references, hierarchies, completion and
324 syntax highlighting. @code{ccls} is derived from @code{cquery} which is not
325 maintained anymore.")
326 (license license:asl2.0)))
327
328 (define-public gperftools
329 (package
330 (name "gperftools")
331 (version "2.7")
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
339 (base32 "0amvwrzn5qc0b0jpxpy5g6zkmj97zjh4hhjrd130hsg2lwwcwhy1"))
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)
346 ;; For tests:
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
352 malloc() implementation plus some thread-friendly performance analysis
353 tools:
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)))
362
363 (define-public cpplint
364 (package
365 (name "cpplint")
366 (version "1.4.5")
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
376 (base32 "1yzcxqx0186sh80p0ydl9z0ld51fn2cdpz9hmhrp15j53g9ira7c"))
377 (file-name (git-file-name name version))))
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)))))
386 (build-system python-build-system)
387 (native-inputs
388 `(("python-pytest" ,python-pytest)
389 ("python-pytest-cov" ,python-pytest-cov)
390 ("python-pytest-runner" ,python-pytest-runner)))
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
394 for style issues following Google’s C++ style guide. While Google maintains
395 it's own version of the tool, this is a fork that aims to be more responsive
396 and make @code{cpplint} usable in wider contexts.")
397 (license license:bsd-3)))
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
407 (url "https://github.com/Stiffstream/sobjectizer.git")
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++.
425 SObjectizer supports not only the Actor Model but also the Publish-Subscribe
426 Model and CSP-like channels. The goal of SObjectizer is to simplify
427 development of concurrent and multithreaded applications in C++.")
428 (license license:bsd-3)))
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
438 (url "https://github.com/mobius3/tweeny.git")
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
449 creation of complex animations for games and other beautiful interactive
450 software. It leverages features of modern @code{C++} to empower developers with
451 an intuitive API for declaring tweenings of any type of value, as long as they
452 support arithmetic operations. The goal of @code{Tweeny} is to provide means to
453 create fluid interpolations when animating position, scale, rotation, frames or
454 other values of screen objects, by setting their values as the tween starting
455 point and then, after each tween step, plugging back the result.")
456 (license license:expat)))
457
458 (define-public abseil-cpp
459 (package
460 (name "abseil-cpp")
461 (version "20200225.1")
462 (source (origin
463 (method git-fetch)
464 (uri (git-reference
465 (url "https://github.com/abseil/abseil-cpp.git")
466 (commit version)))
467 (file-name (git-file-name name version))
468 (sha256
469 (base32
470 "035bffayslawc19q2gmlkr6n6r7k7mvriaq7352rv6gyzaplr98w"))))
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'
479 ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so:
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
498 augment the C++ standard library. The Abseil library code is collected from
499 Google's C++ code base.")
500 (license license:asl2.0)))
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
509 (url "https://github.com/taocpp/PEGTL.git")
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
519 a zero-dependency C++ header-only parser combinator library for creating
520 parsers according to a Parsing Expression Grammar (PEG).")
521 (license license:expat)))