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>
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 ;; Warning: This source has proved unreliable 1 time at least.
45 ;; Consider an alternate source or report upstream if this
47 (uri (string-append "https://mediaarea.net/download/source/"
49 name "_" version ".tar.bz2"))
52 "1dkqbgabzpa6bd7dkqrvd35sdxrhr6qxalb88f3dw0afk65xqb0k"))))
54 `(("autoconf" ,autoconf)
55 ("automake" ,automake)
56 ("libtool" ,libtool)))
57 (build-system gnu-build-system)
60 ;; build scripts not in root of archive
61 (modify-phases %standard-phases
62 (add-after 'unpack 'pre-configure
64 (chdir "Project/GNU/Library")
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)))
74 (let* ((commit "b3e6f41d9844ef64420e628e0c65ed98278a843a")
78 (version (git-version "0.0.0" revision commit))
82 (url "https://github.com/Andersbakken/rct")
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)
92 '("-DWITH_TESTS=ON" ; To run the test suite
93 "-DRCT_RTTI_ENABLED=ON")))
95 `(("cppunit" ,cppunit)
96 ("pkg-config" ,pkg-config)))
98 `(("openssl" ,openssl)
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)
107 (define-public dashel
115 (url "https://github.com/aseba-community/dashel.git")
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")
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)))
140 (url "https://github.com/QuantStack/xsimd.git")
143 (base32 "1ny2qin1j4h35mljivh8z52kwdyjxf4yxlzb8j52ji91v2ccc88j"))
144 (file-name (git-file-name name version))))
145 (build-system cmake-build-system)
147 `(#:configure-flags (list "-DBUILD_TESTS=ON")
148 #:test-target "xtest"))
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
158 (license license:bsd-3)))
160 (define-public fifo-map
161 (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
163 (version (git-version "1.1.1" revision commit)))
167 (home-page "https://github.com/nlohmann/fifo_map")
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"))))
182 `(("catch2" ,catch-framework2)))
183 (build-system cmake-build-system)
186 (modify-phases %standard-phases
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)
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))))
204 (define-public json-modern-cxx
206 (name "json-modern-cxx")
208 (home-page "https://github.com/nlohmann/json")
212 (uri (git-reference (url home-page)
213 (commit (string-append "v" version))))
216 "1mpr781fb2dfbyscrr7nil75lkxsazg4wkm749168lcf2ksrrbfi"))
217 (file-name (git-file-name name version))
218 (modules '((guix build utils)))
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")))
228 (("#include ?\"(catch.hpp)\"" all catch-hpp)
229 (string-append "#include <catch/" catch-hpp ">")))
231 (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp)
233 "#include <fifo_map/" fifo-map-hpp ">")))))
236 `(("amalgamate" ,amalgamate)))
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)))
254 (url "https://github.com/QuantStack/xtl.git")
258 "0rwdw43fq7c581m6frzsd06h71sf7abk7danwa3cp6wd6cgkwdbk"))
259 (file-name (git-file-name name version))))
261 `(("googletest" ,googletest)
262 ("json-modern-cxx" ,json-modern-cxx)))
265 '("-DBUILD_TESTS=ON")
267 (modify-phases %standard-phases
270 (with-directory-excursion "test"
271 (invoke "./test_xtl")
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)))