gnu: Add python-user-agents.
[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.66.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 "1aaw48cmimsskzgiclwn0iifp62a5iw9cbqrhfari876af1828ap"))
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-for-mysql
114 ;; Older version for MySQL 5.7.23.
115 (package
116 (inherit boost)
117 (version "1.59.0")
118 (source (origin
119 (method url-fetch)
120 (uri (string-append
121 "mirror://sourceforge/boost/boost/" version "/boost_"
122 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
123 ".tar.bz2"))
124 (sha256
125 (base32
126 "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj"))))
127 (properties '((hidden? . #t)))))
128
129 (define-public boost-sync
130 (let ((commit "c72891d9b90e2ceb466ec859f640cd012b2d8709")
131 (version "1.55")
132 (revision "1"))
133 (package
134 (name "boost-sync")
135 (version (git-version version revision commit))
136 (source (origin
137 (method git-fetch)
138 (uri (git-reference
139 (url "https://github.com/boostorg/sync.git")
140 (commit commit)))
141 (file-name (git-file-name name version))
142 (sha256
143 (base32
144 "197mp5z048vz5kv1m4v3jm447l2gqsyv0rbfz11dz0ns343ihbyx"))))
145 (build-system trivial-build-system)
146 (arguments
147 `(#:modules ((guix build utils))
148 #:builder
149 (begin
150 (use-modules (guix build utils))
151 (let ((source (assoc-ref %build-inputs "source")))
152 (copy-recursively (string-append source "/include")
153 (string-append %output "/include"))))))
154 (home-page "https://github.com/boostorg/sync")
155 (synopsis "Boost.Sync library")
156 (description "The Boost.Sync library provides mutexes, semaphores, locks
157 and events and other thread related facilities. Boost.Sync originated from
158 Boost.Thread.")
159 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
160
161 (define-public mdds
162 (package
163 (name "mdds")
164 (version "1.3.1")
165 (source (origin
166 (method url-fetch)
167 (uri (string-append
168 "http://kohei.us/files/mdds/src/mdds-" version ".tar.bz2"))
169 (sha256
170 (base32
171 "18g511z1lgfxrga2ld9yr95phmyfbd3ymbv4q5g5lyjn4ljcvf6w"))))
172 (build-system gnu-build-system)
173 (propagated-inputs
174 `(("boost" ,boost))) ; inclusion of header files
175 (home-page "https://gitlab.com/mdds/mdds")
176 (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
177 (description "Mdds (multi-dimensional data structure) provides a
178 collection of multi-dimensional data structures and indexing algorithms
179 for C++. It includes flat segment trees, segment trees, rectangle sets,
180 point quad trees, multi-type vectors and multi-type matrices.")
181 (license license:expat)))