From 462f5ccade9fd1372e2a7d1e854cd6324ebb4105 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 26 Jul 2014 22:54:40 +0200 Subject: profiles: Add 'package->manifest-entry'. Suggested by Alex Kost . * guix/scripts/package.scm (options->installable)[package->manifest-entry]: Move to (guix profiles). [package->manifest-entry*]: New procedure. Use it. * guix/profiles.scm (package->manifest-entry): New procedure. * tests/profiles.scm (guile-for-build): New variable. Call '%guile-for-build'. ("profile-derivation"): New test. --- tests/profiles.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests/profiles.scm') diff --git a/tests/profiles.scm b/tests/profiles.scm index e6fcaad7cf..d405f6453e 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -18,11 +18,25 @@ (define-module (test-profiles) #:use-module (guix profiles) + #:use-module (guix store) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix derivations) + #:use-module (gnu packages bootstrap) #:use-module (ice-9 match) #:use-module (srfi srfi-64)) ;; Test the (guix profile) module. +(define %store + (open-connection)) + +(define guile-for-build + (package-derivation %store %bootstrap-guile)) + +;; Make it the default. +(%guile-for-build guile-for-build) + ;; Example manifest entries. @@ -87,6 +101,19 @@ (null? (manifest-entries m3)) (null? (manifest-entries m4))))))) +(test-assert "profile-derivation" + (run-with-store %store + (mlet* %store-monad + ((entry -> (package->manifest-entry %bootstrap-guile)) + (guile (package->derivation %bootstrap-guile)) + (drv (profile-derivation (manifest (list entry)))) + (profile -> (derivation->output-path drv)) + (bindir -> (string-append profile "/bin")) + (_ (built-derivations (list drv)))) + (return (and (file-exists? (string-append bindir "/guile")) + (string=? (dirname (readlink bindir)) + (derivation->output-path guile))))))) + (test-end "profiles") -- cgit 1.4.1