From ce367ef3a9031e3211d616630ff01c8a6128db96 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 30 Jun 2015 17:42:35 +0200 Subject: environment: Add --system. * guix/scripts/environment.scm (show-help, %options): Add -s/--system. (%default-options): Add 'system' pair. (guix-environment): Pass 'system' value from OPTS to 'lower-inputs'. * doc/guix.texi (Invoking guix environment): Document it. --- guix/scripts/environment.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'guix/scripts/environment.scm') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index e2ac086f6d..7a7664a1ea 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -115,6 +115,8 @@ (define (show-help) --pure unset existing environment variables")) (display (_ " --search-paths display needed environment variable definitions")) + (display (_ " + -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) (newline) (show-build-options-help) (newline) @@ -128,6 +130,7 @@ (define (show-help) (define %default-options ;; Default to opening a new shell. `((exec . ,(or (getenv "SHELL") "/bin/sh")) + (system . ,(%current-system)) (substitutes? . #t) (max-silent-time . 3600) (verbosity . 0))) @@ -162,6 +165,10 @@ (define %options (option '(#\n "dry-run") #f #f (lambda (opt name arg result) (alist-cons 'dry-run? #t result))) + (option '(#\s "system") #t #f + (lambda (opt name arg result) + (alist-cons 'system arg + (alist-delete 'system result eq?)))) %standard-build-options)) (define (pick-all alist key) @@ -243,7 +250,7 @@ (define (handle-argument arg result) ((label item output) (list item output))) inputs) - #:system (%current-system)))) + #:system (assoc-ref opts 'system)))) (mbegin %store-monad ;; First build INPUTS. This is necessary even for ;; --search-paths. -- cgit v1.2.3