gnu: Add python-keras-preprocessing.
[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 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 ;;;
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)
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))
37
38 (define-public libzen
39 (package
40 (name "libzen")
41 (version "0.4.37")
42 (source (origin
43 (method url-fetch)
44 ;; Warning: This source has proved unreliable 1 time at least.
45 ;; Consider an alternate source or report upstream if this
46 ;; happens again.
47 (uri (string-append "https://mediaarea.net/download/source/"
48 name "/" version "/"
49 name "_" version ".tar.bz2"))
50 (sha256
51 (base32
52 "1dkqbgabzpa6bd7dkqrvd35sdxrhr6qxalb88f3dw0afk65xqb0k"))))
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
62 (add-after 'unpack 'pre-configure
63 (lambda _
64 (chdir "Project/GNU/Library")
65 #t)))))
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)))
72
73 (define-public rct
74 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
75 (revision "2"))
76 (package
77 (name "rct")
78 (version (git-version "0.0.0" revision commit))
79 (source (origin
80 (method git-fetch)
81 (uri (git-reference
82 (url "https://github.com/Andersbakken/rct")
83 (commit commit)))
84 (sha256
85 (base32
86 "1m2931jacka27ghnpgf1z1plkkr64z0pga4r4zdrfpp2d7xnrdvb"))
87 (patches (search-patches "rct-add-missing-headers.patch"))
88 (file-name (git-file-name name version))))
89 (build-system cmake-build-system)
90 (arguments
91 '(#:configure-flags
92 '("-DWITH_TESTS=ON" ; To run the test suite
93 "-DRCT_RTTI_ENABLED=ON")))
94 (native-inputs
95 `(("cppunit" ,cppunit)
96 ("pkg-config" ,pkg-config)))
97 (inputs
98 `(("openssl" ,openssl)
99 ("zlib" ,zlib)))
100 (home-page "https://github.com/Andersbakken/rct")
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)
106
107 (define-public dashel
108 (package
109 (name "dashel")
110 (version "1.3.3")
111 (source
112 (origin
113 (method git-fetch)
114 (uri (git-reference
115 (url "https://github.com/aseba-community/dashel.git")
116 (commit version)))
117 (sha256
118 (base32 "0anks2l2i2qp0wlzqck1qgpq15a3l6dg8lw2h8s4nsj7f61lffwy"))
119 (file-name (git-file-name name version))))
120 (build-system cmake-build-system)
121 (arguments '(#:tests? #f)) ; no tests
122 (native-inputs `(("pkg-config" ,pkg-config)))
123 (home-page "https://github.com/aseba-community/dashel")
124 (synopsis "Data stream helper encapsulation library")
125 (description
126 "Dashel is a data stream helper encapsulation C++ library. It provides a
127 unified access to TCP/UDP sockets, serial ports, console, and files streams.
128 It also allows a server application to wait for any activity on any
129 combination of these streams.")
130 (license license:bsd-3)))
131
132 (define-public xsimd
133 (package
134 (name "xsimd")
135 (version "7.2.3")
136 (source
137 (origin
138 (method git-fetch)
139 (uri (git-reference
140 (url "https://github.com/QuantStack/xsimd.git")
141 (commit version)))
142 (sha256
143 (base32 "1ny2qin1j4h35mljivh8z52kwdyjxf4yxlzb8j52ji91v2ccc88j"))
144 (file-name (git-file-name name version))))
145 (build-system cmake-build-system)
146 (arguments
147 `(#:configure-flags (list "-DBUILD_TESTS=ON")
148 #:test-target "xtest"))
149 (native-inputs
150 `(("googletest" ,googletest)))
151 (home-page "https://github.com/QuantStack/xsimd")
152 (synopsis "C++ wrappers for SIMD intrinsics and math implementations")
153 (description "xsimd provides a unified means for using SIMD features for
154 library authors. Namely, it enables manipulation of batches of numbers with
155 the same arithmetic operators as for single values. It also provides
156 accelerated implementation of common mathematical functions operating on
157 batches.")
158 (license license:bsd-3)))
159
160 (define-public fifo-map
161 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
162 (revision "0")
163 (version (git-version "1.1.1" revision commit)))
164 (package
165 (name "fifo-map")
166 (version version)
167 (home-page "https://github.com/nlohmann/fifo_map")
168 (source (origin
169 (method git-fetch)
170 (uri (git-reference
171 (url home-page)
172 (commit commit)))
173 (sha256
174 (base32
175 "0pi77b75kp0l7z454ihcd14nzpi3nc5m4nyjbsgy5f9bw3676196"))
176 (patches (search-patches "fifo-map-remove-catch.hpp.patch"
177 "fifo-map-fix-flags-for-gcc.patch"))
178 (file-name (git-file-name name version))
179 (modules '((guix build utils)))
180 (snippet '(delete-file-recursively "./test/thirdparty"))))
181 (native-inputs
182 `(("catch2" ,catch-framework2)))
183 (build-system cmake-build-system)
184 (arguments
185 `(#:phases
186 (modify-phases %standard-phases
187 (replace 'check
188 (lambda _
189 (invoke "./unit")))
190 (replace 'install
191 (lambda* (#:key outputs #:allow-other-keys)
192 (let* ((out (assoc-ref outputs "out"))
193 (inc (string-append out "/include/fifo_map")))
194 (with-directory-excursion
195 (string-append "../" ,name "-" ,version "-checkout")
196 (install-file "src/fifo_map.hpp" inc)
197 #t)))))))
198 (synopsis "FIFO-ordered associative container for C++")
199 (description "Fifo_map is a C++ header only library for associative
200 container which uses the order in which keys were inserted to the container
201 as ordering relation.")
202 (license license:expat))))
203
204 (define-public json-modern-cxx
205 (package
206 (name "json-modern-cxx")
207 (version "3.1.2")
208 (home-page "https://github.com/nlohmann/json")
209 (source
210 (origin
211 (method git-fetch)
212 (uri (git-reference (url home-page)
213 (commit (string-append "v" version))))
214 (sha256
215 (base32
216 "1mpr781fb2dfbyscrr7nil75lkxsazg4wkm749168lcf2ksrrbfi"))
217 (file-name (git-file-name name version))
218 (modules '((guix build utils)))
219 (snippet
220 '(begin
221 (delete-file-recursively "./third_party")
222 (delete-file-recursively "./test/thirdparty")
223 (delete-file-recursively "./benchmarks/thirdparty")
224 ;; Splits catch and fifo_map
225 (with-directory-excursion "test/src"
226 (let ((files (find-files "." ".*\\.cpp")))
227 (substitute* files
228 (("#include ?\"(catch.hpp)\"" all catch-hpp)
229 (string-append "#include <catch/" catch-hpp ">")))
230 (substitute* files
231 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
232 (string-append
233 "#include <fifo_map/" fifo-map-hpp ">")))))
234 #t))))
235 (native-inputs
236 `(("amalgamate" ,amalgamate)))
237 (inputs
238 `(("catch2" ,catch-framework2)
239 ("fifo-map" ,fifo-map)))
240 (build-system cmake-build-system)
241 (synopsis "JSON parser and printer library for C++")
242 (description "JSON for Modern C++ is a C++ JSON library that provides
243 intuitive syntax and trivial integration.")
244 (license license:expat)))
245
246 (define-public xtl
247 (package
248 (name "xtl")
249 (version "0.6.4")
250 (source (origin
251 (method git-fetch)
252 (uri
253 (git-reference
254 (url "https://github.com/QuantStack/xtl.git")
255 (commit version)))
256 (sha256
257 (base32
258 "0rwdw43fq7c581m6frzsd06h71sf7abk7danwa3cp6wd6cgkwdbk"))
259 (file-name (git-file-name name version))))
260 (native-inputs
261 `(("googletest" ,googletest)
262 ("json-modern-cxx" ,json-modern-cxx)))
263 (arguments
264 `(#:configure-flags
265 '("-DBUILD_TESTS=ON")
266 #:phases
267 (modify-phases %standard-phases
268 (replace 'check
269 (lambda* _
270 (with-directory-excursion "test"
271 (invoke "./test_xtl")
272 #t))))))
273 (home-page "https://github.com/QuantStack/xtl")
274 (build-system cmake-build-system)
275 (synopsis "C++ template library providing some basic tools")
276 (description "xtl is a C++ header-only template library providing basic
277 tools (containers, algorithms) used by other QuantStack packages.")
278 (license license:bsd-3)))