From be296d145dbe712e9b84bf80bcefeb8e24418662 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Sun, 8 Dec 2019 21:47:51 +0100 Subject: [PATCH 1/2] gnu: boost-with-python3: Parameterize python version. * gnu/packages/boost.scm (boost-with-python3): [arguments]: Parameterize python version. --- gnu/packages/boost.scm | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index 0a2a5c5c01..f436d5b688 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -139,13 +139,21 @@ across a broad spectrum of applications.") ("python" ,python) ("tcsh" ,tcsh))) (arguments (substitute-keyword-arguments (package-arguments boost) + ((#:imported-modules _ '()) + `((guix build python-build-system) + ,@%gnu-build-system-modules)) + ((#:modules _ '()) + '((guix build gnu-build-system) + ((guix build python-build-system) #:prefix python:) + (guix build utils))) ((#: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"))) + (let* ((icu (assoc-ref inputs "icu4c")) + (python (assoc-ref inputs "python")) + (python-version (python:python-version python)) + (out (assoc-ref outputs "out"))) (substitute* '("libs/config/configure" "libs/spirit/classic/phoenix/test/runtest.sh" "tools/build/src/engine/execunix.c" @@ -167,15 +175,22 @@ across a broad spectrum of applications.") (string-append "--with-icu=" icu) (string-append "--with-python=" python "/bin/python3") (string-append "--with-python-root=" python) - "--with-python-version=3.7" + (string-append "--with-python-version=" python-version) "--with-toolset=gcc")))) (replace 'provide-libboost_python - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (python (assoc-ref inputs "python")) + (python-version (python:python-version python)) + (libboost.so + (string-append "libboost_python" + (string-join + (string-split python-version #\.) "") + ".so"))) (with-directory-excursion (string-append out "/lib") - (symlink "libboost_python37.so" "libboost_python.so") + (symlink libboost.so "libboost_python.so") ;; Some packages also look for libboost_python3.so - (symlink "libboost_python37.so" "libboost_python3.so")) + (symlink libboost.so "libboost_python3.so")) #t))))))))) (define-public boost-static -- 2.24.0