X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/6cb1ef9ea28ee14b3bb5442e8af1f54c27802f09..6a7ac0a829169f665c0aee6cb7899fa943b2d648:/gnu/packages/boost.scm diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index 73b4cff4c8..0a2a5c5c01 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; Copyright © 2018 Maxim Cournoyer ;;; Copyright © 2018 Efraim Flashner +;;; Copyright © 2019 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,8 +57,7 @@ version-with-underscores ".tar.bz2")))) (sha256 (base32 - "0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3")) - (patches (search-patches "boost-fix-icu-build.patch")))) + "0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3")))) (build-system gnu-build-system) (inputs `(("icu4c" ,icu4c) ("zlib" ,zlib))) @@ -69,7 +69,11 @@ `(#:tests? #f #:make-flags (list "threading=multi" "link=shared" - "cxxflags=-std=c++14" + + ;; XXX: Disable installation of Boosts modular CMake config scripts + ;; which conflicts in 1.70.0 with the ones provided by CMake. + ;; See . + "--no-cmake-config" ;; Set the RUNPATH to $libdir so that the libs find each other. (string-append "linkflags=-Wl,-rpath=" @@ -125,6 +129,72 @@ across a broad spectrum of applications.") (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt" "Some components have other similar licences.")))) +;; TODO: Merge with 'Boost' in the next rebuild cycle. +(define-public boost-with-python3 + (package + (inherit boost) + (name "boost-python3") + (native-inputs + `(("perl" ,perl) + ("python" ,python) + ("tcsh" ,tcsh))) + (arguments (substitute-keyword-arguments (package-arguments boost) + ((#:phases phases) + `(modify-phases ,phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((icu (assoc-ref inputs "icu4c")) + (python (assoc-ref inputs "python")) + (out (assoc-ref outputs "out"))) + (substitute* '("libs/config/configure" + "libs/spirit/classic/phoenix/test/runtest.sh" + "tools/build/src/engine/execunix.c" + "tools/build/src/engine/Jambase" + "tools/build/src/engine/jambase.c") + (("/bin/sh") (which "sh"))) + + (setenv "SHELL" (which "sh")) + (setenv "CONFIG_SHELL" (which "sh")) + + (substitute* "tools/build/src/tools/python.jam" + (("include/python\\$\\(version\\)") + "include/python$(version)m")) + + (invoke "./bootstrap.sh" + (string-append "--prefix=" out) + ;; Auto-detection looks for dependencies only + ;; in traditional install locations. + (string-append "--with-icu=" icu) + (string-append "--with-python=" python "/bin/python3") + (string-append "--with-python-root=" python) + "--with-python-version=3.7" + "--with-toolset=gcc")))) + (replace 'provide-libboost_python + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (with-directory-excursion (string-append out "/lib") + (symlink "libboost_python37.so" "libboost_python.so") + ;; Some packages also look for libboost_python3.so + (symlink "libboost_python37.so" "libboost_python3.so")) + #t))))))))) + +(define-public boost-static + (package + (inherit boost) + (name "boost-static") + (arguments + (substitute-keyword-arguments (package-arguments boost) + ((#:make-flags flags) + `(cons "link=static" (delete "link=shared" ,flags))) + ((#:phases phases) + `(modify-phases ,phases + (replace 'provide-libboost_python + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (with-directory-excursion (string-append out "/lib") + (symlink "libboost_python27.a" "libboost_python.a")) + #t))))))))) + (define-public boost-for-mysql ;; Older version for MySQL 5.7.23. (package