Commit | Line | Data |
---|---|---|
6f774d48 ML |
1 | #!@GUILE@ \ |
2 | --no-auto-compile -e main -s | |
e49951eb MW |
3 | !# |
4 | ;;; GNU Guix --- Functional package management for GNU | |
5 | ;;; Copyright © 2013 Mark H Weaver <mhw@netris.org> | |
cba386c1 | 6 | ;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org> |
e49951eb MW |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
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. | |
14 | ;;; | |
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. | |
19 | ;;; | |
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/>. | |
22 | ||
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. | |
e49951eb | 26 | |
6f774d48 | 27 | (define-syntax-rule (push! elt v) (set! v (cons elt v))) |
e49951eb | 28 | |
6f774d48 ML |
29 | (define (augment-load-paths!) |
30 | ;; Add installed modules to load-path. | |
31 | (push! "@guilemoduledir@" %load-path) | |
75e24d7b | 32 | (push! "@guileobjectdir@" %load-compiled-path)) |
e49951eb | 33 | |
6f774d48 ML |
34 | (define* (main #:optional (args (command-line))) |
35 | (unless (getenv "GUIX_UNINSTALLED") | |
36 | (augment-load-paths!)) | |
7cffaeb6 | 37 | |
6f774d48 ML |
38 | (let ((guix-main (module-ref (resolve-interface '(guix ui)) |
39 | 'guix-main))) | |
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 | |
45 | ;; really do it now. | |
46 | (apply guix-main args))) | |
63666a34 ML |
47 | |
48 | ;;; Local Variables: | |
49 | ;;; mode: scheme | |
50 | ;;; End: |