projects/guix·blob version-1.0.1 · refs

275 lines · 10.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 Ethan R. Jones <[email protected]>
3;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2018 Fis Trivial <[email protected]>
5;;; Copyright © 2018 Ludovic Courtès <[email protected]>
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
69strings, configuration, bit streams, threading, translation, and cross-platform
70operating 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 (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
125unified access to TCP/UDP sockets, serial ports, console, and files streams.
126It also allows a server application to wait for any activity on any
127combination of these streams.")
128 (license license:bsd-3)))
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
151library authors. Namely, it enables manipulation of batches of numbers with
152the same arithmetic operators as for single values. It also provides
153accelerated implementation of common mathematical functions operating on
154batches.")
155 (license license:bsd-3)))
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
197container which uses the order in which keys were inserted to the container
198as ordering relation.")
199 (license license:expat))))
200
201(define-public json-modern-cxx
202 (package
203 (name "json-modern-cxx")
204 (version "3.1.2")
205 (home-page "https://github.com/nlohmann/json")
206 (source
207 (origin
208 (method git-fetch)
209 (uri (git-reference (url home-page)
210 (commit (string-append "v" version))))
211 (sha256
212 (base32
213 "1mpr781fb2dfbyscrr7nil75lkxsazg4wkm749168lcf2ksrrbfi"))
214 (file-name (git-file-name name version))
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
230 "#include <fifo_map/" fifo-map-hpp ">")))))
231 #t))))
232 (native-inputs
233 `(("amalgamate" ,amalgamate)))
234 (inputs
235 `(("catch2" ,catch-framework2)
236 ("fifo-map" ,fifo-map)))
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
240intuitive syntax and trivial integration.")
241 (license license:expat)))
242
243(define-public xtl
244 (package
245 (name "xtl")
246 (version "0.6.4")
247 (source (origin
248 (method git-fetch)
249 (uri
250 (git-reference
251 (url "https://github.com/QuantStack/xtl.git")
252 (commit version)))
253 (sha256
254 (base32
255 "0rwdw43fq7c581m6frzsd06h71sf7abk7danwa3cp6wd6cgkwdbk"))
256 (file-name (git-file-name name version))))
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
274tools (containers, algorithms) used by other QuantStack packages.")
275 (license license:bsd-3)))