me
/
guix
Archived
1
0
Fork 0

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.
master
Ludovic Courtès 2021-02-28 20:53:00 +01:00
parent 9e5812ac59
commit 4f5f1d98ef
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 4 deletions

View File

@ -276,8 +276,8 @@ as base32. Otherwise, it must be a bytevector."
(default '()) (delayed)) (default '()) (delayed))
(snippet origin-snippet (default #f)) ; sexp or #f (snippet origin-snippet (default #f)) ; sexp or #f
(patch-flags origin-patch-flags ; list of strings (patch-flags origin-patch-flags ; string-list gexp
(default '("-p1"))) (default %default-patch-flags))
;; Patching requires Guile, GNU Patch, and a few more. These two fields are ;; Patching requires Guile, GNU Patch, and a few more. These two fields are
;; used to specify these dependencies when needed. ;; used to specify these dependencies when needed.
@ -325,6 +325,9 @@ specifications to 'hash'."
(set-record-type-printer! <origin> print-origin) (set-record-type-printer! <origin> print-origin)
(define %default-patch-flags
#~("-p1"))
(define (origin-actual-file-name origin) (define (origin-actual-file-name origin)
"Return the file name of ORIGIN, either its 'file-name' field or the file "Return the file name of ORIGIN, either its 'file-name' field or the file
name of its URI." name of its URI."
@ -594,7 +597,7 @@ the build code of derivation."
#:key #:key
inputs inputs
(snippet #f) (snippet #f)
(flags '("-p1")) (flags %default-patch-flags)
(modules '()) (modules '())
(guile-for-build (%guile-for-build)) (guile-for-build (%guile-for-build))
(system (%current-system))) (system (%current-system)))
@ -1622,7 +1625,7 @@ unless you know what you are doing."
(content-hash-value hash) (content-hash-value hash)
name #:system system)) name #:system system))
(($ <origin> uri method hash name (= force (patches ...)) snippet (($ <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. ;; Patches and/or a snippet.
(mlet %store-monad ((source (method uri (mlet %store-monad ((source (method uri
(content-hash-algorithm hash) (content-hash-algorithm hash)