2 --no-auto-compile -e main -s
4 ;;; GNU Guix --- Functional package management for GNU
5 ;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 ;; IMPORTANT: We must avoid loading any modules from Guix here,
24 ;; because we need to adjust the guile load paths first.
25 ;; It's okay to import modules from core Guile though.
27 (define-syntax-rule (push! elt v) (set! v (cons elt v)))
29 (define (augment-load-paths!)
30 ;; Add installed modules to load-path.
31 (push! "@guilemoduledir@" %load-path)
32 (push! "@guileobjectdir@" %load-compiled-path))
34 (define* (main #:optional (args (command-line)))
35 (unless (getenv "GUIX_UNINSTALLED")
36 (augment-load-paths!))
38 (let ((guix-main (module-ref (resolve-interface '(guix ui))
40 (bindtextdomain "guix" "@localedir@")
41 (bindtextdomain "guix-packages" "@localedir@")
42 ;; XXX: It would be more convenient to change it to:
43 ;; (exit (apply guix-main (command-line)))
44 ;; but since the 'guix' command is not updated by 'guix pull', we cannot
46 (apply guix-main args)))