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 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
12 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages boost)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix utils)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system trivial)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages icu4c)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages shells))
51 "mirror://sourceforge/boost/boost/" version "/boost_"
52 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
56 "1dyqsr9yb01y0nnjdq9b8q5s2kvhxbayk34832k5cpzn7jy30qbz"))
57 (patches (search-patches "boost-fix-icu-build.patch"))))
58 (build-system gnu-build-system)
59 (inputs `(("icu4c" ,icu4c)
68 (list "threading=multi" "link=shared"
70 ;; Set the RUNPATH to $libdir so that the libs find each other.
71 (string-append "linkflags=-Wl,-rpath="
72 (assoc-ref %outputs "out") "/lib"))
74 (modify-phases %standard-phases
77 (lambda* (#:key inputs outputs #:allow-other-keys)
78 (let ((icu (assoc-ref inputs "icu4c"))
79 (out (assoc-ref outputs "out")))
80 (substitute* '("libs/config/configure"
81 "libs/spirit/classic/phoenix/test/runtest.sh"
82 "tools/build/src/engine/execunix.c"
83 "tools/build/src/engine/Jambase"
84 "tools/build/src/engine/jambase.c")
85 (("/bin/sh") (which "sh")))
87 (setenv "SHELL" (which "sh"))
88 (setenv "CONFIG_SHELL" (which "sh"))
90 (invoke "./bootstrap.sh"
91 (string-append "--prefix=" out)
92 ;; Auto-detection looks for ICU only in traditional
94 (string-append "--with-icu=" icu)
95 "--with-toolset=gcc"))))
97 (lambda* (#:key make-flags #:allow-other-keys)
99 (format #f "-j~a" (parallel-job-count))
102 (lambda* (#:key make-flags #:allow-other-keys)
103 (apply invoke "./b2" "install" make-flags)))
104 (add-after 'install 'provide-libboost_python
105 (lambda* (#:key outputs #:allow-other-keys)
106 (let ((out (assoc-ref outputs "out")))
107 ;; Boost can build support for both Python 2 and Python 3 since
108 ;; version 1.67.0, and suffixes each library with the Python
109 ;; version. Many consumers only check for libboost_python
110 ;; however, so we provide it here as suggested in
111 ;; <https://github.com/boostorg/python/issues/203>.
112 (with-directory-excursion (string-append out "/lib")
113 (symlink "libboost_python27.so" "libboost_python.so"))
116 (home-page "https://www.boost.org")
117 (synopsis "Peer-reviewed portable C++ source libraries")
119 "A collection of libraries intended to be widely useful, and usable
120 across a broad spectrum of applications.")
121 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
122 "Some components have other similar licences."))))
124 ;; Some programs need Boost to be built with C++14 support.
125 (define-public boost-cxx14
126 (package (inherit boost)
128 (substitute-keyword-arguments (package-arguments boost)
129 ((#:make-flags flags)
131 '("cxxflags=-std=c++14")))))
132 (properties '((hidden? . #t)))))
134 (define-public boost-for-mysql
135 ;; Older version for MySQL 5.7.23.
142 "mirror://sourceforge/boost/boost/" version "/boost_"
143 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
147 "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj"))))
148 (arguments (substitute-keyword-arguments (package-arguments boost)
150 `(modify-phases ,phases
151 ;; This was removed after boost-1.67.
152 (add-before 'configure 'more-bin-sh-patching
154 (substitute* "tools/build/doc/bjam.qbk"
155 (("/bin/sh") (which "sh")))))
156 (delete 'provide-libboost_python)))))
157 (properties '((hidden? . #t)))))
159 (define-public boost-sync
160 (let ((commit "c72891d9b90e2ceb466ec859f640cd012b2d8709")
165 (version (git-version version revision commit))
169 (url "https://github.com/boostorg/sync.git")
171 (file-name (git-file-name name version))
174 "197mp5z048vz5kv1m4v3jm447l2gqsyv0rbfz11dz0ns343ihbyx"))))
175 (build-system trivial-build-system)
177 `(#:modules ((guix build utils))
180 (use-modules (guix build utils))
181 (let ((source (assoc-ref %build-inputs "source")))
182 (copy-recursively (string-append source "/include")
183 (string-append %output "/include"))))))
184 (home-page "https://github.com/boostorg/sync")
185 (synopsis "Boost.Sync library")
186 (description "The Boost.Sync library provides mutexes, semaphores, locks
187 and events and other thread related facilities. Boost.Sync originated from
189 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
198 "http://kohei.us/files/mdds/src/mdds-" version ".tar.bz2"))
201 "10cw6irdm6d15nxnys2v5akp8yz52qijpcjvw0frwq7nz5d3vki5"))))
202 (build-system gnu-build-system)
204 `(("boost" ,boost))) ; inclusion of header files
205 (home-page "https://gitlab.com/mdds/mdds")
206 (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
207 (description "Mdds (multi-dimensional data structure) provides a
208 collection of multi-dimensional data structures and indexing algorithms
209 for C++. It includes flat segment trees, segment trees, rectangle sets,
210 point quad trees, multi-type vectors and multi-type matrices.")
211 (license license:expat)))