guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add Bioconductor importer and updater.


From: Ludovic Courtès
Subject: Re: [PATCH] Add Bioconductor importer and updater.
Date: Tue, 22 Dec 2015 23:01:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Ricardo Wurmus <address@hidden> skribis:

> From 8829683fffc03dec7f2faecea75cdd7831ce1741 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <address@hidden>
> 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;
> address@hidden 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]