From 01a43735fe5b2ee5c34431d9e5109e3718e7612b Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 5 Feb 2020 08:26:08 +0100 Subject: [PATCH] =?UTF-8?q?import:=20cran:=20Use=20CRAN=E2=80=99s=20canoni?= =?UTF-8?q?cal=20URL=20as=20home-page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/cran.scm (%cran-canonical-url): New variable. (description->package): Construct home-page using canonical URL. --- guix/import/cran.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index bcb37ed250..9f1214324c 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -134,6 +134,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.10. Bioconductor packages should be @@ -402,6 +403,10 @@ from the alist META, which was derived from the R package's DESCRIPTION file." ((cran) %cran-url) ((bioconductor) %bioconductor-url) ((git) #f))) + (canonical-url (case repository + ((cran) %cran-canonical-url) + ((bioconductor) %bioconductor-url) + ((git) #f))) (uri-helper (case repository ((cran) cran-uri) ((bioconductor) bioconductor-uri) @@ -415,7 +420,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." ((git) (assoc-ref meta 'git)) (else (match (listify meta "URL") ((url rest ...) url) - (_ (string-append base-url name)))))) + (_ (string-append canonical-url name)))))) (source-url (case repository ((git) (assoc-ref meta 'git)) (else -- 2.20.1