summaryrefslogtreecommitdiff
path: root/guix/git-download.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/git-download.scm')
-rw-r--r--guix/git-download.scm31
1 files changed, 10 insertions, 21 deletions
diff --git a/guix/git-download.scm b/guix/git-download.scm
index 94b118a7b9..94a1245480 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -18,6 +18,7 @@
(define-module (guix git-download)
#:use-module (guix gexp)
+ #:use-module (guix store)
#:use-module (guix monads)
#:use-module (guix records)
#:use-module (guix packages)
@@ -52,23 +53,13 @@
(let ((distro (resolve-interface '(gnu packages version-control))))
(module-ref distro 'git)))
-(define* (git-fetch store ref hash-algo hash
+(define* (git-fetch ref hash-algo hash
#:optional name
- #:key (system (%current-system)) guile
+ #:key (system (%current-system)) (guile (default-guile))
(git (git-package)))
- "Return a fixed-output derivation in STORE that fetches REF, a
-<git-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 <git-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 inputs
;; When doing 'git clone --recursive', we need sed, grep, etc. to be
;; available so that 'git submodule' works.
@@ -95,7 +86,7 @@ type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if
#:recursive? '#$(git-reference-recursive? ref)
#:git-command (string-append #$git "/bin/git"))))
- (run-with-store store
+ (mlet %store-monad ((guile (package->derivation guile system)))
(gexp->derivation (or name "git-checkout") build
#:system system
;; FIXME: See <https://bugs.gnu.org/18747>.
@@ -105,9 +96,7 @@ type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if
#:recursive? #t
#:modules '((guix build git)
(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)))
;;; git-download.scm ends here