diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2016-02-19 08:40:33 -0800 |
---|---|---|
committer | John Ericson <Ericson2314@Yahoo.com> | 2016-02-21 10:16:13 -0800 |
commit | 51b66ed4d918a795af55ae50de05fd0cb4b19a38 (patch) | |
tree | abdd779d0457b592e152b9a42befe7a916d7ea95 /pkgs/development/haskell-modules/generic-builder.nix | |
parent | 114cd6765d9a1dc405af223294657b9e765a6f3d (diff) | |
download | nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.tar nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.tar.gz nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.tar.bz2 nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.tar.lz nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.tar.xz nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.tar.zst nixlib-51b66ed4d918a795af55ae50de05fd0cb4b19a38.zip |
haskell: Add notion of cross compiler and define nativeGhc with it
Tested to not change hashes
Diffstat (limited to 'pkgs/development/haskell-modules/generic-builder.nix')
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index b871b7d73faa..50efcc27fe63 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -56,8 +56,9 @@ let inherit (stdenv.lib) optional optionals optionalString versionOlder concatStringsSep enableFeature optionalAttrs toUpper; + isCross = ghc.isCross or false; isGhcjs = ghc.isGhcjs or false; - nativeGhc = if isGhcjs then ghc.nativeGhc else ghc; + nativeGhc = if isCross then ghc.bootPkgs.ghc else ghc; newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal"; newCabalFile = fetchurl { @@ -97,7 +98,7 @@ let (optionalString (isGhcjs || versionOlder "7.4" ghc.version) (enableFeature enableSharedExecutables "executable-dynamic")) (optionalString (isGhcjs || versionOlder "7" ghc.version) (enableFeature doCheck "tests")) ] ++ optionals isGhcjs [ - "--with-hsc2hs=${ghc.nativeGhc}/bin/hsc2hs" + "--with-hsc2hs=${nativeGhc}/bin/hsc2hs" "--ghcjs" ]; |