[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/89: import: cran: Use Bioconductor 3.6 helpers.
From: |
Ricardo Wurmus |
Subject: |
03/89: import: cran: Use Bioconductor 3.6 helpers. |
Date: |
Tue, 7 Nov 2017 02:44:46 -0500 (EST) |
rekado pushed a commit to branch master
in repository guix.
commit 27baf509569392dc4c15906eb848c8313a818c9e
Author: Ricardo Wurmus <address@hidden>
Date: Mon Nov 6 17:10:41 2017 +0100
import: cran: Use Bioconductor 3.6 helpers.
* guix/import/cran.scm (bioconductor-mirror-url): Remove procedure.
(fetch-description): Extract DESCRIPTION file from tarball for Bioconductor
packages.
(latest-bioconductor-release): Use latest-bioconductor-package-version.
---
guix/import/cran.scm | 61 +++++++++++++++++++++++++++++++---------------------
1 file changed, 36 insertions(+), 25 deletions(-)
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index bcfc0d9..5622f75 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -130,9 +130,6 @@ package definition."
;; The latest Bioconductor release is 3.6. Bioconductor packages should be
;; updated together.
-(define (bioconductor-mirror-url name)
- (string-append "https://raw.githubusercontent.com/Bioconductor-mirror/"
- name "/release-3.5"))
(define %bioconductor-version "3.6")
(define %bioconductor-packages-list-url
@@ -168,20 +165,35 @@ bioconductor package NAME, or #F if the package is
unknown."
"Return an alist of the contents of the DESCRIPTION file for the R package
NAME in the given REPOSITORY, or #f in case of failure. NAME is
case-sensitive."
- ;; This API always returns the latest release of the module.
- (let ((url (string-append (case repository
- ((cran) (string-append %cran-url name))
- ((bioconductor) (bioconductor-mirror-url name)))
- "/DESCRIPTION")))
- (guard (c ((http-get-error? c)
- (format (current-error-port)
- "error: failed to retrieve package information \
+ (case repository
+ ((cran)
+ (let ((url (string-append %cran-url name "/DESCRIPTION")))
+ (guard (c ((http-get-error? c)
+ (format (current-error-port)
+ "error: failed to retrieve package information \
from ~s: ~a (~s)~%"
- (uri->string (http-get-error-uri c))
- (http-get-error-code c)
- (http-get-error-reason c))
- #f))
- (description->alist (read-string (http-fetch url))))))
+ (uri->string (http-get-error-uri c))
+ (http-get-error-code c)
+ (http-get-error-reason c))
+ #f))
+ (description->alist (read-string (http-fetch url))))))
+ ((bioconductor)
+ ;; Currently, the bioconductor project does not offer a way to access a
+ ;; package's DESCRIPTION file over HTTP, so we determine the version,
+ ;; download the source tarball, and then extract the DESCRIPTION file.
+ (let* ((version (latest-bioconductor-package-version name))
+ (url (bioconductor-uri name version))
+ (tarball (with-store store (download-to-store store url))))
+ (call-with-temporary-directory
+ (lambda (dir)
+ (parameterize ((current-error-port (%make-void-port "rw+"))
+ (current-output-port (%make-void-port "rw+")))
+ (and (zero? (system* "tar" "--wildcards" "-x"
+ "--strip-components=1"
+ "-C" dir
+ "-f" tarball "*/DESCRIPTION"))
+ (description->alist (with-input-from-file
+ (string-append dir "/DESCRIPTION")
read-string))))))))))
(define (listify meta field)
"Look up FIELD in the alist META. If FIELD contains a comma-separated
@@ -449,16 +461,15 @@ dependencies."
(define upstream-name
(package->upstream-name package))
- (define meta
- (fetch-description 'bioconductor upstream-name))
+ (define version
+ (latest-bioconductor-package-version upstream-name))
- (and meta
- (let ((version (assoc-ref meta "Version")))
- ;; Bioconductor does not provide signatures.
- (upstream-source
- (package (package-name package))
- (version version)
- (urls (list (bioconductor-uri upstream-name version)))))))
+ (and version
+ ;; Bioconductor does not provide signatures.
+ (upstream-source
+ (package (package-name package))
+ (version version)
+ (urls (list (bioconductor-uri upstream-name version))))))
(define (cran-package? package)
"Return true if PACKAGE is an R package from CRAN."
- 30/89: gnu: r-biocgenerics: Update to 0.24.0., (continued)
- 30/89: gnu: r-biocgenerics: Update to 0.24.0., Ricardo Wurmus, 2017/11/07
- 49/89: gnu: r-bsgenome: Update to 1.46.0., Ricardo Wurmus, 2017/11/07
- 57/89: gnu: r-pcamethods: Update to 1.70.0., Ricardo Wurmus, 2017/11/07
- 58/89: gnu: r-aroma-light: Update to 3.8.0., Ricardo Wurmus, 2017/11/07
- 59/89: gnu: r-deseq: Update to 1.30.0., Ricardo Wurmus, 2017/11/07
- 54/89: gnu: r-protgenerics: Update to 1.10.0., Ricardo Wurmus, 2017/11/07
- 61/89: gnu: r-edaseq: Update to 2.12.0., Ricardo Wurmus, 2017/11/07
- 33/89: gnu: r-s4vectors: Update to 0.16.0., Ricardo Wurmus, 2017/11/07
- 43/89: gnu: r-rsamtools: Update to 1.30.0., Ricardo Wurmus, 2017/11/07
- 44/89: gnu: r-delayedarray: Update to 0.4.1., Ricardo Wurmus, 2017/11/07
- 03/89: import: cran: Use Bioconductor 3.6 helpers.,
Ricardo Wurmus <=
- 11/89: gnu: r-geneplotter: Update to 1.56.0., Ricardo Wurmus, 2017/11/07
- 31/89: gnu: r-biocinstaller: Update to 1.28.0., Ricardo Wurmus, 2017/11/07
- 34/89: gnu: r-iranges: Update to 2.12.0., Ricardo Wurmus, 2017/11/07
- 38/89: gnu: r-xvector: Update to 0.18.0., Ricardo Wurmus, 2017/11/07
- 42/89: gnu: r-biostrings: Update to 2.46.0., Ricardo Wurmus, 2017/11/07
- 50/89: gnu: r-seqpattern: Update to 1.10.0., Ricardo Wurmus, 2017/11/07
- 53/89: gnu: r-seqlogo: Update to 1.44.0., Ricardo Wurmus, 2017/11/07
- 62/89: gnu: r-interactivedisplaybase: Update to 1.16.0., Ricardo Wurmus, 2017/11/07
- 66/89: gnu: r-motifrg: Rename input label., Ricardo Wurmus, 2017/11/07
- 82/89: gnu: r-mzid: Update to 1.16.0., Ricardo Wurmus, 2017/11/07