guix-commits
[Top][All Lists]
Advanced

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

40/155: import cran: Ignore default R packages.


From: John Darrington
Subject: 40/155: import cran: Ignore default R packages.
Date: Wed, 21 Dec 2016 20:48:32 +0000 (UTC)

jmd pushed a commit to branch wip-installer
in repository guix.

commit aadce619899163e652fc878f1c69d357666818a9
Author: Ricardo Wurmus <address@hidden>
Date:   Tue May 17 15:22:30 2016 +0200

    import cran: Ignore default R packages.
    
    * guix/import/cran.scm (default-r-packages): New variable.
    (description->package): Drop default R packages from list of inputs.
---
 guix/import/cran.scm |   44 +++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 313e26b..09796e0 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -149,6 +149,38 @@ empty list when the FIELD cannot be found."
                         (string-any char-set:whitespace item)))
                   (map string-trim-both items))))))
 
+(define default-r-packages
+  (list "KernSmooth"
+        "MASS"
+        "Matrix"
+        "base"
+        "boot"
+        "class"
+        "cluster"
+        "codetools"
+        "compiler"
+        "datasets"
+        "foreign"
+        "grDevices"
+        "graphics"
+        "grid"
+        "lattice"
+        "methods"
+        "mgcv"
+        "nlme"
+        "nnet"
+        "parallel"
+        "rpart"
+        "spatial"
+        "splines"
+        "stats"
+        "stats4"
+        "survival"
+        "tcltk"
+        "tools"
+        "translations"
+        "utils"))
+
 (define (guix-name name)
   "Return a Guix package name for a given R package name."
   (string-append "r-" (string-map (match-lambda
@@ -180,11 +212,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))



reply via email to

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