diff options
Diffstat (limited to 'guix')
-rw-r--r-- | guix/ftp.scm | 20 | ||||
-rw-r--r-- | guix/http.scm | 21 |
2 files changed, 37 insertions, 4 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 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 |