guix.in 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!@abs_top_builddir@/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. ;; IMPORTANT: We must avoid loading any modules from Guix here,
  23. ;; because we need to adjust the guile load paths first.
  24. ;; It's okay to import modules from core Guile though.
  25. (define-syntax-rule (push! elt v) (set! v (cons elt v)))
  26. (define (augment-load-paths!)
  27. ;; Add installed modules to load-path.
  28. (push! "@guilemoduledir@" %load-path)
  29. (push! "@guileobjectdir@" %load-compiled-path))
  30. (define* (main #:optional (args (command-line)))
  31. (unless (getenv "GUIX_UNINSTALLED")
  32. (augment-load-paths!))
  33. (let ((guix-main (module-ref (resolve-interface '(guix ui))
  34. 'guix-main)))
  35. (bindtextdomain "guix" "@localedir@")
  36. (bindtextdomain "guix-packages" "@localedir@")
  37. ;; XXX: It would be more convenient to change it to:
  38. ;; (exit (apply guix-main (command-line)))
  39. ;; but since the 'guix' command is not updated by 'guix pull', we cannot
  40. ;; really do it now.
  41. (apply guix-main args)))
  42. ;;; Local Variables:
  43. ;;; mode: scheme
  44. ;;; End: