1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015, 2019 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
8 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
10 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
12 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
15 ;;; This file is part of GNU Guix.
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.
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.
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/>.
30 (define-module (gnu packages boost)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix utils)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system trivial)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages icu4c)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages shells))
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"))))
60 "0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3"))))
61 (build-system gnu-build-system)
62 (inputs `(("icu4c" ,icu4c)
71 (list "threading=multi" "link=shared"
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>.
78 ;; Set the RUNPATH to $libdir so that the libs find each other.
79 (string-append "linkflags=-Wl,-rpath="
80 (assoc-ref %outputs "out") "/lib"))
82 (modify-phases %standard-phases
85 (lambda* (#:key inputs outputs #:allow-other-keys)
86 (let ((icu (assoc-ref inputs "icu4c"))
87 (out (assoc-ref outputs "out")))
88 (substitute* '("libs/config/configure"
89 "libs/spirit/classic/phoenix/test/runtest.sh"
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")))
95 (setenv "SHELL" (which "sh"))
96 (setenv "CONFIG_SHELL" (which "sh"))
98 (invoke "./bootstrap.sh"
99 (string-append "--prefix=" out)
100 ;; Auto-detection looks for ICU only in traditional
101 ;; install locations.
102 (string-append "--with-icu=" icu)
103 "--with-toolset=gcc"))))
105 (lambda* (#:key make-flags #:allow-other-keys)
107 (format #f "-j~a" (parallel-job-count))
110 (lambda* (#:key make-flags #:allow-other-keys)
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"))
124 (home-page "https://www.boost.org")
125 (synopsis "Peer-reviewed portable C++ source libraries")
127 "A collection of libraries intended to be widely useful, and usable
128 across a broad spectrum of applications.")
129 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
130 "Some components have other similar licences."))))
132 ;; TODO: Merge with 'Boost' in the next rebuild cycle.
133 (define-public boost-with-python3
136 (name "boost-python3")
141 (arguments (substitute-keyword-arguments (package-arguments boost)
143 `(modify-phases ,phases
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")))
156 (setenv "SHELL" (which "sh"))
157 (setenv "CONFIG_SHELL" (which "sh"))
159 (substitute* "tools/build/src/tools/python.jam"
160 (("include/python\\$\\(version\\)")
161 "include/python$(version)m"))
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"))
181 (define-public boost-static
184 (name "boost-static")
186 (substitute-keyword-arguments (package-arguments boost)
187 ((#:make-flags flags)
188 `(cons "link=static" (delete "link=shared" ,flags)))
190 `(modify-phases ,phases
191 (replace 'provide-libboost_python
192 (lambda* (#:key outputs #:allow-other-keys)
193 (let ((out (assoc-ref outputs "out")))
194 (with-directory-excursion (string-append out "/lib")
195 (symlink "libboost_python27.a" "libboost_python.a"))
198 (define-public boost-for-mysql
199 ;; Older version for MySQL 5.7.23.
206 "mirror://sourceforge/boost/boost/" version "/boost_"
207 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
211 "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj"))))
212 (arguments (substitute-keyword-arguments (package-arguments boost)
214 `(modify-phases ,phases
215 ;; This was removed after boost-1.67.
216 (add-before 'configure 'more-bin-sh-patching
218 (substitute* "tools/build/doc/bjam.qbk"
219 (("/bin/sh") (which "sh")))))
220 (delete 'provide-libboost_python)))))
221 (properties '((hidden? . #t)))))
223 (define-public boost-sync
224 (let ((commit "c72891d9b90e2ceb466ec859f640cd012b2d8709")
229 (version (git-version version revision commit))
233 (url "https://github.com/boostorg/sync.git")
235 (file-name (git-file-name name version))
238 "197mp5z048vz5kv1m4v3jm447l2gqsyv0rbfz11dz0ns343ihbyx"))))
239 (build-system trivial-build-system)
241 `(#:modules ((guix build utils))
244 (use-modules (guix build utils))
245 (let ((source (assoc-ref %build-inputs "source")))
246 (copy-recursively (string-append source "/include")
247 (string-append %output "/include"))))))
248 (home-page "https://github.com/boostorg/sync")
249 (synopsis "Boost.Sync library")
250 (description "The Boost.Sync library provides mutexes, semaphores, locks
251 and events and other thread related facilities. Boost.Sync originated from
253 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
255 (define-public boost-signals2
257 (name "boost-signals2")
258 (version (package-version boost))
262 (url "https://github.com/boostorg/signals2.git")
263 (commit (string-append "boost-" version))))
264 (file-name (git-file-name name version))
267 "1nayaqshhzr1n6jj43bpvvay36d5gn075h0b95psii5x8ingszdk"))))
268 (build-system trivial-build-system)
270 `(#:modules ((guix build utils))
273 (use-modules (guix build utils))
274 (let ((source (assoc-ref %build-inputs "source")))
275 (copy-recursively (string-append source "/include")
276 (string-append %output "/include"))))))
277 (home-page "https://github.com/boostorg/signals2")
278 (synopsis "Boost.Signals2 library")
279 (description "The Boost.Signals2 library is an implementation of a managed
280 signals and slots system.")
281 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"))))
290 "http://kohei.us/files/mdds/src/mdds-" version ".tar.bz2"))
293 "10cw6irdm6d15nxnys2v5akp8yz52qijpcjvw0frwq7nz5d3vki5"))))
294 (build-system gnu-build-system)
296 `(("boost" ,boost))) ; inclusion of header files
297 (home-page "https://gitlab.com/mdds/mdds")
298 (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
299 (description "Mdds (multi-dimensional data structure) provides a
300 collection of multi-dimensional data structures and indexing algorithms
301 for C++. It includes flat segment trees, segment trees, rectangle sets,
302 point quad trees, multi-type vectors and multi-type matrices.")
303 (license license:expat)))