Add defaultSetupHs to ghcjs, and fix it in regular cabal

This commit is contained in:
Ryan Trinkle 2014-09-20 18:54:09 -04:00
parent c1c4c85800
commit e4ff3fd348
2 changed files with 9 additions and 3 deletions

View File

@ -187,7 +187,7 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
for i in Setup.hs Setup.lhs ${defaultSetupHs}; do
test -f $i && break
done
ghc --make -o Setup -odir $TMPDIR $i
ghc --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
for p in $extraBuildInputs $propagatedNativeBuildInputs; do
if [ -d "$p/lib/ghc-${ghc.ghc.version}/package.conf.d" ]; then

View File

@ -18,6 +18,11 @@ let
optionals = stdenv.lib.optionals;
optionalString = stdenv.lib.optionalString;
filter = stdenv.lib.filter;
defaultSetupHs = builtins.toFile "Setup.hs" ''
import Distribution.Simple
main = defaultMain
'';
in
{
@ -168,9 +173,10 @@ in
PATH=$PATH:${ghc.ghc.ghc}/bin
for i in Setup.hs Setup.lhs; do
test -f $i && ghc --make $i
for i in Setup.hs Setup.lhs ${defaultSetupHs}; do
test -f $i && break
done
ghc --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
for p in $extraBuildInputs $propagatedBuildInputs $propagatedNativeBuildInputs; do
PkgDir="$p/lib/ghcjs-${ghc.ghc.version}_ghc-${ghc.ghc.ghc.version}/package.conf.d"