[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36477] [PATCH v4 15/23] gnu: libnl: Move python outputs to separate
From: |
Mathieu Othacehe |
Subject: |
[bug#36477] [PATCH v4 15/23] gnu: libnl: Move python outputs to separate packages. |
Date: |
Wed, 2 Oct 2019 11:58:56 +0200 |
Cross compiling python extensions is currently broken. To allow libnl
cross compilation, move its python2 and python3 outputs to separate
packages.
* gnu/packages/linux.scm (libnl)[outputs]: Remove python2 and python3
and replace by ...
(libnl-python-package): ... this new procedure,
(libnl-python2, libnl-python3): new variables.
---
gnu/packages/linux.scm | 66 +++++++++++++++++++++++++++---------------
1 file changed, 43 insertions(+), 23 deletions(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c40072a706..8ba3c7d9db 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1953,35 +1953,18 @@ transparently through a bridge.")
"/libnl-doc-" version ".tar.gz"))
(sha256
(base32
"19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
- (inputs
- `(("python-2" ,python-2)
- ("python-3" ,python-3)))
- (outputs '("out" "doc" "python2" "python3"))
+ (outputs `("out" "doc"))
(arguments
- `(#:modules ((guix build gnu-build-system)
- (guix build utils)
- (srfi srfi-1))
- #:phases
+ `(#:phases
(modify-phases %standard-phases
- (add-after 'install 'install-python
- (lambda* (#:key outputs #:allow-other-keys)
- (define (python-inst python)
- (invoke python "setup.py" "build")
- (invoke python "setup.py" "install"
- (string-append "--prefix="
- (assoc-ref %outputs python)))
- (invoke python "setup.py" "clean"))
- (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
- (assoc-ref %outputs "out")))
- (with-directory-excursion "./python"
- (for-each python-inst '("python2" "python3")))
- #t))
(add-after 'install 'install-doc
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
(let ((dest (string-append (assoc-ref outputs "doc")
"/share/doc/libnl")))
(mkdir-p dest)
- (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
+ (invoke "tar" "xf" (assoc-ref
+ (or native-inputs inputs)
+ "libnl3-doc")
"--strip-components=1" "-C" dest)))))))
(home-page "https://www.infradead.org/~tgr/libnl/";)
(synopsis "NetLink protocol library suite")
@@ -1996,6 +1979,43 @@ configuration and monitoring interfaces.")
;; 'nl-addr-add.c'), so the result is GPLv2-only.
(license license:gpl2)))
+;; libnl python extensions used to be outputs of libnl. However, as
+;; cross-compiling python extensions is currently broken, create separate
+;; packages for libnl python extensions.
+(define (libnl-python-package python)
+ (let ((name (string-append "libnl-" python)))
+ (package
+ (inherit libnl)
+ (name name)
+ (inputs `(,@(cond
+ ((string=? python "python2")
+ `(("python-2" ,python-2)))
+ ((string=? python "python3")
+ `(("python-3" ,python-3))))))
+ (propagated-inputs `(("libnl" ,libnl)))
+ (outputs '("out"))
+ (arguments
+ `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (define (python-inst python)
+ (invoke python "setup.py" "build")
+ (invoke python "setup.py" "install"
+ (string-append "--prefix="
+ (assoc-ref %outputs "out")))
+ (invoke python "setup.py" "clean"))
+ (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
+ (assoc-ref inputs "libnl")))
+ (with-directory-excursion "./python" (python-inst ,python))
+ #t))))))))
+
+(define-public libnl-python2 (libnl-python-package "python2"))
+(define-public libnl-python3 (libnl-python-package "python3"))
+
(define-public iw
(package
(name "iw")
--
2.23.0
- [bug#36477] [PATCH v4 18/23] gexp: Use cross extensions when cross-compiling., (continued)
- [bug#36477] [PATCH v4 17/23] gnu: cmake: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 14/23] gnu: guile-sqlite3: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 19/23] utils: Use target-aarch64? and target-arm? helpers., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 12/23] gnu: doxygen: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 20/23] build: vm: Fix arm32 support., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 21/23] system: vm: Add arm64 support., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 15/23] gnu: libnl: Move python outputs to separate packages.,
Mathieu Othacehe <=
- [bug#36477] [PATCH v4 22/23] system: vm: Support cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 23/23] scripts: system: Add --target option., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 00/23] System cross-compilation, Mathieu Othacehe, 2019/10/18