Merge branch 'origin/core-updates-next' into core-updates
[jackhill/guix/guix.git] / gnu / packages / boost.scm
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 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 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages boost)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build utils)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system trivial)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages icu4c)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages shells))
42
43 (define-public boost
44 (package
45 (name "boost")
46 (version "1.67.0")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append
50 "mirror://sourceforge/boost/boost/" version "/boost_"
51 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
52 ".tar.bz2"))
53 (sha256
54 (base32
55 "1fmdlmkzsrd46wwk834jsi2ypxj68w2by0rfcg2pzrafk5rck116"))
56 (patches (search-patches "boost-fix-icu-build.patch"))))
57 (build-system gnu-build-system)
58 (inputs `(("icu4c" ,icu4c)
59 ("zlib" ,zlib)))
60 (native-inputs
61 `(("perl" ,perl)
62 ("python" ,python-2)
63 ("tcsh" ,tcsh)))
64 (arguments
65 `(#:tests? #f
66 #:make-flags
67 (list "threading=multi" "link=shared"
68
69 ;; Set the RUNPATH to $libdir so that the libs find each other.
70 (string-append "linkflags=-Wl,-rpath="
71 (assoc-ref %outputs "out") "/lib"))
72 #:phases
73 (modify-phases %standard-phases
74 (delete 'bootstrap)
75 (replace 'configure
76 (lambda* (#:key inputs outputs #:allow-other-keys)
77 (let ((icu (assoc-ref inputs "icu4c"))
78 (out (assoc-ref outputs "out")))
79 (substitute* '("libs/config/configure"
80 "libs/spirit/classic/phoenix/test/runtest.sh"
81 "tools/build/doc/bjam.qbk"
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")))
86
87 (setenv "SHELL" (which "sh"))
88 (setenv "CONFIG_SHELL" (which "sh"))
89
90 (invoke "./bootstrap.sh"
91 (string-append "--prefix=" out)
92 ;; Auto-detection looks for ICU only in traditional
93 ;; install locations.
94 (string-append "--with-icu=" icu)
95 "--with-toolset=gcc"))))
96 (replace 'build
97 (lambda* (#:key make-flags #:allow-other-keys)
98 (apply invoke "./b2"
99 (format #f "-j~a" (parallel-job-count))
100 make-flags)))
101 (replace 'install
102 (lambda* (#:key make-flags #:allow-other-keys)
103 (apply invoke "./b2" "install" make-flags))))))
104
105 (home-page "https://www.boost.org")
106 (synopsis "Peer-reviewed portable C++ source libraries")
107 (description
108 "A collection of libraries intended to be widely useful, and usable
109 across a broad spectrum of applications.")
110 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
111 "Some components have other similar licences."))))
112
113 (define-public boost-sync
114 (let ((commit "c72891d9b90e2ceb466ec859f640cd012b2d8709")
115 (version "1.55")
116 (revision "1"))
117 (package
118 (name "boost-sync")
119 (version (git-version version revision commit))
120 (source (origin
121 (method git-fetch)
122 (uri (git-reference
123 (url "https://github.com/boostorg/sync.git")
124 (commit commit)))
125 (file-name (git-file-name name version))
126 (sha256
127 (base32
128 "197mp5z048vz5kv1m4v3jm447l2gqsyv0rbfz11dz0ns343ihbyx"))))
129 (build-system trivial-build-system)
130 (arguments
131 `(#:modules ((guix build utils))
132 #:builder
133 (begin
134 (use-modules (guix build utils))
135 (let ((source (assoc-ref %build-inputs "source")))
136 (copy-recursively (string-append source "/include")
137 (string-append %output "/include"))))))
138 (home-page "https://github.com/boostorg/sync")
139 (synopsis "Boost.Sync library")
140 (description "The Boost.Sync library provides mutexes, semaphores, locks
141 and events and other thread related facilities. Boost.Sync originated from
142 Boost.Thread.")
143 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
144
145 (define-public mdds
146 (package
147 (name "mdds")
148 (version "1.3.1")
149 (source (origin
150 (method url-fetch)
151 (uri (string-append
152 "http://kohei.us/files/mdds/src/mdds-" version ".tar.bz2"))
153 (sha256
154 (base32
155 "18g511z1lgfxrga2ld9yr95phmyfbd3ymbv4q5g5lyjn4ljcvf6w"))))
156 (build-system gnu-build-system)
157 (propagated-inputs
158 `(("boost" ,boost))) ; inclusion of header files
159 (home-page "https://gitlab.com/mdds/mdds")
160 (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
161 (description "Mdds (multi-dimensional data structure) provides a
162 collection of multi-dimensional data structures and indexing algorithms
163 for C++. It includes flat segment trees, segment trees, rectangle sets,
164 point quad trees, multi-type vectors and multi-type matrices.")
165 (license license:expat)))