aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 535e7614fd..3557c977e1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8661,6 +8661,26 @@ Return the complete file name for @var{program} as found in
@code{$PATH}, or @code{#f} if @var{program} could not be found.
@end deffn
+@deffn {Scheme Procedure} search-input-file @var{inputs} @var{name}
+Return the complete file name for @var{name} as found in @var{inputs}.
+If @var{name} could not be found, an exception is raised instead.
+Here, @var{inputs} is an association list like @var{inputs} and
+@var{native-inputs} as available to build phases.
+@end deffn
+
+Here is a (simplified) example of how @code{search-input-file} is used
+in a build phase of the @code{wireguard-tools} package:
+
+@lisp
+(add-after 'install 'wrap-wg-quick
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((coreutils (string-append (assoc-ref inputs "coreutils")
+ "/bin")))
+ (wrap-program (search-input-file outputs "bin/wg-quick")
+ #:sh (search-input-file inputs "bin/bash")
+ `("PATH" ":" prefix ,(list coreutils))))))
+@end lisp
+
@subsection Build Phases
@cindex build phases