>From e64186082735f533bf172fcad491eaabed2928f0 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Wed, 2 Aug 2017 13:39:28 +0100 Subject: [PATCH 4/4] gnu: libnl: Add "python2" and "python3" outputs. * gnu/packages/linux.scm (libnl)[native-inputs]: Extend. [outputs]: Add python2, python3. [install-python]: New phase. --- gnu/packages/linux.scm | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 3902560a8..dd9c34999 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -101,6 +101,7 @@ #:use-module (gnu packages xorg) #:use-module (gnu packages groff) #:use-module (gnu packages selinux) + #:use-module (gnu packages swig) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system python) @@ -1464,7 +1465,12 @@ transparently through a bridge.") "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h")))) (build-system gnu-build-system) (native-inputs - `(("flex" ,flex) ("bison" ,bison) + `(("flex" ,flex) + ("bison" ,bison) + ("python-2" ,python-2) + ("python-3" ,python-3) + ("swig" ,swig) + ("pkg-config" ,pkg-config) ("libnl3-doc" ,(origin (method url-fetch) @@ -1474,10 +1480,27 @@ transparently through a bridge.") "/libnl-doc-" version ".tar.gz")) (sha256 (base32 "0srab805yj8wb13l64qjyp3mdbqapxg5vk46v3zlhhzpmxqw8j7r")))))) - (outputs '("out" "doc")) + (outputs '("out" "doc" "python2" "python3")) (arguments `(#:phases (modify-phases %standard-phases + (add-after 'install 'install-python + (lambda* (#:key outputs #:allow-other-keys) + (define (python-inst python) + (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib" + (assoc-ref %outputs "out"))) + (pyout (assoc-ref %outputs python))) + (and + ;; The rpm spec quoth "build twice, otherwise capi.py is + ;; not copied to the build directory" + (zero? (system (format #f "~a ~a setup.py build" + ldflags python pyout))) + (zero? + (system (format #f "~a ~a setup.py install --prefix=~a" + ldflags python pyout))) + (zero? (system* python "setup.py" "clean"))))) + (with-directory-excursion "./python" + (for-each python-inst '("python2" "python3"))))) (add-after 'install 'install-doc (lambda* (#:key inputs outputs #:allow-other-keys) (let ((dest (format #f "~a/share/doc" -- 2.11.0