diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-06-11 18:42:26 +0000 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2021-06-11 14:16:05 -0700 |
commit | b0b5ef7286dca098f40f5075175105c3c0dfbe05 (patch) | |
tree | 072ca704392f8968f06410a1e996192cfd939586 /doc | |
parent | 8f3ead7190b97ce1f0458766105832d5a6e02dcf (diff) | |
download | nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.tar nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.tar.gz nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.tar.bz2 nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.tar.lz nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.tar.xz nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.tar.zst nixpkgs-b0b5ef7286dca098f40f5075175105c3c0dfbe05.zip |
stdenv: introduce dontAddStaticConfigureFlags
With removeUnknownConfigureFlags, it's impossible to express a package that needs --enable-static, but will not accept --disable-shared, without overriding the result of removeUnknownConfigureFlags _again_ in pkgs/top-level/static.nix. It would be much better (and more in line with the rest of Nixpkgs) if we encoded changes needed for static builds in package definitions themselves, rather than in an ever-expanding list in static.nix. This is especially true when doing it in static.nix is going to require multiple overrides to express what could be expressed with stdenv options. So as a step in that direction, and to fix the problem described above, here I replace removeUnknownConfigureFlags with a new stdenv option, dontAddStaticConfigureFlags. With this mechanism, a package that needs one but not both of the flags just needs to set dontAddStaticConfigureFlags and then set up configureFlags manually based on stdenv.hostPlatform.isStatic.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/stdenv/stdenv.chapter.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md index 4daeaf7c8c2..7219b5e80f7 100644 --- a/doc/stdenv/stdenv.chapter.md +++ b/doc/stdenv/stdenv.chapter.md @@ -463,6 +463,12 @@ The prefix under which the package must be installed, passed via the `--prefix` The key to use when specifying the prefix. By default, this is set to `--prefix=` as that is used by the majority of packages. +##### `dontAddStaticConfigureFlags` + +By default, when building statically, stdenv will try to add build system appropriate configure flags to try to enable static builds. + +If this is undesirable, set this variable to true. + ##### `dontAddDisableDepTrack` {#var-stdenv-dontAddDisableDepTrack} By default, the flag `--disable-dependency-tracking` is added to the configure flags to speed up Automake-based builds. If this is undesirable, set this variable to true. @@ -475,7 +481,7 @@ By default, the configure phase applies some special hackery to all files called By default, when the configure script has `--enable-static`, the option `--disable-static` is added to the configure flags. -If this is undesirable, set this variable to true. +If this is undesirable, set this variable to true. It is automatically set to true when building statically, for example through `pkgsStatic`. ##### `configurePlatforms` {#var-stdenv-configurePlatforms} |