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