summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-02-05 14:03:41 +0100
committerVladimír Čunát <vcunat@gmail.com>2017-02-05 14:09:22 +0100
commit3b583d943ee31f36d422167aed391689f5ab93f0 (patch)
tree93f43986418c89142f3adb271deb4369b08da2b6 /doc
parent372cb3760e7e3f7dc544e83b252628f5fe1cef03 (diff)
parent5ae18574fcea525861e721fb6cb510630a3ad1ec (diff)
Merge #19328: mkWrapper fix and docs
Diffstat (limited to 'doc')
-rw-r--r--doc/stdenv.xml44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 6ec5c9f2814f..a2530e102ca8 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -1111,6 +1111,34 @@ functions.</para>
<variablelist>
+ <varlistentry xml:id='fun-makeWrapper'>
+ <term><function>makeWrapper</function>
+ <replaceable>executable</replaceable>
+ <replaceable>wrapperfile</replaceable>
+ <replaceable>args</replaceable></term>
+ <listitem><para>Constructs a wrapper for a program with various
+ possible arguments. For example:
+
+<programlisting>
+# adds `FOOBAR=baz` to `$out/bin/foo`’s environment
+makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz
+
+# prefixes the binary paths of `hello` and `git`
+# Be advised that paths often should be patched in directly
+# (via string replacements or in `configurePhase`).
+makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello git ]}
+</programlisting>
+
+ There’s many more kinds of arguments, they are documented in
+ <literal>nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh</literal>.</para>
+
+ <para><literal>wrapProgram</literal> is a convenience function you probably
+ want to use most of the time.</para>
+
+ </listitem>
+ </varlistentry>
+
+
<varlistentry xml:id='fun-substitute'>
<term><function>substitute</function>
<replaceable>infile</replaceable>
@@ -1268,6 +1296,22 @@ someVar=$(stripHash $name)
</para></listitem>
</varlistentry>
+
+
+ <varlistentry xml:id='fun-wrapProgram'>
+ <term><function>wrapProgram</function>
+ <replaceable>executable</replaceable>
+ <replaceable>makeWrapperArgs</replaceable></term>
+ <listitem><para>Convenience function for <literal>makeWrapper</literal>
+ that automatically creates a sane wrapper file
+
+ It takes all the same arguments as <literal>makeWrapper</literal>,
+ except for <literal>--argv0</literal>.</para>
+
+ <para>It cannot be applied multiple times, since it will overwrite the wrapper
+ file.</para>
+ </listitem>
+ </varlistentry>
</variablelist>