1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
5 ;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages cpp)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages code)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages llvm)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages tls))
44 (uri (string-append "https://mediaarea.net/download/source/"
46 name "_" version ".tar.bz2"))
49 "1hcsrmn85b0xp0mp33aazk7g071q1v3f163nnhv8b0mv9c4bgsfn"))))
51 `(("autoconf" ,autoconf)
52 ("automake" ,automake)
53 ("libtool" ,libtool)))
54 (build-system gnu-build-system)
57 ;; build scripts not in root of archive
58 (modify-phases %standard-phases
59 (add-after 'unpack 'pre-configure
61 (chdir "Project/GNU/Library")))
62 (add-after 'pre-configure 'autogen
64 (zero? (system* "sh" "autogen.sh")))))))
65 (home-page "https://github.com/MediaArea/ZenLib")
66 (synopsis "C++ utility library")
67 (description "ZenLib is a C++ utility library. It includes classes for handling
68 strings, configuration, bit streams, threading, translation, and cross-platform
69 operating system functions.")
70 (license license:zlib)))
73 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
75 (version (git-version "0.0.0" revision commit)))
79 (home-page "https://github.com/Andersbakken/rct")
87 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
88 (patches (search-patches "rct-add-missing-headers.patch"))
89 (file-name (git-file-name name version))))
90 (build-system cmake-build-system)
93 '("-DWITH_TESTS=ON" ; To run the test suite
94 "-DRCT_RTTI_ENABLED=ON")))
96 `(("cppunit" ,cppunit)
97 ("pkg-config" ,pkg-config)))
99 `(("openssl" ,openssl)
101 (synopsis "C++ library providing Qt-like APIs on top of the STL")
102 (description "Rct is a set of C++ tools that provide nicer (more Qt-like)
103 APIs on top of Standard Template Library (@dfn{STL}) classes.")
104 (license (list license:expat ; cJSON
105 license:bsd-4))))) ; everything else (LICENSE.txt)
107 (define-public dashel
111 (home-page "https://github.com/aseba-community/dashel")
114 (uri (string-append home-page "/archive/" version ".tar.gz"))
117 "1ckzac1rsw3cxmpdpwcqv46jyp7risk5ybq6jjiizbqn7labf6dw"))
118 (file-name (string-append name "-" version ".tar.gz"))))
119 (build-system cmake-build-system)
120 (arguments '(#:tests? #f)) ;no tests
121 (native-inputs `(("pkg-config" ,pkg-config)))
122 (synopsis "Data stream helper encapsulation library")
124 "Dashel is a data stream helper encapsulation C++ library. It provides a
125 unified access to TCP/UDP sockets, serial ports, console, and files streams.
126 It also allows a server application to wait for any activity on any
127 combination of these streams.")
128 (license license:bsd-3)))
137 "https://github.com/QuantStack/xsimd/archive/"
141 "0x05l4xpqr9b66sm6lkf48n6x7999ks921x6k2hzkkg6mh3gqd46"))
142 (file-name (string-append name "-" version ".tar.gz"))))
143 (home-page "https://github.com/QuantStack/xsimd")
144 (build-system cmake-build-system)
146 `(#:test-target "xtest"))
148 `(("googletest" ,googletest)))
149 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
150 (description "xsimd provides a unified means for using SIMD features for
151 library authors. Namely, it enables manipulation of batches of numbers with
152 the same arithmetic operators as for single values. It also provides
153 accelerated implementation of common mathematical functions operating on
155 (license license:bsd-3)))
157 (define-public fifo-map
158 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
160 (version (git-version "1.1.1" revision commit)))
164 (home-page "https://github.com/nlohmann/fifo_map")
172 "0pi77b75kp0l7z454ihcd14nzpi3nc5m4nyjbsgy5f9bw3676196"))
173 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
174 "fifo-map-fix-flags-for-gcc.patch"))
175 (file-name (git-file-name name version))
176 (modules '((guix build utils)))
177 (snippet '(delete-file-recursively "./test/thirdparty"))))
179 `(("catch2" ,catch-framework2)))
180 (build-system cmake-build-system)
183 (modify-phases %standard-phases
188 (lambda* (#:key outputs #:allow-other-keys)
189 (let* ((out (assoc-ref outputs "out"))
190 (inc (string-append out "/include/fifo_map")))
191 (with-directory-excursion
192 (string-append "../" ,name "-" ,version "-checkout")
193 (install-file "src/fifo_map.hpp" inc)
195 (synopsis "FIFO-ordered associative container for C++")
196 (description "Fifo_map is a C++ header only library for associative
197 container which uses the order in which keys were inserted to the container
198 as ordering relation.")
199 (license license:expat))))
201 (define-public json-modern-cxx
203 (name "json-modern-cxx")
209 "https://github.com/nlohmann/json/archive/v" version ".tar.gz"))
212 "0m5fhdpx2qll933db2nsi30nns3cifavzvijzz6mxhdkpmngmzz8"))
213 (file-name (string-append name "-" version ".tar.gz"))
214 (modules '((guix build utils)))
217 (delete-file-recursively "./third_party")
218 (delete-file-recursively "./test/thirdparty")
219 (delete-file-recursively "./benchmarks/thirdparty")
220 ;; Splits catch and fifo_map
221 (with-directory-excursion "test/src"
222 (let ((files (find-files "." ".*\\.cpp")))
224 (("#include ?\"(catch.hpp)\"" all catch-hpp)
225 (string-append "#include <catch/" catch-hpp ">")))
227 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
229 "#include <fifo_map/" fifo-map-hpp ">")))))))))
231 `(("amalgamate" ,amalgamate)))
233 `(("catch2" ,catch-framework2)
234 ("fifo-map" ,fifo-map)))
235 (home-page "https://github.com/nlohmann/json")
236 (build-system cmake-build-system)
237 (synopsis "JSON parser and printer library for C++")
238 (description "JSON for Modern C++ is a C++ JSON library that provides
239 intuitive syntax and trivial integration.")
240 (license license:expat)))
250 (url "https://github.com/QuantStack/xtl.git")
254 "0wwnd9adc1wav2299id17k5fbp0ib5gxkbihlk6jlh3v4i5nz11x"))
255 (file-name (git-file-name name version))))
257 `(("googletest" ,googletest)
258 ("json-modern-cxx" ,json-modern-cxx)))
261 '("-DBUILD_TESTS=ON")
263 (modify-phases %standard-phases
266 (with-directory-excursion "test"
267 (invoke "./test_xtl")
269 (home-page "https://github.com/QuantStack/xtl")
270 (build-system cmake-build-system)
271 (synopsis "C++ template library providing some basic tools")
272 (description "xtl is a C++ header-only template library providing basic
273 tools (containers, algorithms) used by other QuantStack packages.")
274 (license license:bsd-3)))