From a2b93f190123f9e0bba0ba5b2bf14e4e952ecfe8 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Sun, 18 Apr 2021 21:17:01 +0200 Subject: [PATCH 4/7] doc: Document 'wrap-script'. * doc/guix.texi (Wrapping Code)[wrap-script]: New section. Document 'wrap-script'. Reuse its docstring. --- doc/guix.texi | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index e8a9a31e1a..a2ff13fe0f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8698,6 +8698,27 @@ Here is an example using the @code{which} procedure in a build phase: ,(dirname (which "readlink" inputs))))))) @end lisp +@subsection Wrapping Code + +This section documents procedures that create ‘wrappers’ around existing +binaries, that e.g. set environment variables required during execution. + +@c TODO document wrap-program + +@deffn {Scheme Procedure} wrap-script @var{prog} @var{inputs} @var{vars} +Wrap the script @var{prog} such that @var{vars} are set first. The format +of @var{vars} is the same as in the @code{wrap-program} procedure. This +procedure differs from @code{wrap-program} in that it does not create a +separate shell script. Instead, @var{prog} is modified directly by prepending +a Guile script, which is interpreted as a comment in the script's language. + +Special encoding comments as supported by Python are recreated on the second +line. + +Note that this procedure can only be used once per file as Guile scripts are +not supported. +@end deffn + @subsection Build Phases @cindex build phases -- 2.31.1