haskell: Tiny refactor in generic-builder. No hashes/interfaces changed.
This commit is contained in:
parent
51b66ed4d9
commit
f13eede7e5
@ -58,7 +58,15 @@ let
|
|||||||
|
|
||||||
isCross = ghc.isCross or false;
|
isCross = ghc.isCross or false;
|
||||||
isGhcjs = ghc.isGhcjs or false;
|
isGhcjs = ghc.isGhcjs or false;
|
||||||
|
packageDbFlag = if isGhcjs || versionOlder "7.6" ghc.version
|
||||||
|
then "package-db"
|
||||||
|
else "package-conf";
|
||||||
|
|
||||||
nativeGhc = if isCross then ghc.bootPkgs.ghc else ghc;
|
nativeGhc = if isCross then ghc.bootPkgs.ghc else ghc;
|
||||||
|
nativeIsCross = nativeGhc.isCross or false;
|
||||||
|
nativePackageDbFlag = if versionOlder "7.6" nativeGhc.version
|
||||||
|
then "package-db"
|
||||||
|
else "package-conf";
|
||||||
|
|
||||||
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
||||||
newCabalFile = fetchurl {
|
newCabalFile = fetchurl {
|
||||||
@ -72,9 +80,6 @@ let
|
|||||||
main = defaultMain
|
main = defaultMain
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ghc76xOrLater = isGhcjs || stdenv.lib.versionOlder "7.6" ghc.version;
|
|
||||||
packageDbFlag = if ghc76xOrLater then "package-db" else "package-conf";
|
|
||||||
|
|
||||||
hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling);
|
hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling);
|
||||||
|
|
||||||
# We cannot enable -j<n> parallelism for libraries because GHC is far more
|
# We cannot enable -j<n> parallelism for libraries because GHC is far more
|
||||||
@ -126,7 +131,7 @@ let
|
|||||||
|
|
||||||
ghcEnv = ghc.withPackages (p: haskellBuildInputs);
|
ghcEnv = ghc.withPackages (p: haskellBuildInputs);
|
||||||
|
|
||||||
setupBuilder = if isGhcjs then "${nativeGhc}/bin/ghc" else ghcCommand;
|
setupBuilder = if isCross then "${nativeGhc}/bin/ghc" else ghcCommand;
|
||||||
setupCommand = "./Setup";
|
setupCommand = "./Setup";
|
||||||
ghcCommand = if isGhcjs then "ghcjs" else "ghc";
|
ghcCommand = if isGhcjs then "ghcjs" else "ghc";
|
||||||
ghcCommandCaps = toUpper ghcCommand;
|
ghcCommandCaps = toUpper ghcCommand;
|
||||||
|
Loading…
Reference in New Issue
Block a user