summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorSarthak Shah <shahsarthakw@gmail.com>2023-04-25 17:52:10 +0530
committerLudovic Courtès <ludo@gnu.org>2023-05-04 17:06:44 +0200
commitae11fcb84ac478dfa56d322ef08890645183a087 (patch)
tree5c6c5131278d1534037fee8a95a4faf9a11b3dbd /doc
parentb20b7e61a33e2a6647397de31daa59431bb8e18e (diff)
downloadguix-ae11fcb84ac478dfa56d322ef08890645183a087.tar.gz
transformations: Add '--with-configure-flag'.
* guix/transformations.scm (transform-package-configure-flag): New
procedure.
(%transformation-options, %transformation-options)
(show-transformation-options-help/detailed): Add it.
* tests/transformations.scm ("options->transformation,
with-configure-flag"): New test.
* doc/guix.texi (Package Transformation Options): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 7af2a85499..55221a10c3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -12919,6 +12919,35 @@ guix build coreutils --with-patch=glibc=./glibc-frob.patch
 In this example, glibc itself as well as everything that leads to
 Coreutils in the dependency graph is rebuilt.
 
+@cindex configure flags, changing them
+@item --with-configure-flag=@var{package}=@var{flag}
+Append @var{flag} to the configure flags of @var{package}, where
+@var{package} is a spec such as @code{guile@@3.0} or @code{glibc}.  The
+build system of @var{package} must support the @code{#:configure-flags}
+argument.
+
+For example, the command below builds GNU@tie{}Hello with the
+configure flag @code{--disable-nls}:
+
+@example
+guix build hello --with-configure-flag=hello=--disable-nls
+@end example
+
+The following command passes an extra flag to @command{cmake} as it
+builds @code{lapack}:
+
+@example
+guix build lapack \
+  --with-configure-flag=lapack=-DBUILD_COMPLEX=OFF
+@end example
+
+@quotation Note
+Under the hood, this option works by passing the
+@samp{#:configure-flags} argument to the build system of the package of
+interest (@pxref{Build Systems}).  Most build systems support that
+option but some do not.  In that case, an error is raised.
+@end quotation
+
 @cindex upstream, latest version
 @item --with-latest=@var{package}
 @itemx --with-version=@var{package}=@var{version}