Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: Remove unnecessary --disable-static #66759

Merged
merged 2 commits into from
Aug 31, 2019

Conversation

nh2
Copy link
Contributor

@nh2 nh2 commented Aug 17, 2019

Motivation for this change

Removes unnecessary --disable-static for most of the few packages that still give it explicitly.

The true-by-default dontDisableStatic already takes care of it.

Fixes these packages not being overridable to have static libs.

Grepping

Before:

% git grep 'disable-static' HEAD~~ 
HEAD~~:doc/stdenv.xml:       <option>--disable-static</option> is added to the configure flags.
HEAD~~:pkgs/applications/display-managers/lightdm/default.nix:    "--disable-static"
HEAD~~:pkgs/applications/misc/kiwix/default.nix:    "--disable-static"
HEAD~~:pkgs/applications/misc/kiwix/default.nix:    "--disable-staticbins"
HEAD~~:pkgs/applications/networking/ids/snort/default.nix:    "--disable-static-daq"
HEAD~~:pkgs/applications/science/electronics/alliance/default.nix:    "--disable-static"
HEAD~~:pkgs/applications/science/logic/verit/default.nix:  # --disable-static actually enables static linking here...
HEAD~~:pkgs/applications/video/mkvtoolnix/default.nix:    "--disable-static-qt"
HEAD~~:pkgs/applications/video/mpv/default.nix:    "--disable-static-build"
HEAD~~:pkgs/desktops/gnome-3/core/mutter/3.28.nix:    "--disable-static"
HEAD~~:pkgs/development/libraries/blitz/default.nix:      "--disable-static"
HEAD~~:pkgs/development/libraries/boehm-gc/7.6.6.nix:    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
HEAD~~:pkgs/development/libraries/boehm-gc/default.nix:    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
HEAD~~:pkgs/development/libraries/concurrencykit/default.nix:  #Deleting this line causes "Unknown option --disable-static"
HEAD~~:pkgs/development/libraries/ffmpeg-full/default.nix:    "--enable-shared --disable-static"
HEAD~~:pkgs/development/libraries/ffmpeg/generic.nix:      "--disable-static"
HEAD~~:pkgs/development/libraries/fftw/default.nix:    [ "--enable-shared" "--disable-static"
HEAD~~:pkgs/development/libraries/freetype/default.nix:  configureFlags = [ "--disable-static" "--bindir=$(dev)/bin" "--enable-freetype-config" ];
HEAD~~:pkgs/development/libraries/ijs/default.nix:  configureFlags = [ "--disable-static" "--enable-shared" ];
HEAD~~:pkgs/development/libraries/libpsl/default.nix:    "--disable-static"
HEAD~~:pkgs/development/libraries/librep/default.nix:    "--disable-static"
HEAD~~:pkgs/development/libraries/libunity/default.nix:    "--disable-static"
HEAD~~:pkgs/development/libraries/libvpx/default.nix:       "--disable-static --enable-shared")
HEAD~~:pkgs/development/libraries/stlport/default.nix:  # fix hardcoded /usr/bin; not recognizing the standard --disable-static flag
HEAD~~:pkgs/development/libraries/vapoursynth/default.nix:    "--disable-static"
HEAD~~:pkgs/development/libraries/xml-security-c/default.nix:    "--disable-static"
HEAD~~:pkgs/development/tools/misc/binutils/default.nix:    (if enableShared then [ "--enable-shared" "--disable-static" ]
HEAD~~:pkgs/misc/drivers/epkowa/default.nix:  configureFlags = [ "--disable-static" "--enable-dependency-reduction" "--disable-frontend"];
HEAD~~:pkgs/misc/drivers/gutenprint/default.nix:    "--disable-static-genppd" # should be harmless on NixOS
HEAD~~:pkgs/servers/firebird/default.nix:      # "--disable-static"
HEAD~~:pkgs/stdenv/generic/setup.sh:            configureFlags="--disable-static $configureFlags"
HEAD~~:pkgs/tools/admin/tigervnc/default.nix:        --disable-xorgcfg --disable-xprint --disable-static \
HEAD~~:pkgs/tools/filesystems/avfs/default.nix:    "--disable-static"
HEAD~~:pkgs/tools/networking/tcptraceroute/default.nix:   # for reasons unknown --disable-static configure flag doesn't disable static
HEAD~~:pkgs/tools/networking/webalizer/default.nix:    "--disable-static"

After:

% git grep 'disable-static'
doc/stdenv.xml:       <option>--disable-static</option> is added to the configure flags.
pkgs/applications/misc/kiwix/default.nix:    "--disable-staticbins"
pkgs/applications/networking/ids/snort/default.nix:    "--disable-static-daq"
pkgs/applications/science/logic/verit/default.nix:  # --disable-static actually enables static linking here...
pkgs/applications/video/mkvtoolnix/default.nix:    "--disable-static-qt"
pkgs/applications/video/mpv/default.nix:    "--disable-static-build"
pkgs/development/libraries/boehm-gc/7.6.6.nix:    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
pkgs/development/libraries/boehm-gc/default.nix:    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
pkgs/development/libraries/concurrencykit/default.nix:  #Deleting this line causes "Unknown option --disable-static"
pkgs/development/libraries/stlport/default.nix:  # fix hardcoded /usr/bin; not recognizing the standard --disable-static flag
pkgs/development/tools/misc/binutils/default.nix:    (if enableShared then [ "--enable-shared" "--disable-static" ]
pkgs/misc/drivers/gutenprint/default.nix:    "--disable-static-genppd" # should be harmless on NixOS
pkgs/stdenv/generic/setup.sh:            configureFlags="--disable-static $configureFlags"
pkgs/tools/admin/tigervnc/default.nix:        --disable-xorgcfg --disable-xprint --disable-static \
pkgs/tools/networking/tcptraceroute/default.nix:   # for reasons unknown --disable-static configure flag doesn't disable static

For boehm-gc I wasn't sure, see https://github.com/NixOS/nixpkgs/pull/34645/files/bd11ffd2677081870971e583b3ed69d3e2b468b9#diff-fb963edb2daf02292a13632110f8bbf3 (CC @dtzWill)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @dtzWill @matthewbauer @Ericson2314

The true-by-default `dontDisableStatic` already takes care of it.

Fixes freetype not being overridable to have static libs.
The true-by-default `dontDisableStatic` already takes care of it.

Fixes these packages not being overridable to have static libs.
@nh2 nh2 requested a review from dtzWill August 17, 2019 14:56
@nh2
Copy link
Contributor Author

nh2 commented Aug 17, 2019

I haven't built that yet so we should make sure everything builds fine before merging this.

@disassembler disassembler merged commit 9e78f76 into NixOS:staging Aug 31, 2019
@Ericson2314
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants