From 5f5e3873d735d13824c172d779e6095d6947f340 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 17 Dec 2020 10:40:30 +0100 Subject: import/cran: Add input style "specification". * guix/import/cran.scm (%input-style): New parameter. (format-inputs): Use it. * guix/scripts/import/cran.scm (guix-import-cran): Set the %input-style parameter. (%options): Add "--style" option. * doc/guix.texi (Invoking guix import): Document it. --- guix/import/cran.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'guix/import') diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 9d38be7a1e..fd44d80915 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -51,7 +51,9 @@ #:use-module (guix upstream) #:use-module (guix packages) #:use-module (gnu packages) - #:export (cran->guix-package + #:export (%input-style + + cran->guix-package bioconductor->guix-package cran-recursive-import %cran-updater @@ -74,6 +76,9 @@ ;;; ;;; Code: +(define %input-style + (make-parameter 'variable)) ; or 'specification + (define string->license (match-lambda ("AGPL-3" 'agpl3+) @@ -128,7 +133,11 @@ (define (format-inputs names) "Generate a sorted list of package inputs from a list of package NAMES." (map (lambda (name) - (list name (list 'unquote (string->symbol name)))) + (case (%input-style) + ((specification) + (list name (list 'unquote (list 'specification->package name)))) + (else + (list name (list 'unquote (string->symbol name)))))) (sort names string-ci