From fb59e275dd84152cf04f89cd5192145ccf071853 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 7 Oct 2014 23:23:09 +0200 Subject: derivations: Add 'graft-derivation'. * guix/derivations.scm (graft-derivation): New procedure. * guix/build/graft.scm: New file. * Makefile.am (MODULES): Add it. * tests/derivations.scm ("graft-derivation"): New test. --- tests/derivations.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests') diff --git a/tests/derivations.scm b/tests/derivations.scm index 855b059d16..48d12990e6 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -813,6 +813,35 @@ Deriver: ~a~%" (stringderivation %store "graft" build + #:inputs `(("a" ,%bash) + ("b" ,%mkdir)))) + (one (add-text-to-store %store "bash" "fake bash")) + (two (build-expression->derivation %store "mkdir" + '(call-with-output-file %output + (lambda (port) + (display "fake mkdir" port))))) + (graft (graft-derivation %store "graft" orig + `(((,%bash) . (,one)) + ((,%mkdir) . (,two)))))) + (and (build-derivations %store (list graft)) + (let ((two (derivation->output-path two)) + (graft (derivation->output-path graft))) + (and (string=? (format #f "foo/~a/bar" two) + (call-with-input-file (string-append graft "/text") + get-string-all)) + (string=? (readlink (string-append graft "/sh")) one) + (string=? (readlink (string-append graft "/self")) graft)))))) + (test-equal "map-derivation" "hello" (let* ((joke (package-derivation %store guile-1.8)) -- cgit v1.2.3