all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Add recursive CRAN importer
@ 2016-05-23 15:40 Ricardo Wurmus
  2016-05-23 15:40 ` [PATCH 1/7] import cran: Remove more invalid characters from package names Ricardo Wurmus
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Ricardo Wurmus @ 2016-05-23 15:40 UTC (permalink / raw)
  To: guix-devel

attached is a patch series that gives us a recursive CRAN importer.  I still
haven't documented it in the manual, because I'm not sure if the
implementation is acceptable.

Simply put, the procedure that produces a package expression now returns
multiple values.  The first is the package expression, the second is a list of
dependencies (with their upstream names).  This allows us to go through that
list and check if any unpackaged inputs are among them.

The recursive importer stops when a package cannot be imported (e.g. when a
bioconductor package has unpackaged CRAN dependencies), or when all packages
either already existed at runtime or have been packaged.

To make this work well I had to create a list of packages that should not be
imported (because they are part of the default R installation), and I had to
make sure that R packages always get a predictable Guix package name.

Comments are very welcome!

~~ Ricardo

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 1/7] import cran: Remove more invalid characters from package names.
@ 2016-05-23 15:32 Ricardo Wurmus
  2016-05-23 21:54 ` Ludovic Courtès
  0 siblings, 1 reply; 23+ messages in thread
From: Ricardo Wurmus @ 2016-05-23 15:32 UTC (permalink / raw)
  To: guix-devel

* guix/import/cran.scm (guix-name): Replace period and underscore with
  dash; always prepend package names with "r-".
---
 guix/import/cran.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index c1a9e8e..8b368af 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -151,9 +151,9 @@ empty list when the FIELD cannot be found."
   "Return the `package' s-expression for an R package published on REPOSITORY
 from the alist META, which was derived from the R package's DESCRIPTION file."
   (define (guix-name name)
-    (if (string-prefix? "r-" name)
-        (string-downcase name)
-        (string-append "r-" (string-downcase name))))
+    (string-append "r-" (string-downcase
+                         (regexp-substitute/global #f "(_|\\.)" name
+                                                   'pre "-" 'post))))
 
   (let* ((base-url   (case repository
                        ((cran)         %cran-url)
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-09-01 11:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 15:40 [PATCH] Add recursive CRAN importer Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 1/7] import cran: Remove more invalid characters from package names Ricardo Wurmus
2016-05-30  8:48   ` Ludovic Courtès
2016-06-14 15:02     ` Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 2/7] import cran: Move guix-name to top-level Ricardo Wurmus
2016-05-30  8:49   ` Ludovic Courtès
2016-05-23 15:40 ` [PATCH 3/7] import cran: description->package: Also return package dependencies Ricardo Wurmus
2016-05-30  8:51   ` Ludovic Courtès
2016-06-14 15:49     ` Ricardo Wurmus
2016-08-05 16:03       ` Ricardo Wurmus
2016-08-29 15:20         ` Ludovic Courtès
2016-08-31 10:39           ` Ricardo Wurmus
2016-09-01 11:50             ` Ludovic Courtès
2016-05-23 15:40 ` [PATCH 4/7] import cran: Ignore default R packages Ricardo Wurmus
2016-05-30  8:52   ` Ludovic Courtès
2016-05-23 15:40 ` [PATCH 5/7] import cran: Add recursive importer Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 6/7] import cran: Add "recursive" option Ricardo Wurmus
2016-05-30  8:55   ` Ludovic Courtès
2016-06-14 15:30     ` Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 7/7] guix import: Print list of expressions Ricardo Wurmus
2016-05-30  8:56   ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2016-05-23 15:32 [PATCH 1/7] import cran: Remove more invalid characters from package names Ricardo Wurmus
2016-05-23 21:54 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.