diff mbox series

[bug#62754,v3] doc: Use G-Expressions for package definition example.

Message ID b8c52652d1a3f3a08f44bf0db59c2f43e3702d57.1683382757.git.mirai@makinata.eu
State New
Headers show
Series [bug#62754,v3] doc: Use G-Expressions for package definition example. | expand

Commit Message

Bruno Victal May 6, 2023, 2:19 p.m. UTC
* doc/guix.texi (Build Phases): Use G-Expressions for example.

Co-authored-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
---
 doc/guix.texi | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)


base-commit: 1cb0dee3a31c6d235389d4d9787fa583c2babc30

Comments

Ludovic Courtès May 6, 2023, 4:08 p.m. UTC | #1
Hi,

Bruno Victal <mirai@makinata.eu> skribis:

> * doc/guix.texi (Build Phases): Use G-Expressions for example.
>
> Co-authored-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>

Applied, thank you, and thanks Simon and Nicolas!

Ludo’.
diff mbox series

Patch

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