From dd58d24fa612df73264bb69f82517e1c2bc6999a Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 7 Oct 2016 15:55:16 +0200 Subject: stdenv: document makeWrapper Add function documentation to `makeWrapper`. Also add user documentation to the nixpkgs manual. --- doc/stdenv.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'doc/stdenv.xml') diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 2e88d6b41548f..b05b7cd2b3b6e 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -1091,7 +1091,35 @@ functions. + + + makeWrapper + executable + wrapperfile + args + Constructs a wrapper for a program with various + possible arguments. For example: + + +# 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 ]} + + + There’s many more kinds of arguments, they are documented in + nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh. + + wrapProgram is a convenience function you probably + want to use most of the time. + + + + substitute infile @@ -1250,6 +1278,22 @@ someVar=$(stripHash $name; echo $strippedName) + + + + wrapProgram + executable + makeWrapperArgs + Convenience function for makeWrapper + that automatically creates a sane wrapper file + + It takes all the same arguments as makeWrapper, + except for --argv0. + + It cannot be applied multiple times, since it will overwrite the wrapper + file. + + -- cgit 1.4.1