mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-27 14:52:05 -05:00
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'.
This commit is contained in:
parent
ba41f87ec7
commit
37c32caf2c
1 changed files with 11 additions and 13 deletions
|
@ -642,21 +642,19 @@ (define (tarxz-name file-name)
|
||||||
(define instantiate-patch
|
(define instantiate-patch
|
||||||
(match-lambda
|
(match-lambda
|
||||||
((? string? patch) ;deprecated
|
((? string? patch) ;deprecated
|
||||||
(interned-file patch #:recursive? #t))
|
(local-file patch #:recursive? #t))
|
||||||
((? struct? patch) ;origin, local-file, etc.
|
((? struct? patch) ;origin, local-file, etc.
|
||||||
(lower-object patch system))))
|
patch)))
|
||||||
|
|
||||||
(mlet %store-monad ((tar -> (lookup-input "tar"))
|
(let ((tar (lookup-input "tar"))
|
||||||
(gzip -> (lookup-input "gzip"))
|
(gzip (lookup-input "gzip"))
|
||||||
(bzip2 -> (lookup-input "bzip2"))
|
(bzip2 (lookup-input "bzip2"))
|
||||||
(lzip -> (lookup-input "lzip"))
|
(lzip (lookup-input "lzip"))
|
||||||
(xz -> (lookup-input "xz"))
|
(xz (lookup-input "xz"))
|
||||||
(patch -> (lookup-input "patch"))
|
(patch (lookup-input "patch"))
|
||||||
(locales -> (lookup-input "locales"))
|
(locales (lookup-input "locales"))
|
||||||
(comp -> (and=> (compressor source-file-name)
|
(comp (and=> (compressor source-file-name) lookup-input))
|
||||||
lookup-input))
|
(patches (map instantiate-patch patches)))
|
||||||
(patches (sequence %store-monad
|
|
||||||
(map instantiate-patch patches))))
|
|
||||||
(define build
|
(define build
|
||||||
(with-imported-modules '((guix build utils))
|
(with-imported-modules '((guix build utils))
|
||||||
#~(begin
|
#~(begin
|
||||||
|
|
Loading…
Reference in a new issue