Merge branch 'master' 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 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages boost)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages python)
30 #:use-module (gnu packages tcsh)
31 #:use-module (gnu packages perl))
32
33 (define-public boost
34 (package
35 (name "boost")
36 (version "1.57.0")
37 (source (origin
38 (method url-fetch)
39 (uri (string-append
40 "mirror://sourceforge/boost/boost_"
41 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
42 ".tar.bz2"))
43 (sha256
44 (base32
45 "0rs94vdmg34bwwj23fllva6mhrml2i7mvmlb11zyrk1k5818q34i"))))
46 (build-system gnu-build-system)
47 (inputs `(("zlib" ,zlib)))
48 (native-inputs
49 `(("perl" ,perl)
50 ("python" ,python-2)
51 ("tcsh" ,tcsh)))
52 (arguments
53 (let ((build-flags
54 `("threading=multi" "link=shared"
55
56 ;; Set the RUNPATH to $libdir so that the libs find each other.
57 (string-append "linkflags=-Wl,-rpath="
58 (assoc-ref outputs "out") "/lib")
59
60 ;; Boost's 'context' library is not yet supported on mips64, so
61 ;; we disable it. The 'coroutine' library depends on 'context',
62 ;; so we disable that too.
63 ,@(if (string-prefix? "mips64" (or (%current-target-system)
64 (%current-system)))
65 '("--without-context" "--without-coroutine")
66 '()))))
67 `(#:tests? #f
68 #:phases
69 (alist-replace
70 'configure
71 (lambda* (#:key outputs #:allow-other-keys)
72 (let ((out (assoc-ref outputs "out")))
73 (substitute* '("libs/config/configure"
74 "libs/spirit/classic/phoenix/test/runtest.sh"
75 "tools/build/doc/bjam.qbk"
76 "tools/build/src/engine/execunix.c"
77 "tools/build/src/engine/Jambase"
78 "tools/build/src/engine/jambase.c")
79 (("/bin/sh") (which "sh")))
80
81 (setenv "SHELL" (which "sh"))
82 (setenv "CONFIG_SHELL" (which "sh"))
83
84 (zero? (system* "./bootstrap.sh"
85 (string-append "--prefix=" out)
86 "--with-toolset=gcc"))))
87 (alist-replace
88 'build
89 (lambda* (#:key outputs #:allow-other-keys)
90 (zero? (system* "./b2" ,@build-flags)))
91
92 (alist-replace
93 'install
94 (lambda* (#:key outputs #:allow-other-keys)
95 (zero? (system* "./b2" "install" ,@build-flags)))
96 %standard-phases))))))
97
98 (home-page "http://boost.org")
99 (synopsis "Peer-reviewed portable C++ source libraries")
100 (description
101 "A collection of libraries intended to be widely useful, and usable
102 across a broad spectrum of applications.")
103 (license (license:x11-style "http://www.boost.org/LICENSE_1_0.txt"
104 "Some components have other similar licences."))))
105
106 (define-public mdds
107 (package
108 (name "mdds")
109 (version "0.12.0")
110 (source (origin
111 (method url-fetch)
112 (uri (string-append
113 "http://kohei.us/files/mdds/src/mdds_" version ".tar.bz2"))
114 (sha256
115 (base32
116 "10ar7r0gkdl2r7916jlkl5c38cynrh7x9s90a5i8d242r8ixw8ia"))))
117 (build-system gnu-build-system)
118 (propagated-inputs
119 `(("boost" ,boost))) ; inclusion of header files
120 (home-page "https://code.google.com/p/multidimalgorithm/")
121 (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
122 (description "Mdds (multi-dimensional data structure) provides a
123 collection of multi-dimensional data structures and indexing algorithms
124 for C++. It includes flat segment trees, segment trees, rectangle sets,
125 point quad trees, multi-type vectors and multi-type matrices.")
126 (license license:expat)))