emacs-daemon-0.22.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit elisp
  5. DESCRIPTION="Gentoo support for Emacs running as a server in the background"
  6. HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Emacs"
  7. SRC_URI="https://dev.gentoo.org/~ulm/emacs/${P}.tar.xz"
  8. LICENSE="GPL-2+"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
  11. DEPEND=">=virtual/emacs-23"
  12. RDEPEND="${DEPEND}"
  13. SITEFILE="10${PN}-gentoo.el"
  14. pkg_setup() {
  15. local has_daemon has_gtk line
  16. has_daemon=$(${EMACS} ${EMACSFLAGS} --eval "(princ (fboundp 'daemonp))")
  17. has_gtk=$(${EMACS} ${EMACSFLAGS} --eval "(princ (featurep 'gtk))")
  18. if [[ ${has_daemon} != t ]]; then
  19. while read line; do ewarn "${line}"; done <<-EOF
  20. Your current Emacs version does not support running as a daemon which
  21. is required for ${CATEGORY}/${PN}.
  22. Use "eselect emacs" to select an Emacs version >= 23.
  23. EOF
  24. elif [[ ${has_gtk} == t ]]; then
  25. while read line; do ewarn "${line}"; done <<-EOF
  26. Your current Emacs is compiled with GTK+. There is a long-standing bug
  27. in GTK+ that prevents Emacs from recovering from X disconnects:
  28. <https://bugzilla.gnome.org/show_bug.cgi?id=85715>
  29. If you run Emacs as a daemon, then it is strongly recommended that you
  30. compile it with the Lucid or the Motif toolkit instead, i.e. with
  31. USE="athena Xaw3d -gtk -motif" or USE="motif -gtk -athena -Xaw3d".
  32. EOF
  33. fi
  34. }
  35. src_compile() { :; }
  36. src_install() {
  37. newinitd emacs.rc emacs
  38. newconfd emacs.conf emacs
  39. exeinto /usr/libexec/emacs
  40. doexe emacs-wrapper.sh emacs-stop.sh
  41. elisp-site-file-install "${SITEFILE}"
  42. dodoc README ChangeLog
  43. }