From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59220) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0MQY-0008FD-Dw for guix-patches@gnu.org; Wed, 21 Aug 2019 04:57:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0MQW-0005uj-GV for guix-patches@gnu.org; Wed, 21 Aug 2019 04:57:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0MQV-0005t7-Ml for guix-patches@gnu.org; Wed, 21 Aug 2019 04:57:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0MQV-0006hc-LG for guix-patches@gnu.org; Wed, 21 Aug 2019 04:57:07 -0400 Subject: [bug#36477] [PATCH v2 46/61] gnu: libnl: Fix cross-compilation. Resent-Message-ID: From: Mathieu Othacehe Date: Wed, 21 Aug 2019 10:54:40 +0200 Message-Id: <20190821085455.18508-46-m.othacehe@gmail.com> In-Reply-To: <20190821085455.18508-1-m.othacehe@gmail.com> References: <20190821085455.18508-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)[native-inputs]: Add python-2 and python-3, [arguments]: In install-python phase, use the cross-compiler and linker to build extensions. In install-doc phase, search libnl3-doc in both inputs and native-inputs. --- gnu/packages/linux.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index cf403c46f1..7503e47805 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. ;;; @@ -1941,6 +1942,8 @@ transparently through a bridge.") ("flex" ,flex) ("pkg-config" ,pkg-config) ("swig" ,swig) + ("python-2" ,python-2) + ("python-3" ,python-3) ("libnl3-doc" ,(origin (method url-fetch) @@ -1961,24 +1964,27 @@ transparently through a bridge.") #:phases (modify-phases %standard-phases (add-after 'install 'install-python - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key target 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")) + (when target + (setenv "CC" (string-append target "-gcc")) + (setenv "LDSHARED" (string-append target "-gcc -shared"))) (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.17.1