[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/29: packages: Simplify patch instantiation.
From: |
guix-commits |
Subject: |
16/29: packages: Simplify patch instantiation. |
Date: |
Mon, 8 Mar 2021 06:24:52 -0500 (EST) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 573ecfd0a5eee808a10ffcc63acf37fbfa69a070
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Jun 25 15:31:37 2017 +0200
packages: Simplify patch instantiation.
* guix/packages.scm (patch-and-repack)[instantiate-patch]: Use
'local-file' instead of 'interned-file'. When PATCH is a struct, return
it. Use 'let' instead of 'mlet'.
---
guix/packages.scm | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index 2b59cd8..845985b 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -635,21 +635,19 @@ specifies modules in scope when evaluating SNIPPET."
(define instantiate-patch
(match-lambda
((? string? patch) ;deprecated
- (interned-file patch #:recursive? #t))
+ (local-file patch #:recursive? #t))
((? struct? patch) ;origin, local-file, etc.
- (lower-object patch system))))
-
- (mlet %store-monad ((tar -> (lookup-input "tar"))
- (gzip -> (lookup-input "gzip"))
- (bzip2 -> (lookup-input "bzip2"))
- (lzip -> (lookup-input "lzip"))
- (xz -> (lookup-input "xz"))
- (patch -> (lookup-input "patch"))
- (locales -> (lookup-input "locales"))
- (comp -> (and=> (compressor source-file-name)
- lookup-input))
- (patches (sequence %store-monad
- (map instantiate-patch patches))))
+ patch)))
+
+ (let ((tar (lookup-input "tar"))
+ (gzip (lookup-input "gzip"))
+ (bzip2 (lookup-input "bzip2"))
+ (lzip (lookup-input "lzip"))
+ (xz (lookup-input "xz"))
+ (patch (lookup-input "patch"))
+ (locales (lookup-input "locales"))
+ (comp (and=> (compressor source-file-name) lookup-input))
+ (patches (map instantiate-patch patches)))
(define build
(with-imported-modules '((guix build utils))
#~(begin
- 09/29: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., (continued)
- 09/29: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., guix-commits, 2021/03/08
- 13/29: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/08
- 10/29: gexp: Reduce allocations while traversing lists., guix-commits, 2021/03/08
- 20/29: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/08
- 21/29: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/08
- 02/29: store: Micro-optimize object cache lookup., guix-commits, 2021/03/08
- 28/29: grafts: Add 'without-grafting'., guix-commits, 2021/03/08
- 29/29: gexp: Allowed/disallowed references and graphs never refer to grafted inputs., guix-commits, 2021/03/08
- 14/29: build-system: Rewrite using gexps., guix-commits, 2021/03/08
- 15/29: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/08
- 16/29: packages: Simplify patch instantiation.,
guix-commits <=
- 25/29: tests: Refer to '%derivation-cache' in the right module., guix-commits, 2021/03/08
- 26/29: packages: 'expand-input' accepts any file-like object., guix-commits, 2021/03/08
- 17/29: packages: Core procedures are written in monadic style., guix-commits, 2021/03/08
- 19/29: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/08
- 05/29: gexp: Micro-optimize sexp serialization., guix-commits, 2021/03/08
- 12/29: gexp: Add 'with-build-variables'., guix-commits, 2021/03/08
- 18/29: packages: Default origin 'patch-flags' is a gexp., guix-commits, 2021/03/08
- 22/29: gexp: Honor #:target in 'compiled-modules'., guix-commits, 2021/03/08
- 23/29: packages: '%standard-patch-inputs' is not influenced by '%current-target-system'., guix-commits, 2021/03/08
- 24/29: download: 'url-fetch/tarbomb' and 'url-fetch/zipbomb' refer to native tools., guix-commits, 2021/03/08