Commit | Line | Data |
---|---|---|
2a72eeee JD |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> | |
713c975a | 3 | ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org> |
1842a7cb | 4 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
c91d3fb7 | 5 | ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> |
6fd5a80d | 6 | ;;; Copyright © 2015, 2019 Ludovic Courtès <ludo@gnu.org> |
57144094 | 7 | ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> |
13de2b70 | 8 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
baef70bb | 9 | ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net> |
71154fe7 | 10 | ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net> |
7624300c | 11 | ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
da39ff58 | 12 | ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> |
12156a45 | 13 | ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org> |
2a72eeee JD |
14 | ;;; |
15 | ;;; This file is part of GNU Guix. | |
16 | ;;; | |
17 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
18 | ;;; under the terms of the GNU General Public License as published by | |
19 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
20 | ;;; your option) any later version. | |
21 | ;;; | |
22 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
23 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
25 | ;;; GNU General Public License for more details. | |
26 | ;;; | |
27 | ;;; You should have received a copy of the GNU General Public License | |
28 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
29 | ||
30 | (define-module (gnu packages boost) | |
b5b73a82 | 31 | #:use-module ((guix licenses) #:prefix license:) |
da39ff58 | 32 | #:use-module (guix utils) |
2a72eeee JD |
33 | #:use-module (guix packages) |
34 | #:use-module (guix download) | |
7624300c | 35 | #:use-module (guix git-download) |
2a72eeee | 36 | #:use-module (guix build-system gnu) |
7624300c | 37 | #:use-module (guix build-system trivial) |
2a72eeee | 38 | #:use-module (gnu packages) |
c28ba7aa | 39 | #:use-module (gnu packages compression) |
bd590b96 LF |
40 | #:use-module (gnu packages icu4c) |
41 | #:use-module (gnu packages perl) | |
2a72eeee | 42 | #:use-module (gnu packages python) |
bd590b96 | 43 | #:use-module (gnu packages shells)) |
2a72eeee JD |
44 | |
45 | (define-public boost | |
46 | (package | |
47 | (name "boost") | |
f1e9999b | 48 | (version "1.70.0") |
2a72eeee JD |
49 | (source (origin |
50 | (method url-fetch) | |
b8e43e61 MB |
51 | (uri (let ((version-with-underscores |
52 | (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))) | |
53 | (list (string-append "mirror://sourceforge/boost/boost/" version | |
54 | "/boost_" version-with-underscores ".tar.bz2") | |
55 | (string-append "https://dl.bintray.com/boostorg/release/" | |
56 | version "/source/boost_" | |
57 | version-with-underscores ".tar.bz2")))) | |
2a72eeee JD |
58 | (sha256 |
59 | (base32 | |
e7a42c4a | 60 | "0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3")))) |
2a72eeee | 61 | (build-system gnu-build-system) |
bd590b96 LF |
62 | (inputs `(("icu4c" ,icu4c) |
63 | ("zlib" ,zlib))) | |
2a72eeee JD |
64 | (native-inputs |
65 | `(("perl" ,perl) | |
66 | ("python" ,python-2) | |
67 | ("tcsh" ,tcsh))) | |
68 | (arguments | |
f828ff5b DT |
69 | `(#:tests? #f |
70 | #:make-flags | |
71 | (list "threading=multi" "link=shared" | |
53a53be9 | 72 | |
941ef1a1 MB |
73 | ;; XXX: Disable installation of Boosts modular CMake config scripts |
74 | ;; which conflicts in 1.70.0 with the ones provided by CMake. | |
75 | ;; See <https://bugs.gnu.org/36721>. | |
76 | "--no-cmake-config" | |
77 | ||
f828ff5b DT |
78 | ;; Set the RUNPATH to $libdir so that the libs find each other. |
79 | (string-append "linkflags=-Wl,-rpath=" | |
0ff4e49a | 80 | (assoc-ref %outputs "out") "/lib")) |
f828ff5b DT |
81 | #:phases |
82 | (modify-phases %standard-phases | |
df216847 | 83 | (delete 'bootstrap) |
baef70bb | 84 | (replace 'configure |
713c975a MW |
85 | (lambda* (#:key inputs outputs #:allow-other-keys) |
86 | (let ((icu (assoc-ref inputs "icu4c")) | |
87 | (out (assoc-ref outputs "out"))) | |
f828ff5b DT |
88 | (substitute* '("libs/config/configure" |
89 | "libs/spirit/classic/phoenix/test/runtest.sh" | |
f828ff5b DT |
90 | "tools/build/src/engine/execunix.c" |
91 | "tools/build/src/engine/Jambase" | |
92 | "tools/build/src/engine/jambase.c") | |
93 | (("/bin/sh") (which "sh"))) | |
aaf77acc | 94 | |
f828ff5b DT |
95 | (setenv "SHELL" (which "sh")) |
96 | (setenv "CONFIG_SHELL" (which "sh")) | |
aaf77acc | 97 | |
baef70bb AI |
98 | (invoke "./bootstrap.sh" |
99 | (string-append "--prefix=" out) | |
713c975a MW |
100 | ;; Auto-detection looks for ICU only in traditional |
101 | ;; install locations. | |
102 | (string-append "--with-icu=" icu) | |
196fb12c | 103 | "--with-toolset=gcc")))) |
baef70bb | 104 | (replace 'build |
196fb12c | 105 | (lambda* (#:key make-flags #:allow-other-keys) |
baef70bb AI |
106 | (apply invoke "./b2" |
107 | (format #f "-j~a" (parallel-job-count)) | |
196fb12c | 108 | make-flags))) |
baef70bb | 109 | (replace 'install |
196fb12c | 110 | (lambda* (#:key make-flags #:allow-other-keys) |
bd65ecf4 MB |
111 | (apply invoke "./b2" "install" make-flags))) |
112 | (add-after 'install 'provide-libboost_python | |
113 | (lambda* (#:key outputs #:allow-other-keys) | |
114 | (let ((out (assoc-ref outputs "out"))) | |
115 | ;; Boost can build support for both Python 2 and Python 3 since | |
116 | ;; version 1.67.0, and suffixes each library with the Python | |
117 | ;; version. Many consumers only check for libboost_python | |
118 | ;; however, so we provide it here as suggested in | |
119 | ;; <https://github.com/boostorg/python/issues/203>. | |
120 | (with-directory-excursion (string-append out "/lib") | |
121 | (symlink "libboost_python27.so" "libboost_python.so")) | |
122 | #t)))))) | |
2a72eeee | 123 | |
a2cfe190 | 124 | (home-page "https://www.boost.org") |
2a72eeee JD |
125 | (synopsis "Peer-reviewed portable C++ source libraries") |
126 | (description | |
127 | "A collection of libraries intended to be widely useful, and usable | |
128 | across a broad spectrum of applications.") | |
a2cfe190 | 129 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt" |
2a72eeee | 130 | "Some components have other similar licences.")))) |
f763eaaa | 131 | |
12156a45 GL |
132 | ;; TODO: Merge with 'Boost' in the next rebuild cycle. |
133 | (define-public boost-with-python3 | |
134 | (package | |
135 | (inherit boost) | |
136 | (name "boost-python3") | |
137 | (native-inputs | |
138 | `(("perl" ,perl) | |
139 | ("python" ,python) | |
140 | ("tcsh" ,tcsh))) | |
141 | (arguments (substitute-keyword-arguments (package-arguments boost) | |
142 | ((#:phases phases) | |
143 | `(modify-phases ,phases | |
144 | (replace 'configure | |
145 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
146 | (let ((icu (assoc-ref inputs "icu4c")) | |
147 | (python (assoc-ref inputs "python")) | |
148 | (out (assoc-ref outputs "out"))) | |
149 | (substitute* '("libs/config/configure" | |
150 | "libs/spirit/classic/phoenix/test/runtest.sh" | |
151 | "tools/build/src/engine/execunix.c" | |
152 | "tools/build/src/engine/Jambase" | |
153 | "tools/build/src/engine/jambase.c") | |
154 | (("/bin/sh") (which "sh"))) | |
155 | ||
156 | (setenv "SHELL" (which "sh")) | |
157 | (setenv "CONFIG_SHELL" (which "sh")) | |
158 | ||
159 | (substitute* "tools/build/src/tools/python.jam" | |
160 | (("include/python\\$\\(version\\)") | |
161 | "include/python$(version)m")) | |
162 | ||
163 | (invoke "./bootstrap.sh" | |
164 | (string-append "--prefix=" out) | |
165 | ;; Auto-detection looks for dependencies only | |
166 | ;; in traditional install locations. | |
167 | (string-append "--with-icu=" icu) | |
168 | (string-append "--with-python=" python "/bin/python3") | |
169 | (string-append "--with-python-root=" python) | |
170 | "--with-python-version=3.7" | |
171 | "--with-toolset=gcc")))) | |
172 | (replace 'provide-libboost_python | |
173 | (lambda* (#:key outputs #:allow-other-keys) | |
174 | (let ((out (assoc-ref outputs "out"))) | |
175 | (with-directory-excursion (string-append out "/lib") | |
176 | (symlink "libboost_python37.so" "libboost_python.so") | |
177 | ;; Some packages also look for libboost_python3.so | |
178 | (symlink "libboost_python37.so" "libboost_python3.so")) | |
179 | #t))))))))) | |
180 | ||
444488fc LC |
181 | (define-public boost-for-mysql |
182 | ;; Older version for MySQL 5.7.23. | |
183 | (package | |
184 | (inherit boost) | |
185 | (version "1.59.0") | |
186 | (source (origin | |
187 | (method url-fetch) | |
188 | (uri (string-append | |
189 | "mirror://sourceforge/boost/boost/" version "/boost_" | |
190 | (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) | |
191 | ".tar.bz2")) | |
192 | (sha256 | |
193 | (base32 | |
194 | "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj")))) | |
da39ff58 EF |
195 | (arguments (substitute-keyword-arguments (package-arguments boost) |
196 | ((#:phases phases) | |
197 | `(modify-phases ,phases | |
198 | ;; This was removed after boost-1.67. | |
199 | (add-before 'configure 'more-bin-sh-patching | |
200 | (lambda _ | |
201 | (substitute* "tools/build/doc/bjam.qbk" | |
202 | (("/bin/sh") (which "sh"))))) | |
203 | (delete 'provide-libboost_python))))) | |
444488fc LC |
204 | (properties '((hidden? . #t))))) |
205 | ||
7624300c MC |
206 | (define-public boost-sync |
207 | (let ((commit "c72891d9b90e2ceb466ec859f640cd012b2d8709") | |
208 | (version "1.55") | |
209 | (revision "1")) | |
210 | (package | |
211 | (name "boost-sync") | |
212 | (version (git-version version revision commit)) | |
213 | (source (origin | |
214 | (method git-fetch) | |
215 | (uri (git-reference | |
216 | (url "https://github.com/boostorg/sync.git") | |
217 | (commit commit))) | |
218 | (file-name (git-file-name name version)) | |
219 | (sha256 | |
220 | (base32 | |
221 | "197mp5z048vz5kv1m4v3jm447l2gqsyv0rbfz11dz0ns343ihbyx")))) | |
222 | (build-system trivial-build-system) | |
223 | (arguments | |
224 | `(#:modules ((guix build utils)) | |
225 | #:builder | |
226 | (begin | |
227 | (use-modules (guix build utils)) | |
228 | (let ((source (assoc-ref %build-inputs "source"))) | |
229 | (copy-recursively (string-append source "/include") | |
230 | (string-append %output "/include")))))) | |
231 | (home-page "https://github.com/boostorg/sync") | |
232 | (synopsis "Boost.Sync library") | |
233 | (description "The Boost.Sync library provides mutexes, semaphores, locks | |
234 | and events and other thread related facilities. Boost.Sync originated from | |
235 | Boost.Thread.") | |
a2cfe190 | 236 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"))))) |
7624300c | 237 | |
71154fe7 RW |
238 | (define-public boost-signals2 |
239 | (package | |
240 | (name "boost-signals2") | |
241 | (version (package-version boost)) | |
242 | (source (origin | |
243 | (method git-fetch) | |
244 | (uri (git-reference | |
245 | (url "https://github.com/boostorg/signals2.git") | |
246 | (commit (string-append "boost-" version)))) | |
247 | (file-name (git-file-name name version)) | |
248 | (sha256 | |
249 | (base32 | |
250 | "1nayaqshhzr1n6jj43bpvvay36d5gn075h0b95psii5x8ingszdk")))) | |
251 | (build-system trivial-build-system) | |
252 | (arguments | |
253 | `(#:modules ((guix build utils)) | |
254 | #:builder | |
255 | (begin | |
256 | (use-modules (guix build utils)) | |
257 | (let ((source (assoc-ref %build-inputs "source"))) | |
258 | (copy-recursively (string-append source "/include") | |
259 | (string-append %output "/include")))))) | |
260 | (home-page "https://github.com/boostorg/signals2") | |
261 | (synopsis "Boost.Signals2 library") | |
262 | (description "The Boost.Signals2 library is an implementation of a managed | |
263 | signals and slots system.") | |
264 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))) | |
265 | ||
f763eaaa AE |
266 | (define-public mdds |
267 | (package | |
268 | (name "mdds") | |
07d4200c | 269 | (version "1.4.3") |
f763eaaa AE |
270 | (source (origin |
271 | (method url-fetch) | |
272 | (uri (string-append | |
57144094 | 273 | "http://kohei.us/files/mdds/src/mdds-" version ".tar.bz2")) |
f763eaaa AE |
274 | (sha256 |
275 | (base32 | |
07d4200c | 276 | "10cw6irdm6d15nxnys2v5akp8yz52qijpcjvw0frwq7nz5d3vki5")))) |
f763eaaa AE |
277 | (build-system gnu-build-system) |
278 | (propagated-inputs | |
279 | `(("boost" ,boost))) ; inclusion of header files | |
62d652a7 | 280 | (home-page "https://gitlab.com/mdds/mdds") |
f763eaaa AE |
281 | (synopsis "Multi-dimensional C++ data structures and indexing algorithms") |
282 | (description "Mdds (multi-dimensional data structure) provides a | |
283 | collection of multi-dimensional data structures and indexing algorithms | |
284 | for C++. It includes flat segment trees, segment trees, rectangle sets, | |
285 | point quad trees, multi-type vectors and multi-type matrices.") | |
286 | (license license:expat))) |