From c0b2d08bf473ccc6a95e0ed38ce966befb83c0c1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 31 Dec 2016 15:28:28 +0100 Subject: git-download: Use a single download script for all derivations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That way, we have only one /gnu/store/…-git-download instead of one /gnu/store/…-PACKAGE-checkout-builder for each package. This is a followup to ced200328ca6337ac446e4557c645629e7d7a997. * guix/git-download.scm (git-fetch)[build]: Get the URL, commit, and recursive parameter using 'getenv'. Pass #:script-name and #:env-vars arguments to 'gexp->derivation'. --- guix/git-download.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/guix/git-download.scm b/guix/git-download.scm index 9cc6dd3d94..81d1d4fbf6 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -82,14 +82,26 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." (((names dirs) ...) dirs))) - (git-fetch '#$(git-reference-url ref) - '#$(git-reference-commit ref) + (git-fetch (getenv "git url") (getenv "git commit") #$output - #:recursive? '#$(git-reference-recursive? ref) + #:recursive? (call-with-input-string + (getenv "git recursive?") + read) #:git-command (string-append #+git "/bin/git"))))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "git-checkout") build + + ;; Use environment variables and a fixed script name so + ;; there's only one script in store for all the + ;; downloads. + #:script-name "git-download" + #:env-vars + `(("git url" . ,(git-reference-url ref)) + ("git commit" . ,(git-reference-commit ref)) + ("git recursive?" . ,(object->string + (git-reference-recursive? ref)))) + #:system system #:local-build? #t ;don't offload repo cloning #:hash-algo hash-algo -- cgit v1.2.3 class='right'>Size -rw-r--r--abduco.scm2013logplainabout -rw-r--r--abiword.scm5399logplainabout -rw-r--r--accessibility.scm6354logplainabout -rw-r--r--acct.scm1679logplainabout -rw-r--r--acl.scm3656logplainabout -rw-r--r--ada.scm4389logplainabout -rw-r--r--admin.scm146470logplainabout -rw-r--r--adns.scm4184logplainabout -rw-r--r--agda.scm9189logplainabout -rw-r--r--aidc.scm6200logplainabout -rw-r--r--algebra.scm63224logplainabout -rw-r--r--android.scm40392logplainabout -rw-r--r--animation.scm12578logplainabout -rw-r--r--anthy.scm2878logplainabout -rw-r--r--antivirus.scm7327logplainabout