summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-06-15 09:46:12 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-06-15 09:46:12 +0200
commita60dbad3bc8211cdec2f623306fc2e02f1cc17a1 (patch)
treecc2ff982329c0713d69cb09c420ff6470c9cdc0b /guix/build
parentc7fbf6186565ed24ebeee870b27a019a77525b5d (diff)
parented8d3f33a5236a1b9fde80bf4ad04e0ecc22a47a (diff)
downloadguix-patches-a60dbad3bc8211cdec2f623306fc2e02f1cc17a1.tar
guix-patches-a60dbad3bc8211cdec2f623306fc2e02f1cc17a1.tar.gz
Merge branch 'staging'
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/haskell-build-system.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index 23d97e6602..91f62138d0 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -260,7 +260,7 @@ given Haskell package."
#t)
(define* (haddock #:key outputs haddock? haddock-flags #:allow-other-keys)
- "Run the test suite of a given Haskell package."
+ "Generate the Haddock documentation of a given Haskell package."
(when haddock?
(run-setuphs "haddock" haddock-flags))
#t)
@@ -275,9 +275,21 @@ given Haskell package."
(_ (error "Could not find a Cabal file to patch."))))
#t)
+(define* (generate-setuphs #:rest empty)
+ "Generate a default Setup.hs if needed."
+ (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-setuphs generate-setuphs)
(delete 'bootstrap)
(add-before 'configure 'setup-compiler setup-compiler)
(add-before 'install 'haddock haddock)