diff options
-rw-r--r-- | guix/import/cran.scm | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm index e06001cdb7..fe1d32d79a 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -85,6 +85,21 @@ (define %input-style (make-parameter 'variable)) ; or 'specification +(define (format-inputs inputs) + "Generate a sorted list of package inputs from a list of upstream inputs." + (map (lambda (input) + (case (%input-style) + ((specification) + `(specification->package ,(upstream-input-name input))) + (else + ((compose string->symbol + upstream-input-downstream-name) + input)))) + (sort inputs + (lambda (a b) + (string-ci<? (upstream-input-name a) + (upstream-input-name b)))))) + (define (string->licenses license-string license-prefix) (let ((licenses (map string-trim-both @@ -177,9 +192,7 @@ package definition." (() '()) ((package-inputs ...) - `((,input-type (list ,@(map (compose string->symbol - upstream-input-downstream-name) - package-inputs))))))) + `((,input-type (list ,@(format-inputs package-inputs))))))) (define %cran-url "https://cran.r-project.org/web/packages/") (define %cran-canonical-url "https://cran.r-project.org/package=") |