From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] New procedure for CRAN URIs. Date: Thu, 17 Sep 2015 17:13:28 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcasW-0000Sx-AW for guix-devel@gnu.org; Thu, 17 Sep 2015 11:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcasS-0001hr-R6 for guix-devel@gnu.org; Thu, 17 Sep 2015 11:13:40 -0400 Received: from pegasus.bbbm.mdc-berlin.de ([141.80.25.20]:38533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcasS-0001h2-BP for guix-devel@gnu.org; Thu, 17 Sep 2015 11:13:36 -0400 Received: from localhost (localhost [127.0.0.1]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 5F090380FFF for ; Thu, 17 Sep 2015 17:13:35 +0200 (CEST) Received: from pegasus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (pegasus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 62gN-FULHZFO for ; Thu, 17 Sep 2015 17:13:29 +0200 (CEST) Received: from HTCAONE.mdc-berlin.net (mab.citx.mdc-berlin.de [141.80.36.102]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP for ; Thu, 17 Sep 2015 17:13:29 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Guix, after it was reported that the plain CRAN URI only points to the latest version of a package and previous versions are archived at a different URI, I took Dave=E2=80=99s advice and wrote a =E2=80=98cran-uri=E2=80=99 = procedure that produces a list of URI strings for a given R package name and a version. Only one of the two URIs will be correct as the archives don=E2=80=99t co= ntain the latest version. The first patch adds the procedure, the second makes the importer generate a package expression containing the procedure call, and the last updates all existing R packages to use this procedure. I=E2=80=99d like to amend and push Vicente=E2=80=99s useful patches for r= -dplyr once this patch set has been accepted. Thanks for your patience! ~~ Ricardo --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-build-Add-cran-uri-procedure.patch" >From 702458583776bd28c865ffdf06977262b3901ee5 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 17 Sep 2015 17:00:18 +0200 Subject: [PATCH 1/3] build: Add cran-uri procedure. * guix/build-system/r.scm (cran-uri): New procedure. --- guix/build-system/r.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm index 4daec5e..da06cb1 100644 --- a/guix/build-system/r.scm +++ b/guix/build-system/r.scm @@ -28,7 +28,8 @@ #:use-module (srfi srfi-26) #:export (%r-build-system-modules r-build - r-build-system)) + r-build-system + cran-uri)) ;; Commentary: ;; @@ -36,6 +37,15 @@ ;; ;; Code: +(define (cran-uri name version) + "Return a list of URI strings for the R package archive on CRAN for the +release corresponding to NAME and VERSION. As only the most recent version is +available via the first URI, the second URI points to the archived version." + (list (string-append "mirror://cran/src/contrib/" + name "_" version ".tar.gz") + (string-append "mirror://cran/src/contrib/Archive/" + name "/" name "_" version ".tar.gz"))) + (define %r-build-system-modules ;; Build-side modules imported by default. `((guix build r-build-system) -- 2.1.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0002-import-cran-sxml-sexp-Use-cran-uri-in-package-expres.patch" >From 05dc8656928709bfc2ea021a4d0d03b02bb79840 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 17 Sep 2015 17:02:42 +0200 Subject: [PATCH 2/3] import: cran-sxml->sexp: Use cran-uri in package expression. * guix/import/cran.scm (cran-sxml->sexp): Use the cran-uri procedure in the generated package expression. --- guix/import/cran.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 8ed5e54..585cb9f 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -165,7 +165,7 @@ representation of the package page." (version ,version) (source (origin (method url-fetch) - (uri (string-append ,@(factorize-uri source-url version))) + (uri (cran-uri ,name version)) (sha256 (base32 ,(bytevector->nix-base32-string (file-sha256 tarball)))))) -- 2.1.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0003-gnu-Use-cran-uri-in-source-expressions.patch" >From 27abdabf051fc19781c05f7fa2bdb6bc3cf7728f Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 17 Sep 2015 17:04:35 +0200 Subject: [PATCH 3/3] gnu: Use cran-uri in source expressions. * gnu/packages/statistics.scm (r-colorspace, r-dichromat, r-digest, r-gtable, r-labeling, r-magrittr, r-munsell, r-rcpp, r-plyr, r-proto, r-rcolorbrewer, r-stringi, r-stringr, r-reshape2, r-scales, r-ggplot2, r-assertthat, r-lazyeval, r-dbi): Use cran-uri in source expressions. --- gnu/packages/statistics.scm | 58 +++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 6ccb97f..54c9abc 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -141,8 +141,7 @@ available, greatly increasing its breadth and scope.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/colorspace_" - version ".tar.gz")) + (uri (cran-uri "colorspace" version)) (sha256 (base32 "0y8n4ljwhbdvkysdwgqzcnpv107pb3px1jip3k6svv86p72nacds")))) (build-system r-build-system) @@ -162,8 +161,7 @@ colors are provided.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/dichromat_" - version ".tar.gz")) + (uri (cran-uri "dichromat" version)) (sha256 (base32 "1l8db1nk29ccqg3mkbafvfiw0775iq4gapysf88xq2zp6spiw59i")))) (build-system r-build-system) @@ -181,8 +179,7 @@ effects of different types of color-blindness.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/digest_" - version ".tar.gz")) + (uri (cran-uri "digest" version)) (sha256 (base32 "0m9grqv67hhf51lz10whymhw0g0d98466ka694kya5x95hn44qih")))) (build-system r-build-system) @@ -207,8 +204,7 @@ OpenSSL should be used.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/gtable_" - version ".tar.gz")) + (uri (cran-uri "gtable" version)) (sha256 (base32 "0k9hfj6r5y238gqh92s3cbdn34biczx3zfh79ix5xq0c5vkai2xh")))) (build-system r-build-system) @@ -226,8 +222,7 @@ OpenSSL should be used.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/labeling_" - version ".tar.gz")) + (uri (cran-uri "labeling" version)) (sha256 (base32 "13sk7zrrrzry6ky1bp8mmnzcl9jhvkig8j4id9nny7z993mnk00d")))) (build-system r-build-system) @@ -244,8 +239,7 @@ algorithms.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/magrittr_" - version ".tar.gz")) + (uri (cran-uri "magrittr" version)) (sha256 (base32 "1s1ar6rag8m277qcqmdp02gn4awn9bdj9ax0r8s32i59mm1mki05")))) (build-system r-build-system) @@ -266,8 +260,7 @@ see package vignette. To quote Rene Magritte, \"Ceci n'est pas un pipe.\"") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/munsell_" - version ".tar.gz")) + (uri (cran-uri "munsell" version)) (sha256 (base32 "1bi5yi0i80778bbzx2rm4f0glpc34kvh24pwwfhm4v32izsqgrw4")))) (build-system r-build-system) @@ -287,8 +280,7 @@ Munsell colour system.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/Rcpp_" - version ".tar.gz")) + (uri (cran-uri "Rcpp" version)) (sha256 (base32 "182109z0yc1snqgd833ssl2cix6cbq83bcxmy5344b15ym820y38")))) (build-system r-build-system) @@ -312,8 +304,7 @@ and Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/plyr_" - version ".tar.gz")) + (uri (cran-uri "plyr" version)) (sha256 (base32 "06v4zxawpjz37rp2q2ii5q43g664z9s29j4ydn0cz3crn7lzl6pk")))) (build-system r-build-system) @@ -335,7 +326,7 @@ panels or collapse high-dimensional arrays to simpler summary statistics.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/proto_" version ".tar.gz")) + (uri (cran-uri "proto" version)) (sha256 (base32 "03mvzi529y6kjcp9bkpk7zlgpcakb3iz73hca6rpjy14pyzl3nfh")))) (build-system r-build-system) @@ -353,8 +344,7 @@ prototype-based, rather than class-based object oriented ideas.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/RColorBrewer_" - version ".tar.gz")) + (uri (cran-uri "RColorBrewer" version)) (sha256 (base32 "1pfcl8z1pnsssfaaz9dvdckyfnnc6rcq56dhislbf571hhg7isgk")))) (build-system r-build-system) @@ -373,10 +363,7 @@ designed by Cynthia Brewer as described at http://colorbrewer2.org") (source (origin (method url-fetch) - (uri (string-append - "mirror://cran/src/contrib/stringi_" - version - ".tar.gz")) + (uri (cran-uri "stringi" version)) (sha256 (base32 "183wrrjhpgl1wbnn9lhghyvhz7l2mc64mpcmzplckal7y9j7pmhw")))) @@ -402,8 +389,7 @@ transliteration, concatenation, date-time formatting and parsing, etc.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/stringr_" - version ".tar.gz")) + (uri (cran-uri "stringr" version)) (sha256 (base32 "0jnz6r9yqyf7dschr2fnn1slg4wn6b4ik5q00j4zrh43bfw7s9pq")))) (build-system r-build-system) @@ -427,8 +413,7 @@ the input of another.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/reshape2_" - version ".tar.gz")) + (uri (cran-uri "reshape2" version)) (sha256 (base32 "0hl082dyk3pk07nqprpn5dvnrkqhnf6zjnjig1ijddxhlmsrzm7v")))) (build-system r-build-system) @@ -450,8 +435,7 @@ using just two functions: melt and dcast (or acast).") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/scales_" - version ".tar.gz")) + (uri (cran-uri "scales" version)) (sha256 (base32 "12xrmn1vh64dl46bq7n7pa427aicb2ifjrby9in3m32nyvir0kac")))) (build-system r-build-system) @@ -477,8 +461,7 @@ legends.") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/ggplot2_" - version ".tar.gz")) + (uri (cran-uri "ggplot2" version)) (sha256 (base32 "0794kjqi3lrxb33lr1mykd58959hlgkhdn259vj8fxrh65mqw920")))) (build-system r-build-system) @@ -506,8 +489,7 @@ aesthetic attributes.") (version "0.1") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/assertthat_" - version ".tar.gz")) + (uri (cran-uri "assertthat" version)) (sha256 (base32 "0dwsqajyglfscqilj843qfqn1ndbqpswa7b4l1d633qjk9d68qqk")))) @@ -527,8 +509,7 @@ wrong.") (version "0.1.10") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/lazyeval_" - version ".tar.gz")) + (uri (cran-uri "lazyeval" version)) (sha256 (base32 "02qfpn2fmy78vx4jxr7g7rhqzcm1kcivfwai7lbh0vvpawia0qwh")))) @@ -546,8 +527,7 @@ evaluation (NSE) in R.") (version "0.3.1") (source (origin (method url-fetch) - (uri (string-append "mirror://cran/src/contrib/DBI_" - version ".tar.gz")) + (uri (cran-uri "DBI" version)) (sha256 (base32 "0xj5baxwnhl23rd5nskhjvranrwrc68f3xlyrklglipi41bm69hw")))) -- 2.1.0 --=-=-=--