diff mbox

[4/7] import cran: Ignore default R packages.

Message ID 1464018008-1767-5-git-send-email-ricardo.wurmus@mdc-berlin.de
State New
Headers show

Commit Message

Ricardo Wurmus May 23, 2016, 3:40 p.m. UTC
* guix/import/cran.scm (default-r-packages): New variable.
(description->package): Drop default R packages from list of inputs.
---
 guix/import/cran.scm | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

Comments

Ludovic Court├Ęs May 30, 2016, 8:52 a.m. UTC | #1
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> * guix/import/cran.scm (default-r-packages): New variable.
> (description->package): Drop default R packages from list of inputs.

OK!

Ludo'.
diff mbox

Patch

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index ff9dbd3..522df3e 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -148,6 +148,16 @@  empty list when the FIELD cannot be found."
                         (string-any char-set:whitespace item)))
                   (map string-trim-both items))))))
 
+(define default-r-packages
+  (list "stats"
+        "methods"
+        "utils"
+        "graphics"
+        "grDevices"
+        "parallel"
+        "grid"
+        "tools"
+        "matrix"))
 
 (define (guix-name name)
   "Return a Guix package name for a given R package name."
@@ -178,11 +188,13 @@  from the alist META, which was derived from the R package's DESCRIPTION file."
                        (_ #f)))
          (tarball    (with-store store (download-to-store store source-url)))
          (sysdepends (map string-downcase (listify meta "SystemRequirements")))
-         (propagate  (lset-union equal?
-                                 (listify meta "Imports")
-                                 (listify meta "LinkingTo")
-                                 (delete "R"
-                                         (listify meta "Depends")))))
+         (propagate  (filter (lambda (name)
+                               (not (member name default-r-packages)))
+                             (lset-union equal?
+                                         (listify meta "Imports")
+                                         (listify meta "LinkingTo")
+                                         (delete "R"
+                                                 (listify meta "Depends"))))))
     (values
      `(package
         (name ,(guix-name name))