summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/crate.scm4
-rw-r--r--guix/import/utils.scm14
2 files changed, 10 insertions, 8 deletions
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 33cc6104c5..233a20e983 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -97,8 +97,8 @@ VERSION, INPUTS, NATIVE-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(base32
,(bytevector->nix-base32-string (port-sha256 port))))))
(build-system cargo-build-system)
- ,@(maybe-native-inputs native-inputs)
- ,@(maybe-inputs inputs)
+ ,@(maybe-native-inputs native-inputs "src")
+ ,@(maybe-inputs inputs "src")
(home-page ,(match home-page
(() "")
(_ home-page)))
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index f304da20e6..be1980d08f 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -211,24 +211,26 @@ into a proper sentence and by using two spaces between sentences."
(regexp-substitute/global #f "\\. \\b"
cleaned 'pre ". " 'post)))
-(define (package-names->package-inputs names)
+(define* (package-names->package-inputs names #:optional (output #f))
(map (lambda (input)
- (list input (list 'unquote (string->symbol input))))
+ (cons* input (list 'unquote (string->symbol input))
+ (or (and output (list output))
+ '())))
names))
-(define (maybe-inputs package-names)
+(define* (maybe-inputs package-names #:optional (output #f))
"Given a list of PACKAGE-NAMES, tries to generate the 'inputs' field of a
package definition."
- (match (package-names->package-inputs package-names)
+ (match (package-names->package-inputs package-names output)
(()
'())
((package-inputs ...)
`((inputs (,'quasiquote ,package-inputs))))))
-(define (maybe-native-inputs package-names)
+(define* (maybe-native-inputs package-names #:optional (output #f))
"Given a list of PACKAGE-NAMES, tries to generate the 'inputs' field of a
package definition."
- (match (package-names->package-inputs package-names)
+ (match (package-names->package-inputs package-names output)
(()
'())
((package-inputs ...)