[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/12: import/print: package->code: Wrap S-expression in definition.
From: |
guix-commits |
Subject: |
07/12: import/print: package->code: Wrap S-expression in definition. |
Date: |
Thu, 16 Apr 2020 17:43:21 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit 86a3b540d08e0ece2a697f7caa6342a55394a6b3
Author: Ricardo Wurmus <address@hidden>
AuthorDate: Wed Apr 15 00:39:45 2020 +0200
import/print: package->code: Wrap S-expression in definition.
* guix/import/print.scm (package->code): Return a definition, not just a
package expression.
---
guix/import/print.scm | 87 ++++++++++++++++++++++++++-------------------------
1 file changed, 44 insertions(+), 43 deletions(-)
diff --git a/guix/import/print.scm b/guix/import/print.scm
index 4529a79..08f3ec9 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)))))))
- branch master updated (7b2cb1b -> c9f321e), guix-commits, 2020/04/16
- 01/12: import/print: Return license with prefix., guix-commits, 2020/04/16
- 03/12: import/json: Add json->scheme-file., guix-commits, 2020/04/16
- 07/12: import/print: package->code: Wrap S-expression in definition.,
guix-commits <=
- 12/12: doc: Document building and installing from JSON files., guix-commits, 2020/04/16
- 05/12: scripts/package: Handle JSON files., guix-commits, 2020/04/16
- 10/12: import/utils: alist->package: Include arguments., guix-commits, 2020/04/16
- 02/12: import/print: package->code: Wrap build system value in module reference., guix-commits, 2020/04/16
- 09/12: import/json: json->code: Handle files with more than one definition., guix-commits, 2020/04/16
- 04/12: scripts/build: options->things-to-build: Handle .json files., guix-commits, 2020/04/16
- 06/12: import/json: Use json->code., guix-commits, 2020/04/16
- 11/12: import/print: Don't factorize URI if there's no version match., guix-commits, 2020/04/16
- 08/12: import/utils: alist->package: Ignore known inputs., guix-commits, 2020/04/16