gnu: emacs-org: Update to 9.4.
[jackhill/guix/guix.git] / scripts / guix.in
... / ...
CommitLineData
1#!@GUILE@ \
2--no-auto-compile -e main -s
3!#
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>
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.
26
27(define-syntax-rule (push! elt v) (set! v (cons elt v)))
28
29(define (augment-load-paths!)
30 ;; Add installed modules to load-path.
31 (push! "@guilemoduledir@" %load-path)
32 (push! "@guileobjectdir@" %load-compiled-path))
33
34(define* (main #:optional (args (command-line)))
35 (unless (getenv "GUIX_UNINSTALLED")
36 (augment-load-paths!))
37
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)))
47
48;;; Local Variables:
49;;; mode: scheme
50;;; End: