summaryrefslogtreecommitdiff
path: root/guix/download.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-09-18 17:01:40 +0200
committerLudovic Courtès <ludo@gnu.org>2013-09-18 18:49:53 +0200
commit59688fc4b5cfac3e05610195a47795f5cc15f338 (patch)
treea1f498fc498857e65e5002817760c8721c9caf45 /guix/download.scm
parent81b66f8567ea2e3ecb0983318d5dedd3b1332e48 (diff)
derivations: 'derivation' and related procedures return a single value.
* guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
Diffstat (limited to 'guix/download.scm')
-rw-r--r--guix/download.scm32
1 files changed, 13 insertions, 19 deletions
diff --git a/guix/download.scm b/guix/download.scm
index fa76615ef2..8b1d15f273 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -25,7 +25,6 @@
#:use-module ((guix build download) #:renamer (symbol-prefix-proc 'build:))
#:use-module (guix utils)
#:use-module (srfi srfi-1)
- #:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:export (%mirrors
url-fetch
@@ -212,27 +211,22 @@ must be a list of symbol/URL-list pairs."
((url ...)
(any https? url)))))
- (let*-values (((gnutls-drv-path gnutls-drv)
- (if need-gnutls?
- (gnutls-derivation store system)
- (values #f #f)))
- ((gnutls)
- (and gnutls-drv
- (derivation-output-path
- (assoc-ref (derivation-outputs gnutls-drv)
- "out"))))
- ((env-vars)
- (if gnutls
- (let ((dir (string-append gnutls "/share/guile/site")))
- ;; XXX: `GUILE_LOAD_COMPILED_PATH' is overridden
- ;; by `build-expression->derivation', so we can't
- ;; set it here.
- `(("GUILE_LOAD_PATH" . ,dir)))
- '())))
+ (let* ((gnutls-drv (if need-gnutls?
+ (gnutls-derivation store system)
+ (values #f #f)))
+ (gnutls (and gnutls-drv
+ (derivation->output-path gnutls-drv "out")))
+ (env-vars (if gnutls
+ (let ((dir (string-append gnutls "/share/guile/site")))
+ ;; XXX: `GUILE_LOAD_COMPILED_PATH' is overridden
+ ;; by `build-expression->derivation', so we can't
+ ;; set it here.
+ `(("GUILE_LOAD_PATH" . ,dir)))
+ '())))
(build-expression->derivation store (or name file-name) system
builder
(if gnutls-drv
- `(("gnutls" ,gnutls-drv-path))
+ `(("gnutls" ,gnutls-drv))
'())
#:hash-algo hash-algo
#:hash hash