lol

treewide: Start to break up static overlay

We can use use `stdenv.hostPlatform.isStatic` instead, and move the
logic per package. The least opionated benefit of this is that it makes
it much easier to replace packages with modified ones, as there is no
longer any issue of overlay order.

CC @FRidh @matthewbauer

+136 -189
+1 -1
pkgs/development/compilers/gcc/10/default.nix
··· 7 7 , profiledCompiler ? false 8 8 , langJit ? false 9 9 , staticCompiler ? false 10 - , enableShared ? true 10 + , enableShared ? !stdenv.targetPlatform.isStatic 11 11 , enableLTO ? true 12 12 , texinfo ? null 13 13 , perl ? null # optional, for texi2pod (then pod2man)
+1 -1
pkgs/development/compilers/gcc/4.8/default.nix
··· 7 7 , profiledCompiler ? false 8 8 , langJit ? false 9 9 , staticCompiler ? false 10 - , enableShared ? true 10 + , enableShared ? !stdenv.targetPlatform.isStatic 11 11 , enableLTO ? true 12 12 , texinfo ? null 13 13 , perl ? null # optional, for texi2pod (then pod2man); required for Java
+1 -1
pkgs/development/compilers/gcc/4.9/default.nix
··· 7 7 , profiledCompiler ? false 8 8 , langJit ? false 9 9 , staticCompiler ? false 10 - , enableShared ? true 10 + , enableShared ? !stdenv.targetPlatform.isStatic 11 11 , enableLTO ? true 12 12 , texinfo ? null 13 13 , perl ? null # optional, for texi2pod (then pod2man); required for Java
+1 -1
pkgs/development/compilers/gcc/6/default.nix
··· 8 8 , profiledCompiler ? false 9 9 , langJit ? false 10 10 , staticCompiler ? false 11 - , enableShared ? true 11 + , enableShared ? !stdenv.targetPlatform.isStatic 12 12 , enableLTO ? true 13 13 , texinfo ? null 14 14 , flex
+1 -1
pkgs/development/compilers/gcc/7/default.nix
··· 6 6 , profiledCompiler ? false 7 7 , langJit ? false 8 8 , staticCompiler ? false 9 - , enableShared ? true 9 + , enableShared ? !stdenv.targetPlatform.isStatic 10 10 , enableLTO ? true 11 11 , texinfo ? null 12 12 , perl ? null # optional, for texi2pod (then pod2man)
+1 -1
pkgs/development/compilers/gcc/8/default.nix
··· 6 6 , profiledCompiler ? false 7 7 , langJit ? false 8 8 , staticCompiler ? false 9 - , enableShared ? true 9 + , enableShared ? !stdenv.targetPlatform.isStatic 10 10 , enableLTO ? true 11 11 , texinfo ? null 12 12 , perl ? null # optional, for texi2pod (then pod2man)
+1 -1
pkgs/development/compilers/gcc/9/default.nix
··· 8 8 , profiledCompiler ? false 9 9 , langJit ? false 10 10 , staticCompiler ? false 11 - , enableShared ? true 11 + , enableShared ? !stdenv.targetPlatform.isStatic 12 12 , enableLTO ? true 13 13 , texinfo ? null 14 14 , perl ? null # optional, for texi2pod (then pod2man)
+2 -1
pkgs/development/compilers/llvm/10/libc++/default.nix
··· 1 1 { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++";
+2 -1
pkgs/development/compilers/llvm/10/libc++abi.nix
··· 1 1 { stdenv, cmake, fetch, libcxx, libunwind, llvm, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++abi";
+3 -1
pkgs/development/compilers/llvm/10/libunwind.nix
··· 1 - { stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: 1 + { stdenv, version, fetch, cmake, fetchpatch 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 pname = "libunwind";
+2 -1
pkgs/development/compilers/llvm/11/libc++/default.nix
··· 1 1 { lib, stdenv, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++";
+2 -1
pkgs/development/compilers/llvm/11/libc++abi.nix
··· 1 1 { stdenv, cmake, fetch, libcxx, libunwind, llvm, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++abi";
+3 -1
pkgs/development/compilers/llvm/11/libunwind.nix
··· 1 - { stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: 1 + { stdenv, version, fetch, cmake, fetchpatch 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 pname = "libunwind";
+2 -1
pkgs/development/compilers/llvm/7/libc++/default.nix
··· 1 1 { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version 2 - , enableShared ? ! stdenv.hostPlatform.isMusl }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++";
+2 -1
pkgs/development/compilers/llvm/7/libc++abi.nix
··· 1 1 { stdenv, cmake, fetch, libcxx, llvm, version 2 2 , standalone ? false 3 3 # on musl the shared objects don't build 4 - , enableShared ? ! stdenv.hostPlatform.isMusl }: 4 + , enableShared ? !stdenv.hostPlatform.isStatic 5 + }: 5 6 6 7 stdenv.mkDerivation { 7 8 pname = "libc++abi";
+2 -1
pkgs/development/compilers/llvm/8/libc++/default.nix
··· 1 1 { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++";
+2 -1
pkgs/development/compilers/llvm/8/libc++abi.nix
··· 1 1 { stdenv, cmake, fetch, libcxx, libunwind, llvm, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++abi";
+3 -1
pkgs/development/compilers/llvm/8/libunwind.nix
··· 1 - { stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: 1 + { stdenv, version, fetch, cmake, fetchpatch 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 stdenv.mkDerivation { 4 6 pname = "libunwind";
+2 -1
pkgs/development/compilers/llvm/9/libc++/default.nix
··· 1 1 { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++";
+2 -1
pkgs/development/compilers/llvm/9/libc++abi.nix
··· 1 1 { stdenv, cmake, fetch, libcxx, libunwind, llvm, version 2 - , enableShared ? true }: 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 6 pname = "libc++abi";
+3 -1
pkgs/development/compilers/llvm/9/libunwind.nix
··· 1 - { stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: 1 + { stdenv, version, fetch, cmake, fetchpatch 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 pname = "libunwind";
+2 -1
pkgs/development/libraries/arrow-cpp/default.nix
··· 1 1 { stdenv, lib, fetchurl, fetchFromGitHub, fetchpatch, fixDarwinDylibNames 2 2 , autoconf, boost, brotli, cmake, flatbuffers, gflags, glog, gtest, lz4 3 3 , perl, python3, rapidjson, snappy, thrift, utf8proc, which, zlib, zstd 4 - , enableShared ? true }: 4 + , enableShared ? !stdenv.hostPlatform.isStatic 5 + }: 5 6 6 7 let 7 8 arrow-testing = fetchFromGitHub {
+1 -1
pkgs/development/libraries/audiofile/default.nix
··· 38 38 # 39 39 # There might be a more sensible way to do this with autotools, but I am not 40 40 # smart enough to discover it. 41 - preBuild = lib.optionalString stdenv.targetPlatform.isStatic '' 41 + preBuild = lib.optionalString stdenv.hostPlatform.isStatic '' 42 42 make -C libaudiofile $makeFlags 43 43 sed -i "s/dependency_libs=.*/dependency_libs=' -lstdc++'/" libaudiofile/libaudiofile.la 44 44 '';
+1 -1
pkgs/development/libraries/boost/generic.nix
··· 8 8 , enableDebug ? false 9 9 , enableSingleThreaded ? false 10 10 , enableMultiThreaded ? true 11 - , enableShared ? !(stdenv.hostPlatform.libc == "msvcrt") # problems for now 11 + , enableShared ? !(with stdenv.hostPlatform; isStatic || libc == "msvcrt") # problems for now 12 12 , enableStatic ? !enableShared 13 13 , enablePython ? false 14 14 , enableNumpy ? false
+3 -1
pkgs/development/libraries/fmt/default.nix
··· 1 - { stdenv, fetchFromGitHub, fetchpatch, cmake, enableShared ? true }: 1 + { stdenv, fetchFromGitHub, fetchpatch, cmake 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 let 4 6 generic = { version, sha256, patches ? [ ] }:
+3 -1
pkgs/development/libraries/gflags/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake, enableShared ? true}: 1 + { stdenv, fetchFromGitHub, cmake 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 pname = "gflags";
+4 -1
pkgs/development/libraries/gmp/5.1.x.nix
··· 1 - { stdenv, fetchurl, m4, cxx ? true, withStatic ? true }: 1 + { stdenv, fetchurl, m4 2 + , cxx ? true 3 + , withStatic ? stdenv.hostPlatform.isStatic 4 + }: 2 5 3 6 let inherit (stdenv.lib) optional; in 4 7
+2 -1
pkgs/development/libraries/gmp/6.x.nix
··· 1 1 { stdenv, fetchurl, m4 2 2 , cxx ? !stdenv.hostPlatform.useAndroidPrebuilt && !stdenv.hostPlatform.isWasm 3 3 , buildPackages 4 - , withStatic ? false }: 4 + , withStatic ? stdenv.hostPlatform.isStatic 5 + }: 5 6 6 7 # Note: this package is used for bootstrapping fetchurl, and thus 7 8 # cannot use fetchpatch! All mutable patches (generated by GitHub or
+4 -1
pkgs/development/libraries/libbacktrace/default.nix
··· 1 - { stdenv, callPackage, fetchFromGitHub, enableStatic ? false, enableShared ? true }: 1 + { stdenv, callPackage, fetchFromGitHub 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + , enableShared ? !stdenv.hostPlatform.isStatic 4 + }: 2 5 let 3 6 yesno = b: if b then "yes" else "no"; 4 7 in stdenv.mkDerivation rec {
+4 -1
pkgs/development/libraries/libexecinfo/default.nix
··· 1 - { stdenv, fetchurl, fetchpatch, enableStatic ? true, enableShared ? true }: 1 + { stdenv, fetchurl, fetchpatch 2 + , enableStatic ? true 3 + , enableShared ? !stdenv.hostPlatform.isStatic 4 + }: 2 5 3 6 stdenv.mkDerivation rec { 4 7 pname = "libexecinfo";
+3 -1
pkgs/development/libraries/libiberty/default.nix
··· 1 - { stdenv, buildPackages, staticBuild ? false }: 1 + { stdenv, buildPackages 2 + , staticBuild ? stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 let inherit (buildPackages.buildPackages) gcc; in 4 6
+2 -2
pkgs/development/libraries/libiconv/default.nix
··· 1 1 { fetchurl, stdenv, lib 2 - , enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt 3 - , enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + , enableShared ? !stdenv.hostPlatform.isStatic 4 4 }: 5 5 6 6 # assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
+4 -1
pkgs/development/libraries/libjpeg-turbo/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake, nasm, enableStatic ? false, enableShared ? true }: 1 + { stdenv, fetchFromGitHub, cmake, nasm 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + , enableShared ? !stdenv.hostPlatform.isStatic 4 + }: 2 5 3 6 stdenv.mkDerivation rec { 4 7
+3 -1
pkgs/development/libraries/libpfm/default.nix
··· 1 - { stdenv, fetchurl, enableShared ? true }: 1 + { stdenv, fetchurl 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 stdenv.mkDerivation (rec { 4 6 version = "4.11.0";
+1 -1
pkgs/development/libraries/libxml2/default.nix
··· 1 1 { stdenv, lib, fetchurl, fetchpatch 2 2 , zlib, xz, libintl, python, gettext, ncurses, findXMLCatalogs 3 - , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform 3 + , pythonSupport ? enableShared && stdenv.buildPlatform == stdenv.hostPlatform 4 4 , icuSupport ? false, icu ? null 5 5 , enableShared ? stdenv.hostPlatform.libc != "msvcrt" 6 6 , enableStatic ? !enableShared,
+1 -1
pkgs/development/libraries/libxsmm/default.nix
··· 1 1 { stdenv, fetchFromGitHub, coreutils, gfortran, gnused 2 2 , python3, util-linux, which 3 3 4 - , enableStatic ? false 4 + , enableStatic ? stdenv.hostPlatform.isStatic 5 5 }: 6 6 7 7 let
+1 -1
pkgs/development/libraries/ncurses/default.nix
··· 3 3 , abiVersion ? "6" 4 4 , mouseSupport ? false 5 5 , unicode ? true 6 - , enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt 6 + , enableStatic ? stdenv.hostPlatform.isStatic 7 7 , enableShared ? !enableStatic 8 8 , withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt 9 9
+2 -2
pkgs/development/libraries/neon/default.nix
··· 1 1 { stdenv, fetchurl, libxml2, pkgconfig, perl 2 2 , compressionSupport ? true, zlib ? null 3 3 , sslSupport ? true, openssl ? null 4 - , static ? false 5 - , shared ? true 4 + , static ? stdenv.hostPlatform.isStatic 5 + , shared ? !stdenv.hostPlatform.isStatic 6 6 }: 7 7 8 8 assert compressionSupport -> zlib != null;
+1 -1
pkgs/development/libraries/openssl/default.nix
··· 2 2 , withCryptodev ? false, cryptodev 3 3 , enableSSL2 ? false 4 4 , enableSSL3 ? false 5 - , static ? false 5 + , static ? stdenv.hostPlatform.isStatic 6 6 }: 7 7 8 8 # Note: this package is used for bootstrapping fetchurl, and thus
+1 -1
pkgs/development/libraries/rocksdb/default.nix
··· 10 10 , zstd 11 11 , enableJemalloc ? false, jemalloc 12 12 , enableLite ? false 13 - , enableShared ? true 13 + , enableShared ? !stdenv.hostPlatform.isStatic 14 14 }: 15 15 16 16 stdenv.mkDerivation rec {
+3 -2
pkgs/development/libraries/science/math/mkl/default.nix
··· 1 - { callPackage 1 + { stdenv 2 + , callPackage 2 3 , stdenvNoCC 3 4 , fetchurl 4 5 , rpmextract 5 6 , undmg 6 7 , darwin 7 8 , validatePkgConfig 8 - , enableStatic ? false 9 + , enableStatic ? stdenv.hostPlatform.isStatic 9 10 }: 10 11 11 12 /*
+2 -2
pkgs/development/libraries/science/math/openblas/default.nix
··· 15 15 # Select a specific optimization target (other than the default) 16 16 # See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt 17 17 , target ? null 18 - , enableStatic ? false 19 - , enableShared ? true 18 + , enableStatic ? stdenv.hostPlatform.isStatic 19 + , enableShared ? !stdenv.hostPlatform.isStatic 20 20 }: 21 21 22 22 with stdenv.lib;
+3 -1
pkgs/development/libraries/thrift/default.nix
··· 1 1 { stdenv, fetchurl, fetchpatch, boost, zlib, libevent, openssl, python, cmake, pkgconfig 2 - , bison, flex, twisted, static ? false }: 2 + , bison, flex, twisted 3 + , static ? stdenv.hostPlatform.isStatic 4 + }: 3 5 4 6 stdenv.mkDerivation rec { 5 7 pname = "thrift";
+6 -4
pkgs/development/libraries/zlib/default.nix
··· 1 1 { stdenv 2 2 , fetchurl 3 - # Note: If `{ static = false; shared = false; }`, upstream's default is used 4 - # (which is building both static and shared as of zlib 1.2.11). 5 - , shared ? true 3 + , shared ? !stdenv.hostPlatform.isStatic 6 4 , static ? true 7 5 # If true, a separate .static ouput is created and the .a is moved there. 8 6 # In this case `pkg-config` auto detection does not currently work if the 9 7 # .static output is given as `buildInputs` to another package (#66461), because 10 8 # the `.pc` file lists only the main output's lib dir. 11 9 # If false, and if `{ static = true; }`, the .a stays in the main output. 12 - , splitStaticOutput ? static 10 + , splitStaticOutput ? shared && static 13 11 }: 12 + 13 + # Without either the build will actually still succeed because the build 14 + # system makes an arbitrary choice, but we shouldn't be so indecisive. 15 + assert shared || static; 14 16 15 17 # Note: this package is used for bootstrapping fetchurl, and thus 16 18 # cannot use fetchpatch! All mutable patches (generated by GitHub or
+1 -1
pkgs/development/tools/misc/binutils/default.nix
··· 2 2 , fetchFromGitHub, fetchurl, zlib, autoreconfHook, gettext 3 3 # Enabling all targets increases output size to a multiple. 4 4 , withAllTargets ? false, libbfd, libopcodes 5 - , enableShared ? true 5 + , enableShared ? !stdenv.hostPlatform.isStatic 6 6 , noSysDirs 7 7 , gold ? !stdenv.buildPlatform.isDarwin || stdenv.hostPlatform == stdenv.targetPlatform 8 8 , bison ? null
+2 -2
pkgs/development/tools/parsing/tree-sitter/default.nix
··· 5 5 , Security 6 6 , callPackage 7 7 8 - , enableShared ? true 9 - , enableStatic ? false 8 + , enableShared ? !stdenv.hostPlatform.isStatic 9 + , enableStatic ? stdenv.hostPlatform.isStatic 10 10 , webUISupport ? false 11 11 }: 12 12
+2 -2
pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix
··· 1 1 { stdenv, appleDerivation, lib 2 - , enableStatic ? stdenv.targetPlatform.isiOS 3 - , enableShared ? !stdenv.targetPlatform.isiOS 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + , enableShared ? !stdenv.hostPlatform.isStatic 4 4 }: 5 5 6 6 appleDerivation {
+1 -1
pkgs/os-specific/linux/busybox/default.nix
··· 1 1 { stdenv, lib, buildPackages, fetchurl, fetchFromGitLab 2 - , enableStatic ? false 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 3 , enableMinimal ? false 4 4 # Allow forcing musl without switching stdenv itself, e.g. for our bootstrapping: 5 5 # nix build -f pkgs/top-level/release.nix stdenvBootstrapTools.x86_64-linux.dist
+12 -8
pkgs/os-specific/linux/libcap/default.nix
··· 1 - { stdenv, lib, buildPackages, fetchurl, attr, perl, pam 2 - , static ? stdenv.targetPlatform.isStatic }: 1 + { stdenv, lib, buildPackages, fetchurl, attr, perl 2 + , usePam ? !isStatic, pam ? null 3 + , isStatic ? stdenv.hostPlatform.isStatic 4 + }: 5 + 6 + assert usePam -> pam != null; 3 7 4 8 stdenv.mkDerivation rec { 5 9 pname = "libcap"; ··· 10 14 sha256 = "1qf80lifygbnxwvqjf8jz5j24n6fqqx4ixnkbf76xs2vrmcq664j"; 11 15 }; 12 16 13 - patches = lib.optional static ./no-shared-lib.patch; 17 + patches = lib.optional isStatic ./no-shared-lib.patch; 14 18 15 19 outputs = [ "out" "dev" "lib" "man" "doc" ] 16 - ++ lib.optional (pam != null) "pam"; 20 + ++ lib.optional usePam "pam"; 17 21 18 22 depsBuildBuild = [ buildPackages.stdenv.cc ]; 19 23 nativeBuildInputs = [ perl ]; 20 24 21 - buildInputs = [ pam ]; 25 + buildInputs = lib.optional usePam pam; 22 26 23 27 propagatedBuildInputs = [ attr ]; 24 28 25 29 makeFlags = [ 26 30 "lib=lib" 27 - "PAM_CAP=${if pam == null then "no" else "yes"}" 31 + "PAM_CAP=${if usePam then "yes" else "no"}" 28 32 "BUILD_CC=$(CC_FOR_BUILD)" 29 33 "CC:=$(CC)" 30 34 ]; ··· 48 52 installFlags = [ "RAISE_SETFCAP=no" ]; 49 53 50 54 postInstall = '' 51 - ${lib.optionalString (!static) ''rm "$lib"/lib/*.a''} 55 + ${lib.optionalString (!isStatic) ''rm "$lib"/lib/*.a''} 52 56 mkdir -p "$doc/share/doc/${pname}-${version}" 53 57 cp License "$doc/share/doc/${pname}-${version}/" 54 - '' + stdenv.lib.optionalString (pam != null) '' 58 + '' + stdenv.lib.optionalString usePam '' 55 59 mkdir -p "$pam/lib/security" 56 60 mv "$lib"/lib/security "$pam/lib" 57 61 '';
+3 -1
pkgs/servers/gobetween/default.nix
··· 1 - { buildGoModule, fetchFromGitHub, lib, enableStatic ? false }: 1 + { stdenv, buildGoModule, fetchFromGitHub, lib 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 buildGoModule rec { 4 6 pname = "gobetween";
+1 -1
pkgs/tools/compression/bzip2/default.nix
··· 1 1 { stdenv, fetchurl 2 - , linkStatic ? (stdenv.hostPlatform.system == "i686-cygwin") 2 + , linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin 3 3 , autoreconfHook 4 4 }: 5 5
+2 -1
pkgs/tools/compression/lz4/default.nix
··· 1 1 { stdenv, fetchFromGitHub, valgrind, fetchpatch 2 - , enableStatic ? false, enableShared ? true 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + , enableShared ? !stdenv.hostPlatform.isStatic 3 4 }: 4 5 5 6 stdenv.mkDerivation rec {
+3 -1
pkgs/tools/compression/xz/default.nix
··· 1 - { stdenv, fetchurl, enableStatic ? false }: 1 + { stdenv, fetchurl 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 + }: 2 4 3 5 # Note: this package is used for bootstrapping fetchurl, and thus 4 6 # cannot use fetchpatch! All mutable patches (generated by GitHub or
+3 -1
pkgs/tools/filesystems/nixpart/0.4/parted.nix
··· 1 1 { stdenv, fetchurl, fetchpatch, lvm2, libuuid, gettext, readline 2 - , util-linux, check, enableStatic ? false }: 2 + , util-linux, check 3 + , enableStatic ? stdenv.hostPlatform.isStatic 4 + }: 3 5 4 6 stdenv.mkDerivation rec { 5 7 name = "parted-3.1";
+2 -1
pkgs/tools/graphics/optipng/default.nix
··· 1 - { stdenv, fetchurl, libpng, static ? false 1 + { stdenv, fetchurl, libpng 2 + , static ? stdenv.hostPlatform.isStatic 2 3 }: 3 4 4 5 # This package comes with its own copy of zlib, libpng and pngxtern
+1 -1
pkgs/tools/misc/hdf5/default.nix
··· 6 6 , zlib ? null 7 7 , szip ? null 8 8 , mpi ? null 9 - , enableShared ? true 9 + , enableShared ? !stdenv.hostPlatform.isStatic 10 10 }: 11 11 12 12 # cpp and mpi options are mutually exclusive
+1 -1
pkgs/tools/misc/parted/default.nix
··· 11 11 , python3 12 12 , util-linux 13 13 , check 14 - , enableStatic ? false 14 + , enableStatic ? stdenv.hostPlatform.isStatic 15 15 }: 16 16 17 17 stdenv.mkDerivation rec {
+1 -1
pkgs/tools/misc/toybox/default.nix
··· 1 1 { 2 2 stdenv, lib, fetchFromGitHub, which, 3 3 buildPackages, 4 - enableStatic ? false, 4 + enableStatic ? stdenv.hostPlatform.isStatic, 5 5 enableMinimal ? false, 6 6 extraConfig ? "" 7 7 }:
+1 -1
pkgs/tools/networking/dropbear/default.nix
··· 1 1 { stdenv, lib, fetchurl, glibc, zlib 2 - , enableStatic ? false 2 + , enableStatic ? stdenv.hostPlatform.isStatic 3 3 , sftpPath ? "/run/current-system/sw/libexec/sftp-server" 4 4 }: 5 5
+1 -1
pkgs/tools/package-management/nix/default.nix
··· 22 22 , confDir 23 23 , withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp 24 24 , withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp 25 - , enableStatic ? false 25 + , enableStatic ? stdenv.hostPlatform.isStatic 26 26 , name, suffix ? "", src, patches ? [] 27 27 28 28 }:
+1 -1
pkgs/tools/system/ipmitool/default.nix
··· 1 - { stdenv, lib, fetchurl, openssl, fetchpatch, static ? false }: 1 + { stdenv, lib, fetchurl, openssl, fetchpatch, static ? stdenv.hostPlatform.isStatic }: 2 2 3 3 let 4 4 pkgname = "ipmitool";
+1 -1
pkgs/tools/system/pciutils/default.nix
··· 1 1 { stdenv, fetchurl, pkgconfig, zlib, kmod, which 2 - , static ? stdenv.targetPlatform.isStatic 2 + , static ? stdenv.hostPlatform.isStatic 3 3 , darwin ? null 4 4 }: 5 5
+1 -111
pkgs/top-level/static.nix
··· 112 112 enableApp = false; 113 113 }; 114 114 115 - ncurses = super.ncurses.override { 116 - enableStatic = true; 117 - }; 118 - libxml2 = super.libxml2.override ({ 119 - enableShared = false; 120 - enableStatic = true; 121 - } // optionalAttrs super.stdenv.hostPlatform.isDarwin { 122 - pythonSupport = false; 123 - }); 124 115 zlib = super.zlib.override { 125 - static = true; 126 - shared = false; 127 - splitStaticOutput = false; 128 - 129 116 # Don’t use new stdenv zlib because 130 117 # it doesn’t like the --disable-shared flag 131 118 stdenv = super.stdenv; 132 119 }; 133 - xz = super.xz.override { 134 - enableStatic = true; 135 - }; 136 - busybox = super.busybox.override { 137 - enableStatic = true; 138 - }; 139 - libiberty = super.libiberty.override { 140 - staticBuild = true; 141 - }; 142 - libpfm = super.libpfm.override { 143 - enableShared = false; 144 - }; 145 - ipmitool = super.ipmitool.override { 146 - static = true; 147 - }; 148 - neon = super.neon.override { 149 - static = true; 150 - shared = false; 151 - }; 152 - fmt = super.fmt.override { 153 - enableShared = false; 154 - }; 155 120 gifsicle = super.gifsicle.override { 156 121 static = true; 157 122 }; 158 - bzip2 = super.bzip2.override { 159 - linkStatic = true; 160 - }; 161 - optipng = super.optipng.override { 162 - static = true; 163 - }; 164 - openblas = super.openblas.override { 165 - enableStatic = true; 166 - enableShared = false; 167 - }; 168 - mkl = super.mkl.override { enableStatic = true; }; 169 - nix = super.nix.override { enableStatic = true; }; 170 - nixUnstable = super.nixUnstable.override { enableStatic = true; }; 171 - openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: { 123 + openssl = super.openssl_1_1.overrideAttrs (o: { 172 124 # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. 173 125 configureFlags = (removeUnknownConfigureFlags o.configureFlags); 174 126 }); 175 - arrow-cpp = super.arrow-cpp.override { 176 - enableShared = false; 177 - }; 178 127 boost = super.boost.override { 179 - enableStatic = true; 180 - enableShared = false; 181 - 182 128 # Don’t use new stdenv for boost because it doesn’t like the 183 129 # --disable-shared flag 184 130 stdenv = super.stdenv; 185 131 }; 186 - thrift = super.thrift.override { 187 - static = true; 188 - twisted = null; 189 - }; 190 - gmp = super.gmp.override { 191 - withStatic = true; 192 - }; 193 - gflags = super.gflags.override { 194 - enableShared = false; 195 - }; 196 132 cdo = super.cdo.override { 197 133 enable_all_static = true; 198 134 }; ··· 202 138 crc32c = super.crc32c.override { 203 139 staticOnly = true; 204 140 }; 205 - parted = super.parted.override { 206 - enableStatic = true; 207 - }; 208 - libiconvReal = super.libiconvReal.override { 209 - enableShared = false; 210 - enableStatic = true; 211 - }; 212 141 perl = super.perl.override { 213 142 # Don’t use new stdenv zlib because 214 143 # it doesn’t like the --disable-shared flag ··· 219 148 }; 220 149 snappy = super.snappy.override { 221 150 static = true; 222 - }; 223 - lz4 = super.lz4.override { 224 - enableShared = false; 225 - enableStatic = true; 226 151 }; 227 152 libressl = super.libressl.override { 228 153 buildShared = false; 229 154 }; 230 - libjpeg_turbo = super.libjpeg_turbo.override { 231 - enableStatic = true; 232 - enableShared = false; 233 - }; 234 - 235 - darwin = super.darwin // { 236 - libiconv = super.darwin.libiconv.override { 237 - enableShared = false; 238 - enableStatic = true; 239 - }; 240 - }; 241 155 242 156 kmod = super.kmod.override { 243 157 withStatic = true; ··· 260 174 static = true; 261 175 }; 262 176 263 - llvmPackages_8 = super.llvmPackages_8 // { 264 - libraries = super.llvmPackages_8.libraries // rec { 265 - libcxxabi = super.llvmPackages_8.libraries.libcxxabi.override { 266 - enableShared = false; 267 - }; 268 - libcxx = super.llvmPackages_8.libraries.libcxx.override { 269 - enableShared = false; 270 - inherit libcxxabi; 271 - }; 272 - libunwind = super.llvmPackages_8.libraries.libunwind.override { 273 - enableShared = false; 274 - }; 275 - }; 276 - }; 277 - 278 177 ocaml-ng = self.lib.mapAttrs (_: set: 279 178 if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set 280 179 ) super.ocaml-ng; ··· 289 188 # Note: -static doesn’t work on darwin 290 189 libev = super.libev.override { static = !super.stdenv.hostPlatform.isDarwin; }; 291 190 292 - libexecinfo = super.libexecinfo.override { enableShared = false; }; 293 - 294 - tree-sitter = super.tree-sitter.override { 295 - enableShared = false; 296 - enableStatic = true; 297 - }; 298 - 299 191 xorg = super.xorg.overrideScope' (xorgself: xorgsuper: { 300 192 libX11 = xorgsuper.libX11.overrideAttrs (attrs: { 301 193 depsBuildBuild = attrs.depsBuildBuild ++ [ (self.buildPackages.stdenv.cc.libc.static or null) ]; ··· 319 211 configureFlags = attrs.configureFlags ++ [ "--disable-shared" ]; 320 212 }); 321 213 }); 322 - 323 - libcap = super.libcap.override { pam = null; }; 324 214 }