Ricardo Wurmus <ricardo.wur...@mdc-berlin.de> skribis: > From 8829683fffc03dec7f2faecea75cdd7831ce1741 Mon Sep 17 00:00:00 2001 > From: Ricardo Wurmus <ricardo.wur...@mdc-berlin.de> > Date: Wed, 16 Dec 2015 14:45:28 +0100 > Subject: [PATCH] import: Add Bioconductor importer and updater. > > * guix/import/cran.scm (bioconductor->guix-package, > %bioconductor-updater, latest-bioconductor-release, > bioconductor-package?): New procedures. > (%bioconductor-url, %bioconductor-svn-url): New variables. > (description->package): Update signature to distinguish between packages > from different repositories. > (latest-release): Rename procedure ... > (latest-cran-release): ... to this. > (cran-package?): Do not assume all R packages are available on CRAN. > * tests/cran.scm: Update tests. > * guix/scripts/import/bioconductor.scm: New file. > * guix/scripts/import.scm (importers): Add "bioconductor" importers. > * guix/scripts/refresh.scm (%updaters): Add "%bioconductor-updater". > * doc/guix.texi: Document Bioconductor importer and updater.
[...] > @item cran > the updater for @uref{http://cran.r-project.org/, CRAN} packages; > +@item bioconductor > +the updater for @uref{http://www.bioconductor.org/, Bioconductor} packages; “R packages” > - (properties ,`(,'quasiquote ((,'upstream-name . ,name)))) > + (properties ,`(,'quasiquote ((,'upstream-name . ,name) > + (,'r-repository . ,repository)))) What about adding ‘upstream-name’ only when the upstream name is different from the Guix name minus “r-”? Regarding ‘r-repository’, I guess it can be inferred from the source URL? The risk with properties is that they are missing from current packages, they are easily forgotten (since there’s no expansion-time check for these), and forgetting them would lead to packages being silently ignored by ‘guix refresh’. > (define (cran-package? package) > "Return true if PACKAGE is an R package from CRAN." > - ;; Assume all R packages are available on CRAN. > - (string-prefix? "r-" (package-name package))) > + ;; Assume all R packages are available on CRAN, unless otherwise indicated > + ;; by the r-repository property. > + (let ((properties (package-properties package))) > + (and (string-prefix? "r-" (package-name package)) > + (or (not properties) > + (not (assoc-ref properties 'r-repository)) > + (eqv? 'cran (assoc-ref properties 'r-repository)))))) We could check whether the source URL starts with “mirror://cran”, no? And forget about the ‘r-repository’ property? > +(define (bioconductor-package? package) > + "Return true if PACKAGE is an R package from Bioconductor." > + (let ((properties (package-properties package))) > + (and (string-prefix? "r-" (package-name package)) > + properties > + (eqv? 'bioconductor (assoc-ref properties 'r-repository))))) Likewise, should we check based on the URL? > +++ b/guix/scripts/import/bioconductor.scm I was wondering whether this should be a separate script or not. A precedent would be the ELPA importer, which takes a repository name as an argument. We could have done the same with the CRAN importer here. WDYT? The rest LGTM. Thank you! Ludo’.