summary refs log tree commit diff
path: root/doc/stdenv.xml
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-10-07 15:55:16 +0200
committerProfpatsch <mail@profpatsch.de>2016-10-08 23:36:40 +0200
commitdd58d24fa612df73264bb69f82517e1c2bc6999a (patch)
treeb7340b0798ecd4b22e7097661ebe9095b26bef32 /doc/stdenv.xml
parent40fc02bb30343a79c827fce478436d9d72ab0f86 (diff)
downloadnixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.tar
nixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.tar.gz
nixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.tar.bz2
nixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.tar.lz
nixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.tar.xz
nixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.tar.zst
nixlib-dd58d24fa612df73264bb69f82517e1c2bc6999a.zip
stdenv: document makeWrapper
Add function documentation to `makeWrapper`.
Also add user documentation to the nixpkgs manual.
Diffstat (limited to 'doc/stdenv.xml')
-rw-r--r--doc/stdenv.xml44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 2e88d6b41548..b05b7cd2b3b6 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -1091,7 +1091,35 @@ 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>
@@ -1250,6 +1278,22 @@ someVar=$(stripHash $name; echo $strippedName)
 
     </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>