guix import stackage: Default to LTS version that matches GHC.
In particular, this means that 'guix lint' won't warn to update to versions that won't necessarily fit our package set well. * guix/import/stackage.scm (%stackage-url): Change to "https", avoiding redirect log messages. (%default-lts-version): New variable. (stackage-lts-info-fetch, stackage->guix-package, latest-lts-release): Use it. (lts-info-ghc-version): Remove unused procedure. Signed-off-by: Timothy Sample <samplet@ngyro.com>
This commit is contained in:
parent
1aced9aa0c
commit
f0bb2662bb
1 changed files with 11 additions and 10 deletions
|
@ -39,12 +39,10 @@
|
||||||
;;; Stackage info fetcher and access functions
|
;;; Stackage info fetcher and access functions
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define %stackage-url "http://www.stackage.org")
|
(define %stackage-url "https://www.stackage.org")
|
||||||
|
|
||||||
(define (lts-info-ghc-version lts-info)
|
;; Latest LTS version compatible with GHC 8.6.5.
|
||||||
"Returns the version of the GHC compiler contained in LTS-INFO."
|
(define %default-lts-version "14.27")
|
||||||
(and=> (assoc-ref lts-info "snapshot")
|
|
||||||
(cut assoc-ref <> "ghc")))
|
|
||||||
|
|
||||||
(define (lts-info-packages lts-info)
|
(define (lts-info-packages lts-info)
|
||||||
"Returns the alist of packages contained in LTS-INFO."
|
"Returns the alist of packages contained in LTS-INFO."
|
||||||
|
@ -57,9 +55,10 @@
|
||||||
;; "Retrieve the information about the LTS Stackage release VERSION."
|
;; "Retrieve the information about the LTS Stackage release VERSION."
|
||||||
(memoize
|
(memoize
|
||||||
(lambda* (#:optional (version ""))
|
(lambda* (#:optional (version ""))
|
||||||
(let* ((url (if (string=? "" version)
|
(let* ((url (string-append %stackage-url
|
||||||
(string-append %stackage-url "/lts")
|
"/lts-" (if (string-null? version)
|
||||||
(string-append %stackage-url "/lts-" version)))
|
%default-lts-version
|
||||||
|
version)))
|
||||||
(lts-info (json-fetch url)))
|
(lts-info (json-fetch url)))
|
||||||
(if lts-info
|
(if lts-info
|
||||||
(reverse lts-info)
|
(reverse lts-info)
|
||||||
|
@ -90,7 +89,7 @@
|
||||||
(lambda* (package-name ; upstream name
|
(lambda* (package-name ; upstream name
|
||||||
#:key
|
#:key
|
||||||
(include-test-dependencies? #t)
|
(include-test-dependencies? #t)
|
||||||
(lts-version "")
|
(lts-version %default-lts-version)
|
||||||
(packages-info
|
(packages-info
|
||||||
(lts-info-packages
|
(lts-info-packages
|
||||||
(stackage-lts-info-fetch lts-version))))
|
(stackage-lts-info-fetch lts-version))))
|
||||||
|
@ -119,7 +118,9 @@ included in the Stackage LTS release."
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define latest-lts-release
|
(define latest-lts-release
|
||||||
(let ((pkgs-info (mlambda () (lts-info-packages (stackage-lts-info-fetch)))))
|
(let ((pkgs-info
|
||||||
|
(mlambda () (lts-info-packages
|
||||||
|
(stackage-lts-info-fetch %default-lts-version)))))
|
||||||
(lambda* (package)
|
(lambda* (package)
|
||||||
"Return an <upstream-source> for the latest Stackage LTS release of
|
"Return an <upstream-source> for the latest Stackage LTS release of
|
||||||
PACKAGE or #f if the package is not included in the Stackage LTS release."
|
PACKAGE or #f if the package is not included in the Stackage LTS release."
|
||||||
|
|
Reference in a new issue