Skip to content

Commit

Permalink
cabal.mkDerivation: Use defaultMain if no Setup.{l,}hs exists.
Browse files Browse the repository at this point in the history
This mirrors the default behaviour of cabal-install for the Simple build type
  • Loading branch information
shlevy authored and jwiegley committed Aug 16, 2014
1 parent 42c31e0 commit dc285e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/build-support/cabal/default.nix
Expand Up @@ -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
Expand Down

2 comments on commit dc285e6

@peti
Copy link
Member

@peti peti commented on dc285e6 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you push this patch? I thought it was clear that there are changes I'd like to make before pushing this to master?

@jwiegley
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peti Pure mistake, my apologies.

Please sign in to comment.