aboutsummaryrefslogtreecommitdiff
path: root/guix/svn-download.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-14 14:42:10 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-14 14:42:10 +0100
commitf220a8384890b2a50f30c62fba56e507333f1a92 (patch)
treec51640dc8115aecb8f7b3ffc055f6b2e066d16f7 /guix/svn-download.scm
parent023d9892c0411adb523e6bc8337be3e7e94e606f (diff)
downloadguix-f220a8384890b2a50f30c62fba56e507333f1a92.tar
guix-f220a8384890b2a50f30c62fba56e507333f1a92.tar.gz
packages: Convert source derivations to monadic style.
* guix/packages.scm (origin->derivation): Take body from 'package-source-derivation', and change it to monadic style. Expect METHOD to a monadic procedure. (package-source-derivation): Define in terms of 'origin->derivation'. * guix/download.scm (url-fetch): Remove 'store' argument. Remove 'guile-for-build' variable. Turn into a monadic procedure. * guix/git-download.scm (git-fetch): Likewise. * guix/svn-download.scm (svn-fetch): Likewise. * tests/builders.scm (url-fetch*): New procedure. Change tests to call 'url-fetch*' instead of 'url-fetch'. * tests/packages.scm ("package-source-derivation, snippet"): Remove 'store' parameter of 'fetch' and change it to use 'interned-file' instead of 'add-to-store'. * gnu/packages/bootstrap.scm (bootstrap-origin)[boot]: Remove 'store' parameter.
Diffstat (limited to 'guix/svn-download.scm')
-rw-r--r--guix/svn-download.scm28
1 files changed, 8 insertions, 20 deletions
diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index 1c03bb9e76..ee67513e16 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -49,23 +49,13 @@
(let ((distro (resolve-interface '(gnu packages version-control))))
(module-ref distro 'subversion)))
-(define* (svn-fetch store ref hash-algo hash
+(define* (svn-fetch ref hash-algo hash
#:optional name
- #:key (system (%current-system)) guile
+ #:key (system (%current-system)) (guile (default-guile))
(svn (subversion-package)))
- "Return a fixed-output derivation in STORE that fetches REF, a
-<svn-reference> object. The output is expected to have recursive hash HASH of
-type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if
-#f."
- (define guile-for-build
- (match guile
- ((? package?)
- (package-derivation store guile system))
- (#f ; the default
- (let* ((distro (resolve-interface '(gnu packages commencement)))
- (guile (module-ref distro 'guile-final)))
- (package-derivation store guile system)))))
-
+ "Return a fixed-output derivation that fetches REF, a <svn-reference>
+object. The output is expected to have recursive hash HASH of type
+HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(define build
#~(begin
(use-modules (guix build svn))
@@ -74,7 +64,7 @@ type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if
#$output
#:svn-command (string-append #$svn "/bin/svn"))))
- (run-with-store store
+ (mlet %store-monad ((guile (package->derivation guile system)))
(gexp->derivation (or name "svn-checkout") build
#:system system
;; FIXME: See <https://bugs.gnu.org/18747>.
@@ -84,9 +74,7 @@ type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if
#:recursive? #t
#:modules '((guix build svn)
(guix build utils))
- #:guile-for-build guile-for-build
- #:local-build? #t)
- #:guile-for-build guile-for-build
- #:system system))
+ #:guile-for-build guile
+ #:local-build? #t)))
;;; svn-download.scm ends here