Merge pull request #21876 from shlevy/ghcWithPackages-cross

ghc with-packages-wrapper: Add support for cross-compiling
This commit is contained in:
Peter Simons 2017-01-15 21:07:35 +01:00 committed by GitHub
commit c85a8f0d2a

View File

@ -32,8 +32,10 @@ let
isGhcjs = ghc.isGhcjs or false;
ghc761OrLater = isGhcjs || lib.versionOlder "7.6.1" ghc.version;
packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
ghcCommand = if isGhcjs then "ghcjs" else "ghc";
ghcCommandCaps= lib.toUpper ghcCommand;
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
ghcCommand = "${crossPrefix}${ghcCommand'}";
ghcCommandCaps= lib.toUpper ghcCommand';
libDir = "$out/lib/${ghcCommand}-${ghc.version}";
docDir = "$out/share/doc/ghc/html";
packageCfgDir = "${libDir}/package.conf.d";