aboutsummaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-06-25 15:31:37 +0200
committerLudovic Courtès <ludo@gnu.org>2021-03-30 22:48:43 +0200
commit37c32caf2cd21c8b7ca764c262efc7be49f26c86 (patch)
tree1cdde10e0a2ba07b33fc22e08ac141aba788436e /guix/packages.scm
parentba41f87ec77a3ee1757fd79ea53c171593451c6f (diff)
downloadguix-37c32caf2cd21c8b7ca764c262efc7be49f26c86.tar
guix-37c32caf2cd21c8b7ca764c262efc7be49f26c86.tar.gz
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'.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm26
1 files changed, 12 insertions, 14 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 171eb0b347..1b2728f033 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -642,21 +642,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