From e279767d6927d2077255db3bf39c40030ba3791e Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 6 Jan 2019 15:40:11 +0100 Subject: doc: don't overwrite makeFlagsArray in the example Arrays like these should be appended to instead of overwritten in almost every case to avoid loosing the existing flags. --- doc/stdenv.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/stdenv.xml') diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 564471bbbbc6..ac0d84b90f96 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -1279,7 +1279,9 @@ makeFlags = [ "PREFIX=$(out)" ]; make. You must use this instead of makeFlags if the arguments contain spaces, e.g. -makeFlagsArray=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar") +preBuild = '' + makeFlagsArray+=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar") +''; Note that shell arrays cannot be passed through environment variables, so you cannot set makeFlagsArray in a derivation -- cgit v1.2.3 From adb717a153e9fda88d9bf9ac183d64fdf4887c40 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 26 Jan 2019 22:20:23 -0500 Subject: nixpkgs/manual: document default setup hooks Fixes #34857. --- doc/stdenv.xml | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 131 insertions(+), 4 deletions(-) (limited to 'doc/stdenv.xml') diff --git a/doc/stdenv.xml b/doc/stdenv.xml index ac0d84b90f96..21667252ad00 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -2192,10 +2192,128 @@ addEnvHooks "$hostOffset" myBashFunction - Here are some packages that provide a setup hook. Since the mechanism is - modular, this probably isn't an exhaustive list. Then again, since the - mechanism is only to be used as a last resort, it might be. - + First, let’s cover some setup hooks that are part of Nixpkgs + default stdenv. This means that they are run for every package + built using stdenv.mkDerivation. Some of + these are platform specific, so they may run on Linux but not + Darwin or vice-versa. + + + + move-docs.sh + + + + This setup hook moves any installed documentation to the + /share subdirectory directory. This includes + the man, doc and info directories. This is needed for legacy + programs that do not know use the share subdirectory. + + + + + + compress-man-pages.sh + + + + This setup hook compresses any man pages that have been + installed. The compression is done using the gzip program. This + helps to reduce installed size of packages. + + + + + + strip.sh + + + + This runs the strip command on installed binaries and + libraries. This removed things like debug symbols when they are + not needed. This also helps to reduce installed size of + packages. + + + + + + patch-shebangs.sh + + + + This setup hook patches installed scripts to use the full path + to the shebang interpreter. A shebang interpreter is the first + commented line of a script telling the operating system + what to use to run this script. In Nix, we want an exact path + to that interpreter to be used. This often replcaes + /bin/sh with a path in the Nix store. + + + + + + audit-tmpdir.sh + + + + This verifies that no references are left from the install + binaries to the directory used to build those binaries. This + ensures that the binaries do not need things outside the Nix + store. This currently Linux only. + + + + + + multiple-outputs.sh + + + + This setup hook adds configure flags that tell packages to + install files into any one of the proper outputs listed in + outputs. This behavior can be turned off by setting + setOutputFlags to false in the derivation + environment. See for + more information. + + + + + + move-sbin.sh + + + + This setup hook moves any binaries installed in the sbin + subdirectory into bin. In addition, a link is provided from + sbin to bin for compatibility. + + + + + + move-lib64.sh + + + + This setup hook moves any libraries installed in the lib64 + subdirectory into lib. In addition, a link is provided from + lib64 to lib for compatibility. + + + + + + set-source-date-epoch-to-latest.sh + + + + This sets SOURCE_DATE_EPOCH to the + modification time of the most recent file. + + + Bintools Wrapper @@ -2302,6 +2420,15 @@ addEnvHooks "$hostOffset" myBashFunction + + + + + Here are some more packages that provide a setup hook. Since the + mechanism is modular, this probably isn't an exhaustive list. Then + again, since the mechanism is only to be used as a last resort, it + might be. + Perl -- cgit v1.2.3 From d7b62cb601b48d0dd8a70fdc4b5169d9492e4ce2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 27 Jan 2019 11:57:36 -0500 Subject: nixpkgs/manual: address review comments Mostly taken from requested changes exactly as recommended. --- doc/stdenv.xml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'doc/stdenv.xml') diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 21667252ad00..3a51907eb8a6 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -2207,7 +2207,8 @@ addEnvHooks "$hostOffset" myBashFunction This setup hook moves any installed documentation to the /share subdirectory directory. This includes the man, doc and info directories. This is needed for legacy - programs that do not know use the share subdirectory. + programs that do not know how to use the + share subdirectory. @@ -2219,7 +2220,7 @@ addEnvHooks "$hostOffset" myBashFunction This setup hook compresses any man pages that have been installed. The compression is done using the gzip program. This - helps to reduce installed size of packages. + helps to reduce the installed size of packages. @@ -2230,9 +2231,9 @@ addEnvHooks "$hostOffset" myBashFunction This runs the strip command on installed binaries and - libraries. This removed things like debug symbols when they are - not needed. This also helps to reduce installed size of - packages. + libraries. This removes unnecessary information like debug + symbols when they are not needed. This also helps to reduce the + installed size of packages. @@ -2244,10 +2245,11 @@ addEnvHooks "$hostOffset" myBashFunction This setup hook patches installed scripts to use the full path to the shebang interpreter. A shebang interpreter is the first - commented line of a script telling the operating system - what to use to run this script. In Nix, we want an exact path - to that interpreter to be used. This often replcaes - /bin/sh with a path in the Nix store. + commented line of a script telling the operating system which + program will run the script (e.g #!/bin/bash). In + Nix, we want an exact path to that interpreter to be used. This + often replaces /bin/sh with a path in the + Nix store. @@ -2260,7 +2262,7 @@ addEnvHooks "$hostOffset" myBashFunction This verifies that no references are left from the install binaries to the directory used to build those binaries. This ensures that the binaries do not need things outside the Nix - store. This currently Linux only. + store. This is currently supported in Linux only. @@ -2425,9 +2427,9 @@ addEnvHooks "$hostOffset" myBashFunction Here are some more packages that provide a setup hook. Since the - mechanism is modular, this probably isn't an exhaustive list. Then - again, since the mechanism is only to be used as a last resort, it - might be. + list of hooks is extensible, this is not an exhaustive list the + mechanism is only to be used as a last resort, it might cover most + uses. -- cgit v1.2.3