From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:42718) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oMK-0002Jt-RT for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4oMJ-0004ct-AU for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50039) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4oMJ-0004cV-7r for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:11 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4oMJ-0006eI-4u for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:11 -0400 Subject: [bug#36477] [PATCH v3 31/48] gnu: libnl: Fix cross-compilation. Resent-Message-ID: From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:33:16 +0200 Message-Id: <20190902153333.11190-32-m.othacehe@gmail.com> In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-1-m.othacehe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36477@debbugs.gnu.org Cc: Pierre-Moana Levesque From: Pierre-Moana Levesque * gnu/packages/linux.scm (libnl)[inputs]: Add python-2 and python-3 unless cross-compiling, [outputs]: disable python2 and python3 outputs when cross-compiling, [arguments]: Disable install-python phase when cross-compiling. In install-doc phase, search libnl3-doc in both inputs and native-inputs. --- gnu/packages/linux.scm | 49 +++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 874fa819e5..9c38bbcfc0 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -36,6 +36,7 @@ ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2019 Stefan Stefanović ;;; Copyright © 2019 Pierre Langlois +;;; Copyright © 2019 Pierre-Moana Levesque ;;; ;;; This file is part of GNU Guix. ;;; @@ -1949,36 +1950,44 @@ transparently through a bridge.") (string-join (string-split version #\.) "_") "/libnl-doc-" version ".tar.gz")) (sha256 - (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx")))))) - (inputs - `(("python-2" ,python-2) - ("python-3" ,python-3))) - (outputs '("out" "doc" "python2" "python3")) + (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx")))) + ,@(if (%current-target-system) + '() + '(("python-2" ,python-2) + ("python-3" ,python-3))))) + (outputs `("out" "doc" + ,@(if (%current-target-system) + '() + '("python2" "python3")))) (arguments `(#:modules ((guix build gnu-build-system) (guix build utils) (srfi srfi-1)) #: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)) + ,@(if (%current-target-system) + '() + ;; Cross building Python extensions is not supported. + '((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 native-inputs 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") -- 2.20.1