diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-09-24 14:05:52 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-09-24 14:06:09 +0200 |
commit | 8689901f95499e98e0209e75b4f268bf2af325c1 (patch) | |
tree | 46345436a0991f5b15b5aee253f66743c0f3ffa5 /gnu | |
parent | 300868ba57e3786dae399f3cac4fff39ad6c316f (diff) | |
download | guix-8689901f95499e98e0209e75b4f268bf2af325c1.tar guix-8689901f95499e98e0209e75b4f268bf2af325c1.tar.gz |
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.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages.scm | 13 |
1 files changed, 12 insertions, 1 deletions
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." |