summaryrefslogtreecommitdiff
path: root/guix/build/haskell-build-system.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-10-05 19:15:39 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-10-05 19:15:39 +0200
commitcf6db76d2af2f287f12928df160447ab4165b3e5 (patch)
tree49a1309c0e04c00090ab106f7ae3495a6da328c1 /guix/build/haskell-build-system.scm
parente65b2181e8b436278e3dd0b405602a400fbd0a75 (diff)
parenta6798218bea0d6b2df598042d1ced29f74bb4250 (diff)
downloadguix-patches-cf6db76d2af2f287f12928df160447ab4165b3e5.tar
guix-patches-cf6db76d2af2f287f12928df160447ab4165b3e5.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build/haskell-build-system.scm')
-rw-r--r--guix/build/haskell-build-system.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index 5a72d22842..72714a29ad 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -28,6 +28,7 @@
#:use-module (ice-9 regex)
#:use-module (ice-9 match)
#:use-module (ice-9 vlist)
+ #:use-module (ice-9 ftw)
#:export (%standard-phases
haskell-build))
@@ -266,8 +267,19 @@ given Haskell package."
(run-setuphs "haddock" haddock-flags))
#t)
+(define* (patch-cabal-file #:key cabal-revision #:allow-other-keys)
+ (when cabal-revision
+ ;; Cabal requires there to be a single file with the suffix ".cabal".
+ (match (scandir "." (cut string-suffix? ".cabal" <>))
+ ((original)
+ (format #t "replacing ~s with ~s~%" original cabal-revision)
+ (copy-file cabal-revision original))
+ (_ (error "Could not find a Cabal file to patch."))))
+ #t)
+
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (add-after 'unpack 'patch-cabal-file patch-cabal-file)
(delete 'bootstrap)
(add-before 'configure 'setup-compiler setup-compiler)
(add-before 'install 'haddock haddock)