From a3bd281a1103584a4f4a0836ae90563c19f7585f Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sun, 3 May 2026 23:44:26 +0200 Subject: gnu: libnl-python-package: Fix build on Python@3.12. * gnu/packages/linux.scm (libnl-python-package) [inputs]: Improve style, drop input labels. For python@3, replace python-3 by python-wrapper, and add python-setuptools. [arguments]: Rewrite them in a modern style, don't change the logic. Change-Id: Id87cfdcc2afdd299b46fc47f53c59bd0f75e7125 Signed-off-by: Sharlatan Hellseher --- gnu/packages/linux.scm | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 40ad7ee1b7..0b924eb469 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4843,32 +4843,32 @@ configuration and monitoring interfaces.") (package (inherit libnl) (name name) - (inputs `(,@(cond - ((string=? python "python2") - `(("python-2" ,python-2))) - ((string=? python "python3") - `(("python-3" ,python-3)))) - ("libxcrypt" ,libxcrypt))) ;required by Python.h + (inputs + (append (cond + ((string=? python "python2") + (list python-2)) + ((string=? python "python3") + (list python-setuptools python-wrapper))) + (list libxcrypt))) ;required by Python.h (propagated-inputs (list libnl)) (outputs '("out")) (arguments - `(#:modules ((guix build gnu-build-system) + (list + #: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)))))))) + #:phases + #~(modify-phases %standard-phases + (replace 'install + (lambda* (#:key inputs #:allow-other-keys) + (let ((libnl (search-input-directory inputs "lib/libnl"))) + (setenv "LDFLAGS" + (string-append "-Wl,-rpath=" (dirname libnl)))) + (with-directory-excursion "./python" + (invoke "python" "setup.py" "build") + (invoke "python" "setup.py" "install" + (string-append "--prefix=" #$output)) + (invoke "python" "setup.py" "clean")))))))))) (define-public libnl-python3 (libnl-python-package "python3")) -- cgit v1.3