@@ -275,9 +275,21 @@ given Haskell package."
(_ (error "Could not find a Cabal file to patch."))))
#t)
+(define* (generate-setup #:rest empty)
+ "Generate boilerplate Setup.hs if missing."
+ (when (not (or (file-exists? "Setup.hs")
+ (file-exists? "Setup.lhs")))
+ (format #t "generating missing Setup.hs~%")
+ (with-output-to-file "Setup.hs"
+ (lambda ()
+ (format #t "import Distribution.Simple~%")
+ (format #t "main = defaultMain~%"))))
+ #t)
+
(define %standard-phases
(modify-phases gnu:%standard-phases
(add-after 'unpack 'patch-cabal-file patch-cabal-file)
+ (add-after 'unpack 'generate-setup generate-setup)
(delete 'bootstrap)
(add-before 'configure 'setup-compiler setup-compiler)
(add-before 'install 'haddock haddock)