summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-09-24 11:26:30 +0200
committerLudovic Courtès <ludo@gnu.org>2014-09-24 14:06:09 +0200
commit300868ba57e3786dae399f3cac4fff39ad6c316f (patch)
treef7fb1e6d2e2e7cf0aec10f233d1286cd3f855b57 /guix/scripts
parentc107b54108f6640504371d414f8a47191b92dbb8 (diff)
guix build: Add -L/--load-path as a common option.
* guix/scripts/build.scm (show-build-options-help): Document -L. (%standard-build-options): Add -L/--load-path. * tests/guix-package.sh: Test it.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/build.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 09401e923c..cde2a25613 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -33,7 +33,7 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-37)
- #:autoload (gnu packages) (specification->package)
+ #:autoload (gnu packages) (specification->package %package-module-path)
#:autoload (guix download) (download-to-store)
#:export (%standard-build-options
set-build-options-from-command-line
@@ -100,6 +100,8 @@ the new package's version number from URI."
options handled by 'set-build-options-from-command-line', and listed in
'%standard-build-options'."
(display (_ "
+ -L, --load-path=DIR prepend DIR to the package module search path"))
+ (display (_ "
-K, --keep-failed keep build tree of failed builds"))
(display (_ "
-n, --dry-run do not build the derivations"))
@@ -136,7 +138,15 @@ options handled by 'set-build-options-from-command-line', and listed in
(define %standard-build-options
;; List of standard command-line options for tools that build something.
- (list (option '(#\K "keep-failed") #f #f
+ (list (option '(#\L "load-path") #t #f
+ (lambda (opt name arg result . rest)
+ ;; XXX: Imperatively modify the search paths.
+ (%package-module-path (cons arg (%package-module-path)))
+ (set! %load-path (cons arg %load-path))
+ (set! %load-compiled-path (cons arg %load-compiled-path))
+
+ (apply values (cons result rest))))
+ (option '(#\K "keep-failed") #f #f
(lambda (opt name arg result . rest)
(apply values
(alist-cons 'keep-failed? #t result)