lol

haskell: make generic builder follow compiler’s shared config

enableShared in generic-builder.nix should default to what the GHC
compiler was compiled with. Add a passthru to all of the GHC compilers
to hold the value of enableShared. If enableShared is not set in the
GHC we just use false as the default value for enableSharedLibraries.

Note: I may have missed some compilers. Only GHC & GHCJS are covered
by this commit but this shouldn’t break evaluation of anything else.

authored by

Matthew Bauer and committed by
John Ericson
fd7a6ea0 17621f63

+18 -4
+4 -1
pkgs/development/compilers/ghc/7.10.3-binary.nix
··· 153 [ $(./main) == "yes" ] 154 ''; 155 156 - passthru = { targetPrefix = ""; }; 157 158 meta.license = stdenv.lib.licenses.bsd3; 159 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"];
··· 153 [ $(./main) == "yes" ] 154 ''; 155 156 + passthru = { 157 + targetPrefix = ""; 158 + enableShared = true; 159 + }; 160 161 meta.license = stdenv.lib.licenses.bsd3; 162 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"];
+1
pkgs/development/compilers/ghc/7.10.3.nix
··· 177 inherit bootPkgs targetPrefix; 178 179 inherit llvmPackages; 180 181 # Our Cabal compiler name 182 haskellCompilerName = "ghc-7.10.3";
··· 177 inherit bootPkgs targetPrefix; 178 179 inherit llvmPackages; 180 + inherit enableShared; 181 182 # Our Cabal compiler name 183 haskellCompilerName = "ghc-7.10.3";
+1
pkgs/development/compilers/ghc/8.0.2.nix
··· 183 inherit bootPkgs targetPrefix; 184 185 inherit llvmPackages; 186 187 # Our Cabal compiler name 188 haskellCompilerName = "ghc-8.0.2";
··· 183 inherit bootPkgs targetPrefix; 184 185 inherit llvmPackages; 186 + inherit enableShared; 187 188 # Our Cabal compiler name 189 haskellCompilerName = "ghc-8.0.2";
+4 -1
pkgs/development/compilers/ghc/8.2.1-binary.nix
··· 155 [ $(./main) == "yes" ] 156 ''; 157 158 - passthru = { targetPrefix = ""; }; 159 160 meta.license = stdenv.lib.licenses.bsd3; 161 # AArch64 should work in theory but eventually some builds start segfaulting
··· 155 [ $(./main) == "yes" ] 156 ''; 157 158 + passthru = { 159 + targetPrefix = ""; 160 + enableShared = true; 161 + }; 162 163 meta.license = stdenv.lib.licenses.bsd3; 164 # AArch64 should work in theory but eventually some builds start segfaulting
+1
pkgs/development/compilers/ghc/8.2.2.nix
··· 199 inherit bootPkgs targetPrefix; 200 201 inherit llvmPackages; 202 203 # Our Cabal compiler name 204 haskellCompilerName = "ghc-8.2.2";
··· 199 inherit bootPkgs targetPrefix; 200 201 inherit llvmPackages; 202 + inherit enableShared; 203 204 # Our Cabal compiler name 205 haskellCompilerName = "ghc-8.2.2";
+1
pkgs/development/compilers/ghc/8.4.3.nix
··· 193 inherit bootPkgs targetPrefix; 194 195 inherit llvmPackages; 196 197 # Our Cabal compiler name 198 haskellCompilerName = "ghc-8.4.3";
··· 193 inherit bootPkgs targetPrefix; 194 195 inherit llvmPackages; 196 + inherit enableShared; 197 198 # Our Cabal compiler name 199 haskellCompilerName = "ghc-8.4.3";
+1
pkgs/development/compilers/ghc/head.nix
··· 191 inherit bootPkgs targetPrefix; 192 193 inherit llvmPackages; 194 195 # Our Cabal compiler name 196 haskellCompilerName = "ghc-8.5";
··· 191 inherit bootPkgs targetPrefix; 192 193 inherit llvmPackages; 194 + inherit enableShared; 195 196 # Our Cabal compiler name 197 haskellCompilerName = "ghc-8.5";
+2 -1
pkgs/development/compilers/ghcjs-ng/default.nix
··· 42 inherit (bootGhcjs) version; 43 isGhcjs = true; 44 45 socket-io = nodePackages."socket.io"; 46 47 # Relics of the old GHCJS build system ··· 96 97 meta.platforms = passthru.bootPkgs.ghc.meta.platforms; 98 } 99 -
··· 42 inherit (bootGhcjs) version; 43 isGhcjs = true; 44 45 + enableShared = true; 46 + 47 socket-io = nodePackages."socket.io"; 48 49 # Relics of the old GHCJS build system ··· 98 99 meta.platforms = passthru.bootPkgs.ghc.meta.platforms; 100 }
+2
pkgs/development/compilers/ghcjs/base.nix
··· 179 # let us assume ghcjs is never actually cross compiled 180 targetPrefix = ""; 181 182 inherit stage1Packages; 183 mkStage2 = stage2 { 184 inherit ghcjsBoot;
··· 179 # let us assume ghcjs is never actually cross compiled 180 targetPrefix = ""; 181 182 + enableShared = true; 183 + 184 inherit stage1Packages; 185 mkStage2 = stage2 { 186 inherit ghcjsBoot;
+1 -1
pkgs/development/haskell-modules/generic-builder.nix
··· 30 , profilingDetail ? "all-functions" 31 # TODO enable shared libs for cross-compiling 32 , enableSharedExecutables ? false 33 - , enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) 34 , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin 35 , enableStaticLibraries ? !hostPlatform.isWindows 36 , enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
··· 30 , profilingDetail ? "all-functions" 31 # TODO enable shared libs for cross-compiling 32 , enableSharedExecutables ? false 33 + , enableSharedLibraries ? (ghc.enableShared or false) 34 , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin 35 , enableStaticLibraries ? !hostPlatform.isWindows 36 , enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"