From 8689901f95499e98e0209e75b4f268bf2af325c1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 24 Sep 2014 14:05:52 +0200 Subject: Introduce the 'GUIX_PACKAGE_PATH' environment variable. * gnu/packages.scm (%package-module-path): Honor $GUIX_PACKAGE_PATH. * test-env.in: Unset 'GUIX_PACKAGE_PATH'. * tests/guix-package.sh: Test it. * doc/guix.texi (Package Modules): Document it. --- gnu/packages.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages.scm b/gnu/packages.scm index ddabacd199..6d128280cc 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -91,7 +91,18 @@ ;; Search path for package modules. Each item must be either a directory ;; name or a pair whose car is a directory and whose cdr is a sub-directory ;; to narrow the search. - (list (cons %distro-root-directory "gnu/packages"))) + (let* ((not-colon (char-set-complement (char-set #\:))) + (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") + not-colon))) + ;; Automatically add items from $GUIX_PACKAGE_PATH to Guile's search path. + (for-each (lambda (directory) + (set! %load-path (cons directory %load-path)) + (set! %load-compiled-path + (cons directory %load-compiled-path))) + environment) + + (make-parameter + (append environment `((,%distro-root-directory . "gnu/packages")))))) (define* (scheme-files directory) "Return the list of Scheme files found under DIRECTORY." -- cgit v1.2.3