git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #23607 from NixOS/haskell/justStaticExecutables

Haskell/just static executables

commit722b12965290a55a758cbf7aee587682edd5e5af authorPeter Simons <simons@cryp.to> dateWed 8 Mar 2017, 08:49 (10 years ago) parent22c2651f67a89e
2 files changed+14−24
pkgs/development/haskell-modules/lib.nix+8 pkgs/top-level/all-packages.nix+6−24
pkgs/development/haskell-modules/lib.nix+8
@@ -76,6 +76,14 @@ rec {
7676 fixupPhase = ":";
7777 });
7878
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+
7987 buildFromSdist = pkg: pkgs.lib.overrideDerivation pkg (drv: {
8088 unpackPhase = let src = sdistTarball pkg; tarname = "${pkg.pname}-${pkg.version}"; in ''
8189 echo "Source tarball is at ${src}/${tarname}.tar.gz"
pkgs/top-level/all-packages.nix+6−24
@@ -3289,14 +3289,9 @@ with pkgs;
32893289
32903290 pal = callPackage ../tools/misc/pal { };
32913291
3292− pandoc = haskell.lib.overrideCabal haskellPackages.pandoc (drv: {
3292+ pandoc = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.pandoc) (drv: {
32933293 configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
32943294 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";
33003295 });
33013296
33023297 panomatic = callPackage ../tools/graphics/panomatic { };
@@ -5134,15 +5129,12 @@ with pkgs;
51345129
51355130 cabal-install = haskell.lib.disableSharedExecutables haskellPackages.cabal-install;
51365131
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;
51435133
51445134 all-cabal-hashes = callPackage ../data/misc/hackage/default.nix { };
51455135
5136+ purescript = haskell.lib.justStaticExecutables haskellPackages.purescript;
5137+
51465138 inherit (ocamlPackages) haxe;
51475139
51485140 hxcpp = callPackage ../development/compilers/haxe/hxcpp.nix { };
@@ -6758,12 +6750,7 @@ with pkgs;
67586750
67596751 shards = callPackage ../development/tools/build-managers/shards { };
67606752
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;
67676754
67686755 shncpd = callPackage ../tools/networking/shncpd { };
67696756
@@ -13027,13 +13014,8 @@ with pkgs;
1302713014
1302813015 cyclone = callPackage ../applications/audio/pd-plugins/cyclone { };
1302913016
13030− darcs = haskell.lib.overrideCabal haskellPackages.darcs (drv: {
13017+ darcs = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.darcs) (drv: {
1303113018 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";
1303713019 });
1303813020
1303913021 darktable = callPackage ../applications/graphics/darktable {