summaryrefslogtreecommitdiff
path: root/guix/ftp.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/ftp.scm')
-rw-r--r--guix/ftp.scm20
1 files changed, 18 insertions, 2 deletions
diff --git a/guix/ftp.scm b/guix/ftp.scm
index 79bae6ece6..2717bf3fb3 100644
--- a/guix/ftp.scm
+++ b/guix/ftp.scm
@@ -17,7 +17,10 @@
;;; along with Guix. If not, see <ftp://www.gnu.org/licenses/>.
(define-module (guix ftp)
+ #: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 (ftp-fetch))
@@ -29,7 +32,7 @@
(define* (ftp-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,11 +42,24 @@ a different file name."
(use-modules (guix build ftp))
(ftp-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 ftp-client)
(guix build ftp)
- (guix build utils))))
+ (guix build utils))
+ #:guile-for-build guile-for-build))
+
;;; ftp.scm ends here