From patchwork Sun Jul 11 11:47:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31281 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 071AA27BC85; Sun, 11 Jul 2021 12:49:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0C33827BC81 for ; Sun, 11 Jul 2021 12:49:13 +0100 (BST) Received: from localhost ([::1]:49260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxP-000420-V5 for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxH-00041S-70 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxG-0008HD-Vq for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxG-00073h-Vl for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 01/20] utils: Define target-linux? predicate. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409126935 (code B ref 49025); Sun, 11 Jul 2021 11:49:02 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:11 +0000 Received: from localhost ([127.0.0.1]:34028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwK-0006zN-RP for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:11 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwG-0006xg-Q4 for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:02 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no0qv; Sun, 11 Jul 2021 13:48:00 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:04 +0200 Message-Id: <20210711114723.27568-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004080; bh=KuxsCFQnj4ZbArXRFEqUpWBp+xjAPFA4gW0yO+6p0Uk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jj7lYcNn1kDwmugZC6ybH1uLrzaQ5JNVDst8WsVEFIXv3aBZO/lCGpeE/2Bjq1TY/ WS5JnRyJkDiYl+MCg1Vs5myGcSzmL2t0OLm8mp0OsSBjJpL82NkVraVdD25pwYJCto d4WK9Jz338H2S8bkUqHM2cMEQJwHoXelmbk/4YlbIApYrEljBJGDq/iEAqNSkm939y yATiNp/+BplA4DUt/yWTyFJqCODBra2nSLgRZD9BEmkJikQUOSmO3JKOrQF1lcG4Rm nrJGYVihweC+J+SwkAqV15hPa9kWMptWnv232ev0xUFzFWyx5/2kN6eU302WEZ6M2B NiyAbQgMQELow== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * guix/utils.scm (target-linux?): New predicate. * tests/utils.scm ("target-linux?"): Test it. ("target-mingw?"): Also test ‘target-mingw?’. --- guix/utils.scm | 6 ++++++ tests/utils.scm | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index 19990ceb8a..4ff2602e23 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Maxim Cournoyer ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Chris Marusich +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -81,6 +82,7 @@ %current-system %current-target-system package-name->name+version + target-linux? target-mingw? target-arm32? target-aarch64? @@ -543,6 +545,10 @@ a character other than '@'." (idx (values (substring spec 0 idx) (substring spec (1+ idx)))))) +(define* (target-linux? #:optional (target (or (%current-target-system) + (%current-system)))) + (string-contains target "linux")) + (define* (target-mingw? #:optional (target (%current-target-system))) (and target (string-suffix? "-mingw32" target))) diff --git a/tests/utils.scm b/tests/utils.scm index 7fcbb25552..80a0e669a4 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2016 Mathieu Lirzin ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -289,6 +290,22 @@ skip these tests." (string-closest "hello" '("kikoo" "helo" "hihihi" "halo")) (string-closest "hello" '("aaaaa" "12345" "hellohello" "h")))) +(test-equal "target-linux?" + '(#t #f #f #t) + (map (compose ->bool target-linux?) + '("i686-linux-gnu" "i686-w64-mingw32" + ;; Checking that "gnu" is present is not sufficient, + ;; as GNU/Hurd exists. + "i686-pc-gnu" + ;; Some targets have a suffix. + "arm-linux-gnueabihf"))) + +(test-equal "target-mingw?" + '(#f #f #t) + (map (compose ->bool target-mingw?) + '("i686-linux-gnu" "i686-pc-gnu" + "i686-w64-mingw32"))) + (test-end) (false-if-exception (delete-file temp-file)) From patchwork Sun Jul 11 11:47:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31282 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 86DB827BC81; Sun, 11 Jul 2021 12:49:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 190AE27BC83 for ; Sun, 11 Jul 2021 12:49:13 +0100 (BST) Received: from localhost ([::1]:49262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxQ-000423-12 for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxG-00041K-QP for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxG-0008H6-Ig for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxG-00073a-IR for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 02/20] utils: Define a target-x86-32? and target-x86-64? predicate. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600408526874 (code B ref 49025); Sun, 11 Jul 2021 11:49:02 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:05 +0000 Received: from localhost ([127.0.0.1]:34022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwK-0006z6-2t for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:04 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwH-0006y4-HA for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:02 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no0r2; Sun, 11 Jul 2021 13:48:00 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:05 +0200 Message-Id: <20210711114723.27568-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004080; bh=lf5YV93HuGoFIHD1h6x01QuYB2H0sCsCvf+MhMqf3Ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OEYLruNOj0JR9cguKaPzvCYBvZ6fMewVwuBF/wVADMAClkMJNhO2iSFJ3Oi4gIl8Z T+oaxcBG3p5w+eTgXKUj8b/F3sUj2xL8690ZdhOiDu+5+BsHGxiVCGXZ2DHTWYcLsF XnEE0FdqrYiM1h1DkD7bJrS/qrpIjZ1I6417FW57S5lo3Lfp7cBYHUbyqKBmkhiNk/ lTUvbqjIJN67OXesIsVdLzRmRKO0evnvLa8WF4gMysnec/SvQXOo9+lqqpc6Qsi3XU ASj/7ejFgKNtZ8K5g1OjdmMBWDY4ZtS/LVC9u2e/QYlP0P2MD77beSexBvCRBuDf2g ZpJQVpfP9vGhw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * guix/utils.scm (target-x86-32?, target-x86-64?): New predicates. * tests/utils.scm ("target-x86-32?", "target-x86-64?"): New tests. --- guix/utils.scm | 20 ++++++++++++++++++++ tests/utils.scm | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index 4ff2602e23..2256ea2ca6 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -84,6 +84,8 @@ package-name->name+version target-linux? target-mingw? + target-x86-32? + target-x86-64? target-arm32? target-aarch64? target-arm? @@ -553,6 +555,24 @@ a character other than '@'." (and target (string-suffix? "-mingw32" target))) +(define* (target-x86-32? #:optional (target (or (%current-target-system) + (%current-system)))) + "Is the architecture of TARGET a variant of Intel's 32-bit architecture +(IA32)?" + ;; Intel also has a 16-bit architecture in the iN86 series, i286 + ;; (see, e.g. https://en.wikipedia.org/wiki/Intel/808286) so this + ;; procedure is not named target-x86?. + (or (string-prefix? "i386-" target) + (string-prefix? "i486-" target) + (string-prefix? "i586-" target) + (string-prefix? "i686-" target))) + +(define* (target-x86-64? #:optional (target (or (%current-target-system) + (%current-system)))) + "Is the architecture of TARGET a variant of Intel/AMD's 64-bit +architecture (x86_64)?" + (string-prefix? "x86_64-" target)) + (define* (target-arm32? #:optional (target (or (%current-target-system) (%current-system)))) (string-prefix? "arm" target)) diff --git a/tests/utils.scm b/tests/utils.scm index 80a0e669a4..92439b5587 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -306,6 +306,29 @@ skip these tests." '("i686-linux-gnu" "i686-pc-gnu" "i686-w64-mingw32"))) +(test-equal "target-x86-32?" + '(#f #f #f #t #t #t #t #f) + ;; These are (according to Wikipedia) two RISC architectures + ;; by Intel and presumably not compatible with the x86-32 series. + (map target-x86-32? + '("i860-gnu" "i960-gnu" + ;; This is a 16-bit architecture + "i286-gnu" + ;; These are part of the x86-32 series. + "i386-gnu" "i486-gnu" "i586-gnu" "i686-gnu" + ;; Maybe this one will exist some day, but not yet. + "i786-gnu"))) + +(test-equal "target-x86-64?" + '(#t #f #f #f) + (map target-x86-64? + `("x86_64-linux-gnu" "i386-linux-gnu" + ;; Just because it includes "64" doesn't make it 64-bit. + "aarch64-linux-gnu" + ;; Note that (expt 2 109) in decimal notation starts with 64. + ;; However, it isn't 32-bit. + ,(format #f "x86_~a-linux-gnu" (expt 2 109))))) + (test-end) (false-if-exception (delete-file temp-file)) From patchwork Sun Jul 11 11:47:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31283 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 D77CE27BC81; Sun, 11 Jul 2021 12:49:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9B7AB27BC84 for ; Sun, 11 Jul 2021 12:49:13 +0100 (BST) Received: from localhost ([::1]:49282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxQ-000431-Mi for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxH-00041a-Jt for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxH-0008HL-Br for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxH-00073p-Bh for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 03/20] packages: Define this-package-input and this-package-native-input. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409226944 (code B ref 49025); Sun, 11 Jul 2021 11:49:03 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:12 +0000 Received: from localhost ([127.0.0.1]:34048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwR-00070O-Kx for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:12 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwH-0006y5-U1 for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:02 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no0r9; Sun, 11 Jul 2021 13:48:01 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:06 +0200 Message-Id: <20210711114723.27568-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004081; bh=+F3V0IHIUMToVYJ2+Q+SGOqXx5CD1I8U9LvkAPCAvXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FDowmsgA55Tjl5zgh+vaig9kgxjtJIcN3xGFoo41K2rYknEvLeFTW9GBimVeSCKWS tegTmR9R1W1mw52Oh3rgkjVnFYeofWi7CirRa7ueFDsGuN6QMDkY9gezjcnJlYkl4f PPuYsAqXik97+9O7yFB81horckZ1MmCK/Dw+/pNAsj4tE3Ths/Qwr9+POYTyU1buCy Eu7kFI79YjFozj2TasLrIKKETzMBpQLeNRGcs99uWl0bhytBvesAEhK8GAlrbMxSDT GYdVTkZakRMloPP+c8sbhWyvv/7m/LKh2lM9fYiX8ESE6dfHKQ1ikHQ1IhabOQcq6C RC9RXLQD6Owbg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 These macros are intended to be used in build phases. More precisely, (assoc-ref %build-inputs "input") can be replaced by #$(this-package-input "input") or #+(this-package-native-input "native-input") as appropriate. * guix/packages.scm (package-input, package-native-input): New (unexported) procedures. (this-package-input, this-package-native-input): New macros. --- guix/packages.scm | 29 +++++++++++++++++++++++++++++ tests/packages.scm | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/guix/packages.scm b/guix/packages.scm index 3ba61b42c9..56300e6b61 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -108,6 +108,9 @@ deprecated-package package-field-location + this-package-input + this-package-native-input + package-direct-sources package-transitive-sources package-direct-inputs @@ -513,6 +516,32 @@ object." #f))) (_ #f))) +(define (package-input package name) + "Return the package input NAME of PACKAGE--i.e., an input +from the ‘inputs’ or ‘propagated-inputs’ field. Native inputs are not +considered. If this input does not exist, return #f instead." + (and=> (or (assoc-ref (package-inputs package) name) + (assoc-ref (package-propagated-inputs package) name)) + car)) + +(define (package-native-input package name) + "Return the native package input NAME of PACKAGE--i.e., an input +from the ‘native-inputs’ field. If this native input does not exist, +return #f instead." + (and=> (assoc-ref (package-native-inputs package) name) + car)) + +(define-syntax-rule (this-package-input name) + "Return the input NAME of the package being defined--i.e., an input +from the ‘inputs’ or ‘propagated-inputs’ field. Native inputs are not +considered. If this input does not exist, return #f instead." + (package-input this-package name)) + +(define-syntax-rule (this-package-native-input name) + "Return the native package input NAME of the package being defined--i.e., +an input from the ‘native-inputs’ field. If this native input does not +exist, return #f instead." + (package-native-input this-package name)) ;; Error conditions. diff --git a/tests/packages.scm b/tests/packages.scm index 47fc34d3ce..9814015a05 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -1866,6 +1867,39 @@ (package-location (specification->package "guile@2")) (specification->location "guile@2")) +(test-eq "this-package-input, exists" + hello + (package-arguments + (dummy-package "a" + (inputs `(("hello" ,hello))) + (arguments (this-package-input "hello"))))) + +(test-eq "this-package-input, exists in propagated-inputs" + hello + (package-arguments + (dummy-package "a" + (propagated-inputs `(("hello" ,hello))) + (arguments (this-package-input "hello"))))) + +(test-eq "this-package-input, does not exist" + #f + (package-arguments + (dummy-package "a" + (arguments (this-package-input "hello"))))) + +(test-eq "this-package-native-input, exists" + hello + (package-arguments + (dummy-package "a" + (native-inputs `(("hello" ,hello))) + (arguments (this-package-native-input "hello"))))) + +(test-eq "this-package-native-input, does not exists" + #f + (package-arguments + (dummy-package "a" + (arguments (this-package-native-input "hello"))))) + (test-end "packages") ;;; Local Variables: From patchwork Sun Jul 11 11:47:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31285 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 5A11227BC84; Sun, 11 Jul 2021 12:49:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1CDA227BC81 for ; Sun, 11 Jul 2021 12:49:21 +0100 (BST) Received: from localhost ([::1]:50028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxY-0004bk-4x for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxH-00041i-Vd for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxH-0008I1-OD for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxH-00073w-O2 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 04/20] net-base: Don't cross-compile. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409226951 (code B ref 49025); Sun, 11 Jul 2021 11:49:03 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:12 +0000 Received: from localhost ([127.0.0.1]:34050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwS-00070X-5n for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:12 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwI-0006yC-9P for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:03 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no1rE; Sun, 11 Jul 2021 13:48:01 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:07 +0200 Message-Id: <20210711114723.27568-5-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004081; bh=dXo/CT5ws9YCjb4KyPL/cL4A6QUuDtlcTxOVUdW0BV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GeaQknRVy7huMHYXUhVMK+MO0Vxjl3BdkzkTFrko1S+DZB0EJAUXRGcz47ZaDHsXc xWIty8m/W/L7CdFkUDUa/pCDQgXFQfGzk1bzkeTM+stP1I+q28RnhR9WrGcc6bueMD vBeX8p8Vo6o7eVZqS9huXeu9VXXx2jDEf5+LRLn60slFLZxns4a4uN2jkSIQP2JpXF 1602FpUUII87iPsBex4U2Zx6lR1to7NfHzp6RCcCQI5+RPus0zP+XORPrQGnmvfPup Vrji6p7Oe1rHGjQ5x/6EKQ7jrRGdmsXBz1cBg2e9FJjoGquyFj7JRN89qzjJhx48WP OA36m5ikvqMKg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 net-base is pure data, so cross-compiling is pointless. * gnu/packages/admin.scm (net-base)[arguments]<#:target>: Set to #f. (net-base)[arguments]<#:allowed-references>: Disallow all references. --- gnu/packages/admin.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index aab62331a3..394575ffec 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -937,6 +937,11 @@ to allow automatic login and starting any app.") (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) + ;; This package consists solely of architecture-independent + ;; tables. Cross-compilation is pointless! Make sure we'll + ;; always get the same derivation. + #:target #f + #:allowed-references () #:builder (begin (use-modules (guix build utils) (srfi srfi-26)) From patchwork Sun Jul 11 11:47:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31287 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 77F3027BC83; Sun, 11 Jul 2021 12:49:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0D80027BC81 for ; Sun, 11 Jul 2021 12:49:22 +0100 (BST) Received: from localhost ([::1]:50084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxZ-0004eH-3B for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxI-00041y-Os for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxI-0008Im-Hs for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxI-00074B-Hv for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 05/20] tzdata: Don't bother with cross-compiling. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409326966 (code B ref 49025); Sun, 11 Jul 2021 11:49:04 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:13 +0000 Received: from localhost ([127.0.0.1]:34054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwS-00070l-Sp for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:13 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwI-0006yM-Kg for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:03 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no1rL; Sun, 11 Jul 2021 13:48:01 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:08 +0200 Message-Id: <20210711114723.27568-6-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004081; bh=Cmu09yDer4DaeEBMYUMihlI6CWPn3E1bzKVUj0Wn+SU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gIYKK847T5SKgGEOPgOtT3XeFpHbqyTp74Ef8t4QtsaA6dlfIsBi43QLtRAV1pIgh ckEthmMV20Mw8Bkf40JYr5UlzcRy4gO32y8g/SPLDsleI7rpSTg2dPepsLcLm+GSg7 Nmracu0ntp2FJPSPxjx2Wv+QK58qUqJzOAtBA2fn52iMzmTjNS9qgdUfuRlhxfg4of Sa2P+wKMU2/P7JPy96JGn3+b5Kz1zOd8v36PUlaJ1eTcsV2skPXJ7X4E7C77rZZqBw LAuQIW3zh9jZVk8i933h2iBHhpiDJfhNV5mTgtU/mgJqmL+QVKkz0R9nruj/bptlNP HpWkfgH3vfjRA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 The time zone database is architecture-independent, so trying to cross-compile it is pointless! * gnu/packages/base.scm (tzdata)[arguments]<#:target>: Set to #f. (tzdata)[allowed-references]: Only include the "out" output itself, to make sure no (architecture-dependent) binaries are installed. --- gnu/packages/base.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 565d2ccab8..88e4ec09a6 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2020 Vitaliy Shatrov ;;; Copyright © 2020 Chris Marusich ;;; Copyright © 2021 Leo Le Bouter +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -1257,6 +1258,14 @@ command.") (build-system gnu-build-system) (arguments `(#:tests? #f + ;; This consists purely of (architecture-independent) data, + ;; so ‘cross-compilation’ is pointless here! + ;; (The binaries zic, dump, and tzselect are deleted in the post-install + ;; phase.) + #:target #f + ;; share/zoneinfo/posix is a symlink to share/zoneinfo, + ;; so include the package itself in #:allowed-references. + #:allowed-references ("out") #:make-flags (let ((out (assoc-ref %outputs "out")) (tmp (getenv "TMPDIR"))) (list (string-append "TOPDIR=" out) From patchwork Sun Jul 11 11:47:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31286 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 918FC27BC81; Sun, 11 Jul 2021 12:49:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2D75127BC83 for ; Sun, 11 Jul 2021 12:49:21 +0100 (BST) Received: from localhost ([::1]:50030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxY-0004bn-6I for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxI-00041q-CG for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxI-0008Id-4j for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxI-000743-4g for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 06/20] libgpg-error: Remove trailing #f from phases. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409326958 (code B ref 49025); Sun, 11 Jul 2021 11:49:04 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:13 +0000 Received: from localhost ([127.0.0.1]:34052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwS-00070e-Gb for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:12 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwI-0006y4-Lw for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:03 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no2rW; Sun, 11 Jul 2021 13:48:02 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:09 +0200 Message-Id: <20210711114723.27568-7-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004082; bh=rN441zyK8WHq8KGxpb4NN+FKMHbVY0resArbEcsKgRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KjQyXuctqyI13BwD7hPL9ZX4852AhoO7zwQ+33dVF7X33FzYZBAJQX7dP7erRMwl/ TlM/CPx265Lx833iYWczUNw4JUw0tpUgnRT1PDqKf0PPXd4A4o3+7Gc0fKJ4AqLuFo npZ9uIHNRMW/7siWXZnHxsZG2UM8mY2p2B2SBBDY1uACI+YXlEBgsb5BAwGDiWTikM jZEh4l/X3/7toLTpPMl0tQFLpwe5zdm1r6DUkRutOEJ3fuhKXvWKZniPIlClEVRGMT dBqCObUZIaa7ubSEcf9DnCFTqnTXYASAwvO1QQF8/i4e6i0OouLd8OF48EsA60YKfp zylMWvIiKVozw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 These aren't required anymore. * gnu/packages/gnupg.scm (libgpgerror)[arguments]{cross-symlinks}: Remove trailing #f. --- gnu/packages/gnupg.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index a6ec75765c..5c0d03927e 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -114,8 +114,7 @@ (string-append x "-unknown-linux-gnu"))))) (symlink (string-append "lock-obj-pub." triplet ".h") - "src/syscfg/lock-obj-pub.linux-gnu.h")) - #t)))) + "src/syscfg/lock-obj-pub.linux-gnu.h")))))) '())) (native-inputs `(("gettext" ,gettext-minimal))) (home-page "https://gnupg.org") From patchwork Sun Jul 11 11:47:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31290 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 18BA527BC83; Sun, 11 Jul 2021 12:49:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5122D27BC81 for ; Sun, 11 Jul 2021 12:49:29 +0100 (BST) Received: from localhost ([::1]:50878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxg-0005Au-CG for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxJ-00042a-7n for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxI-0008Is-WC for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxJ-00074I-0B for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 07/20] libgpg-error: Prevent silent miscompilation some systems. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409326973 (code B ref 49025); Sun, 11 Jul 2021 11:49:04 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:13 +0000 Received: from localhost ([127.0.0.1]:34056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwT-00070t-9l for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:13 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwJ-0006xg-21 for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:04 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no2rb; Sun, 11 Jul 2021 13:48:02 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:10 +0200 Message-Id: <20210711114723.27568-8-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004082; bh=QFau1FaeK/5b1bWqy9BVr+tMxwUOU/Qw1BH0pUCw/qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=by92CKWc6W/OvtNN3hWBc3PEzqoNOZ/EtQ7PnA/FNDLY1yVV0po9meJa7vLp1wdnG hMi2czE89AbUlLXE5/zb2rtqu23B4YHJVsfc1AO6YtLZh+uTVrA6qgFxOXV08QruER H3Cj1zY9n3geDD3OapbAXHifKDGgEmr53ti/DJ1Au5TB8JOxAztEOjhb9lz/N5UXSb 2Z60ihz1cqf/ZILGbyr9k6ezaTOFFQlVfaKqTk6mZ4XxWHkhVX/RT511yk+axrPa/O +50DTcaZtJ/PkiZi8ECH7PuMzHd+eaTa5S6oicTFI1x/vEIRX/E2XG+lcQo0wF3JQ+ BHks6iPUzwW4A== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/packages/gpg.scm (libgpgerror)[arguments]<#:phases>{cross-symlinks}: Only link to src/syscfg/lock-obj-pub.linux-gnu.h if the package is being compiled for a Linux target. Do not link either if the architecture is unknown, as the headers vary with the architecture. --- gnu/packages/gnupg.scm | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 5c0d03927e..1a7c682ad6 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2018 Björn Höfling ;;; Copyright © 2019 Mathieu Othacehe ;;; Copyright © 2020 Fredrik Salomonsson +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,6 +78,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system perl) #:use-module (guix build-system python) + #:use-module (ice-9 match) #:use-module (srfi srfi-1)) (define-public libgpg-error @@ -94,27 +96,37 @@ (build-system gnu-build-system) (arguments (if (%current-target-system) - `(#:modules ((ice-9 match) - (guix build gnu-build-system) + `(#:modules ((guix build gnu-build-system) (guix build utils)) #:phases (modify-phases %standard-phases ;; When cross-compiling, some platform specific properties cannot ;; be detected. Create a symlink to the appropriate platform - ;; file. See Cross-Compiling section at: + ;; file if required. Note that these platform files depend on + ;; both the operating system and architecture! + ;; + ;; See Cross-Compiling section at: ;; https://github.com/gpg/libgpg-error/blob/master/README (add-after 'unpack 'cross-symlinks - (lambda* (#:key target inputs #:allow-other-keys) - (let ((triplet - (match (string-take target - (string-index target #\-)) - ("armhf" "arm-unknown-linux-gnueabi") - ("mips64el" "mips-unknown-linux-gnu") - (x - (string-append x "-unknown-linux-gnu"))))) - (symlink - (string-append "lock-obj-pub." triplet ".h") - "src/syscfg/lock-obj-pub.linux-gnu.h")))))) + (lambda _ + (define (link triplet source) + (symlink (string-append "lock-obj-pub." triplet ".h") + (string-append "src/syscfg/lock-obj-pub." + source ".h"))) + ,(let* ((target (%current-target-system)) + (architecture + (string-take target (string-index target #\-)))) + (cond ((target-linux? target) + (match architecture + ("armhf" + `(link "arm-unknown-linux-gnueabi" "linux-gnu")) + ("mips64el" + `(link "mips-unknown-linux-gnu" "linux-gnu")) + ;; Don't always link to the "linux-gnu" + ;; configuration, as this is not correct for + ;; all architectures. + (_ #t))) + (#t #t))))))) '())) (native-inputs `(("gettext" ,gettext-minimal))) (home-page "https://gnupg.org") From patchwork Sun Jul 11 11:47:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31291 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 7BC0827BC83; Sun, 11 Jul 2021 12:49:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5087E27BC81 for ; Sun, 11 Jul 2021 12:49:30 +0100 (BST) Received: from localhost ([::1]:50998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxh-0005FG-B8 for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxJ-00044S-Lh for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxJ-0008Iy-DZ for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxJ-00074P-DB for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 08/20] libgpg-error: Fix cross-compilation error. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409426980 (code B ref 49025); Sun, 11 Jul 2021 11:49:05 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:14 +0000 Received: from localhost ([127.0.0.1]:34058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwT-000710-QF for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:14 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwJ-0006y5-EX for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:04 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no2rg; Sun, 11 Jul 2021 13:48:03 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:11 +0200 Message-Id: <20210711114723.27568-9-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004083; bh=GTJXiJu9i4qQ52TOPO4K/hcLzGRUNQA7Cm4Az8dv4LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=K35tjD110iCpP0pad8s/ZeHNmiJGu9OIdIri9fnxi06JvRD0Wg1wg15CvdVISHgl7 KbWiUcBYn0rBAc8hjKx7taL+RdSqgl0jPn9i9/W+VeNkTgbmpdSTIj9RwjFDw26hwo Ut1oh6zNtZRXSdZlW+XVYqNFWDStsk0fMnf5kYKhW4Qhog8YKmpqDdGNeVPbPlf1P7 baIgMDbFbT6u93xV7ZqCoS9L8gEWwyYsvIMVyXLeLMsKOwxM+kzla1CovdiEPbMjWm lwkINdDq/mOg+rA21/K0KSjmXb8veIC2YWjmH/4q7WTE1n7CwfPARV0adz6MImZLUF U5S+7JGRYyDMg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 TODO: inform upstream about the cross-compilation error. * gnu/packages/gnupg.scm (libgpg-error)[arguments]{fix-gen-lock-obj.sh}: Prevent generated header files from being sprinkled with ‘\c’. --- gnu/packages/gnupg.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 1a7c682ad6..bb6fa4678b 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -100,6 +100,13 @@ (guix build utils)) #:phases (modify-phases %standard-phases + ;; If this is left out, some generated header + ;; files will be sprinkled with ‘\c’, which + ;; the compiler won't like. + (add-after 'unpack 'fix-gen-lock-obj.sh + (lambda _ + (substitute* "src/gen-lock-obj.sh" + (("if test -n `echo -n`") "if ! test -n `echo -n`")))) ;; When cross-compiling, some platform specific properties cannot ;; be detected. Create a symlink to the appropriate platform ;; file if required. Note that these platform files depend on From patchwork Sun Jul 11 11:47:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31284 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 B810B27BC83; Sun, 11 Jul 2021 12:49:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8B6D227BC81 for ; Sun, 11 Jul 2021 12:49:17 +0100 (BST) Received: from localhost ([::1]:49622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XxU-0004ID-IY for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxK-00045w-23 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxJ-0008J9-PI for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxJ-00074X-PJ for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 09/20] python: Fix reference to input when cross-compiling. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409526988 (code B ref 49025); Sun, 11 Jul 2021 11:49:05 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:15 +0000 Received: from localhost ([127.0.0.1]:34060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwU-000717-3T for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:14 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwJ-0006yC-Qz for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:04 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no3rp; Sun, 11 Jul 2021 13:48:03 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:12 +0200 Message-Id: <20210711114723.27568-10-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004083; bh=tfhxpmot2txmcMbR0eEYan/RUbd5LXwGOg8MLYaAdXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gqEKyVhgyrlmtRtl0P+50nPXXCG7+jsiXFtSMN2D0mR7m4a0Ngc+6ZKv+nhHiQSax 0ymcXqxTLAu05dpXJgTYLgpkHO3YQvdjTrEX7x3f84xuxhxz5NUsO9q0G7v2f2zK9r D4Y3svqi5zkOEEH7+efesL7P1pzd+nQQLK073qFJ5luOFgdF6xWOO+5yg1duxk61Tg vjRfwnNNBogiK0YEd0rYThLXXuBXjPyxpTbH6fopkXPujen9hwfAh63thVf6FTo242 111Kt053HAu11lao/Mcd3hU3HrzXX+AlPOS2raXqBbijlI89MZKillOYnJT3N1feZ9 jcd7l+f0NaPkQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 "sitecustomize.py" is a native input, so look it up in 'native-inputs', not 'inputs'. * gnu/packages/python.scm (customize-site): Look up "sizecustomize.py" in 'native-inputs', not 'inputs'. --- gnu/packages/python.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 227c612a68..ef47e79632 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -110,13 +110,14 @@ (define* (customize-site version) "Generate a install-sitecustomize.py phase, using VERSION." - `(lambda* (#:key inputs outputs #:allow-other-keys) + `(lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (site-packages (string-append out "/lib/python" ,(version-major+minor version) "/site-packages")) - (sitecustomize.py (assoc-ref inputs "sitecustomize.py")) + (sitecustomize.py (assoc-ref (or native-inputs inputs) + "sitecustomize.py")) (dest (string-append site-packages "/sitecustomize.py"))) (mkdir-p site-packages) (copy-file sitecustomize.py dest) From patchwork Sun Jul 11 11:47:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31293 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 44F6927BC83; Sun, 11 Jul 2021 12:49:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1199D27BC81 for ; Sun, 11 Jul 2021 12:49:37 +0100 (BST) Received: from localhost ([::1]:51756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxo-0005k5-4r for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxK-00047M-ED for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxK-0008JS-63 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxK-00074e-4v for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 10/20] openssl: Remove trailing #t from phases. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409526996 (code B ref 49025); Sun, 11 Jul 2021 11:49:06 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:15 +0000 Received: from localhost ([127.0.0.1]:34062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwV-00071F-1M for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:15 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwK-0006y4-6i for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:04 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no3ru; Sun, 11 Jul 2021 13:48:03 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:13 +0200 Message-Id: <20210711114723.27568-11-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004083; bh=j/A6t2tDNHqcA+3FK2plLU7eEVpICq+dbE6XR1ZiAr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XtXS+MIbv12W9PDkNU/GaWOv82Nq1YR0fMfQmgI0pr1J9mCrvwCGmRtZFVpeVDFmc uuwGJXCHl/qA89bFTbqGqKgAiFOiSYhwrbK4CuklMp67nw/GFx27Yt6ACOuMZz16Yy s9NvbFvT4Ebeejdqi4wMyTPCMoQNMkhcF8ieexdXSVZJsb1tzzhCX1oWpbP1iWQOpj anYEDgAMPq0UGi+XdO/a5tQqL6+6VM80VHgiQgfYu8wXtoLfQIVzzS+o6KSkVGK/I0 Y4mWFJXRlzOF+XuNDP5NRbANsDDwlW4WpO0j6aliwfAIiysyCs4ACkbQDyRvqKWvgH ftJeysFvbbJ5A== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/packages/tls.scm (openssl)[arguments]<#:phases>: Delete trailing #t. --- gnu/packages/tls.scm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 297e16dd70..8a8fcb59fd 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -364,8 +364,7 @@ required structures.") ((string-prefix? "powerpc64" target) "linux-ppc64") ((string-prefix? "powerpc" target) - "linux-ppc"))) - #t))) + "linux-ppc")))))) '()) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) @@ -404,8 +403,7 @@ required structures.") (for-each (lambda (file) (install-file file slib) (delete-file file)) - (find-files lib "\\.a$")) - #t))) + (find-files lib "\\.a$"))))) (add-after 'install 'move-extra-documentation (lambda* (#:key outputs #:allow-other-keys) ;; Move man3 pages and full HTML documentation to "doc". @@ -418,8 +416,7 @@ required structures.") (copy-recursively man3 man-target) (delete-file-recursively man3) (copy-recursively html html-target) - (delete-file-recursively html) - #t))) + (delete-file-recursively html)))) (add-after 'install 'remove-miscellany (lambda* (#:key outputs #:allow-other-keys) @@ -428,8 +425,7 @@ required structures.") (let ((out (assoc-ref outputs "out"))) (delete-file-recursively (string-append out "/share/openssl-" ,(package-version this-package) - "/misc")) - #t)))))) + "/misc")))))))) (native-search-paths (list (search-path-specification (variable "SSL_CERT_DIR") From patchwork Sun Jul 11 11:47:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31288 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 1448B27BC83; Sun, 11 Jul 2021 12:49:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 95D8527BC81 for ; Sun, 11 Jul 2021 12:49:25 +0100 (BST) Received: from localhost ([::1]:50486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxc-0004ua-Ix for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxK-00048v-SW for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxK-0008K3-I8 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxK-00074m-I5 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 11/20] openssl: Make the #:phases argument a G-expression. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409527003 (code B ref 49025); Sun, 11 Jul 2021 11:49:06 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:15 +0000 Received: from localhost ([127.0.0.1]:34064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwV-00071N-B0 for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:15 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwK-0006yM-IO for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:05 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no3s6; Sun, 11 Jul 2021 13:48:04 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:14 +0200 Message-Id: <20210711114723.27568-12-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004084; bh=JHdidYibbmla5GyzrkyF1oyuXoOo0MlYIgVGOuNjBkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AxtG/gz5gqXUz21c/HVBQlxaNRdshWm1jhnVDKdEa0/2CHIfJcVl8xsVZxtMT0/wR sCo25n8j1HKHJPA8ilPOHO3GzFox8ddV1uminI889naq+I7i48A0TVC6QUIxkdXkfz m3brdINxDXfyAiMP8a8P9FHWDrn+RoFKCpxBKME8igx2cgvdOPCfEPAfXoVOU0KXGA 1Ec7axiaqlsChsHTcuGTogwhnRxtrum3dscWR2B3hfWalT4Y+5sqLY+u7x69cmwa52 qzqUB23QpqACWKkj0+T8BFvf7ebIQXBOEbbtO6/vAJIT181p4OiY7/2B4BeNVdEBeP /3mKcUQak39zA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 This allows using this-package-native-input later. * gnu/packages/tls.scm (openssl)[arguments]<#:phases>: Make this a G-expression. (openssl-1.0)[arguments]<#:phases>: Likewise. --- gnu/packages/tls.scm | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 8a8fcb59fd..0024709a96 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -40,6 +40,7 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix build-system perl) @@ -339,9 +340,10 @@ required structures.") ;; so we explicitly disallow it here. #:disallowed-references ,(list (canonical-package perl)) #:phases + ,#~ (modify-phases %standard-phases - ,@(if (%current-target-system) - '((add-before + #$@(if (%current-target-system) + #~((add-before 'configure 'set-cross-compile (lambda* (#:key target outputs #:allow-other-keys) (setenv "CROSS_COMPILE" (string-append target "-")) @@ -365,7 +367,7 @@ required structures.") "linux-ppc64") ((string-prefix? "powerpc" target) "linux-ppc")))))) - '()) + #~()) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -375,9 +377,9 @@ required structures.") (("/usr/bin/env") (string-append (assoc-ref %build-inputs "coreutils") "/bin/env"))) - (invoke ,@(if (%current-target-system) - '("./Configure") - '("./config")) + (invoke #$@(if (%current-target-system) + #~("./Configure") + #~("./config")) "shared" ;build shared libraries "--libdir=lib" @@ -386,13 +388,13 @@ required structures.") ;; conventional. (string-append "--openssldir=" out "/share/openssl-" - ,(package-version this-package)) + #$(package-version this-package)) (string-append "--prefix=" out) (string-append "-Wl,-rpath," lib) - ,@(if (%current-target-system) - '((getenv "CONFIGURE_TARGET_ARCH")) - '()))))) + #$@(if (%current-target-system) + #~((getenv "CONFIGURE_TARGET_ARCH")) + #~()))))) (add-after 'install 'move-static-libraries (lambda* (#:key outputs #:allow-other-keys) ;; Move static libraries to the "static" output. @@ -424,7 +426,7 @@ required structures.") ;; scripts. Remove them to avoid retaining a reference on Perl. (let ((out (assoc-ref outputs "out"))) (delete-file-recursively (string-append out "/share/openssl-" - ,(package-version this-package) + #$(package-version this-package) "/misc")))))))) (native-search-paths (list (search-path-specification @@ -469,7 +471,7 @@ required structures.") ;; Parallel build is not supported in 1.0.x. ((#:parallel-build? _ #f) #f) ((#:phases phases) - `(modify-phases ,phases + #~(modify-phases #$phases (add-before 'patch-source-shebangs 'patch-tests (lambda* (#:key inputs native-inputs #:allow-other-keys) (let ((bash (assoc-ref (or native-inputs inputs) "bash"))) @@ -492,9 +494,9 @@ required structures.") ;; Override this phase because OpenSSL 1.0 does not understand -rpath. (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - (invoke ,@(if (%current-target-system) - '("./Configure") - '("./config")) + (invoke #$@(if (%current-target-system) + #~("./Configure") + #~("./config")) "shared" ;build shared libraries "--libdir=lib" @@ -502,12 +504,12 @@ required structures.") ;; PREFIX/ssl. Change that to something more ;; conventional. (string-append "--openssldir=" out - "/share/openssl-" ,version) + "/share/openssl-" #$version) (string-append "--prefix=" out) - ,@(if (%current-target-system) - '((getenv "CONFIGURE_TARGET_ARCH")) - '()))))) + #$@(if (%current-target-system) + '((getenv "CONFIGURE_TARGET_ARCH")) + '()))))) (delete 'move-extra-documentation) (add-after 'install 'move-man3-pages (lambda* (#:key outputs #:allow-other-keys) @@ -532,7 +534,7 @@ required structures.") ;; scripts. Remove them to avoid retaining a reference on Perl. (let ((out (assoc-ref outputs "out"))) (delete-file-recursively (string-append out "/share/openssl-" - ,version "/misc")) + #$version "/misc")) #t))))))))) (define-public libressl From patchwork Sun Jul 11 11:47:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31298 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 52E0527BC84; Sun, 11 Jul 2021 12:50:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8C8A227BC83 for ; Sun, 11 Jul 2021 12:50:01 +0100 (BST) Received: from localhost ([::1]:53200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XyC-0006gA-LV for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxO-0004MC-9T for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxO-0008OC-1K for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxO-00075q-0k for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:10 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 12/20] openssl: Use G-exp machinery for referring to outputs. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600411127086 (code B ref 49025); Sun, 11 Jul 2021 11:49:09 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:31 +0000 Received: from localhost ([127.0.0.1]:34082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2Xwk-00072i-Iz for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:31 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwK-0006xg-Uw for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:20 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no4sB; Sun, 11 Jul 2021 13:48:04 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:15 +0200 Message-Id: <20210711114723.27568-13-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004084; bh=3B3QDGP7dkXVyEAZJY8WCsdDeSjbBRGSdZVIeTRN4/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iG4P4l8jHJS2IATGZtakvZPgCTM8MfCuGJzIcB784VHIU+YjOeVt+jKimD8YhwxK1 Zini3P0Q7uStU8kzdVMSK1ay8B3rwk0Al6cY+p1SHoqyLLoiDa/qEa2zrBXSOnxfOT 2nJyGpIHYu1VumoHqf+Ul312hzEpC+KyvzoaCjpXL71+HWZRGRWD3WVpE/6R784k6L dzc35W8yf+GSRHpBLHfI2AXtmuShhSsgLH0kwh3mSCruuySOf5uHuMM9QNhOOYxo1L 5mvwnnLXB4LiLIAZrBmb42b4rOxnNJpJgE72GlmzzLs6bvme1b00xGhQAXlzCRhk27 HtfoLpbXo1RXg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 This doesn't fix anything broken, just for simplifying the code a little while we're rebuilding the world anyway. IMHO this makes the code a little more readable. * gnu/packages/tls.scm (openssl)[arguments]<#:phases>: Don't refer to the association list 'outputs', use #$output, #$output:doc and #$output:static instead. --- gnu/packages/tls.scm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 0024709a96..fd4a8b07b2 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2021 Solene Rapenne ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -345,7 +346,7 @@ required structures.") #$@(if (%current-target-system) #~((add-before 'configure 'set-cross-compile - (lambda* (#:key target outputs #:allow-other-keys) + (lambda* (#:key target #:allow-other-keys) (setenv "CROSS_COMPILE" (string-append target "-")) (setenv "CONFIGURE_TARGET_ARCH" (cond @@ -369,8 +370,8 @@ required structures.") "linux-ppc")))))) #~()) (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) + (lambda _ + (let* ((out #$output) (lib (string-append out "/lib"))) ;; It's not a shebang so patch-source-shebangs misses it. (substitute* "config" @@ -396,23 +397,23 @@ required structures.") #~((getenv "CONFIGURE_TARGET_ARCH")) #~()))))) (add-after 'install 'move-static-libraries - (lambda* (#:key outputs #:allow-other-keys) + (lambda _ ;; Move static libraries to the "static" output. - (let* ((out (assoc-ref outputs "out")) + (let* ((out #$output) (lib (string-append out "/lib")) - (static (assoc-ref outputs "static")) + (static #$output:static) (slib (string-append static "/lib"))) (for-each (lambda (file) (install-file file slib) (delete-file file)) (find-files lib "\\.a$"))))) (add-after 'install 'move-extra-documentation - (lambda* (#:key outputs #:allow-other-keys) + (lambda _ ;; Move man3 pages and full HTML documentation to "doc". - (let* ((out (assoc-ref outputs "out")) + (let* ((out #$output) (man3 (string-append out "/share/man/man3")) (html (string-append out "/share/doc/openssl")) - (doc (assoc-ref outputs "doc")) + (doc #$output:doc) (man-target (string-append doc "/share/man/man3")) (html-target (string-append doc "/share/doc/openssl"))) (copy-recursively man3 man-target) @@ -421,13 +422,12 @@ required structures.") (delete-file-recursively html)))) (add-after 'install 'remove-miscellany - (lambda* (#:key outputs #:allow-other-keys) + (lambda _ ;; The 'misc' directory contains random undocumented shell and Perl ;; scripts. Remove them to avoid retaining a reference on Perl. - (let ((out (assoc-ref outputs "out"))) - (delete-file-recursively (string-append out "/share/openssl-" - #$(package-version this-package) - "/misc")))))))) + (delete-file-recursively (string-append #$output "/share/openssl-" + #$(package-version this-package) + "/misc"))))))) (native-search-paths (list (search-path-specification (variable "SSL_CERT_DIR") From patchwork Sun Jul 11 11:47:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31289 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 DDE9C27BC84; Sun, 11 Jul 2021 12:49:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 95B5E27BC83 for ; Sun, 11 Jul 2021 12:49:29 +0100 (BST) Received: from localhost ([::1]:50900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxg-0005BR-JP for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxL-0004AZ-8j for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxK-0008Ko-UT for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxK-00074t-UI for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 13/20] openssl: Move documentation instead of copying and deleting it. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409627010 (code B ref 49025); Sun, 11 Jul 2021 11:49:06 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:16 +0000 Received: from localhost ([127.0.0.1]:34066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwV-00071U-OR for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:15 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwL-0006y5-9s for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:05 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no4sF; Sun, 11 Jul 2021 13:48:04 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:16 +0200 Message-Id: <20210711114723.27568-14-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004085; bh=7hdPjzxNLQ83Vv9FIbPnqNpMd0gcoxSAu51LPUrnFVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aLfvH5fISF8dy17J5FgHVT/3HRTTwdu+LW1DxFpJRxzvVtlZbzLaICo8YJjkT59lu sq6nmNt4MPo2PeumsWUdG01LBMPNnjyXGGmGjRI2/lPWdibmKqWOqsdEqbuD6gbQ72 i0GIK6b8w/bo+nW7XB2ec6IgEKmPXUjhT4ws7MrSWJbxZKha2TYJLDkqhv6gCD37lt 5mjiOgL+rq7tQbNslvHe68M+HtI/EdSwvlBjtUw4aelTdCaRKo2LflcRozstJ/VsOb tbVs9iP6YMpHePxarPQePHQSgKVCylQVSZxT2fxwMn6wdTi2QtvW/4WcSdDUCFi/mJ VmWMZmG3s6mOQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/packages/tls.scm (openssl)[arguments]<#:phases>{move-extra-documentation}: Use 'rename-file' instead of 'copy-recursively' and 'delete-file-recursively'. --- gnu/packages/tls.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index fd4a8b07b2..fcecc6ba41 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -416,10 +416,10 @@ required structures.") (doc #$output:doc) (man-target (string-append doc "/share/man/man3")) (html-target (string-append doc "/share/doc/openssl"))) - (copy-recursively man3 man-target) - (delete-file-recursively man3) - (copy-recursively html html-target) - (delete-file-recursively html)))) + (mkdir-p (dirname man3-target)) + (mkdir-p (dirname html-target)) + (rename-file man3 man-target) + (rename-file html html-target)))) (add-after 'install 'remove-miscellany (lambda _ From patchwork Sun Jul 11 11:47:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31296 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 7014327BC83; Sun, 11 Jul 2021 12:49:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E78B927BC81 for ; Sun, 11 Jul 2021 12:49:44 +0100 (BST) Received: from localhost ([::1]:52440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxw-0006BO-0y for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxL-0004By-JS for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxL-0008LS-Ac for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxL-000750-AL for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 14/20] openssl: Move all man pages to separate output, not only man3. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409627018 (code B ref 49025); Sun, 11 Jul 2021 11:49:07 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:16 +0000 Received: from localhost ([127.0.0.1]:34068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwW-00071b-0a for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:16 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwL-0006yC-M9 for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:05 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no5sJ; Sun, 11 Jul 2021 13:48:05 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:17 +0200 Message-Id: <20210711114723.27568-15-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004085; bh=JIGYb8218IvtqiEioBC7F/bNr95fECSLQRHNxnN79pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ieoICplQehvrMTWu1wPMbtdudwgW0hngI+4BfRBmxylQ1FKqFJRZWo9dAmcMP069o qoDh3hGcN71Sue/elLeOOJj4FolfsIdDCqYIVtnuiQzjCX9FSgHWUYXhGRn5j7PXl0 OOAt2PkPsU3VMJCuvoBaphoUfi4I4nGdXZvv08YFNc1GstMaSOBBkhSQXFydza4q1c lEjv1uhDe5RwRUdEP1H7/ZOQ9ah0R1CtWdBBQspVsWu1qJf+5g5a4f1W6C9HL1s6Ya fkjhR9Q3UaYKFBkHsnC+catVoSjTutsGci38cxA5Rnj3KEaJFQN5oUh74jAYs+cGO/ xQbMhnAk6zKjw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 There does not seem to be any reason to only move man3 pages. So, move all man pages to a separate output for documentation. * gnu/packages/tls.scm (openssl)[arguments]<#:phases>{move-extra-documentation}: Move all man pages, not only man3. --- gnu/packages/tls.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index fcecc6ba41..6cebc1d6ed 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -409,16 +409,16 @@ required structures.") (find-files lib "\\.a$"))))) (add-after 'install 'move-extra-documentation (lambda _ - ;; Move man3 pages and full HTML documentation to "doc". + ;; Move man pages and full HTML documentation to "doc". (let* ((out #$output) - (man3 (string-append out "/share/man/man3")) - (html (string-append out "/share/doc/openssl")) + (man (string-append out "/share/man")) + (html (string-append out "/share/doc/openssl")) (doc #$output:doc) - (man-target (string-append doc "/share/man/man3")) + (man-target (string-append doc "/share/man")) (html-target (string-append doc "/share/doc/openssl"))) - (mkdir-p (dirname man3-target)) + (mkdir-p (dirname man-target)) (mkdir-p (dirname html-target)) - (rename-file man3 man-target) + (rename-file man man-target) (rename-file html html-target)))) (add-after 'install 'remove-miscellany From patchwork Sun Jul 11 11:47:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31292 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 A4EFF27BC83; Sun, 11 Jul 2021 12:49:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7180727BC81 for ; Sun, 11 Jul 2021 12:49:33 +0100 (BST) Received: from localhost ([::1]:51364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxk-0005Ts-HQ for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxL-0004DM-VN for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxL-0008Lk-MS for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxL-000758-MG for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 15/20] openssl: Extract logic for computing CONFIGURE_TARGET_ARCH. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409627026 (code B ref 49025); Sun, 11 Jul 2021 11:49:07 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:16 +0000 Received: from localhost ([127.0.0.1]:34070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwW-00071j-AD for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:16 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwM-0006y4-2B for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:06 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no5sP; Sun, 11 Jul 2021 13:48:05 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:18 +0200 Message-Id: <20210711114723.27568-16-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004085; bh=59zKgKpvwivXNlDrsEtd2QfN4mS/pBxN1trlqWAIkiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oeIcvvqICV7FNzjBPxYad1JxQdzU5TOF5Alfc2EV8NpSxReD6TKXvKJusGLmiL8Ql QRaBLIqfhRd+2rBVFHIdxYzeUSgNyDnWqjGqzF1tphLmSJd1AwdAG1CPNUogWYER+9 bOfRD4nJNxc71OoWAHMMPGBmk3VyZVNtaerkQuVoTqrAoieubGrFV0NW2DbyrhFQaE g2w47ZRc94qzoJSqSQMG2AaUVcr6dwlgKjkcaZn7eFtOHRIHoNhrSY9YY9jB3cPOPs nWmkqdriyuq5uKpozqnEL1yHknPSOyWjkIVmADXqnnqlpxdh8VEW7r/vrweFc/9/IG 9pXbun5YEJOUQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 By computing this value outside the build code, new targets can be added without causing rebuilds for other targets. * gnu/packages/tls.scm (target->openssl-target): New procedure. (openssl)[arguments]<#:phases>{set-cross-compile}: Use it. --- gnu/packages/tls.scm | 46 ++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 6cebc1d6ed..8c7bba0b6e 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -311,6 +311,31 @@ required structures.") (define-public guile3.0-gnutls (deprecated-package "guile3.0-gnutls" gnutls)) +(define (target->openssl-target target) + "Return the value to set CONFIGURE_TARGET_ARCH to when cross-compiling +OpenSSL for TARGET." + ;; Keep this code outside the build code, + ;; such that new targets can be added + ;; without causing rebuilds for other targets. + (cond ((string-prefix? "i586" target) + "hurd-x86") + ((string-prefix? "i686" target) + "linux-x86") + ((string-prefix? "x86_64" target) + "linux-x86_64") + ((string-prefix? "mips64el" target) + "linux-mips64") + ((string-prefix? "arm" target) + "linux-armv4") + ((string-prefix? "aarch64" target) + "linux-aarch64") + ((string-prefix? "powerpc64le" target) + "linux-ppc64le") + ((string-prefix? "powerpc64" target) + "linux-ppc64") + ((string-prefix? "powerpc" target) + "linux-ppc"))) + (define-public openssl (package (name "openssl") @@ -349,25 +374,8 @@ required structures.") (lambda* (#:key target #:allow-other-keys) (setenv "CROSS_COMPILE" (string-append target "-")) (setenv "CONFIGURE_TARGET_ARCH" - (cond - ((string-prefix? "i586" target) - "hurd-x86") - ((string-prefix? "i686" target) - "linux-x86") - ((string-prefix? "x86_64" target) - "linux-x86_64") - ((string-prefix? "mips64el" target) - "linux-mips64") - ((string-prefix? "arm" target) - "linux-armv4") - ((string-prefix? "aarch64" target) - "linux-aarch64") - ((string-prefix? "powerpc64le" target) - "linux-ppc64le") - ((string-prefix? "powerpc64" target) - "linux-ppc64") - ((string-prefix? "powerpc" target) - "linux-ppc")))))) + #$(target->openssl-target + (%current-target-system)))))) #~()) (replace 'configure (lambda _ From patchwork Sun Jul 11 11:47:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31294 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 9F6C927BC83; Sun, 11 Jul 2021 12:49:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1F4B727BC81 for ; Sun, 11 Jul 2021 12:49:38 +0100 (BST) Received: from localhost ([::1]:51878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxp-0005oP-6T for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxN-0004H4-0T for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxM-0008MO-F8 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxM-00075M-Ey for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 16/20] glib: Use a correct python in scripts when cross-compiling. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600410227050 (code B ref 49025); Sun, 11 Jul 2021 11:49:08 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:22 +0000 Received: from localhost ([127.0.0.1]:34074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwX-00071y-0C for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:22 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwM-0006yM-Eo for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:07 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no5sU; Sun, 11 Jul 2021 13:48:06 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:19 +0200 Message-Id: <20210711114723.27568-17-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004086; bh=6hXOZRlH/MbFutLfGerdJWqLFB8VU+FCKvMl68udIcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RlAsHSlmUjLAHnMlkEhP/NKa5+r/UG/+3oA3ipaIEZU5xwFnUI6yku8w8KOG6xdrO eVpDyXgyKeQxPuZdGGNIIZYMcf9GimRCpKBxUKNH5mr/zc1TyGUSepwHmrJBdJHa/h w+3Z5bSZsWP+mOVG0pf0pjKlvRPkySiNBm83gz/4ZurhB+4YphmxdZyLQNTuIp4Vl4 gjRfIElHQHVYlElKWj8xeSgHSo8Wkn0ltHBbzfsUBtVkLVgvyYVO4110yY0vYY9ym9 H3kB2dlBhREtOJu9EUN/v6TPkwKkz3b4XSzKk/VNYX1sWjOumtCdL/LJaMzajNQ1YQ DA4oX0TSsjI2g== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 During the build, a native python should be used as these scripts will be invoked during the build, but when installed, they should be a python for the system we're compiling for. * gnu/packages/glib.scm (glib)[arguments]<#:phases>{patch-python-references}: Look up "python" in 'native-inputs', not 'inputs'. (glib)[inputs]{python,python-wrapper,bash-minimal}: New inputs. --- gnu/packages/glib.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index f0be2ddaa4..99f5c5d450 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2020 Florian Pelz ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Arthur Margerit +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -223,14 +224,19 @@ shared NFS home directories.") #t)) ;; Python references are not being patched in patch-phase of build, ;; despite using python-wrapper as input. So we patch them manually. + ;; + ;; These python scripts are both used during build and installed, + ;; so at first, use a python from 'native-inputs', not 'inputs'. When + ;; cross-compiling, the 'patch-shebangs' phase will replace + ;; the native python with a python from 'inputs'. (add-after 'unpack 'patch-python-references - (lambda* (#:key inputs #:allow-other-keys) + (lambda* (#:key native-inputs inputs #:allow-other-keys) (substitute* '("gio/gdbus-2.0/codegen/gdbus-codegen.in" "glib/gtester-report.in" "gobject/glib-genmarshal.in" "gobject/glib-mkenums.in") (("@PYTHON@") - (string-append (assoc-ref inputs "python") + (string-append (assoc-ref (or native-inputs inputs) "python") "/bin/python" ,(version-major+minor (package-version python))))) @@ -293,6 +299,13 @@ shared NFS home directories.") ("xsltproc" ,libxslt))) (inputs `(("bash-completion" ,bash-completion) + ;; "python", "python-wrapper" and "bash-minimal" + ;; are for the 'patch-shebangs' phase, to make + ;; sure the installed scripts end up with a correct shebang + ;; when cross-compiling. + ("python" ,python) + ("python-wrapper" ,python-wrapper) + ("bash-minimal" ,bash-minimal) ("dbus" ,dbus) ("libelf" ,libelf))) (propagated-inputs From patchwork Sun Jul 11 11:47:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31295 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 3D46327BC83; Sun, 11 Jul 2021 12:49:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 13A1D27BC81 for ; Sun, 11 Jul 2021 12:49:41 +0100 (BST) Received: from localhost ([::1]:52142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxs-0005zR-5x for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxM-0004F8-Cw for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxM-0008M4-2t for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxM-00075F-2E for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 17/20] glib: Verify the cross-compiled python is used in installed scripts. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600409727033 (code B ref 49025); Sun, 11 Jul 2021 11:49:08 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:17 +0000 Received: from localhost ([127.0.0.1]:34072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwW-00071r-LU for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:16 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwM-0006y5-QW for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:07 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no6sd; Sun, 11 Jul 2021 13:48:06 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:20 +0200 Message-Id: <20210711114723.27568-18-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004086; bh=EdavLGCsmRKElVg3FWy+Yzt6MfN1A72DGpe66SV+JdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mR5I4F7/won+Ilqy6aNN5UnRIj7puBRbmdBxZ/2AfIz8raoEHZhaPyvewk5ehti0L fn4FF+N6PxWG9DRA6rYuzcGaGp7xByiv0ecZbQ8/JmfdTGD2N0EqduH25vKCWUfBWz myLIcrFhpUWTq6Ctg+4IA/s1DmXIRkfCT4R1cvllE/cAeFSCrRNh38oJP2W5FXg7yC i/bL5NP0tUsUj7DjMicYFMDJYZxDsEjK5P4ZRgI4GFQp3EcCx0qBvWAZtOeHijq1b9 K4Ad9Uihcsh7MgsI+phZLVvv1h3BrlEPG5jxqHEm2szzxKNqzOJ1qgbm8jUry/J5Jb hSQL3H4QOnMNw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/packages/glib.scm (glib)[arguments]<#:disallowed-references>: Disallow the native python when cross-compiling. --- gnu/packages/glib.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 99f5c5d450..e4ebed7e2c 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -77,6 +77,8 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (srfi srfi-26) #:use-module ((srfi srfi-1) #:hide (zip)) ;; Export variables up-front to allow circular dependency with the 'xorg' @@ -200,7 +202,15 @@ shared NFS home directories.") "static" ;static libraries "bin")) ;executables; depends on Python (arguments - `(#:disallowed-references (,tzdata-for-tests) + `(#:disallowed-references + (,tzdata-for-tests + ;; Verify glib-mkenums, gtester, ... use the cross-compiled + ;; python. + ,@(if (%current-target-system) + (map (cut gexp-input <> #:native? #t) + `(,(this-package-native-input "python") + ,(this-package-native-input "python-wrapper"))) + '())) #:configure-flags '("--default-library=both" "-Dman=true" "-Dselinux=disabled") From patchwork Sun Jul 11 11:47:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 31297 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 7F30027BC83; Sun, 11 Jul 2021 12:49:47 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 548E527BC81 for ; Sun, 11 Jul 2021 12:49:47 +0100 (BST) Received: from localhost ([::1]:52548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Xxy-0006FT-Cz for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:49:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxN-0004Hg-5G for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxM-0008Mb-SE for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxM-00075U-Rt for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 18/20] glib: Look up "tzdata" in 'native-inputs', not 'inputs'. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600410227057 (code B ref 49025); Sun, 11 Jul 2021 11:49:08 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:22 +0000 Received: from localhost ([127.0.0.1]:34076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2Xwc-00072F-5Q for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:22 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwN-0006yC-5b for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:07 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no6sl; Sun, 11 Jul 2021 13:48:06 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:21 +0200 Message-Id: <20210711114723.27568-19-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004086; bh=ZjEmLqo+AcCFyVjjjxBD6t1exf9WfOPlDV6wnmCi6Pw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OH6qhYFT3+sb/XAbCSDFdMSSjDHxKjlavCAq5Z7cD31zsfMo4wAbq4gELYOQZGF/l xkE3hlKdRrIT80oqB40r127iNGX46KyFN5tL0CKqelSNHcx7ZBWu5AIquL+cWWZ3w9 LOXk9bv+ZBJFIc+gNLV7UpY7xOGUtEU/meFRS26YsCWQ04Bxy9mPgYRaeKKxVvmQ18 VuO6Yuaq5TFilyPcjG3L+wtJu7mXUW0zm//EUM6hVSvXLc0159Ws3UaOB/7bR44ttU ScupWTFsJbth+JiUB7cDZU9CykgBla0QoausmQ+5YfS/OnbIRkD+MAIPI93mCBZE2O 5WmErV3SHqmeg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 Otherwise, "tzdata" won't be found when cross-compiling and string-append will complain about types. Alternatively, "tzdata" could be moved from 'native-inputs' to 'inputs'. * gnu/packages/glib.scm (glib)[arguments]<#:phases>{pre-check}: Look up "tzdata" in 'native-inputs', not 'inputs'. --- gnu/packages/glib.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index e4ebed7e2c..01683df8c5 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -252,10 +252,11 @@ shared NFS home directories.") (package-version python))))) #t)) (add-before 'check 'pre-check - (lambda* (#:key inputs outputs #:allow-other-keys) + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) ;; For tests/gdatetime.c. (setenv "TZDIR" - (string-append (assoc-ref inputs "tzdata") + (string-append (assoc-ref (or native-inputs inputs) + "tzdata") "/share/zoneinfo")) ;; Some tests want write access there. (setenv "HOME" (getcwd)) From patchwork Sun Jul 11 11:47:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31300 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 B6D9527BC83; Sun, 11 Jul 2021 12:51:05 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3BBD027BC81 for ; Sun, 11 Jul 2021 12:51:05 +0100 (BST) Received: from localhost ([::1]:55824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XzE-0008Uv-Aq for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:51:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxN-0004Ip-JJ for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxN-0008Mv-88 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxN-00075b-84 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 19/20] libelf: Update configure script and config.guess and config.sub. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600410327064 (code B ref 49025); Sun, 11 Jul 2021 11:49:09 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:23 +0000 Received: from localhost ([127.0.0.1]:34078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2Xwc-00072M-Gh for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:23 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwN-0006y4-I1 for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:08 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no6sp; Sun, 11 Jul 2021 13:48:07 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:22 +0200 Message-Id: <20210711114723.27568-20-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004087; bh=PmFSgOK+NW3vsdrropSeKY9k4clOeil1DsdklQk68os=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JGjd3BbyspEvzgwufOwHaPl3n4HMvAUrqolL4tT0BJbWE0KwuWC9U6xgaQHB+9atp MLqqLj8K8clE9ScTf0XuRbxejto7IQ/I9s9OOxYtw7X+omaDHXHM8kEF+ccH9vxUd9 nuGOQi9IvkLNZeXeyW5yDuL3K+TYqLi4q6YPU3Dsq8w7u/KKyWQkXCiyaitRmoVFEi EFf5aAsCN2mCRzdC20noNeK5XR69tAK7ZIR1RGGkWZgDRAAUFCZ/Z3JaMaM+dKoGkQ 1fgKJckZbi51yKGwjAZQfzKCiqv5w7zyFkEfBsYuEmFkhtOt8SSKT1vhkrDlEOCeJm 9nKYuT1kAMVaw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 The current configure script is too old to find the cross-compiler and support variables passed as arguments. Also, config.guess and config.sub are too old to recognise powerpc64 and aarch64. Solve this by regenerating the 'configure' script and replacing 'config.guess' and 'config.sub'. * gnu/packages/elf.scm (libelf)[arguments]<#:phases>{configure}: Remove phase. (libelf)[arguments]<#:phases>{delete-configure}: Regenerate the configure script and replace 'config.guess' and 'config.sub'. --- gnu/packages/elf.scm | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm index 0309dd95b5..2bc1d00048 100644 --- a/gnu/packages/elf.scm +++ b/gnu/packages/elf.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2020 Mark Wielaard ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2021 Leo Le Bouter +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+)) #:use-module (gnu packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) #:use-module (gnu packages gcc) @@ -205,22 +207,32 @@ static analysis of the ELF binaries at hand.") (arguments `(#:phases (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - ;; This old `configure' script doesn't support - ;; variables passed as arguments. - (let ((out (assoc-ref outputs "out"))) - (setenv "CONFIG_SHELL" (which "bash")) - (invoke "./configure" - (string-append "--prefix=" out) - ,@(if (string=? "powerpc64le-linux" - (%current-system)) - '("--host=powerpc64le-unknown-linux-gnu") - '()) - ,@(if (string=? "aarch64-linux" - (%current-system)) - '("--host=aarch64-unknown-linux-gnu") - '())))))))) + ;; This old 'configure' script doesn't support cross-compilation + ;; well. I.e., it fails to find the cross-compiler. Also, + ;; the old `configure' script doesn't support variables passed as + ;; arguments. A third problem is that config.sub is too old to + ;; recognise aarch64 and powerpc64le. + ;; + ;; Solve this by regenerating the configure script and letting + ;; autoreconf update 'config.sub'. While 'config.sub' is updated + ;; anyway, update 'config.guess' as well. + (add-before 'bootstrap 'delete-configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (delete-file "configure") + (delete-file "config.sub") + (delete-file "config.guess") + (for-each (lambda (file) + (install-file + (string-append + (assoc-ref (or native-inputs inputs) "automake") + "/share/automake-" + ,(version-major+minor (package-version automake)) + "/" file) ".")) + '("config.sub" "config.guess"))))))) + (native-inputs + `(("autoconf" ,autoconf) + ;; For up-to-date 'config.guess' and 'config.sub' + ("automake" ,automake))) (home-page (string-append "https://web.archive.org/web/20181111033959/" "http://www.mr511.de/software/english.html")) (synopsis "ELF object file access library") From patchwork Sun Jul 11 11:47:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31299 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 BFD5E27BC83; Sun, 11 Jul 2021 12:50:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4853B27BC81 for ; Sun, 11 Jul 2021 12:50:01 +0100 (BST) Received: from localhost ([::1]:53140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2XyC-0006eD-BH for patchwork@mira.cbaines.net; Sun, 11 Jul 2021 07:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2XxN-0004Km-VF for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2XxN-0008NB-L1 for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2XxN-00075i-KP for guix-patches@gnu.org; Sun, 11 Jul 2021 07:49:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 20/20] meson: Support cross-compilation. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Jul 2021 11:49:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162600411027079 (code B ref 49025); Sun, 11 Jul 2021 11:49:09 +0000 Received: (at 49025) by debbugs.gnu.org; 11 Jul 2021 11:48:30 +0000 Received: from localhost ([127.0.0.1]:34080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2Xwj-00072f-Kp for submit@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:30 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2XwO-0006y5-4T for 49025@debbugs.gnu.org; Sun, 11 Jul 2021 07:48:09 -0400 Received: from localhost.localdomain ([213.119.242.127]) by xavier.telenet-ops.be with bizsmtp id Tnno2500V2ldwth01no7sv; Sun, 11 Jul 2021 13:48:07 +0200 From: Maxime Devos Date: Sun, 11 Jul 2021 13:47:23 +0200 Message-Id: <20210711114723.27568-21-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210711114723.27568-1-maximedevos@telenet.be> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626004087; bh=3tBa9V1leanhbYl9v7RAQpnEDEHIN0Ae8OnikCyvaIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sjBZQCSOkdupABjMJFxEJ4VFPuo2HiLruwqmheqvDn1WbKIZ5MqaKtLr+TOJxI6A9 D9kSQJmKh2+lrI6J97V1or4o9vgO+REpW2MX8C/mCTq6ME/IhPCUBwj7ba5J0q7oXX o5FdTXH0Kun/59ByB6Z1iBUoTBJHTpu8S224Pt+g6CVgi5wuE/f0w/VGolk3mUTM6t 3efTW0evyR0/j4XYsoOxc5PiBcjmxB8NeUhLiJmLL15JsJcypgmHtlVQZETU93pfW1 BgYGSCymG3f5f4lBnO04+ryeFzKAKdHTfQV3yHZJwsznfdBrdOQLCU3ghcjq97gnMm UqODby9XTJ0aw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 For cross-compilation, meson needs to be passed a ‘cross file’ with information on the architecture, CPU type, endianness and operating system, and the name of the cross-compiler binaries. The new module (guix build meson-configuration) has some utilities for writing these cross files, used by 'make-cross-file' in a G-exp. The values for the cross file are generated by 'make-machine-alist' and 'make-binaries-alist'. 'make-machine-alist' and 'make-binaries-alist' live on the host side, such that new architectures and operating systems can be added without causing rebuilds for old architectures. Currently, only GNU/Hurd, GNU/Linux, MinGW, x86-32 and x86-64 are supported by 'make-machine-alist'. For other architectures, someone needs to figure out what to use as ‘CPU type’ first. Only i686-linux-gnu and aarch64-linux-gnu have been tested. The first target is only tested in a previous version of this patch series. This has been tested with: $ ./pre-inst-env guix build glib --target=aarch64-linux-gnu on a x86_64-linux system. ‘If it compiles, it should work.’ * guix/build/meson-configuration.scm (configuration-port): New parameter. (write-section-header): New procedure. (write-assignment): New procedure. (write-assignments): New procedure. * guix/build-system/meson.scm (target-hurd?): New predicate. (make-machine-alist): New procedure. (make-binaries-alist): New procedure. (make-cross-file): New procedure. (meson-cross-build): New procedure. (lower)[build-inputs]: Add standard cross packages when cross-compiling. Do not include regular 'inputs' when cross-compiling. (lower)[host-inputs]: Include 'inputs' when cross-compiling. (lower)[target-inputs]: Add cross packages when cross-compiling. (lower)[build]: Call 'meson-cross-build' instead of 'cross-build' when cross-compiling. (lower)[target]: Set it. (lower)[private-keywords]: Do not remove #:target when cross-compiling. --- Makefile.am | 1 + guix/build-system/meson.scm | 201 ++++++++++++++++++++++++++--- guix/build/meson-configuration.scm | 71 ++++++++++ 3 files changed, 254 insertions(+), 19 deletions(-) create mode 100644 guix/build/meson-configuration.scm diff --git a/Makefile.am b/Makefile.am index 05f013e3c2..6c17ab8492 100644 --- a/Makefile.am +++ b/Makefile.am @@ -234,6 +234,7 @@ MODULES = \ guix/build/emacs-utils.scm \ guix/build/java-utils.scm \ guix/build/lisp-utils.scm \ + guix/build/meson-configuration.scm \ guix/build/maven/java.scm \ guix/build/maven/plugin.scm \ guix/build/maven/pom.scm \ diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index 5adc0f92c8..55311f85f0 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2017 Peter Mikkelsen ;;; Copyright © 2018, 2019 Marius Bakke ;;; Copyright © 2021 Ludovic Courtès +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,7 +31,8 @@ #:use-module (guix packages) #:use-module (ice-9 match) #:export (%meson-build-system-modules - meson-build-system)) + meson-build-system + make-cross-file)) ;; Commentary: ;; @@ -40,6 +42,66 @@ ;; ;; Code: +(define (target-hurd? triplet) + (and (string-suffix? "-gnu" triplet) + (not (string-contains triplet "linux")))) + +(define (make-machine-alist triplet) + "Make an association list describing what should go into +the ‘host_machine’ section of the cross file when cross-compiling +for TRIPLET." + `((system . ,(cond ((target-hurd? triplet) "gnu") + ((target-linux? triplet) "linux") + ((target-mingw? triplet) "windows") + (#t (error "meson: unknown operating system")))) + (cpu_family . ,(cond ((target-x86-32? triplet) "x86") + ((target-x86-64? triplet) "x86_64") + ((target-arm32? triplet) "arm") + ((target-aarch64? triplet) "aarch64") + ((target-powerpc? triplet) + (if (target-64bit? triplet) + "ppc64" + "ppc")) + (#t (error "meson: unknown architecture")))) + (cpu . ,(cond ((target-x86-32? triplet) ; i386, ..., i686 + (substring triplet 0 4)) + ((target-x86-64? triplet) "x86_64") + ((target-aarch64? triplet) "armv8-a") + (#t (error "meson: unknown CPU")))) + (endian . ,(cond ((string-prefix? "powerpc64le-" triplet) "little") + ((string-prefix? "mips64el-" triplet) "little") + ((target-x86-32? triplet) "little") + ((target-x86-64? triplet) "little") + ;; At least in Guix. Aarch64 has a big-endian + ;; mode as well. + ((target-aarch64? triplet) "little") + (#t (error "meson: unknown architecture")))))) + +(define (make-binaries-alist triplet) + "Make an associatoin list describing what should go into +the ‘binaries’ section of the cross file when cross-compiling for +TRIPLET." + `((c . ,(cc-for-target triplet)) + (cpp . ,(cxx-for-target triplet)) + (pkgconfig . ,(pkg-config-for-target triplet)) + (objcopy . ,(string-append triplet "-objcopy")) + (ar . ,(string-append triplet "-ar")) + (ld . ,(string-append triplet "-ld")) + (strip . ,(string-append triplet "-strip")))) + +(define (make-cross-file triplet) + (computed-file "cross-file" + (with-imported-modules '((guix build meson-configuration)) + #~(begin + (use-modules (guix build meson-configuration)) + (call-with-output-file #$output + (lambda (f) + (parameterize ((configuration-port f)) + (write-section-header "host_machine") + (write-assignments '#$(make-machine-alist triplet)) + (write-section-header "binaries") + (write-assignments '#$(make-binaries-alist triplet))))))))) + (define %meson-build-system-modules ;; Build-side modules imported by default. `((guix build meson-build-system) @@ -68,24 +130,34 @@ #:rest arguments) "Return a bag for NAME." (define private-keywords - `(#:meson #:ninja #:inputs #:native-inputs #:outputs #:target)) - - (and (not target) ;; TODO: add support for cross-compilation. - (bag - (name name) - (system system) - (build-inputs `(("meson" ,meson) - ("ninja" ,ninja) - ,@native-inputs - ,@inputs - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(standard-packages))) - (host-inputs (if source - `(("source" ,source)) - '())) - (outputs outputs) - (build meson-build) - (arguments (strip-keyword-arguments private-keywords arguments))))) + `(#:meson #:ninja #:inputs #:native-inputs #:outputs + ,@(if target + '() + '(#:target)))) + + (bag + (name name) + (system system) (target target) + (build-inputs `(("meson" ,meson) + ("ninja" ,ninja) + ,@native-inputs + ,@(if target '() inputs) + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(if target + (standard-cross-packages target 'host) + '()) + ,@(standard-packages))) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@(if target inputs '()))) + ;; Keep the standard inputs of 'gnu-buid-system'. + (target-inputs (if target + (standard-cross-packages target 'target) + '())) + (outputs outputs) + (build (if target meson-cross-build meson-build)) + (arguments (strip-keyword-arguments private-keywords arguments)))) (define* (meson-build name inputs #:key @@ -161,6 +233,97 @@ has a 'meson.build' file." #:disallowed-references disallowed-references #:guile-for-build guile))) +(define* (meson-cross-build name + #:key + target + build-inputs host-inputs target-inputs + guile source + (outputs '("out")) + (configure-flags ''()) + (search-paths '()) + (native-search-paths '()) + + (build-type "debugoptimized") + (tests? #f) + (test-target "test") + (glib-or-gtk? #f) + (parallel-build? #t) + (parallel-tests? #f) + (validate-runpath? #t) + (patch-shebangs? #t) + (strip-binaries? #t) + (strip-flags ''("--strip-debug")) + (strip-directories ''("lib" "lib64" "libexec" + "bin" "sbin")) + (elf-directories ''("lib" "lib64" "libexec" + "bin" "sbin")) + (phases '%standard-phases) + (system (%current-system)) + (imported-modules %meson-build-system-modules) + (modules '((guix build meson-build-system) + (guix build utils))) + allowed-references + disallowed-references) + "Cross-build SOURCE for TARGET using MESON, and with INPUTS, assuming that +SOURCE has a 'meson.build' file." + (define cross-file + (make-cross-file target)) + (define inputs + (if (null? target-inputs) + (input-tuples->gexp host-inputs) + #~(append #$(input-tuples->gexp host-inputs) + #+(input-tuples->gexp target-inputs)))) + (define builder + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + + (define build-phases + #$(let ((phases (if (pair? phases) (sexp->gexp phases) phases))) + (if glib-or-gtk? + phases + #~(modify-phases #$phases + (delete 'glib-or-gtk-compile-schemas) + (delete 'glib-or-gtk-wrap))))) + + ;; Do not use 'with-build-variables', as there should be + ;; no reason to use %build-inputs and friends. + (meson-build #:source #+source + #:system #$system + #:outputs #$(outputs->gexp outputs) + #:inputs #$inputs + #:native-inputs #+(input-tuples->gexp build-inputs) + #:search-paths '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:native-search-paths '#$(sexp->gexp + (map search-path-specification->sexp + native-search-paths)) + #:phases build-phases + #:configure-flags `("--cross-file" #+cross-file + ,@#$(sexp->gexp configure-flags)) + #:build-type #$build-type + #:tests? #$tests? + #:test-target #$test-target + #:parallel-build? #$parallel-build? + #:parallel-tests? #$parallel-tests? + #:validate-runpath? #$validate-runpath? + #:patch-shebangs? #$patch-shebangs? + #:strip-binaries? #$strip-binaries? + #:strip-flags #$(sexp->gexp strip-flags) + #:strip-directories #$(sexp->gexp strip-directories) + #:elf-directories #$(sexp->gexp elf-directories))))) + + (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) + system #:graft? #f))) + (gexp->derivation name builder + #:system system + #:target target + #:substitutable? substitutable? + #:allowed-references allowed-references + #:disallowed-references disallowed-references + #:guile-for-build guile))) + (define meson-build-system (build-system (name 'meson) diff --git a/guix/build/meson-configuration.scm b/guix/build/meson-configuration.scm new file mode 100644 index 0000000000..81b4eaa7e1 --- /dev/null +++ b/guix/build/meson-configuration.scm @@ -0,0 +1,71 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Maxime Devos +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build meson-configuration) + #:use-module (ice-9 match) + #:export (write-section-header write-assignment + write-assignments make-machine-alist + configuration-port)) + +;; Commentary: +;; +;; Utilities for generating a ‘Cross build definition file’ for +;; the Meson build system. Configuration values are currently +;; never escaped. In practice this is unlikely to be a problem +;; in the build environment. +;; +;; Code: + +(define configuration-port + (fluid->parameter (make-unbound-fluid))) + +(define (write-section-header section-name) + "Write a section header for section named SECTION-NAME +to the configuration port." + (format (configuration-port) "[~a]~%" section-name)) + +(define (write-assignment key value) + "Write an assignment of VALUE to KEY to the configuration +port. VALUE must be a string (without any special characters +such as quotes), a boolean or an integer. Lists are currently +not supported" + (define port (configuration-port)) + (match value + ((? string?) + (format port "~a = '~a'~%" key value)) + ((? integer?) + (format port "~a = ~a~%" key value)) + (#f + (format port "~a = true~%" key)) + (#t + (format port "~a = false~%" key)))) + +(define* (write-assignments alist) + "Write the assignments in ALIST, an association list, +to the configuration port." + (for-each (match-lambda + ((key . value) + (write-assignment key value))) + alist)) + +(define* (make-machine-alist #:key system cpu-family cpu endian) + "Make an association list for the [host_machine] section." + `((system . ,system) + (cpu-family . ,cpu-family) + (cpu . ,cpu) + (endian . ,endian)))