gnu: r-opencyto: Update to 2.8.4.
[jackhill/guix/guix.git] / gnu / packages / boost.scm
CommitLineData
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>
bc64d955 6;;; Copyright © 2015, 2019, 2020, 2021 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>
2b857ba6 10;;; Copyright © 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
ca5f81ff 11;;; Copyright © 2018, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
f204d155 12;;; Copyright © 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
a4c04bee 13;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
2ac164a8 14;;; Copyright © 2019, 2020 Giacomo Leidi <goodoldpaul@autistici.org>
02fef961 15;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
a0828560 16;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
5d3cec76 17;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
94cf3676 18;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
ccff3380 19;;; Copyright © 2021 Franck Pérignon <franck.perignon@univ-grenoble-alpes.fr>
74f83a1d 20;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
04b6e1ed 21;;; Copyright © 2021 Aleksandr Vityazev <avityazev@posteo.org>
2a72eeee
JD
22;;;
23;;; This file is part of GNU Guix.
24;;;
25;;; GNU Guix is free software; you can redistribute it and/or modify it
26;;; under the terms of the GNU General Public License as published by
27;;; the Free Software Foundation; either version 3 of the License, or (at
28;;; your option) any later version.
29;;;
30;;; GNU Guix is distributed in the hope that it will be useful, but
31;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33;;; GNU General Public License for more details.
34;;;
35;;; You should have received a copy of the GNU General Public License
36;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38(define-module (gnu packages boost)
b5b73a82 39 #:use-module ((guix licenses) #:prefix license:)
da39ff58 40 #:use-module (guix utils)
2a72eeee
JD
41 #:use-module (guix packages)
42 #:use-module (guix download)
7624300c 43 #:use-module (guix git-download)
2a72eeee 44 #:use-module (guix build-system gnu)
7624300c 45 #:use-module (guix build-system trivial)
2a72eeee 46 #:use-module (gnu packages)
c28ba7aa 47 #:use-module (gnu packages compression)
7b7b468e 48 #:use-module (gnu packages hurd)
bd590b96 49 #:use-module (gnu packages icu4c)
2b857ba6 50 #:use-module (gnu packages llvm)
bd590b96 51 #:use-module (gnu packages perl)
2a72eeee 52 #:use-module (gnu packages python)
2ac164a8 53 #:use-module (gnu packages shells)
ccff3380 54 #:use-module (gnu packages mpi)
2ac164a8 55 #:use-module (srfi srfi-1))
2a72eeee 56
5cde458b
MB
57(define (version-with-underscores version)
58 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))
59
60(define (boost-patch name version hash)
61 (origin
62 (method url-fetch)
63 (uri (string-append "https://www.boost.org/patches/"
64 (version-with-underscores version) "/" name))
65 (file-name (string-append "boost-" name))
66 (sha256 (base32 hash))))
67
2a72eeee
JD
68(define-public boost
69 (package
70 (name "boost")
68ce9c38 71 (version "1.77.0")
2a72eeee
JD
72 (source (origin
73 (method url-fetch)
74f83a1d 74 (uri (string-append "https://boostorg.jfrog.io/artifactory/main/release/"
5cde458b
MB
75 version "/source/boost_"
76 (version-with-underscores version) ".tar.bz2"))
2a72eeee
JD
77 (sha256
78 (base32
68ce9c38 79 "0m08hhk3l7zvzajyk39qlw566q3fhixayhc2j11328qf0gy8b7zw"))))
2a72eeee 80 (build-system gnu-build-system)
8394619b 81 (inputs (list icu4c zlib))
2a72eeee
JD
82 (native-inputs
83 `(("perl" ,perl)
a4c04bee
MO
84 ,@(if (%current-target-system)
85 '()
5d3cec76 86 `(("python" ,python-minimal-wrapper)))
2a72eeee
JD
87 ("tcsh" ,tcsh)))
88 (arguments
2ac164a8
GL
89 `(#:imported-modules ((guix build python-build-system)
90 ,@%gnu-build-system-modules)
91 #:modules (((guix build python-build-system) #:select (python-version))
92 ,@%gnu-build-system-modules)
93 #:tests? #f
f828ff5b
DT
94 #:make-flags
95 (list "threading=multi" "link=shared"
53a53be9 96
f828ff5b
DT
97 ;; Set the RUNPATH to $libdir so that the libs find each other.
98 (string-append "linkflags=-Wl,-rpath="
a4c04bee
MO
99 (assoc-ref %outputs "out") "/lib")
100 ,@(if (%current-target-system)
101 `("--user-config=user-config.jam"
102 ;; Python is not supported when cross-compiling.
103 "--without-python"
104 "binary-format=elf"
105 "target-os=linux"
106 ,@(cond
107 ((string-prefix? "arm" (%current-target-system))
108 '("abi=aapcs"
109 "address-model=32"
110 "architecture=arm"))
111 ((string-prefix? "aarch64" (%current-target-system))
112 '("abi=aapcs"
113 "address-model=64"
114 "architecture=arm"))
115 (else '())))
116 '()))
f828ff5b
DT
117 #:phases
118 (modify-phases %standard-phases
df216847 119 (delete 'bootstrap)
baef70bb 120 (replace 'configure
713c975a
MW
121 (lambda* (#:key inputs outputs #:allow-other-keys)
122 (let ((icu (assoc-ref inputs "icu4c"))
2ac164a8 123 (python (assoc-ref inputs "python"))
713c975a 124 (out (assoc-ref outputs "out")))
f828ff5b
DT
125 (substitute* '("libs/config/configure"
126 "libs/spirit/classic/phoenix/test/runtest.sh"
d7f77688 127 "tools/build/src/engine/execunix.cpp")
f828ff5b 128 (("/bin/sh") (which "sh")))
aaf77acc 129
f828ff5b
DT
130 (setenv "SHELL" (which "sh"))
131 (setenv "CONFIG_SHELL" (which "sh"))
aaf77acc 132
a4c04bee
MO
133 ,@(if (%current-target-system)
134 `((call-with-output-file "user-config.jam"
135 (lambda (port)
136 (format port
137 "using gcc : cross : ~a-c++ ;"
138 ,(%current-target-system)))))
139 '())
140
7b7b468e 141 ;; Change an #ifdef __MACH__ that really targets macOS.
061ffcf2
JN
142 (substitute* "boost/test/utils/timer.hpp"
143 (("defined\\(__MACH__\\)")
144 "(defined __MACH__ && !defined __GNU__)"))
7b7b468e 145
baef70bb
AI
146 (invoke "./bootstrap.sh"
147 (string-append "--prefix=" out)
713c975a
MW
148 ;; Auto-detection looks for ICU only in traditional
149 ;; install locations.
150 (string-append "--with-icu=" icu)
2ac164a8
GL
151 ;; Ditto for Python.
152 ,@(if (%current-target-system)
153 '()
154 `((string-append "--with-python-root=" python)
155 (string-append "--with-python=" python "/bin/python")
156 (string-append "--with-python-version="
157 (python-version python))))
196fb12c 158 "--with-toolset=gcc"))))
baef70bb 159 (replace 'build
196fb12c 160 (lambda* (#:key make-flags #:allow-other-keys)
baef70bb
AI
161 (apply invoke "./b2"
162 (format #f "-j~a" (parallel-job-count))
196fb12c 163 make-flags)))
baef70bb 164 (replace 'install
196fb12c 165 (lambda* (#:key make-flags #:allow-other-keys)
bd65ecf4 166 (apply invoke "./b2" "install" make-flags)))
a4c04bee
MO
167 ,@(if (%current-target-system)
168 '()
169 '((add-after 'install 'provide-libboost_python
2ac164a8
GL
170 (lambda* (#:key inputs outputs #:allow-other-keys)
171 (let* ((out (assoc-ref outputs "out"))
172 (python-version (python-version
173 (assoc-ref inputs "python")))
174 (libboost_pythonNN.so
175 (string-append "libboost_python"
176 (string-join (string-split
177 python-version #\.)
178 "")
179 ".so")))
a4c04bee 180 (with-directory-excursion (string-append out "/lib")
2ac164a8
GL
181 (symlink libboost_pythonNN.so "libboost_python.so")
182 ;; Some packages only look for the major version.
183 (symlink libboost_pythonNN.so
184 (string-append "libboost_python"
185 (string-take python-version 1)
68ce9c38 186 ".so")))))))))))
2a72eeee 187
a2cfe190 188 (home-page "https://www.boost.org")
2a72eeee
JD
189 (synopsis "Peer-reviewed portable C++ source libraries")
190 (description
191 "A collection of libraries intended to be widely useful, and usable
192across a broad spectrum of applications.")
a2cfe190 193 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
2a72eeee 194 "Some components have other similar licences."))))
f763eaaa 195
2b857ba6
RW
196;; Sadly, this is needed for irods. It won't link with 1.69 or later.
197(define-public boost-for-irods
198 (package
199 (inherit boost)
200 (name "boost-for-irods")
201 (version "1.68.0")
202 (source (origin
203 (method url-fetch)
204 (uri (string-append
205 "mirror://sourceforge/boost/boost/" version "/boost_"
206 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
207 ".tar.bz2"))
208 (sha256
209 (base32
210 "1dyqsr9yb01y0nnjdq9b8q5s2kvhxbayk34832k5cpzn7jy30qbz"))))
211 (build-system gnu-build-system)
212 (properties `((hidden? . #true)))
213 (inputs
214 `(("icu4c" ,icu4c)
215 ("libcxx" ,libcxx+libcxxabi-6)
216 ("libcxxabi" ,libcxxabi-6)
217 ("zlib" ,zlib)))
218 (native-inputs
8394619b 219 (list clang-6 perl tcsh))
2b857ba6
RW
220 (arguments
221 `(#:tests? #f
222 #:make-flags
223 (list "threading=multi" "link=shared"
224 "cxxflags=-stdlib=libc++"
225 "--without-python"
226
227 ;; Set the RUNPATH to $libdir so that the libs find each other.
228 (string-append "linkflags=-stdlib=libc++ -Wl,-rpath="
229 (assoc-ref %outputs "out") "/lib"))
230 #:phases
231 (modify-phases %standard-phases
232 (delete 'bootstrap)
233 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
234 (lambda* (#:key native-inputs inputs #:allow-other-keys)
235 (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
236 (setenv "CPLUS_INCLUDE_PATH"
237 (string-join
425ccde6 238 (cons (search-input-directory inputs "/include/c++/v1")
2b857ba6
RW
239 ;; Hide GCC's C++ headers so that they do not interfere with
240 ;; the Clang headers.
241 (delete (string-append gcc "/include/c++")
242 (string-split (getenv "CPLUS_INCLUDE_PATH")
243 #\:)))
244 ":"))
245 (format #true
246 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
247 (getenv "CPLUS_INCLUDE_PATH")))))
248 (replace 'configure
249 (lambda* (#:key inputs outputs #:allow-other-keys)
250 (let ((icu (assoc-ref inputs "icu4c"))
251 (out (assoc-ref outputs "out"))
bc64d955 252 (sh (search-input-file inputs "/bin/sh")))
2b857ba6
RW
253 (substitute* '("libs/config/configure"
254 "libs/spirit/classic/phoenix/test/runtest.sh"
255 "tools/build/src/engine/execunix.c"
256 "tools/build/src/engine/Jambase"
257 "tools/build/src/engine/jambase.c")
258 (("/bin/sh") sh))
259
260 (setenv "SHELL" (which "sh"))
261 (setenv "CONFIG_SHELL" (which "sh"))
262
263 (invoke "./bootstrap.sh"
264 (string-append "--prefix=" out)
265 ;; Auto-detection looks for ICU only in traditional
266 ;; install locations.
267 (string-append "--with-icu=" icu)
268 "--with-toolset=clang"))))
269 (replace 'build
270 (lambda* (#:key make-flags #:allow-other-keys)
271 (apply invoke "./b2"
272 (format #f "-j~a" (parallel-job-count))
273 make-flags)))
274 (replace 'install
275 (lambda* (#:key make-flags #:allow-other-keys)
276 (apply invoke "./b2" "install" make-flags))))))))
277
03d66a84
MB
278(define-public boost-with-python3
279 (deprecated-package "boost-with-python3" boost))
280
31872b3e
EF
281(define-public boost-static
282 (package
283 (inherit boost)
284 (name "boost-static")
285 (arguments
286 (substitute-keyword-arguments (package-arguments boost)
287 ((#:make-flags flags)
288 `(cons "link=static" (delete "link=shared" ,flags)))
289 ((#:phases phases)
290 `(modify-phases ,phases
291 (replace 'provide-libboost_python
0e907e27
MB
292 (lambda* (#:key inputs outputs #:allow-other-keys)
293 (let* ((out (assoc-ref outputs "out"))
294 (python-version (python-version
295 (assoc-ref inputs "python")))
296 (libboost_pythonNN.a
297 (string-append "libboost_python"
298 (string-join (string-split
299 python-version #\.)
300 "")
301 ".a")))
31872b3e 302 (with-directory-excursion (string-append out "/lib")
0e907e27 303 (symlink libboost_pythonNN.a "libboost_python.a"))
31872b3e
EF
304 #t)))))))))
305
444488fc
LC
306(define-public boost-for-mysql
307 ;; Older version for MySQL 5.7.23.
308 (package
309 (inherit boost)
310 (version "1.59.0")
311 (source (origin
312 (method url-fetch)
313 (uri (string-append
314 "mirror://sourceforge/boost/boost/" version "/boost_"
315 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
316 ".tar.bz2"))
317 (sha256
318 (base32
319 "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj"))))
da39ff58
EF
320 (arguments (substitute-keyword-arguments (package-arguments boost)
321 ((#:phases phases)
322 `(modify-phases ,phases
a0828560
EF
323 (replace 'configure
324 (lambda* (#:key inputs outputs #:allow-other-keys)
325 (let ((icu (assoc-ref inputs "icu4c"))
326 (out (assoc-ref outputs "out")))
327 (substitute* (append
328 (find-files "tools/build/src/engine/" "execunix\\.c.*")
329 '("libs/config/configure"
330 "libs/spirit/classic/phoenix/test/runtest.sh"
331 "tools/build/doc/bjam.qbk"
332 "tools/build/src/engine/Jambase"))
333 (("/bin/sh") (which "sh")))
334
335 (setenv "SHELL" (which "sh"))
336 (setenv "CONFIG_SHELL" (which "sh"))
337
338 ,@(if (%current-target-system)
339 `((call-with-output-file "user-config.jam"
340 (lambda (port)
341 (format port
342 "using gcc : cross : ~a-c++ ;"
343 ,(%current-target-system)))))
344 '())
345
346 (invoke "./bootstrap.sh"
347 (string-append "--prefix=" out)
348 ;; Auto-detection looks for ICU only in traditional
349 ;; install locations.
350 (string-append "--with-icu=" icu)
351 "--with-toolset=gcc"))))
352 (delete 'provide-libboost_python)))
353 ((#:make-flags make-flags)
354 `(cons* "--without-python" ,make-flags))))
355 (native-inputs
356 (alist-delete "python" (package-native-inputs boost)))
444488fc
LC
357 (properties '((hidden? . #t)))))
358
7624300c 359(define-public boost-sync
d3fe88c6 360 (let ((commit "e690de2d30e2f1649ff500c9a6f3539814994b1c")
7624300c 361 (version "1.55")
d3fe88c6 362 (revision "2"))
7624300c
MC
363 (package
364 (name "boost-sync")
365 (version (git-version version revision commit))
366 (source (origin
367 (method git-fetch)
368 (uri (git-reference
b0e7b699 369 (url "https://github.com/boostorg/sync")
7624300c
MC
370 (commit commit)))
371 (file-name (git-file-name name version))
372 (sha256
373 (base32
d3fe88c6 374 "0473hb15affjq2804xa99ikk4y1gzi46rygd9zhncl28ib7mnn26"))))
7624300c
MC
375 (build-system trivial-build-system)
376 (arguments
377 `(#:modules ((guix build utils))
378 #:builder
379 (begin
380 (use-modules (guix build utils))
381 (let ((source (assoc-ref %build-inputs "source")))
382 (copy-recursively (string-append source "/include")
383 (string-append %output "/include"))))))
384 (home-page "https://github.com/boostorg/sync")
385 (synopsis "Boost.Sync library")
386 (description "The Boost.Sync library provides mutexes, semaphores, locks
387and events and other thread related facilities. Boost.Sync originated from
388Boost.Thread.")
a2cfe190 389 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
7624300c 390
71154fe7
RW
391(define-public boost-signals2
392 (package
393 (name "boost-signals2")
394 (version (package-version boost))
395 (source (origin
396 (method git-fetch)
397 (uri (git-reference
b0e7b699 398 (url "https://github.com/boostorg/signals2")
71154fe7
RW
399 (commit (string-append "boost-" version))))
400 (file-name (git-file-name name version))
401 (sha256
402 (base32
04b6e1ed 403 "1prhj98jgvkj2m3ia5lcgxnl1a4h13cyzqd55skjn983rivi6090"))))
71154fe7
RW
404 (build-system trivial-build-system)
405 (arguments
406 `(#:modules ((guix build utils))
407 #:builder
408 (begin
409 (use-modules (guix build utils))
410 (let ((source (assoc-ref %build-inputs "source")))
411 (copy-recursively (string-append source "/include")
412 (string-append %output "/include"))))))
413 (home-page "https://github.com/boostorg/signals2")
414 (synopsis "Boost.Signals2 library")
415 (description "The Boost.Signals2 library is an implementation of a managed
416signals and slots system.")
417 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"))))
418
ccff3380
FP
419
420(define-public boost-mpi
421 (package
422 (inherit boost)
423 (name "boost-mpi")
424 (native-inputs
425 `(("perl" ,perl)
426 ,@(if (%current-target-system)
427 '()
428 `(("python" ,python-wrapper)))
429 ("openmpi" , openmpi)))
430 (arguments
431 (substitute-keyword-arguments (package-arguments boost)
432 ((#:phases phases)
433 `(modify-phases ,phases
434 (add-after 'configure 'update-jam
435 (lambda* (#:key inputs outputs #:allow-other-keys)
436 (let ((output-port (open-file "project-config.jam" "a")))
437 (display "using mpi ;" output-port)
438 (newline output-port)
439 (close output-port))))))))
440 (home-page "https://www.boost.org")
441 (synopsis "Message Passing Interface (MPI) library for C++")))
442
f763eaaa
AE
443(define-public mdds
444 (package
445 (name "mdds")
b424ca57 446 (version "2.0.3")
f763eaaa
AE
447 (source (origin
448 (method url-fetch)
b424ca57
MB
449 (uri (string-append "https://kohei.us/files/mdds/src/mdds-"
450 version ".tar.xz"))
f763eaaa
AE
451 (sha256
452 (base32
b424ca57 453 "1r68kxqppmhfg0dhz54d0hqzs5882cqrv1x6wpg7lak6gyyws0bc"))))
f763eaaa
AE
454 (build-system gnu-build-system)
455 (propagated-inputs
8394619b 456 (list boost)) ; inclusion of header files
62d652a7 457 (home-page "https://gitlab.com/mdds/mdds")
f763eaaa
AE
458 (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
459 (description "Mdds (multi-dimensional data structure) provides a
460collection of multi-dimensional data structures and indexing algorithms
461for C++. It includes flat segment trees, segment trees, rectangle sets,
462point quad trees, multi-type vectors and multi-type matrices.")
463 (license license:expat)))