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