[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/20: packages: Default origin 'patch-flags' is a gexp.
From: |
guix-commits |
Subject: |
17/20: packages: Default origin 'patch-flags' is a gexp. |
Date: |
Mon, 1 Mar 2021 09:32:12 -0500 (EST) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit fe75626fec48cbc5c50f147d3bfd0eb1fbdc0f67
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Feb 28 20:53:00 2021 +0100
packages: Default origin 'patch-flags' is a gexp.
Using a gexp instead of a list means that 'gexp->sexp' & co. do not need
to scan that list for file-like objects.
* guix/packages.scm (<origin>)[patch-flags]: Default to
%DEFAULT-PATCH-FLAGS.
(%default-patch-flags): New variable.
(patch-and-repack): #:flags defaults to %DEFAULT-PATCH-FLAGS.
(origin->derivation): Don't expect FLAGS to be a list.
---
guix/packages.scm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index 6d9b038..9b0fc9b 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -275,8 +275,8 @@ as base32. Otherwise, it must be a bytevector."
(default '()) (delayed))
(snippet origin-snippet (default #f)) ; sexp or #f
- (patch-flags origin-patch-flags ; list of strings
- (default '("-p1")))
+ (patch-flags origin-patch-flags ; string-list gexp
+ (default %default-patch-flags))
;; Patching requires Guile, GNU Patch, and a few more. These two fields are
;; used to specify these dependencies when needed.
@@ -324,6 +324,9 @@ specifications to 'hash'."
(set-record-type-printer! <origin> print-origin)
+(define %default-patch-flags
+ #~("-p1"))
+
(define (origin-actual-file-name origin)
"Return the file name of ORIGIN, either its 'file-name' field or the file
name of its URI."
@@ -587,7 +590,7 @@ the build code of derivation."
#:key
inputs
(snippet #f)
- (flags '("-p1"))
+ (flags %default-patch-flags)
(modules '())
(guile-for-build (%guile-for-build))
(system (%current-system)))
@@ -1619,7 +1622,7 @@ unless you know what you are doing."
(content-hash-value hash)
name #:system system))
(($ <origin> uri method hash name (= force (patches ...)) snippet
- (flags ...) inputs (modules ...) guile-for-build)
+ flags inputs (modules ...) guile-for-build)
;; Patches and/or a snippet.
(mlet %store-monad ((source (method uri
(content-hash-algorithm hash)
- 02/20: packages: Turn 'bag->derivation' into a monadic procedure., (continued)
- 02/20: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/01
- 05/20: gexp: Micro-optimize sexp serialization., guix-commits, 2021/03/01
- 04/20: packages: Core procedures are written in monadic style., guix-commits, 2021/03/01
- 01/20: build-system: Rewrite using gexps., guix-commits, 2021/03/01
- 07/20: gexp: 'gexp-inputs' returns both native and non-native inputs., guix-commits, 2021/03/01
- 03/20: packages: Simplify patch instantiation., guix-commits, 2021/03/01
- 09/20: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., guix-commits, 2021/03/01
- 12/20: grafts: Inline 'grafting?' and 'set-grafting'., guix-commits, 2021/03/01
- 15/20: serialization: Micro-optimize string literal output in 'write-file-tree'., guix-commits, 2021/03/01
- 16/20: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/01
- 17/20: packages: Default origin 'patch-flags' is a gexp.,
guix-commits <=
- 18/20: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/01
- 08/20: gexp: Keep 'lower-inputs' private., guix-commits, 2021/03/01
- 10/20: store: Object cache profiling shows the number of entries., guix-commits, 2021/03/01
- 11/20: gexp: Reduce allocations while traversing lists., guix-commits, 2021/03/01
- 06/20: gexp: 'gexp-inputs' returns a list of <gexp-input> records., guix-commits, 2021/03/01
- 13/20: store: Micro-optimize object cache lookup., guix-commits, 2021/03/01
- 14/20: gexp: Reduce allocations in 'gexp-attribute'., guix-commits, 2021/03/01
- 20/20: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/01
- 19/20: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/01