summaryrefslogtreecommitdiff
path: root/guix/http.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/http.scm')
-rw-r--r--guix/http.scm21
1 files changed, 19 insertions, 2 deletions
diff --git a/guix/http.scm b/guix/http.scm
index 97ed3983f1..182d011b77 100644
--- a/guix/http.scm
+++ b/guix/http.scm
@@ -17,7 +17,10 @@
;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix http)
+ #:use-module (ice-9 match)
#:use-module (guix derivations)
+ #:use-module (guix packages)
+ #:use-module ((guix store) #:select (derivation-path?))
#:use-module (guix utils)
#:export (http-fetch))
@@ -29,7 +32,7 @@
(define* (http-fetch store url hash-algo hash
#:optional name
- #:key (system (%current-system)))
+ #:key (system (%current-system)) guile)
"Return the path of a fixed-output derivation in STORE that fetches URL,
which is expected to have hash HASH of type HASH-ALGO (a symbol). By
default, the file name is the base name of URL; optionally, NAME can specify
@@ -39,8 +42,22 @@ a different file name."
(use-modules (guix build http))
(http-fetch ,url %output)))
+ (define guile-for-build
+ (match guile
+ ((? package?)
+ (package-derivation store guile system))
+ ((and (? string?) (? derivation-path?))
+ guile)
+ (#f ; the default
+ (let* ((distro (resolve-interface '(distro packages base)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system)))))
+
(build-expression->derivation store (or name (basename url)) system
builder '()
#:hash-algo hash-algo
#:hash hash
- #:modules '((guix build http))))
+ #:modules '((guix build http))
+ #:guile-for-build guile-for-build))
+
+;;; http.scm ends here