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