From patchwork Wed Oct 2 09:58:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15570 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 7631C1749F; Wed, 2 Oct 2019 11:01:49 +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 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 29D3E1749D for ; Wed, 2 Oct 2019 11:01:49 +0100 (BST) Received: from localhost ([::1]:53166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbS8-0004xZ-Ep for patchwork@mira.cbaines.net; Wed, 02 Oct 2019 06:01:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51236) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbQi-0003v8-0z for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFbQc-0000BK-Bm for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:19 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54924) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFbQc-0000BD-7s for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:14 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFbQc-0000aZ-4Q for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:14 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v4 15/23] gnu: libnl: Move python outputs to separate packages. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Oct 2019 10:00:14 +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 Cc: Mathieu Othacehe Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.15700103911948 (code B ref 36477); Wed, 02 Oct 2019 10:00:14 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Oct 2019 09:59:51 +0000 Received: from localhost ([127.0.0.1]:35473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbQC-0000V7-BU for submit@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:48 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:51815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbQA-0000TZ-03 for 36477@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:47 -0400 Received: by mail-wm1-f54.google.com with SMTP id 7so6492551wme.1 for <36477@debbugs.gnu.org>; Wed, 02 Oct 2019 02:59:45 -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=bMZVx5p0lHmdJ0EPD5SDFt3TVr+vXSj9rkCXvPV1yGc=; b=PmhWya3N0X87//IIE7Kg/4neDOjybwCcQDoAVbc3fuAU39MPR9endGGDCJdQ/n6W82 1SWI0InXMBlDlhBIxgtxSuXNb6mujH90/OdQW/t1NmlcLXL7rae5hTGtKKUKhJRf7R+2 DSw6C3zzSGoYcDXi04Bb3VZOkRSJws5F8XJPs4PYkkGmuMQaolD1crneaDZFou76Eqdq zBYPhTtEo2yNilDtCzorhgJg0bmq9czRB9cr3HeQdnfzaU16YpBdcj9Em818EogAZSoi LSGuwnXUFKwwtl7elPRrYfogk18v1cyYtQKCwR+fBqAvQIyKzQ+exgfloOR58ExTJjFb gQyg== 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=bMZVx5p0lHmdJ0EPD5SDFt3TVr+vXSj9rkCXvPV1yGc=; b=d+7aFNoQmQiX3zsWba8pUaEy7i/Wuirx26jtrej1le42Qfsu91vJbx7/cPxTB5Vp69 pG07mlvG7kRUwR8pFhlqSroaP8OdO5Y/qYdeK+jBYngvep+NzKWwCm2jy5v0bmTYrYNx Ej8ZahkzZ/wEUXjARlNHqeBUFeIHR0K9OC0W0ln0GiZxUCoj5hn1GyPnsE+EqvJr+r9w l3HPJWMujGy7yQ89NLh+TQjlnhmOvFRznjeU7OJSL6YRUI3Ld4iXQORNiIltSljksEcM ByW8j6MVajF/1PXHmx/rMTzcVTTp6JWRR5QklBcEROxLQVlnKVdzYXWAz+Ttj3PMH1pu BM6Q== X-Gm-Message-State: APjAAAVFEDRnEX0nFYp3zmfIYPuDXKLo+M3HdUjiDu+lsluFiUuSv5be qj6XIkHHoGHhsX8abVxaUckdZiOX X-Google-Smtp-Source: APXvYqyvr08FuyB6/YN6GMR/cymk4lhli0vlwMLeEhRQemRmM/V7w6JBIqbUd/1fTWagmDAiLBa0Tg== X-Received: by 2002:a1c:3b06:: with SMTP id i6mr2161128wma.6.1570010379913; Wed, 02 Oct 2019 02:59:39 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:fa:a50:21e:67ff:fe5b:4283]) by smtp.gmail.com with ESMTPSA id w12sm29621318wrg.47.2019.10.02.02.59.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 02:59:39 -0700 (PDT) From: Mathieu Othacehe Date: Wed, 2 Oct 2019 11:58:56 +0200 Message-Id: <20191002095904.6325-16-m.othacehe@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191002095904.6325-1-m.othacehe@gmail.com> References: <20191002095904.6325-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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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")