build-system: haskell: Add ‘hackage-uri’ procedure.

* guix/build-system/haskell (hackage-uri): New procedure.
* guix/import/hackage.scm (hackage-module->sexp, latest-release): Use it.
* tests/hackage.scm (match-ghc-foo, match-ghc-foo-6, match-ghc-foo-revision,
match-ghc-foo-import): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Xinglu Chen 2021-11-02 17:48:09 +01:00 committed by Ludovic Courtès
parent a955e4d7f6
commit 39f4ef59ff
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 17 additions and 19 deletions

View file

@ -170,10 +170,7 @@ library
('source
('origin
('method 'url-fetch)
('uri ('string-append
"https://hackage.haskell.org/package/foo/foo-"
'version
".tar.gz"))
('uri ('hackage-uri "foo" 'version))
('sha256
('base32
(? string? hash)))))
@ -215,10 +212,7 @@ library
('source
('origin
('method 'url-fetch)
('uri ('string-append
"https://hackage.haskell.org/package/foo/foo-"
'version
".tar.gz"))
('uri ('hackage-uri "foo" 'version))
('sha256
('base32
(? string? hash)))))
@ -343,10 +337,7 @@ executable cabal
('source
('origin
('method 'url-fetch)
('uri ('string-append
"https://hackage.haskell.org/package/foo/foo-"
'version
".tar.gz"))
('uri ('hackage-uri "foo" 'version))
('sha256
('base32
(? string? hash)))))
@ -409,10 +400,7 @@ executable cabal
('source
('origin
('method 'url-fetch)
('uri ('string-append
"https://hackage.haskell.org/package/foo/foo-"
'version
".tar.gz"))
('uri ('hackage-uri "foo" 'version))
('sha256
('base32
(? string? hash)))))