guix: Add archive support for bioconductor-uri.

* guix/build-system/r.scm (bioconductor-uri): Also return the archive URL.
* guix/import/cran.scm (latest-bioconductor-release, fetch-description):
Adjust because bioconductor-uri now returns a list.
This commit is contained in:
Ricardo Wurmus 2017-11-06 17:49:47 +01:00
parent 27baf50956
commit 25e51b1c45
No known key found for this signature in database
GPG key ID: 197A5888235FACAC
2 changed files with 8 additions and 5 deletions

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -50,8 +50,11 @@ (define (cran-uri name version)
(define (bioconductor-uri name version) (define (bioconductor-uri name version)
"Return a URI string for the R package archive on Bioconductor for the "Return a URI string for the R package archive on Bioconductor for the
release corresponding to NAME and VERSION." release corresponding to NAME and VERSION."
(string-append "https://bioconductor.org/packages/release/bioc/src/contrib/" (list (string-append "https://bioconductor.org/packages/release/bioc/src/contrib/"
name "_" version ".tar.gz")) name "_" version ".tar.gz")
;; TODO: use %bioconductor-version from (guix import cran)
(string-append "https://bioconductor.org/packages/3.6/bioc/src/contrib/Archive/"
name "_" version ".tar.gz")))
(define %r-build-system-modules (define %r-build-system-modules
;; Build-side modules imported by default. ;; Build-side modules imported by default.

View file

@ -182,7 +182,7 @@ (define (fetch-description repository name)
;; package's DESCRIPTION file over HTTP, so we determine the version, ;; package's DESCRIPTION file over HTTP, so we determine the version,
;; download the source tarball, and then extract the DESCRIPTION file. ;; download the source tarball, and then extract the DESCRIPTION file.
(let* ((version (latest-bioconductor-package-version name)) (let* ((version (latest-bioconductor-package-version name))
(url (bioconductor-uri name version)) (url (car (bioconductor-uri name version)))
(tarball (with-store store (download-to-store store url)))) (tarball (with-store store (download-to-store store url))))
(call-with-temporary-directory (call-with-temporary-directory
(lambda (dir) (lambda (dir)
@ -469,7 +469,7 @@ (define version
(upstream-source (upstream-source
(package (package-name package)) (package (package-name package))
(version version) (version version)
(urls (list (bioconductor-uri upstream-name version)))))) (urls (bioconductor-uri upstream-name version)))))
(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."