import: stackage: Support input changes.

* guix/import/stackage.scm (latest-lts-release): Rename package to pkg
to avoid name conflict and add input-changes.
This commit is contained in:
Lars-Dominik Braun 2021-09-16 08:12:17 +02:00
parent 8b4d3a523f
commit 127828ddd7
No known key found for this signature in database
GPG key ID: F663943E08D8092A

View file

@ -139,10 +139,10 @@ (define latest-lts-release
(mlambda () (mlambda ()
(stackage-lts-packages (stackage-lts-packages
(stackage-lts-info-fetch %default-lts-version))))) (stackage-lts-info-fetch %default-lts-version)))))
(lambda* (package) (lambda* (pkg)
"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."
(let* ((hackage-name (guix-package->hackage-name package)) (let* ((hackage-name (guix-package->hackage-name pkg))
(version (lts-package-version (packages) hackage-name)) (version (lts-package-version (packages) hackage-name))
(name-version (hackage-name-version hackage-name version))) (name-version (hackage-name-version hackage-name version)))
(match (and=> name-version hackage-fetch) (match (and=> name-version hackage-fetch)
@ -152,9 +152,13 @@ (define latest-lts-release
#f) #f)
(_ (let ((url (hackage-source-url hackage-name version))) (_ (let ((url (hackage-source-url hackage-name version)))
(upstream-source (upstream-source
(package (package-name package)) (package (package-name pkg))
(version version) (version version)
(urls (list url)))))))))) (urls (list url))
(input-changes
(changed-inputs
pkg
(stackage->guix-package hackage-name #:packages (packages))))))))))))
(define (stackage-lts-package? package) (define (stackage-lts-package? package)
"Return whether PACKAGE is available on the default Stackage LTS release." "Return whether PACKAGE is available on the default Stackage LTS release."