[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/13: doc: Use G-Expressions for package definition example.
From: |
guix-commits |
Subject: |
12/13: doc: Use G-Expressions for package definition example. |
Date: |
Sat, 6 May 2023 12:21:18 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 8ffe52df47353a3ae31375c0666aa6122bf4cf0b
Author: Bruno Victal <mirai@makinata.eu>
AuthorDate: Sat May 6 15:19:40 2023 +0100
doc: Use G-Expressions for package definition example.
* doc/guix.texi (Build Phases): Use G-Expressions for example.
Co-authored-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
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 @@ phase before the @code{build} phase, called
;; 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
- 01/13: tests: Add missing module imports for marionette-evaluated code., (continued)
- 01/13: tests: Add missing module imports for marionette-evaluated code., guix-commits, 2023/05/06
- 04/13: gnu: python-ldap: Update to 3.4.3., guix-commits, 2023/05/06
- 10/13: doc: cookbook: Remove outdated section about GUIX_PACKAGE_PATH., guix-commits, 2023/05/06
- 02/13: services: dbus-service, secret-service: Do not cause (fibers) to be loaded., guix-commits, 2023/05/06
- 03/13: gnu: mod-wsgi: Update to 4.9.4., guix-commits, 2023/05/06
- 09/13: gnu: glances: Update to 3.3.1.1., guix-commits, 2023/05/06
- 06/13: lint: archival: Warn against non-origin package sources., guix-commits, 2023/05/06
- 05/13: gnu: gitile: Fix build., guix-commits, 2023/05/06
- 11/13: gnu: hostapd: Add ACS and full dynamic vlan support, guix-commits, 2023/05/06
- 07/13: gnu: msmtp: Install old msmtpqueue scripts, guix-commits, 2023/05/06
- 12/13: doc: Use G-Expressions for package definition example.,
guix-commits <=
- 08/13: gnu: python-ujson: Update to 5.7.0., guix-commits, 2023/05/06
- 13/13: download: Refer to the 'guile-gnutls' package and not 'gnutls'., guix-commits, 2023/05/06