From 30d77359f6573f69185e01edd63c6711c84c4586 Mon Sep 17 00:00:00 2001
From: Daniel Buckmaster <dan.buckmaster@gmail.com>
Date: Tue, 16 Jun 2015 12:02:07 +1000
Subject: [PATCH] Only warn for Setup.hs if build type isn't Simple

Because cabal sdist will add a default Setup.hs anyway
---
 Cabal/Distribution/PackageDescription/Check.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Cabal/Distribution/PackageDescription/Check.hs b/Cabal/Distribution/PackageDescription/Check.hs
index c857df3128..83eeea405b 100644
--- a/Cabal/Distribution/PackageDescription/Check.hs
+++ b/Cabal/Distribution/PackageDescription/Check.hs
@@ -1523,10 +1523,11 @@ checkLicensesExist ops pkg = do
 checkSetupExists :: Monad m => CheckPackageContentOps m
                  -> PackageDescription
                  -> m (Maybe PackageCheck)
-checkSetupExists ops _ = do
+checkSetupExists ops pkg = do
+  let simpleBuild = buildType pkg == Just Simple
   hsexists  <- doesFileExist ops "Setup.hs"
   lhsexists <- doesFileExist ops "Setup.lhs"
-  return $ check (not hsexists && not lhsexists) $
+  return $ check (not simpleBuild && not hsexists && not lhsexists) $
     PackageDistInexcusable $
       "The package is missing a Setup.hs or Setup.lhs script."
 
-- 
GitLab