summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-15 00:39:45 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-16 23:41:52 +0200
commit86a3b540d08e0ece2a697f7caa6342a55394a6b3 (patch)
tree928b0e02a9bd61a68da6cad4a181d28629e1e5b0
parentc89343232065c50d196cd194073d2034eaedaf44 (diff)
downloadpatches-86a3b540d08e0ece2a697f7caa6342a55394a6b3.tar
patches-86a3b540d08e0ece2a697f7caa6342a55394a6b3.tar.gz
import/print: package->code: Wrap S-expression in definition.
* guix/import/print.scm (package->code): Return a definition, not just a package expression.
-rw-r--r--guix/import/print.scm87
1 files changed, 44 insertions, 43 deletions
diff --git a/guix/import/print.scm b/guix/import/print.scm
index 4529a79b23..08f3ec9c34 100644
--- a/guix/import/print.scm
+++ b/guix/import/print.scm
@@ -121,46 +121,47 @@ when evaluated."
(home-page (package-home-page package))
(supported-systems (package-supported-systems package))
(properties (package-properties package)))
- `(package
- (name ,name)
- (version ,version)
- (source ,(source->code source version))
- ,@(match properties
- (() '())
- (_ `((properties ,properties))))
- ,@(if replacement
- `((replacement ,replacement))
- '())
- (build-system (@ (guix build-system ,(build-system-name build-system))
- ,(symbol-append (build-system-name build-system)
- '-build-system)))
- ,@(match arguments
- (() '())
- (args `((arguments ,(list 'quasiquote args)))))
- ,@(match outputs
- (("out") '())
- (outs `((outputs (list ,@outs)))))
- ,@(match native-inputs
- (() '())
- (pkgs `((native-inputs ,(package-lists->code pkgs)))))
- ,@(match inputs
- (() '())
- (pkgs `((inputs ,(package-lists->code pkgs)))))
- ,@(match propagated-inputs
- (() '())
- (pkgs `((propagated-inputs ,(package-lists->code pkgs)))))
- ,@(if (lset= string=? supported-systems %supported-systems)
- '()
- `((supported-systems (list ,@supported-systems))))
- ,@(match (map search-path-specification->code native-search-paths)
- (() '())
- (paths `((native-search-paths (list ,@paths)))))
- ,@(match (map search-path-specification->code search-paths)
- (() '())
- (paths `((search-paths (list ,@paths)))))
- (home-page ,home-page)
- (synopsis ,synopsis)
- (description ,description)
- (license ,(if (list? license)
- `(list ,@(map license->code license))
- (license->code license))))))
+ `(define-public ,(string->symbol name)
+ (package
+ (name ,name)
+ (version ,version)
+ (source ,(source->code source version))
+ ,@(match properties
+ (() '())
+ (_ `((properties ,properties))))
+ ,@(if replacement
+ `((replacement ,replacement))
+ '())
+ (build-system (@ (guix build-system ,(build-system-name build-system))
+ ,(symbol-append (build-system-name build-system)
+ '-build-system)))
+ ,@(match arguments
+ (() '())
+ (args `((arguments ,(list 'quasiquote args)))))
+ ,@(match outputs
+ (("out") '())
+ (outs `((outputs (list ,@outs)))))
+ ,@(match native-inputs
+ (() '())
+ (pkgs `((native-inputs ,(package-lists->code pkgs)))))
+ ,@(match inputs
+ (() '())
+ (pkgs `((inputs ,(package-lists->code pkgs)))))
+ ,@(match propagated-inputs
+ (() '())
+ (pkgs `((propagated-inputs ,(package-lists->code pkgs)))))
+ ,@(if (lset= string=? supported-systems %supported-systems)
+ '()
+ `((supported-systems (list ,@supported-systems))))
+ ,@(match (map search-path-specification->code native-search-paths)
+ (() '())
+ (paths `((native-search-paths (list ,@paths)))))
+ ,@(match (map search-path-specification->code search-paths)
+ (() '())
+ (paths `((search-paths (list ,@paths)))))
+ (home-page ,home-page)
+ (synopsis ,synopsis)
+ (description ,description)
+ (license ,(if (list? license)
+ `(list ,@(map license->code license))
+ (license->code license)))))))