gnu: upower: Enable GObject introspection.
[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.58.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 "1rfkqxns60171q62cppiyzj8pmsbwp1l8jd7p6crriryqd7j1z7x"))
46 (patches (list (search-patch "boost-mips-avoid-m32.patch")))))
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 (let ((build-flags
55 `("threading=multi" "link=shared"
56
57 ;; Set the RUNPATH to $libdir so that the libs find each other.
58 (string-append "linkflags=-Wl,-rpath="
59 (assoc-ref outputs "out") "/lib")
60
61 ;; Boost's 'context' library is not yet supported on mips64, so
62 ;; we disable it. The 'coroutine' library depends on 'context',
63 ;; so we disable that too.
64 ,@(if (string-prefix? "mips64" (or (%current-target-system)
65 (%current-system)))
66 '("--without-context" "--without-coroutine")
67 '()))))
68 `(#:tests? #f
69 #:phases
70 (alist-replace
71 'configure
72 (lambda* (#:key outputs #:allow-other-keys)
73 (let ((out (assoc-ref outputs "out")))
74 (substitute* '("libs/config/configure"
75 "libs/spirit/classic/phoenix/test/runtest.sh"
76 "tools/build/doc/bjam.qbk"
77 "tools/build/src/engine/execunix.c"
78 "tools/build/src/engine/Jambase"
79 "tools/build/src/engine/jambase.c")
80 (("/bin/sh") (which "sh")))
81
82 (setenv "SHELL" (which "sh"))
83 (setenv "CONFIG_SHELL" (which "sh"))
84
85 (zero? (system* "./bootstrap.sh"
86 (string-append "--prefix=" out)
87 "--with-toolset=gcc"))))
88 (alist-replace
89 'build
90 (lambda* (#:key outputs #:allow-other-keys)
91 (zero? (system* "./b2" ,@build-flags)))
92
93 (alist-replace
94 'install
95 (lambda* (#:key outputs #:allow-other-keys)
96 (zero? (system* "./b2" "install" ,@build-flags)))
97 %standard-phases))))))
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)))