|
|
@ -13,10 +13,13 @@ |
|
|
|
(define url-fetch* (@@ (guix download) url-fetch*)) |
|
|
|
(define url-fetch* (@@ (guix download) url-fetch*)) |
|
|
|
|
|
|
|
|
|
|
|
(define* (url-fetch/xz-file url hash-algo hash |
|
|
|
(define* (url-fetch/xz-file url hash-algo hash |
|
|
|
#:optional name |
|
|
|
#:optional name |
|
|
|
#:key (system (%current-system)) |
|
|
|
#:key (system (%current-system)) |
|
|
|
(guile (default-guile))) |
|
|
|
(guile (default-guile))) |
|
|
|
"Similar to 'url-fetch' but decompress the xz file at URL." |
|
|
|
"Similar to 'url-fetch' but decompress the xz file at URL as the result. |
|
|
|
|
|
|
|
This is mainly used for adding xz-compressed patches to a origin definition. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\".xz\" extension in the URL is assumed." |
|
|
|
(define file-name |
|
|
|
(define file-name |
|
|
|
(match url |
|
|
|
(match url |
|
|
|
((head _ ...) |
|
|
|
((head _ ...) |
|
|
@ -27,13 +30,13 @@ |
|
|
|
(module-ref (resolve-interface '(gnu packages compression)) 'xz)) |
|
|
|
(module-ref (resolve-interface '(gnu packages compression)) 'xz)) |
|
|
|
|
|
|
|
|
|
|
|
(mlet %store-monad ((drv (url-fetch* url hash-algo hash |
|
|
|
(mlet %store-monad ((drv (url-fetch* url hash-algo hash |
|
|
|
(or name file-name) |
|
|
|
(or name (basename file-name ".xz")) |
|
|
|
#:system system |
|
|
|
#:system system |
|
|
|
#:guile guile)) |
|
|
|
#:guile guile)) |
|
|
|
(guile (package->derivation guile system))) |
|
|
|
(guile (package->derivation guile system))) |
|
|
|
;; Take the xz file, and simply decompress it. |
|
|
|
;; Take the xz file, and simply decompress it. |
|
|
|
;; Use ungrafted xz so that the resulting tarball doesn't depend on |
|
|
|
;; Use ungrafted xz so that the resulting file doesn't depend on whether |
|
|
|
;; whether grafts are enabled. |
|
|
|
;; grafts are enabled. |
|
|
|
(gexp->derivation (or name file-name) |
|
|
|
(gexp->derivation (or name file-name) |
|
|
|
(with-imported-modules '((guix build utils)) |
|
|
|
(with-imported-modules '((guix build utils)) |
|
|
|
#~(begin |
|
|
|
#~(begin |
|
|
|