import: cran: Suggest input changes.

* guix/import/cran.scm (latest-cran-release, latest-bioconductor-release):
Return input-changes.
This commit is contained in:
Ricardo Wurmus 2019-01-11 09:27:21 +01:00
parent 7e634c2f53
commit 91e05559bd
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; ;;;
@ -390,11 +390,11 @@ (define (package->upstream-name package)
(_ #f))) (_ #f)))
(_ #f))))) (_ #f)))))
(define (latest-cran-release package) (define (latest-cran-release pkg)
"Return an <upstream-source> for the latest release of PACKAGE." "Return an <upstream-source> for the latest release of the package PKG."
(define upstream-name (define upstream-name
(package->upstream-name package)) (package->upstream-name pkg))
(define meta (define meta
(fetch-description 'cran upstream-name)) (fetch-description 'cran upstream-name))
@ -403,15 +403,18 @@ (define meta
(let ((version (assoc-ref meta "Version"))) (let ((version (assoc-ref meta "Version")))
;; CRAN does not provide signatures. ;; CRAN does not provide signatures.
(upstream-source (upstream-source
(package (package-name package)) (package (package-name pkg))
(version version) (version version)
(urls (cran-uri upstream-name version)))))) (urls (cran-uri upstream-name version))
(input-changes
(changed-inputs pkg
(description->package 'cran meta)))))))
(define (latest-bioconductor-release package) (define (latest-bioconductor-release pkg)
"Return an <upstream-source> for the latest release of PACKAGE." "Return an <upstream-source> for the latest release of the package PKG."
(define upstream-name (define upstream-name
(package->upstream-name package)) (package->upstream-name pkg))
(define version (define version
(latest-bioconductor-package-version upstream-name)) (latest-bioconductor-package-version upstream-name))
@ -419,9 +422,13 @@ (define version
(and version (and version
;; Bioconductor does not provide signatures. ;; Bioconductor does not provide signatures.
(upstream-source (upstream-source
(package (package-name package)) (package (package-name pkg))
(version version) (version version)
(urls (bioconductor-uri upstream-name version))))) (urls (bioconductor-uri upstream-name version))
(input-changes
(changed-inputs
pkg
(cran->guix-package upstream-name 'bioconductor))))))
(define (cran-package? package) (define (cran-package? package)
"Return true if PACKAGE is an R package from CRAN." "Return true if PACKAGE is an R package from CRAN."