Skip to content
Snippets Groups Projects
Commit ce367ef3 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

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.
parent 6b6298ae
No related branches found
No related tags found
No related merge requests found
...@@ -4219,6 +4219,10 @@ only contain package inputs. ...@@ -4219,6 +4219,10 @@ only contain package inputs.
@item --search-paths @item --search-paths
Display the environment variable definitions that make up the Display the environment variable definitions that make up the
environment. environment.
@item --system=@var{system}
@itemx -s @var{system}
Attempt to build for @var{system}---e.g., @code{i686-linux}.
@end table @end table
It also supports all of the common build options that @command{guix It also supports all of the common build options that @command{guix
......
...@@ -115,6 +115,8 @@ (define (show-help) ...@@ -115,6 +115,8 @@ (define (show-help)
--pure unset existing environment variables")) --pure unset existing environment variables"))
(display (_ " (display (_ "
--search-paths display needed environment variable definitions")) --search-paths display needed environment variable definitions"))
(display (_ "
-s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\""))
(newline) (newline)
(show-build-options-help) (show-build-options-help)
(newline) (newline)
...@@ -128,6 +130,7 @@ (define (show-help) ...@@ -128,6 +130,7 @@ (define (show-help)
(define %default-options (define %default-options
;; Default to opening a new shell. ;; Default to opening a new shell.
`((exec . ,(or (getenv "SHELL") "/bin/sh")) `((exec . ,(or (getenv "SHELL") "/bin/sh"))
(system . ,(%current-system))
(substitutes? . #t) (substitutes? . #t)
(max-silent-time . 3600) (max-silent-time . 3600)
(verbosity . 0))) (verbosity . 0)))
...@@ -162,6 +165,10 @@ (define %options ...@@ -162,6 +165,10 @@ (define %options
(option '(#\n "dry-run") #f #f (option '(#\n "dry-run") #f #f
(lambda (opt name arg result) (lambda (opt name arg result)
(alist-cons 'dry-run? #t 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)) %standard-build-options))
(define (pick-all alist key) (define (pick-all alist key)
...@@ -243,7 +250,7 @@ (define (handle-argument arg result) ...@@ -243,7 +250,7 @@ (define (handle-argument arg result)
((label item output) ((label item output)
(list item output))) (list item output)))
inputs) inputs)
#:system (%current-system)))) #:system (assoc-ref opts 'system))))
(mbegin %store-monad (mbegin %store-monad
;; First build INPUTS. This is necessary even for ;; First build INPUTS. This is necessary even for
;; --search-paths. ;; --search-paths.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment