aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <ldb@leibniz-psychology.org>2020-02-05 08:26:08 +0100
committerChristopher Baines <mail@cbaines.net>2020-12-15 22:34:30 +0000
commitf14bb29defb36051039e977ba3791b542d90578a (patch)
tree57e51ae063558270113dfeb3a1758415e9a98f2d
parent0510ca15aa395ddd3daf0720b541662671bf14c3 (diff)
downloadguix-f14bb29defb36051039e977ba3791b542d90578a.tar.gz
guix-f14bb29defb36051039e977ba3791b542d90578a.zip
import: cran: Use CRAN’s canonical URL as home-page.
* guix/import/cran.scm (%cran-canonical-url): New variable. (description->package): Construct home-page using canonical URL. Signed-off-by: Christopher Baines <mail@cbaines.net>
-rw-r--r--guix/import/cran.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 1d25a5125e..9d38be7a1e 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -141,6 +141,7 @@ package definition."
`((,type (,'quasiquote ,(format-inputs package-inputs)))))))
(define %cran-url "https://cran.r-project.org/web/packages/")
+(define %cran-canonical-url "https://cran.r-project.org/package=")
(define %bioconductor-url "https://bioconductor.org/packages/")
;; The latest Bioconductor release is 3.12. Bioconductor packages should be
@@ -441,6 +442,10 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
((bioconductor) %bioconductor-url)
((git) #f)
((hg) #f)))
+ (canonical-url-base (case repository
+ ((cran) %cran-canonical-url)
+ ((bioconductor) %bioconductor-url)
+ ((git) #f)))
(uri-helper (case repository
((cran) cran-uri)
((bioconductor) bioconductor-uri)
@@ -456,7 +461,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
((hg) (assoc-ref meta 'hg))
(else (match (listify meta "URL")
((url rest ...) url)
- (_ (string-append base-url name))))))
+ (_ (string-append canonical-url-base name))))))
(source-url (case repository
((git) (assoc-ref meta 'git))
((hg) (assoc-ref meta 'hg))