1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

cabal.mkDerivation: Use defaultMain if no Setup.{l,}hs exists.

This mirrors the default behaviour of cabal-install for the Simple build type
This commit is contained in:
Shea Levy 2014-08-13 22:38:32 -04:00 committed by John Wiegley
parent 42c31e08df
commit dc285e6895

View file

@ -182,6 +182,12 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
for i in Setup.hs Setup.lhs; do
test -f $i && ghc --make $i
done
if [ ! -f Setup ]; then
ghc --make ${builtins.toFile "Setup.hs" ''
import Distribution.Simple
main = defaultMain
''} -o Setup -odir $TMPDIR
fi
for p in $extraBuildInputs $propagatedNativeBuildInputs; do
if [ -d "$p/lib/ghc-${ghc.ghc.version}/package.conf.d" ]; then