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> |
df216847 | 10 | ;;; Copyright © 2018 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> |
2a72eeee JD |
13 | ;;; |
14 | ;;; This file is part of GNU Guix. | |
15 | ;;; | |
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. | |
20 | ;;; | |
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. | |
25 | ;;; | |
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/>. | |
28 | ||
29 | (define-module (gnu packages boost) | |
b5b73a82 | 30 | #:use-module ((guix licenses) #:prefix license:) |
da39ff58 | 31 | #:use-module (guix utils) |
2a72eeee JD |
32 | #:use-module (guix packages) |
33 | #:use-module (guix download) | |
7624300c | 34 | #:use-module (guix git-download) |
2a72eeee | 35 | #:use-module (guix build-system gnu) |
7624300c | 36 | #:use-module (guix build-system trivial) |
2a72eeee | 37 | #:use-module (gnu packages) |
c28ba7aa | 38 | #:use-module (gnu packages compression) |
bd590b96 LF |
39 | #:use-module (gnu packages icu4c) |
40 | #:use-module (gnu packages perl) | |
2a72eeee | 41 | #:use-module (gnu packages python) |
bd590b96 | 42 | #:use-module (gnu packages shells)) |
2a72eeee JD |
43 | |
44 | (define-public boost | |
45 | (package | |
46 | (name "boost") | |
3ea66dad | 47 | (version "1.68.0") |
2a72eeee JD |
48 | (source (origin |
49 | (method url-fetch) | |
50 | (uri (string-append | |
de67e922 | 51 | "mirror://sourceforge/boost/boost/" version "/boost_" |
2a72eeee JD |
52 | (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) |
53 | ".tar.bz2")) | |
54 | (sha256 | |
55 | (base32 | |
3ea66dad | 56 | "1dyqsr9yb01y0nnjdq9b8q5s2kvhxbayk34832k5cpzn7jy30qbz")) |
713c975a | 57 | (patches (search-patches "boost-fix-icu-build.patch")))) |
2a72eeee | 58 | (build-system gnu-build-system) |
bd590b96 LF |
59 | (inputs `(("icu4c" ,icu4c) |
60 | ("zlib" ,zlib))) | |
2a72eeee JD |
61 | (native-inputs |
62 | `(("perl" ,perl) | |
63 | ("python" ,python-2) | |
64 | ("tcsh" ,tcsh))) | |
65 | (arguments | |
f828ff5b DT |
66 | `(#:tests? #f |
67 | #:make-flags | |
68 | (list "threading=multi" "link=shared" | |
53a53be9 | 69 | |
f828ff5b DT |
70 | ;; Set the RUNPATH to $libdir so that the libs find each other. |
71 | (string-append "linkflags=-Wl,-rpath=" | |
0ff4e49a | 72 | (assoc-ref %outputs "out") "/lib")) |
f828ff5b DT |
73 | #:phases |
74 | (modify-phases %standard-phases | |
df216847 | 75 | (delete 'bootstrap) |
baef70bb | 76 | (replace 'configure |
713c975a MW |
77 | (lambda* (#:key inputs outputs #:allow-other-keys) |
78 | (let ((icu (assoc-ref inputs "icu4c")) | |
79 | (out (assoc-ref outputs "out"))) | |
f828ff5b DT |
80 | (substitute* '("libs/config/configure" |
81 | "libs/spirit/classic/phoenix/test/runtest.sh" | |
f828ff5b DT |
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"))) | |
aaf77acc | 86 | |
f828ff5b DT |
87 | (setenv "SHELL" (which "sh")) |
88 | (setenv "CONFIG_SHELL" (which "sh")) | |
aaf77acc | 89 | |
baef70bb AI |
90 | (invoke "./bootstrap.sh" |
91 | (string-append "--prefix=" out) | |
713c975a MW |
92 | ;; Auto-detection looks for ICU only in traditional |
93 | ;; install locations. | |
94 | (string-append "--with-icu=" icu) | |
196fb12c | 95 | "--with-toolset=gcc")))) |
baef70bb | 96 | (replace 'build |
196fb12c | 97 | (lambda* (#:key make-flags #:allow-other-keys) |
baef70bb AI |
98 | (apply invoke "./b2" |
99 | (format #f "-j~a" (parallel-job-count)) | |
196fb12c | 100 | make-flags))) |
baef70bb | 101 | (replace 'install |
196fb12c | 102 | (lambda* (#:key make-flags #:allow-other-keys) |
bd65ecf4 MB |
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")) | |
114 | #t)))))) | |
2a72eeee | 115 | |
a2cfe190 | 116 | (home-page "https://www.boost.org") |
2a72eeee JD |
117 | (synopsis "Peer-reviewed portable C++ source libraries") |
118 | (description | |
119 | "A collection of libraries intended to be widely useful, and usable | |
120 | across a broad spectrum of applications.") | |
a2cfe190 | 121 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt" |
2a72eeee | 122 | "Some components have other similar licences.")))) |
f763eaaa | 123 | |
b9103c82 LF |
124 | ;; Some programs need Boost to be built with C++14 support. |
125 | (define-public boost-cxx14 | |
126 | (package (inherit boost) | |
127 | (arguments | |
128 | (substitute-keyword-arguments (package-arguments boost) | |
129 | ((#:make-flags flags) | |
130 | `(append ,flags | |
131 | '("cxxflags=-std=c++14"))))) | |
132 | (properties '((hidden? . #t))))) | |
133 | ||
444488fc LC |
134 | (define-public boost-for-mysql |
135 | ;; Older version for MySQL 5.7.23. | |
136 | (package | |
137 | (inherit boost) | |
138 | (version "1.59.0") | |
139 | (source (origin | |
140 | (method url-fetch) | |
141 | (uri (string-append | |
142 | "mirror://sourceforge/boost/boost/" version "/boost_" | |
143 | (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) | |
144 | ".tar.bz2")) | |
145 | (sha256 | |
146 | (base32 | |
147 | "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj")))) | |
da39ff58 EF |
148 | (arguments (substitute-keyword-arguments (package-arguments boost) |
149 | ((#:phases phases) | |
150 | `(modify-phases ,phases | |
151 | ;; This was removed after boost-1.67. | |
152 | (add-before 'configure 'more-bin-sh-patching | |
153 | (lambda _ | |
154 | (substitute* "tools/build/doc/bjam.qbk" | |
155 | (("/bin/sh") (which "sh"))))) | |
156 | (delete 'provide-libboost_python))))) | |
444488fc LC |
157 | (properties '((hidden? . #t))))) |
158 | ||
7624300c MC |
159 | (define-public boost-sync |
160 | (let ((commit "c72891d9b90e2ceb466ec859f640cd012b2d8709") | |
161 | (version "1.55") | |
162 | (revision "1")) | |
163 | (package | |
164 | (name "boost-sync") | |
165 | (version (git-version version revision commit)) | |
166 | (source (origin | |
167 | (method git-fetch) | |
168 | (uri (git-reference | |
169 | (url "https://github.com/boostorg/sync.git") | |
170 | (commit commit))) | |
171 | (file-name (git-file-name name version)) | |
172 | (sha256 | |
173 | (base32 | |
174 | "197mp5z048vz5kv1m4v3jm447l2gqsyv0rbfz11dz0ns343ihbyx")))) | |
175 | (build-system trivial-build-system) | |
176 | (arguments | |
177 | `(#:modules ((guix build utils)) | |
178 | #:builder | |
179 | (begin | |
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 | |
188 | Boost.Thread.") | |
a2cfe190 | 189 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"))))) |
7624300c | 190 | |
f763eaaa AE |
191 | (define-public mdds |
192 | (package | |
193 | (name "mdds") | |
07d4200c | 194 | (version "1.4.3") |
f763eaaa AE |
195 | (source (origin |
196 | (method url-fetch) | |
197 | (uri (string-append | |
57144094 | 198 | "http://kohei.us/files/mdds/src/mdds-" version ".tar.bz2")) |
f763eaaa AE |
199 | (sha256 |
200 | (base32 | |
07d4200c | 201 | "10cw6irdm6d15nxnys2v5akp8yz52qijpcjvw0frwq7nz5d3vki5")))) |
f763eaaa AE |
202 | (build-system gnu-build-system) |
203 | (propagated-inputs | |
204 | `(("boost" ,boost))) ; inclusion of header files | |
62d652a7 | 205 | (home-page "https://gitlab.com/mdds/mdds") |
f763eaaa AE |
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))) |