Merge pull request #23607 from NixOS/haskell/justStaticExecutables

Haskell/just static executables

authored by

Peter Simons and committed by
GitHub
722b1296 22c26518

+14 -24
+8
pkgs/development/haskell-modules/lib.nix
··· 76 76 fixupPhase = ":"; 77 77 }); 78 78 79 + # link executables statically against haskell libs to reduce closure size 80 + justStaticExecutables = drv: overrideCabal drv (drv: { 81 + enableSharedExecutables = false; 82 + isLibrary = false; 83 + doHaddock = false; 84 + postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc"; 85 + }); 86 + 79 87 buildFromSdist = pkg: pkgs.lib.overrideDerivation pkg (drv: { 80 88 unpackPhase = let src = sdistTarball pkg; tarname = "${pkg.pname}-${pkg.version}"; in '' 81 89 echo "Source tarball is at ${src}/${tarname}.tar.gz"
+6 -24
pkgs/top-level/all-packages.nix
··· 3289 3289 3290 3290 pal = callPackage ../tools/misc/pal { }; 3291 3291 3292 - pandoc = haskell.lib.overrideCabal haskellPackages.pandoc (drv: { 3292 + pandoc = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.pandoc) (drv: { 3293 3293 configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"]; 3294 3294 buildTools = drv.buildTools or [] ++ [haskellPackages.hsb2hs]; 3295 - enableSharedExecutables = false; 3296 - enableSharedLibraries = false; 3297 - isLibrary = false; 3298 - doHaddock = false; 3299 - postFixup = "rm -rf $out/lib $out/nix-support $out/share"; 3300 3295 }); 3301 3296 3302 3297 panomatic = callPackage ../tools/graphics/panomatic { }; ··· 5134 5129 5135 5130 cabal-install = haskell.lib.disableSharedExecutables haskellPackages.cabal-install; 5136 5131 5137 - stack = haskell.lib.overrideCabal haskellPackages.stack (drv: { 5138 - enableSharedExecutables = false; 5139 - isLibrary = false; 5140 - doHaddock = false; 5141 - postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc"; 5142 - }); 5132 + stack = haskell.lib.justStaticExecutables haskellPackages.stack; 5143 5133 5144 5134 all-cabal-hashes = callPackage ../data/misc/hackage/default.nix { }; 5135 + 5136 + purescript = haskell.lib.justStaticExecutables haskellPackages.purescript; 5145 5137 5146 5138 inherit (ocamlPackages) haxe; 5147 5139 ··· 6758 6750 6759 6751 shards = callPackage ../development/tools/build-managers/shards { }; 6760 6752 6761 - shellcheck = haskell.lib.overrideCabal haskellPackages.ShellCheck (drv: { 6762 - isLibrary = false; 6763 - enableSharedExecutables = false; 6764 - doHaddock = false; 6765 - postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc"; 6766 - }); 6753 + shellcheck = haskell.lib.justStaticExecutables haskellPackages.ShellCheck; 6767 6754 6768 6755 shncpd = callPackage ../tools/networking/shncpd { }; 6769 6756 ··· 13027 13014 13028 13015 cyclone = callPackage ../applications/audio/pd-plugins/cyclone { }; 13029 13016 13030 - darcs = haskell.lib.overrideCabal haskellPackages.darcs (drv: { 13017 + darcs = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.darcs) (drv: { 13031 13018 configureFlags = (stdenv.lib.remove "-flibrary" drv.configureFlags or []) ++ ["-f-library"]; 13032 - enableSharedExecutables = false; 13033 - enableSharedLibraries = false; 13034 - isLibrary = false; 13035 - doHaddock = false; 13036 - postFixup = "rm -rf $out/lib $out/nix-support $out/share"; 13037 13019 }); 13038 13020 13039 13021 darktable = callPackage ../applications/graphics/darktable {