[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/17: packages: Simplify patch instantiation.
From: |
guix-commits |
Subject: |
05/17: packages: Simplify patch instantiation. |
Date: |
Mon, 22 Mar 2021 18:02:37 -0400 (EDT) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 81a68ae1a58a0b99d106e1a4f77f75fe8fa4df8a
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 4510b4a..564ab5c 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -640,21 +640,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
- branch wip-build-systems-gexp created (now 082df93), guix-commits, 2021/03/22
- 01/17: gexp: Add 'with-build-variables'., guix-commits, 2021/03/22
- 03/17: build-system: Rewrite using gexps., guix-commits, 2021/03/22
- 04/17: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/22
- 05/17: packages: Simplify patch instantiation.,
guix-commits <=
- 02/17: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/22
- 07/17: packages: Default origin 'patch-flags' is a gexp., guix-commits, 2021/03/22
- 12/17: packages: 'expand-input' accepts any file-like object., guix-commits, 2021/03/22
- 13/17: packages: Call 'bag-grafts' only on the tip of the package graph., guix-commits, 2021/03/22
- 06/17: packages: Core procedures are written in monadic style., guix-commits, 2021/03/22
- 08/17: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/22
- 16/17: gexp: Do not add derivations to the object cache., guix-commits, 2021/03/22
- 17/17: gnu: docbook-xsl: Move 'use-modules' form to the top level., guix-commits, 2021/03/22
- 10/17: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/22
- 09/17: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/22