From patchwork Mon Sep 2 15:33:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15236 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 22F371734D; Mon, 2 Sep 2019 16:36:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id CC83E17329 for ; Mon, 2 Sep 2019 16:36:22 +0100 (BST) Received: from localhost ([::1]:37616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oNS-0003Kq-Ah for patchwork@mira.cbaines.net; Mon, 02 Sep 2019 11:36:22 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v3 31/48] gnu: libnl: Fix cross-compilation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Sep 2019 15:35:11 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36477 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 36477@debbugs.gnu.org Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.156743848125262 (code B ref 36477); Mon, 02 Sep 2019 15:35:11 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Sep 2019 15:34:41 +0000 Received: from localhost ([127.0.0.1]:58807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLp-0006ZH-1W for submit@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:41 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:36990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLU-0006Ty-B0 for 36477@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:23 -0400 Received: by mail-wr1-f50.google.com with SMTP id z11so14454017wrt.4 for <36477@debbugs.gnu.org>; Mon, 02 Sep 2019 08:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0+GuQDDI58k33AT968scC+piSTN9/sNYcscllq3AvvI=; b=ldwGYlyrhlEpwefKrEWwfqafG7Bf/5eHElk4/dmT2GWHZRG0DCYIRguRuWpPU+2Ovb 35cNIEYS9xAzipcoldrzo1QBM0Z3eB4UZbjTTau+rp5qfl3HjnytTA97sEgHnwcpN66I Fbb2UXZ8fuxexNEtbZWn/9Y2iZCeGrYVI7WRtp0Fd6AQda1ekI2UwfeGlZ6CZ3ERdyCY j1M6DGUH/WgtIndwje4tohuaad31kIJZbSqdEACROnonLk6lKHjSbsuZpH2PHQR4dohK mI3hi4hgTekLrp9zm3p86r8tWEfvtO0WHY7bIzsS0NN3nWkHoK/4dLM/pzA4i8IMKfvg SVDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0+GuQDDI58k33AT968scC+piSTN9/sNYcscllq3AvvI=; b=l3rYM19NADds4C+Y9N2pBA/pZssH05SdYcGN4q99rnNCinwXtJR0m83Nq8IdCDh5XI cWx1EZeXYmn/ZC8GawtzHYqXVdBz2ef+vN3P8HW30RrUhpCtLrqXRtlucNbN2DTI0q1a /KgN9PoBwXnDx46e4YNiHG+4TTmJwymHVqug8OPliiT7IEVjgBFB35ZyoKHoBjJumXPH FbINEQrmc8XKFbDB2DlpTjgnLk6orezGWtPPNu5VJzsThQEJbof9vDcRxVaB7jY3+ics WXdbCeKUvfLq2f0+BGgb/wU1yhdswIzQAVsmzIt+r+/FglCJB/9PdVUGc9AgxqpphrrX RwrA== X-Gm-Message-State: APjAAAWRBf7HGmj3QAQWxpgAxWLpxsT1At206HCi9y1WET2BnbHpBghz mDHV0Hq/Zzhjl7bKT1QzMCHLrWPX X-Google-Smtp-Source: APXvYqyakYHVphvD19yg0hfFCwlMSsmQruD8VHqEScsMPTWBTju3UfdrmZBgtKaZaUfF4a2EBjon4A== X-Received: by 2002:a5d:68cd:: with SMTP id p13mr30288136wrw.18.1567438454555; Mon, 02 Sep 2019 08:34:14 -0700 (PDT) Received: from localhost.localdomain ([80.12.63.115]) by smtp.gmail.com with ESMTPSA id b26sm17232265wmj.14.2019.09.02.08.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:34:14 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:33:16 +0200 Message-Id: <20190902153333.11190-32-m.othacehe@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-1-m.othacehe@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre-Moana Levesque Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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")