haskell: Tiny refactor in generic-builder. No hashes/interfaces changed.

This commit is contained in:
John Ericson 2016-02-19 08:45:45 -08:00
parent 51b66ed4d9
commit f13eede7e5
1 changed files with 9 additions and 4 deletions

View File

@ -58,7 +58,15 @@ let
isCross = ghc.isCross 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;
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";
newCabalFile = fetchurl {
@ -72,9 +80,6 @@ let
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);
# We cannot enable -j<n> parallelism for libraries because GHC is far more
@ -126,7 +131,7 @@ let
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";
ghcCommand = if isGhcjs then "ghcjs" else "ghc";
ghcCommandCaps = toUpper ghcCommand;