From: Bruno Victal <mirai@makinata.eu>
To: 62754@debbugs.gnu.org
Cc: Bruno Victal <mirai@makinata.eu>,
mail@nicolasgoaziou.fr, zimon.toutoune@gmail.com
Subject: [bug#62754] [PATCH v3] doc: Use G-Expressions for package definition example.
Date: Sat, 6 May 2023 15:19:40 +0100 [thread overview]
Message-ID: <b8c52652d1a3f3a08f44bf0db59c2f43e3702d57.1683382757.git.mirai@makinata.eu> (raw)
In-Reply-To: <2db67ea84f7a23bf04280ad1e365ac8709167d66.1681215490.git.mirai@makinata.eu>
* 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(-)
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
base-commit: 1cb0dee3a31c6d235389d4d9787fa583c2babc30
--
2.39.2
next prev parent reply other threads:[~2023-05-06 14:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 15:13 [bug#62754] [PATCH] doc: Use G-Expressions for package definition example Bruno Victal
2023-04-10 19:00 ` Ivan Sokolov
2023-04-11 12:19 ` [bug#62754] [PATCH v2] " Bruno Victal
2023-04-21 8:21 ` Nicolas Goaziou
2023-05-05 14:06 ` Simon Tournier
2023-05-06 14:19 ` Bruno Victal [this message]
2023-05-06 16:08 ` bug#62754: [PATCH] " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8c52652d1a3f3a08f44bf0db59c2f43e3702d57.1683382757.git.mirai@makinata.eu \
--to=mirai@makinata.eu \
--cc=62754@debbugs.gnu.org \
--cc=mail@nicolasgoaziou.fr \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.