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