From patchwork Mon Jan 8 08:02:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 58648 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 D7E4D27BBE9; Mon, 8 Jan 2024 08:06:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6CFD227BBEC for ; Mon, 8 Jan 2024 08:06:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMkd1-0003Fm-EV; Mon, 08 Jan 2024 03:04:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMkcz-0003EC-UB for guix-patches@gnu.org; Mon, 08 Jan 2024 03:04:57 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMkcz-0002lp-Lp for guix-patches@gnu.org; Mon, 08 Jan 2024 03:04:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMkd5-000809-1U for guix-patches@gnu.org; Mon, 08 Jan 2024 03:05:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68315] [PATCH 02/48] build-system: gnu: Improve gnu-cross-build style. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Jan 2024 08:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68315 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68315@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 68315-submit@debbugs.gnu.org id=B68315.170470104830111 (code B ref 68315); Mon, 08 Jan 2024 08:05:02 +0000 Received: (at 68315) by debbugs.gnu.org; 8 Jan 2024 08:04:08 +0000 Received: from localhost ([127.0.0.1]:34900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMkcB-0007pU-Vn for submit@debbugs.gnu.org; Mon, 08 Jan 2024 03:04:08 -0500 Received: from 19.mo583.mail-out.ovh.net ([46.105.35.78]:51601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMkc9-0007pA-Nz for 68315@debbugs.gnu.org; Mon, 08 Jan 2024 03:04:06 -0500 Received: from director10.ghost.mail-out.ovh.net (unknown [10.109.176.8]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4D33326B25 for <68315@debbugs.gnu.org>; Mon, 8 Jan 2024 08:03:58 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-g4dsk (unknown [10.110.178.220]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id B575D1FDF1; Mon, 8 Jan 2024 08:03:57 +0000 (UTC) Received: from ngraves.fr ([37.59.142.103]) by ghost-submission-6684bf9d7b-g4dsk with ESMTPSA id BBIRKG2sm2U5mCwAQKEHUQ (envelope-from ); Mon, 08 Jan 2024 08:03:57 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-103G0057aec1ea6-fd29-411e-b691-da76ba8b486e, 93F3D688BC7B2D554E6C57CDC3775C4FA39180DF) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 Date: Mon, 8 Jan 2024 09:02:34 +0100 Message-ID: <20240108080350.1665-2-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240108080350.1665-1-ngraves@ngraves.fr> References: <20240108080350.1665-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 12424586950433628898 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehiedgheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpedvleelgeeffeetleekueegvdfhtedvueffiefhkedtleejkeduveelgfdufeduleenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepieekfeduheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhht 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build-system/gnu.scm (gnu-cross-build): Use with-imported-modules around the gnu-cross-build builder gexp. Change-Id: I47246571b1d84a82a67a8c289fd5ad4b5a3b5aeb --- guix/build-system/gnu.scm | 93 ++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index cdbb547773..c3de5c2544 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012-2023 Ludovic Courtès +;;; Copyright © 2024 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -511,56 +512,57 @@ (define* (gnu-cross-build name cross-built inputs, and NATIVE-INPUTS are inputs that run on the build platform." (define builder - #~(begin - (use-modules #$@(sexp->gexp modules)) + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) - (define %build-host-inputs - #+(input-tuples->gexp build-inputs)) + (define %build-host-inputs + #+(input-tuples->gexp build-inputs)) - (define %build-target-inputs - (append #$(input-tuples->gexp host-inputs) - #+(input-tuples->gexp target-inputs))) + (define %build-target-inputs + (append #$(input-tuples->gexp host-inputs) + #+(input-tuples->gexp target-inputs))) - (define %build-inputs - (append %build-host-inputs %build-target-inputs)) + (define %build-inputs + (append %build-host-inputs %build-target-inputs)) - (define %outputs - #$(outputs->gexp outputs)) + (define %outputs + #$(outputs->gexp outputs)) - (gnu-build #:source #+source - #:system #$system - #:build #$build - #:target #$target - #:outputs %outputs - #:inputs %build-target-inputs - #:native-inputs %build-host-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 #$(if (pair? phases) - (sexp->gexp phases) - phases) - #:locale #$locale - #:bootstrap-scripts #$bootstrap-scripts - #:configure-flags #$configure-flags - #:make-flags #$make-flags - #:out-of-source? #$out-of-source? - #:tests? #$tests? - #:test-target #$test-target - #:parallel-build? #$parallel-build? - #:parallel-tests? #$parallel-tests? - #:patch-shebangs? #$patch-shebangs? - #:license-file-regexp #$license-file-regexp - #:strip-binaries? #$strip-binaries? - #:validate-runpath? #$validate-runpath? - #:make-dynamic-linker-cache? #$make-dynamic-linker-cache? - #:license-file-regexp #$license-file-regexp - #:strip-flags #$strip-flags - #:strip-directories #$strip-directories))) + (gnu-build #:source #+source + #:system #$system + #:build #$build + #:target #$target + #:outputs %outputs + #:inputs %build-target-inputs + #:native-inputs %build-host-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 #$(if (pair? phases) + (sexp->gexp phases) + phases) + #:locale #$locale + #:bootstrap-scripts #$bootstrap-scripts + #:configure-flags #$configure-flags + #:make-flags #$make-flags + #:out-of-source? #$out-of-source? + #:tests? #$tests? + #:test-target #$test-target + #:parallel-build? #$parallel-build? + #:parallel-tests? #$parallel-tests? + #:patch-shebangs? #$patch-shebangs? + #:license-file-regexp #$license-file-regexp + #:strip-binaries? #$strip-binaries? + #:validate-runpath? #$validate-runpath? + #:make-dynamic-linker-cache? #$make-dynamic-linker-cache? + #:license-file-regexp #$license-file-regexp + #:strip-flags #$strip-flags + #:strip-directories #$strip-directories)))) (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f))) @@ -568,7 +570,6 @@ (define %outputs #:system system #:target target #:graft? #f - #:modules imported-modules #:substitutable? substitutable? #:allowed-references allowed-references #:disallowed-references disallowed-references