diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-06-11 21:50:17 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-06-11 21:50:17 +0200 |
commit | 9809055707de8c518e928e09ea76dd10fbc19a6a (patch) | |
tree | e8a1f8d619ee8bae7074f9f0561e39929ca4ca90 /tests/derivations.scm | |
parent | b37eb5ede67f8f26dcbbb0d9c60050db10b63d00 (diff) |
Add a `%current-system' fluid.
* guix/utils.scm (gnu-triplet->nix-system): New procedure.
(%current-system): New variable.
* tests/utils.scm ("gnu-triplet->nix-system"): New test.
* tests/derivations.scm (%current-system): Remove. Update users to
use (%current-system) instead.
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r-- | tests/derivations.scm | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm index eb2f360b2a..b4e4ccea8e 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -30,10 +30,6 @@ #:use-module (ice-9 rdelim) #:use-module (ice-9 ftw)) -(define %current-system - ;; System type as expected by Nix, usually ARCHITECTURE-KERNEL. - "x86_64-linux") - (define %store (false-if-exception (open-connection))) @@ -79,7 +75,7 @@ (let ((builder (add-text-to-store %store "my-builder.sh" "#!/bin/sh\necho hello, world\n" '()))) - (store-path? (derivation %store "foo" %current-system builder + (store-path? (derivation %store "foo" (%current-system) builder '() '(("HOME" . "/homeless")) '())))) (test-assert "build derivation with 1 source" @@ -88,7 +84,7 @@ "echo hello, world > \"$out\"\n" '())) ((drv-path drv) - (derivation %store "foo" %current-system + (derivation %store "foo" (%current-system) "/bin/sh" `(,builder) '(("HOME" . "/homeless") ("zzz" . "Z!") @@ -106,7 +102,7 @@ (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo -n hello > $out" '())) (hash (sha256 (string->utf8 "hello"))) - (drv-path (derivation %store "fixed" %current-system + (drv-path (derivation %store "fixed" (%current-system) "/bin/sh" `(,builder) '() `((,builder)) #:hash hash #:hash-algo 'sha256)) @@ -120,7 +116,7 @@ (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo one > $out ; echo two > $second" '())) - (drv-path (derivation %store "fixed" %current-system + (drv-path (derivation %store "fixed" (%current-system) "/bin/sh" `(,builder) '(("HOME" . "/homeless") ("zzz" . "Z!") @@ -146,7 +142,7 @@ "echo $PATH ; mkdir --version ; mkdir $out ; touch $out/good" '())) (drv-path - (derivation %store "foo" %current-system + (derivation %store "foo" (%current-system) "/bin/sh" `(,builder) `(("PATH" . ,(string-append @@ -168,7 +164,7 @@ (call-with-output-file (string-append %output "/test") (lambda (p) (display '(hello guix) p))))) - (drv-path (build-expression->derivation %store "goo" %current-system + (drv-path (build-expression->derivation %store "goo" (%current-system) builder '())) (succeeded? (build-derivations %store (list drv-path)))) (and succeeded? @@ -185,7 +181,7 @@ (lambda (p) (display '(world) p))))) (drv-path (build-expression->derivation %store "double" - %current-system + (%current-system) builder '() #:outputs '("out" "second"))) @@ -204,7 +200,7 @@ (dup2 (port->fdes p) 1) (execl (string-append cu "/bin/uname") "uname" "-a"))))) - (drv-path (build-expression->derivation %store "uname" %current-system + (drv-path (build-expression->derivation %store "uname" (%current-system) builder `(("cu" . ,%coreutils)))) (succeeded? (build-derivations %store (list drv-path)))) @@ -227,7 +223,7 @@ (lambda (p) (put-bytevector p bv)))))) (drv-path (build-expression->derivation - %store "hello-2.8.tar.gz" %current-system builder '() + %store "hello-2.8.tar.gz" (%current-system) builder '() #:hash (nix-base32-string->bytevector "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6") #:hash-algo 'sha256)) |