diff mbox series

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

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

Commit Message

Bruno Victal April 10, 2023, 3:13 p.m. UTC
* doc/guix.texi (Build Phases): Use G-Expressions for example.
---
 doc/guix.texi | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)


base-commit: b78d6ceaa07be3c7582627cd28712b67102e521c

Comments

Ivan Sokolov April 10, 2023, 7 p.m. UTC | #1
Bruno Victal <mirai@makinata.eu> writes:

> * doc/guix.texi (Build Phases): Use G-Expressions for example.
> ---
>  doc/guix.texi | 29 +++++++++++++++++------------
>  1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index ed42488882..100ad93a3e 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -10131,21 +10131,26 @@ 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 "out" 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
> +introduced with @code{lambda*}; it honors the @code{inputs} 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}.
>  
>
> base-commit: b78d6ceaa07be3c7582627cd28712b67102e521c

inputs parameter has not previously appeared in the documentation, the
sentence before last does not make sense anymore.
diff mbox series

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index ed42488882..100ad93a3e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10131,21 +10131,26 @@  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 "out" 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
+introduced with @code{lambda*}; it honors the @code{inputs} 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}.