summaryrefslogtreecommitdiff
path: root/guix/import/cran.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2016-07-06 12:42:38 +0200
committerRicardo Wurmus <rekado@elephly.net>2016-12-17 15:56:48 +0100
commitbfa0c752bc19810f7b4908c3d0f4a1dd7832c1b6 (patch)
treecc3e775b6966669b869fabc7f687c89ff74816ac /guix/import/cran.scm
parent2e5f32ce1b2d552527b8eb9a85a100a92d6d252a (diff)
import cran: Move guix-name to top-level.
* guix/import/cran.scm (guix-name): Move to top-level.
Diffstat (limited to 'guix/import/cran.scm')
-rw-r--r--guix/import/cran.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index ee34eade94..c98ab88aec 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -148,16 +148,17 @@ empty list when the FIELD cannot be found."
(string-any char-set:whitespace item)))
(map string-trim-both items))))))
+(define (guix-name name)
+ "Return a Guix package name for a given R package name."
+ (string-append "r-" (string-map (match-lambda
+ (#\_ #\-)
+ (#\. #\-)
+ (chr (char-downcase chr)))
+ name)))
+
(define (description->package repository meta)
"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)
- (string-append "r-" (string-map (match-lambda
- (#\_ #\-)
- (#\. #\-)
- (chr (char-downcase chr)))
- name)))
-
(let* ((base-url (case repository
((cran) %cran-url)
((bioconductor) %bioconductor-url)))