From patchwork Mon Mar 14 22:57:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Sample X-Patchwork-Id: 37821 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 0566C27BBEA; Mon, 14 Mar 2022 22:58:28 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED 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 6B8D927BBE9 for ; Mon, 14 Mar 2022 22:58:27 +0000 (GMT) Received: from localhost ([::1]:52536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTtdy-0007vv-Id for patchwork@mira.cbaines.net; Mon, 14 Mar 2022 18:58:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTtdb-0007Gz-RE for guix-patches@gnu.org; Mon, 14 Mar 2022 18:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTtdb-0004w4-BD for guix-patches@gnu.org; Mon, 14 Mar 2022 18:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTtdb-00052v-9v for guix-patches@gnu.org; Mon, 14 Mar 2022 18:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54394] [PATCH core-updates 03/12] gnu-bootstrap: Allow multiple module directories. Resent-From: Timothy Sample Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Mar 2022 22:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54394@debbugs.gnu.org Cc: Timothy Sample Received: via spool by 54394-submit@debbugs.gnu.org id=B54394.164729868219383 (code B ref 54394); Mon, 14 Mar 2022 22:58:03 +0000 Received: (at 54394) by debbugs.gnu.org; 14 Mar 2022 22:58:02 +0000 Received: from localhost ([127.0.0.1]:46872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTtdZ-00052S-Sj for submit@debbugs.gnu.org; Mon, 14 Mar 2022 18:58:02 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:49541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTtdY-00052B-PM for 54394@debbugs.gnu.org; Mon, 14 Mar 2022 18:58:01 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9AE3D5C01F2; Mon, 14 Mar 2022 18:57:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 14 Mar 2022 18:57:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=biLz8c H3xsv7fSUbxIVteTx17M64Yqw2WrVQgUk6LHk=; b=ToV39FKyP7gpPuY1LPzUIz sQgZqkmKFOdcte6yr6dBwMummfWbNS7/elkmw5nXFQtY1EMgxAcxkUxivNwmpOkv Y40B72x1PsTaKTuqaVtIZjfFQd2gw54Ka+2OgQpasheKTHa8muPQUmxkfdP8EIhO xtmAjr+Vg5q9RiJabmVSQGz2AmUTuN/jweUlda4ABHzn+tGgey2ygtXuoX9c31UB qHTAISu0eryBVJyIGWvXshIxdcAYK4z7pZ6MPDM+g1Ze1bi3LMEkpUBydnZrURKH lW/rmxb6WhzRJBzwWV5uTyG+Ee4BuizjglUA4UV/9q5Y1cR5dTOYY5003fclHwVQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvledgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhimhhothhhhicuufgrmhhplhgvuceoshgrmhhplhgvthes nhhghihrohdrtghomheqnecuggftrfgrthhtvghrnhepkeefhfeigeeuffelhffhheegve ekteegkeegkefhjeetjeevgffguddtjeevgeefnecuffhomhgrihhnpehnghihrhhordgt ohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsh grmhhplhgvthesnhhghihrohdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Mar 2022 18:57:55 -0400 (EDT) From: Timothy Sample Date: Mon, 14 Mar 2022 16:57:02 -0600 Message-Id: <20220314225712.19869-3-samplet@ngyro.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <87v8wg40dl.fsf@ngyro.com> References: <87v8wg40dl.fsf@ngyro.com> MIME-Version: 1.0 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/build/gnu-bootstrap.scm (bootstrap-configure, bootstrap-build, bootstrap-install): Treat the 'modules' argument as a list of directories. * gnu/packages/commencement.scm (bootar, gash-boot, gash-utils-boot): Adjust call sites. --- gnu/packages/commencement.scm | 18 +++++++++--------- guix/build/gnu-bootstrap.scm | 21 ++++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 644db8cc58..fd3a9c37e7 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -121,9 +121,9 @@ (define bootar (invoke guile "--no-auto-compile" source) (chdir "bootar")))) (replace 'configure (bootstrap-configure "Bootar" ,version - "." "scripts")) - (replace 'build (bootstrap-build ".")) - (replace 'install (bootstrap-install "." "scripts")))))) + '(".") "scripts")) + (replace 'build (bootstrap-build '("."))) + (replace 'install (bootstrap-install '(".") "scripts")))))) (inputs `(("guile" ,%bootstrap-guile))) (home-page "https://git.ngyro.com/bootar") (synopsis "Tar decompression and extraction in Guile Scheme") @@ -158,9 +158,9 @@ (define gash-boot (modify-phases %standard-phases (replace 'configure (bootstrap-configure "Gash" ,(package-version gash) - "gash" "scripts")) - (replace 'build (bootstrap-build "gash")) - (replace 'install (bootstrap-install "gash" "scripts")) + '("gash") "scripts")) + (replace 'build (bootstrap-build '("gash"))) + (replace 'install (bootstrap-install '("gash") "scripts")) (add-after 'install 'install-symlinks (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -222,9 +222,9 @@ (define gash-utils-boot (delete-file "scripts/template.in"))) (replace 'configure (bootstrap-configure "Gash-Utils" ,(package-version gash-utils) - "gash" "scripts")) - (replace 'build (bootstrap-build "gash")) - (replace 'install (bootstrap-install "gash" "scripts")) + '("gash") "scripts")) + (replace 'build (bootstrap-build '("gash"))) + (replace 'install (bootstrap-install '("gash") "scripts")) ;; XXX: The scripts should add Gash to their load paths and ;; this phase should not exist. (add-after 'install 'copy-gash diff --git a/guix/build/gnu-bootstrap.scm b/guix/build/gnu-bootstrap.scm index 7ca6ae8458..b4257a3717 100644 --- a/guix/build/gnu-bootstrap.scm +++ b/guix/build/gnu-bootstrap.scm @@ -25,6 +25,7 @@ (define-module (guix build gnu-bootstrap) #:use-module (guix build utils) + #:use-module (srfi srfi-1) #:use-module (system base compile) #:export (bootstrap-configure bootstrap-build @@ -32,7 +33,7 @@ (define-module (guix build gnu-bootstrap) (define (bootstrap-configure name version modules scripts) "Create a procedure that configures an early bootstrap package. The -procedure will search the MODULES directory and configure all of the +procedure will search each directory in MODULES and configure all of the '.in' files with NAME and VERSION. It will then search the SCRIPTS directory and configure all of the '.in' files with the bootstrap Guile and its module and object directories." @@ -52,9 +53,8 @@ (define (bootstrap-configure name version modules scripts) (substitute* target (("@PACKAGE_NAME@") name) (("@VERSION@") version)))) - (find-files modules - (lambda (fn st) - (string-suffix? ".in" fn)))) + (append-map (lambda (dir) (find-files dir "\\.in$")) + modules)) (for-each (lambda (template) (format #t "Configuring ~a~%" template) (let ((target (string-drop-right template 3))) @@ -71,7 +71,7 @@ (define (bootstrap-configure name version modules scripts) (define (bootstrap-build modules) "Create a procedure that builds an early bootstrap package. The -procedure will search the MODULES directory and compile all of the +procedure will search each directory in MODULES and compile all of the '.scm' files." (lambda _ (add-to-load-path (getcwd)) @@ -81,13 +81,15 @@ (define (bootstrap-build modules) (dir (dirname scm))) (format #t "Compiling ~a~%" scm) (compile-file scm #:output-file go))) - (find-files modules "\\.scm$")) + (append-map (lambda (dir) (find-files dir "\\.scm$")) + modules)) #t)) (define (bootstrap-install modules scripts) "Create a procedure that installs an early bootstrap package. The -procedure will install all of the '.scm' and '.go' files in the MODULES -directory, and all the executable files in the SCRIPTS directory." +procedure will install all of the '.scm' and '.go' files in each of the +directories in MODULES, and all the executable files in the SCRIPTS +directory." (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (guile-dir (assoc-ref inputs "guile")) @@ -105,7 +107,8 @@ (define (bootstrap-install modules scripts) (install-file scm (string-append moddir "/" dir)) (format #t "Installing ~a~%" go) (install-file go (string-append godir "/" dir)))) - (find-files modules "\\.scm$")) + (append-map (lambda (dir) (find-files dir "\\.scm$")) + modules)) (for-each (lambda (script) (format #t "Installing ~a~%" script) (install-file script (string-append out "/bin")))