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