Commit | Line | Data |
---|---|---|
17ce0d45 EJ |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com> | |
c304543e | 3 | ;;; Copyright © 2018 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> |
17ce0d45 EJ |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
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. | |
13 | ;;; | |
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. | |
18 | ;;; | |
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/>. | |
21 | ||
22 | (define-module (gnu packages cpp) | |
23 | #:use-module ((guix licenses) #:prefix license:) | |
24 | #:use-module (guix packages) | |
25 | #:use-module (guix download) | |
e8b40974 FT |
26 | #:use-module (guix git-download) |
27 | #:use-module (guix build-system cmake) | |
17ce0d45 EJ |
28 | #:use-module (guix build-system gnu) |
29 | #:use-module (gnu packages) | |
e8b40974 FT |
30 | #:use-module (gnu packages autotools) |
31 | #:use-module (gnu packages check) | |
e3c0676a | 32 | #:use-module (gnu packages code) |
e8b40974 | 33 | #:use-module (gnu packages compression) |
e3c0676a | 34 | #:use-module (gnu packages llvm) |
e8b40974 FT |
35 | #:use-module (gnu packages pkg-config) |
36 | #:use-module (gnu packages tls)) | |
17ce0d45 EJ |
37 | |
38 | (define-public libzen | |
39 | (package | |
40 | (name "libzen") | |
c304543e | 41 | (version "0.4.37") |
17ce0d45 EJ |
42 | (source (origin |
43 | (method url-fetch) | |
c0588f98 PN |
44 | ;; Warning: This source has proved unreliable 1 time at least. |
45 | ;; Consider an alternate source or report upstream if this | |
46 | ;; happens again. | |
17ce0d45 EJ |
47 | (uri (string-append "https://mediaarea.net/download/source/" |
48 | name "/" version "/" | |
49 | name "_" version ".tar.bz2")) | |
50 | (sha256 | |
51 | (base32 | |
c0588f98 | 52 | "1dkqbgabzpa6bd7dkqrvd35sdxrhr6qxalb88f3dw0afk65xqb0k")))) |
17ce0d45 EJ |
53 | (native-inputs |
54 | `(("autoconf" ,autoconf) | |
55 | ("automake" ,automake) | |
56 | ("libtool" ,libtool))) | |
57 | (build-system gnu-build-system) | |
58 | (arguments | |
59 | '(#:phases | |
60 | ;; build scripts not in root of archive | |
61 | (modify-phases %standard-phases | |
d10092b8 | 62 | (add-after 'unpack 'pre-configure |
17ce0d45 | 63 | (lambda _ |
c0588f98 PN |
64 | (chdir "Project/GNU/Library") |
65 | #t))))) | |
17ce0d45 EJ |
66 | (home-page "https://github.com/MediaArea/ZenLib") |
67 | (synopsis "C++ utility library") | |
68 | (description "ZenLib is a C++ utility library. It includes classes for handling | |
69 | strings, configuration, bit streams, threading, translation, and cross-platform | |
70 | operating system functions.") | |
71 | (license license:zlib))) | |
e8b40974 FT |
72 | |
73 | (define-public rct | |
74 | (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a") | |
1e72a23d | 75 | (revision "2")) |
e8b40974 FT |
76 | (package |
77 | (name "rct") | |
1e72a23d | 78 | (version (git-version "0.0.0" revision commit)) |
e8b40974 FT |
79 | (source (origin |
80 | (method git-fetch) | |
81 | (uri (git-reference | |
1e72a23d | 82 | (url "https://github.com/Andersbakken/rct") |
e8b40974 FT |
83 | (commit commit))) |
84 | (sha256 | |
85 | (base32 | |
86 | "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb")) | |
a893dc2f | 87 | (patches (search-patches "rct-add-missing-headers.patch")) |
e8b40974 FT |
88 | (file-name (git-file-name name version)))) |
89 | (build-system cmake-build-system) | |
90 | (arguments | |
91 | '(#:configure-flags | |
a893dc2f FT |
92 | '("-DWITH_TESTS=ON" ; To run the test suite |
93 | "-DRCT_RTTI_ENABLED=ON"))) | |
e8b40974 FT |
94 | (native-inputs |
95 | `(("cppunit" ,cppunit) | |
bad12e83 LF |
96 | ("pkg-config" ,pkg-config))) |
97 | (inputs | |
98 | `(("openssl" ,openssl) | |
e8b40974 | 99 | ("zlib" ,zlib))) |
1e72a23d | 100 | (home-page "https://github.com/Andersbakken/rct") |
e8b40974 FT |
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) | |
27031358 LC |
106 | |
107 | (define-public dashel | |
108 | (package | |
109 | (name "dashel") | |
110 | (version "1.3.3") | |
111 | (home-page "https://github.com/aseba-community/dashel") | |
112 | (source (origin | |
113 | (method url-fetch) | |
114 | (uri (string-append home-page "/archive/" version ".tar.gz")) | |
115 | (sha256 | |
116 | (base32 | |
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") | |
123 | (description | |
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))) | |
655ca713 FT |
129 | |
130 | (define-public xsimd | |
131 | (package | |
132 | (name "xsimd") | |
133 | (version "4.1.2") | |
134 | (source (origin | |
135 | (method url-fetch) | |
136 | (uri (string-append | |
137 | "https://github.com/QuantStack/xsimd/archive/" | |
138 | version ".tar.gz")) | |
139 | (sha256 | |
140 | (base32 | |
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) | |
145 | (arguments | |
146 | `(#:test-target "xtest")) | |
147 | (native-inputs | |
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 | |
154 | batches.") | |
155 | (license license:bsd-3))) | |
385357c0 FT |
156 | |
157 | (define-public fifo-map | |
158 | (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9") | |
159 | (revision "0") | |
160 | (version (git-version "1.1.1" revision commit))) | |
161 | (package | |
162 | (name "fifo-map") | |
163 | (version version) | |
164 | (home-page "https://github.com/nlohmann/fifo_map") | |
165 | (source (origin | |
166 | (method git-fetch) | |
167 | (uri (git-reference | |
168 | (url home-page) | |
169 | (commit commit))) | |
170 | (sha256 | |
171 | (base32 | |
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")))) | |
178 | (native-inputs | |
179 | `(("catch2" ,catch-framework2))) | |
180 | (build-system cmake-build-system) | |
181 | (arguments | |
182 | `(#:phases | |
183 | (modify-phases %standard-phases | |
184 | (replace 'check | |
185 | (lambda _ | |
186 | (invoke "./unit"))) | |
187 | (replace 'install | |
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) | |
194 | #t))))))) | |
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)))) | |
e3c0676a FT |
200 | |
201 | (define-public json-modern-cxx | |
202 | (package | |
203 | (name "json-modern-cxx") | |
204 | (version "3.1.2") | |
8f22bf9e | 205 | (home-page "https://github.com/nlohmann/json") |
e3c0676a FT |
206 | (source |
207 | (origin | |
8f22bf9e MB |
208 | (method git-fetch) |
209 | (uri (git-reference (url home-page) | |
210 | (commit (string-append "v" version)))) | |
e3c0676a FT |
211 | (sha256 |
212 | (base32 | |
8f22bf9e MB |
213 | "1mpr781fb2dfbyscrr7nil75lkxsazg4wkm749168lcf2ksrrbfi")) |
214 | (file-name (git-file-name name version)) | |
e3c0676a FT |
215 | (modules '((guix build utils))) |
216 | (snippet | |
217 | '(begin | |
218 | (delete-file-recursively "./third_party") | |
219 | (delete-file-recursively "./test/thirdparty") | |
220 | (delete-file-recursively "./benchmarks/thirdparty") | |
221 | ;; Splits catch and fifo_map | |
222 | (with-directory-excursion "test/src" | |
223 | (let ((files (find-files "." ".*\\.cpp"))) | |
224 | (substitute* files | |
225 | (("#include ?\"(catch.hpp)\"" all catch-hpp) | |
226 | (string-append "#include <catch/" catch-hpp ">"))) | |
227 | (substitute* files | |
228 | (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp) | |
229 | (string-append | |
8f22bf9e MB |
230 | "#include <fifo_map/" fifo-map-hpp ">"))))) |
231 | #t)))) | |
e3c0676a FT |
232 | (native-inputs |
233 | `(("amalgamate" ,amalgamate))) | |
234 | (inputs | |
235 | `(("catch2" ,catch-framework2) | |
236 | ("fifo-map" ,fifo-map))) | |
e3c0676a FT |
237 | (build-system cmake-build-system) |
238 | (synopsis "JSON parser and printer library for C++") | |
239 | (description "JSON for Modern C++ is a C++ JSON library that provides | |
cfcfc6ab | 240 | intuitive syntax and trivial integration.") |
e3c0676a | 241 | (license license:expat))) |
6f3c8506 FT |
242 | |
243 | (define-public xtl | |
244 | (package | |
245 | (name "xtl") | |
0bb41aec | 246 | (version "0.4.14") |
6f3c8506 | 247 | (source (origin |
0bb41aec KK |
248 | (method git-fetch) |
249 | (uri | |
250 | (git-reference | |
251 | (url "https://github.com/QuantStack/xtl.git") | |
252 | (commit version))) | |
6f3c8506 FT |
253 | (sha256 |
254 | (base32 | |
0bb41aec KK |
255 | "0wwnd9adc1wav2299id17k5fbp0ib5gxkbihlk6jlh3v4i5nz11x")) |
256 | (file-name (git-file-name name version)))) | |
6f3c8506 FT |
257 | (native-inputs |
258 | `(("googletest" ,googletest) | |
259 | ("json-modern-cxx" ,json-modern-cxx))) | |
260 | (arguments | |
261 | `(#:configure-flags | |
262 | '("-DBUILD_TESTS=ON") | |
263 | #:phases | |
264 | (modify-phases %standard-phases | |
265 | (replace 'check | |
266 | (lambda* _ | |
267 | (with-directory-excursion "test" | |
268 | (invoke "./test_xtl") | |
269 | #t)))))) | |
270 | (home-page "https://github.com/QuantStack/xtl") | |
271 | (build-system cmake-build-system) | |
272 | (synopsis "C++ template library providing some basic tools") | |
273 | (description "xtl is a C++ header-only template library providing basic | |
274 | tools (containers, algorithms) used by other QuantStack packages.") | |
275 | (license license:bsd-3))) |