summaryrefslogtreecommitdiff
path: root/guix/import/cabal.scm
diff options
context:
space:
mode:
authorRobert Vollmert <rob@vllmrt.net>2019-06-13 21:39:14 +0200
committerTimothy Sample <samplet@ngyro.com>2019-06-13 22:18:52 -0400
commitca45da9fc9b1eee399ce4344b18cbb129daeca4c (patch)
tree361e65e3401f9c875ac5aa76ede6c6a5bcdab159 /guix/import/cabal.scm
parent30825c46298c70028f70da1470eadbadf1e0d858 (diff)
downloadpatches-ca45da9fc9b1eee399ce4344b18cbb129daeca4c.tar
patches-ca45da9fc9b1eee399ce4344b18cbb129daeca4c.tar.gz
import: hackage: Handle Hackage revisions.
Hackage packages can have metadata revisions (Cabal file only) that are not reflected in the source archive. The Haskell build system has support for this, but until now the Hackage importer would create a package based on the revised Cabal file which would then build using the old Cabal file. Fixes <https://bugs.gnu.org/35750>. * guix/import/cabal.scm (<cabal-package>): Add 'revision' field. (eval-cabal): Parse 'x-revision:' property. * guix/import/hackage.scm (read-cabal-and-hash): New procedure. (hackage-fetch-and-hash): New procedure. (hackage-fetch): Rewrite using 'hackage-fetch-and-hash'. (hackage-module->sexp): Add 'cabal-hash' argument and use it to populate the '#:cabal-revision' argument. (hackage->guix-package): Use the new '-and-hash' functions to get the hash of the Cabal file and pass it to 'hackage-module->sexp'. * guix/tests/hackage.scm: Test import of Cabal file revision. Signed-off-by: Timothy Sample <samplet@ngyro.com>
Diffstat (limited to 'guix/import/cabal.scm')
-rw-r--r--guix/import/cabal.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 1a87be0b00..7dfe771e41 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -40,6 +40,7 @@
cabal-package?
cabal-package-name
cabal-package-version
+ cabal-package-revision
cabal-package-license
cabal-package-home-page
cabal-package-source-repository
@@ -638,13 +639,14 @@ If #f use the function 'port-filename' to obtain it."
;; information of the Cabal file, but only the ones we currently are
;; interested in.
(define-record-type <cabal-package>
- (make-cabal-package name version license home-page source-repository
+ (make-cabal-package name version revision license home-page source-repository
synopsis description
executables lib test-suites
flags eval-environment custom-setup)
cabal-package?
(name cabal-package-name)
(version cabal-package-version)
+ (revision cabal-package-revision)
(license cabal-package-license)
(home-page cabal-package-home-page)
(source-repository cabal-package-source-repository)
@@ -838,6 +840,7 @@ See the manual for limitations.")))))))
(define (cabal-evaluated-sexp->package evaluated-sexp)
(let* ((name (lookup-join evaluated-sexp "name"))
(version (lookup-join evaluated-sexp "version"))
+ (revision (lookup-join evaluated-sexp "x-revision"))
(license (lookup-join evaluated-sexp "license"))
(home-page (lookup-join evaluated-sexp "homepage"))
(home-page-or-hackage
@@ -856,7 +859,7 @@ See the manual for limitations.")))))))
(custom-setup (match (make-cabal-section evaluated-sexp 'custom-setup)
((x) x)
(_ #f))))
- (make-cabal-package name version license home-page-or-hackage
+ (make-cabal-package name version revision license home-page-or-hackage
source-repository synopsis description executables lib
test-suites flags eval-environment custom-setup)))