summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-05-02 23:55:24 +0200
committerLudovic Courtès <ludo@gnu.org>2015-05-02 23:57:11 +0200
commitdedb17ad010ee9ef67f3f4f3997dd17f226c8090 (patch)
treef83cc692eaf5e3ae952fa9626b1fcef1755a2d84 /guix/packages.scm
parentb9212a5455304661d1e969ced5df63aa9b6b761f (diff)
profiles: Store search paths in manifests.
Discussed in <http://bugs.gnu.org/20255>. * guix/packages.scm (sexp->search-path-specification): New variable. * guix/profiles.scm (<manifest-entry>)[search-paths]: New field. (package->manifest-entry): Initialize it. (manifest->gexp): Match it. Wrap #$deps in (propagated-inputs ...). Emit (search-paths ...). Increment version. (find-package): New procedure. (sexp->manifest)[infer-search-paths]: New procedure. Use it to initialize the 'search-paths' field for versions 0 and 1. Add case for version 2. * guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]: Remove. Use 'manifest-entry-search-paths' instead of 'manifest-entry->package' plus 'package-native-search-paths'. * tests/profiles.scm ("profile-manifest, search-paths"): New test.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index a979f31a32..b7a1979a7d 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -56,6 +56,7 @@
search-path-specification
search-path-specification?
search-path-specification->sexp
+ sexp->search-path-specification
package
package?
@@ -202,10 +203,24 @@ representation."
(define (search-path-specification->sexp spec)
"Return an sexp representing SPEC, a <search-path-specification>. The sexp
corresponds to the arguments expected by `set-path-environment-variable'."
+ ;; Note that this sexp format is used both by build systems and in
+ ;; (guix profiles), so think twice before you change it.
(match spec
(($ <search-path-specification> variable files separator type pattern)
`(,variable ,files ,separator ,type ,pattern))))
+(define (sexp->search-path-specification sexp)
+ "Convert SEXP, which is as returned by 'search-path-specification->sexp', to
+a <search-path-specification> object."
+ (match sexp
+ ((variable files separator type pattern)
+ (search-path-specification
+ (variable variable)
+ (files files)
+ (separator separator)
+ (file-type type)
+ (file-pattern pattern)))))
+
(define %supported-systems
;; This is the list of system types that are supported. By default, we
;; expect all packages to build successfully here.