aboutsummaryrefslogtreecommitdiff
path: root/guix/import/hackage.scm
diff options
context:
space:
mode:
authorTimothy Sample <samplet@ngyro.com>2020-11-03 15:30:28 -0500
committerTimothy Sample <samplet@ngyro.com>2020-11-21 22:11:36 -0500
commit464b1fffb0f08a452b4ee67ba23c87730d73568e (patch)
treee56ff4c08670df996ced3242f4528519c7996c52 /guix/import/hackage.scm
parenteeee65076e3199c778b177e06de3aae7696dbb9f (diff)
downloadguix-464b1fffb0f08a452b4ee67ba23c87730d73568e.tar
guix-464b1fffb0f08a452b4ee67ba23c87730d73568e.tar.gz
lint: Add 'check-haskell-stackage' checker.
* guix/lint.scm (check-haskell-stackage): New procedure. (%network-dependent-checkers): Add 'haskell-stackage' checker. * guix/import/hackage.scm (%hackage-url): New variable. (hackage-source-url, hackage-cabal-url): Use it in place of a hard-coded string. * guix/import/stackage.scm (%stackage-url): Make it a parameter. (stackage-lts-info-fetch): Update accordingly. * tests/lint.scm ("hackage-stackage"): New test.
Diffstat (limited to 'guix/import/hackage.scm')
-rw-r--r--guix/import/hackage.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 35c67cad8d..6ca4f65cb0 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -40,7 +40,8 @@
#:use-module (guix upstream)
#:use-module (guix packages)
#:use-module ((guix utils) #:select (call-with-temporary-output-file))
- #:export (hackage->guix-package
+ #:export (%hackage-url
+ hackage->guix-package
hackage-recursive-import
%hackage-updater
@@ -92,20 +93,23 @@
(define package-name-prefix "ghc-")
+(define %hackage-url
+ (make-parameter "https://hackage.haskell.org"))
+
(define (hackage-source-url name version)
"Given a Hackage package NAME and VERSION, return a url to the source
tarball."
- (string-append "https://hackage.haskell.org/package/" name
- "/" name "-" version ".tar.gz"))
+ (string-append (%hackage-url) "/package/"
+ name "/" name "-" version ".tar.gz"))
(define* (hackage-cabal-url name #:optional version)
"Given a Hackage package NAME and VERSION, return a url to the corresponding
.cabal file on Hackage. If VERSION is #f or missing, the url for the latest
version is returned."
(if version
- (string-append "https://hackage.haskell.org/package/"
+ (string-append (%hackage-url) "/package/"
name "-" version "/" name ".cabal")
- (string-append "https://hackage.haskell.org/package/"
+ (string-append (%hackage-url) "/package/"
name "/" name ".cabal")))
(define (hackage-name->package-name name)