From dc285e6895e97355f769fdd6341b3e9c0cce2cf9 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 13 Aug 2014 22:38:32 -0400 Subject: [PATCH] cabal.mkDerivation: Use defaultMain if no Setup.{l,}hs exists. This mirrors the default behaviour of cabal-install for the Simple build type --- pkgs/build-support/cabal/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index 69423004d65fca..7147b287faeb10 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -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