pre-inst-env.el.in 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ;;; pre-inst-env.el --- Pre-installation environment for Guile-Daemon
  2. ;; Copyright (C) 2016 Alex Kost <alezost@gmail.com>
  3. ;; This file is part of Guile-Daemon.
  4. ;; Guile-Daemon is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;;
  9. ;; Guile-Daemon is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with Guile-Daemon. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This file can be used to set up environment variables for
  18. ;; Guile-Daemon inside Emacs. This allows you to run "guile-daemon" in
  19. ;; "M-x shell", or to use (daemon ...) modules in Geiser. See the
  20. ;; manual for details.
  21. ;;; Code:
  22. (let ((src-modules (expand-file-name "modules" "@abs_top_srcdir@"))
  23. (build-modules (expand-file-name "modules" "@abs_top_builddir@"))
  24. (guile-path (getenv "GUILE_LOAD_PATH"))
  25. (guile-cpath (getenv "GUILE_LOAD_COMPILED_PATH")))
  26. (setenv "GUILE_DAEMON_UNINSTALLED" "1")
  27. (setenv "PATH"
  28. (concat (expand-file-name "scripts" "@abs_top_builddir@")
  29. ":" (getenv "PATH")))
  30. (setenv "GUILE_LOAD_PATH"
  31. (let ((base (if guile-path
  32. (concat build-modules ":" guile-path)
  33. build-modules)))
  34. (if (string= src-modules build-modules)
  35. base
  36. (concat src-modules ":" base))))
  37. (setenv "GUILE_LOAD_COMPILED_PATH"
  38. (if guile-cpath
  39. (concat build-modules ":" guile-cpath)
  40. build-modules)))
  41. ;;; pre-inst-env.el ends here