From patchwork Sat May 6 14:19:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49832 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 53DD527BBEA; Sat, 6 May 2023 15:28:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham 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 0270327BBE2 for ; Sat, 6 May 2023 15:28:19 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvItI-0006uh-3G; Sat, 06 May 2023 10:28:04 -0400 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 1pvItG-0006uD-4h for guix-patches@gnu.org; Sat, 06 May 2023 10:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvItF-0001qS-T1 for guix-patches@gnu.org; Sat, 06 May 2023 10:28:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvItF-0002fn-Nw for guix-patches@gnu.org; Sat, 06 May 2023 10:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62754] [PATCH v3] doc: Use G-Expressions for package definition example. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 06 May 2023 14:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62754 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62754@debbugs.gnu.org Cc: Bruno Victal , mail@nicolasgoaziou.fr, zimon.toutoune@gmail.com Received: via spool by 62754-submit@debbugs.gnu.org id=B62754.168338324410221 (code B ref 62754); Sat, 06 May 2023 14:28:01 +0000 Received: (at 62754) by debbugs.gnu.org; 6 May 2023 14:27:24 +0000 Received: from localhost ([127.0.0.1]:35508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvIse-0002em-DX for submit@debbugs.gnu.org; Sat, 06 May 2023 10:27:24 -0400 Received: from smtpmciv1.myservices.hosting ([185.26.107.237]:60638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvIsc-0002ee-Tb for 62754@debbugs.gnu.org; Sat, 06 May 2023 10:27:23 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv1.myservices.hosting (Postfix) with ESMTP id 5BFE7206A4; Sat, 6 May 2023 16:27:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5D93B80098; Sat, 6 May 2023 16:19:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id EvlnLqOIV3Zx; Sat, 6 May 2023 16:19:44 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id B2FF380097; Sat, 6 May 2023 16:19:43 +0200 (CEST) From: Bruno Victal Date: Sat, 6 May 2023 15:19:40 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: <2db67ea84f7a23bf04280ad1e365ac8709167d66.1681215490.git.mirai@makinata.eu> References: <2db67ea84f7a23bf04280ad1e365ac8709167d66.1681215490.git.mirai@makinata.eu> 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Build Phases): Use G-Expressions for example. Co-authored-by: Nicolas Goaziou --- doc/guix.texi | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) base-commit: 1cb0dee3a31c6d235389d4d9787fa583c2babc30 diff --git a/doc/guix.texi b/doc/guix.texi index 55221a10c3..e4b664aba9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10140,23 +10140,31 @@ Build Phases ;; other fields omitted (build-system gnu-build-system) (arguments - '(#:phases (modify-phases %standard-phases - (delete 'configure) - (add-before 'build 'set-prefix-in-makefile - (lambda* (#:key outputs #:allow-other-keys) - ;; Modify the makefile so that its - ;; 'PREFIX' variable points to "out". - (let ((out (assoc-ref outputs "out"))) - (substitute* "Makefile" - (("PREFIX =.*") - (string-append "PREFIX = " - out "\n"))))))))))) + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-prefix-in-makefile + (lambda* (#:key inputs #:allow-other-keys) + ;; Modify the makefile so that its + ;; 'PREFIX' variable points to #$output and + ;; 'XMLLINT' points to the correct path. + (substitute* "Makefile" + (("PREFIX =.*") + (string-append "PREFIX = " #$output "\n")) + (("XMLLINT =.*") + (string-append "XMLLINT = " + (search-input-file inputs "/bin/xmllint") + "\n")))))))))) @end lisp The new phase that is inserted is written as an anonymous procedure, -introduced with @code{lambda*}; it honors the @code{outputs} parameter -we have seen before. @xref{Build Utilities}, for more about the helpers -used by this phase, and for more examples of @code{modify-phases}. +introduced with @code{lambda*}; it looks for the @file{xmllint} +executable under a @file{/bin} directory among the package's inputs +(@pxref{package Reference}). It also honors the @code{outputs} parameter +we have seen before. @xref{Build Utilities}, for more about +the helpers used by this phase, and for more examples of +@code{modify-phases}. @cindex code staging @cindex staging, of code