xemacs-21.4.24.ebuild 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # Note: xemacs currently does not work with a hardened profile. If you
  4. # want to use xemacs on a hardened profile then compile with the
  5. # -nopie flag in CFLAGS or help fix bug #75028.
  6. EAPI="5"
  7. WANT_AUTOCONF="2.1"
  8. inherit autotools eutils flag-o-matic toolchain-funcs
  9. DESCRIPTION="highly customizable open source text editor and application development system"
  10. HOMEPAGE="http://www.xemacs.org/"
  11. SRC_URI="http://ftp.xemacs.org/xemacs-21.4/${P}.tar.gz
  12. http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
  13. LICENSE="GPL-2+"
  14. SLOT="0"
  15. KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86"
  16. IUSE="eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xim athena neXt Xaw3d gdbm berkdb"
  17. X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
  18. RDEPEND="
  19. berkdb? ( sys-libs/db:= )
  20. gdbm? ( >=sys-libs/gdbm-1.8.3 )
  21. >=sys-libs/zlib-1.1.4
  22. >=dev-libs/openssl-0.9.6:0
  23. >=media-libs/audiofile-0.2.3
  24. gpm? ( >=sys-libs/gpm-1.19.6 )
  25. postgres? ( dev-db/postgresql:= )
  26. ldap? ( net-nds/openldap )
  27. nas? ( media-libs/nas )
  28. X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
  29. dnd? ( x11-libs/dnd )
  30. motif? ( >=x11-libs/motif-2.3:0 )
  31. athena? ( x11-libs/libXaw )
  32. Xaw3d? ( x11-libs/libXaw3d )
  33. neXt? ( x11-libs/neXtaw )
  34. xface? ( media-libs/compface )
  35. tiff? ( media-libs/tiff:0 )
  36. png? ( >=media-libs/libpng-1.2:0 )
  37. jpeg? ( virtual/jpeg:0 )
  38. canna? ( app-i18n/canna )
  39. !amd64? ( freewnn? ( app-i18n/freewnn ) )
  40. >=sys-libs/ncurses-5.2:=
  41. >=app-eselect/eselect-emacs-1.15"
  42. DEPEND="${RDEPEND}
  43. >=sys-apps/texinfo-5"
  44. PDEPEND="app-xemacs/xemacs-base
  45. mule? ( app-xemacs/mule-base )"
  46. src_unpack() {
  47. unpack ${P}.tar.gz
  48. use neXt && unpack NeXT_XEmacs.tar.gz
  49. }
  50. src_prepare() {
  51. # see bug 58350, 102540 and 143580
  52. epatch "${FILESDIR}"/xemacs-21.4.19-db.patch
  53. # see bug 576512
  54. epatch "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
  55. # Some binaries and man pages are installed under suffixed names
  56. # to avoid collions with their GNU Emacs counterparts (see below).
  57. # Fix internal filename references.
  58. sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
  59. sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
  60. sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
  61. # Run autoconf. XEmacs tries to be smart by providing a stub
  62. # configure.ac file for autoconf 2.59 but this throws our
  63. # autotools eclass so it must be removed first.
  64. rm "${S}"/configure.ac || die
  65. eautoconf
  66. use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
  67. }
  68. src_configure() {
  69. local myconf=""
  70. if use X; then
  71. myconf="${myconf} --with-widgets=athena"
  72. myconf="${myconf} --with-dialogs=athena"
  73. myconf="${myconf} --with-menubars=lucid"
  74. myconf="${myconf} --with-scrollbars=lucid"
  75. if use motif ; then
  76. myconf="--with-widgets=motif"
  77. myconf="${myconf} --with-dialogs=motif"
  78. myconf="${myconf} --with-scrollbars=motif"
  79. myconf="${myconf} --with-menubars=lucid"
  80. fi
  81. if use athena ; then
  82. myconf="--with-scrollbars=athena"
  83. fi
  84. if use Xaw3d; then
  85. myconf="${myconf} --with-athena=3d"
  86. elif use neXt; then
  87. myconf="${myconf} --with-athena=next"
  88. else
  89. myconf="${myconf} --with-athena=xaw"
  90. fi
  91. use dnd && myconf="${myconf} --with-dragndrop --with-offix"
  92. myconf="${myconf} $(use_with tiff ) $(use_with png )"
  93. myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
  94. else
  95. myconf="${myconf}
  96. --without-x
  97. --without-xpm
  98. --without-dragndrop
  99. --with-gif=no"
  100. fi
  101. if use mule ; then
  102. myconf="${myconf} --with-mule"
  103. if use xim ; then
  104. if use motif ; then
  105. myconf="${myconf} --with-xim=motif"
  106. else
  107. myconf="${myconf} --with-xim=xlib"
  108. fi
  109. else
  110. myconf="${myconf} --with-xim=no"
  111. fi
  112. myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
  113. fi
  114. # This determines the type of sounds we are playing
  115. local soundconf="native"
  116. # This determines how these sounds should be played
  117. use nas && soundconf="${soundconf},nas"
  118. myconf="${myconf} --with-sound=${soundconf}"
  119. if use gdbm || use berkdb ; then
  120. use gdbm && mydb="gdbm"
  121. use berkdb && mydb="${mydb},berkdb"
  122. myconf="${myconf} --with-database=${mydb}"
  123. else
  124. myconf="${myconf} --without-database"
  125. fi
  126. # fixes #21264, this should be fixed in 21.4.21 and has been fixed
  127. # in 21.5 for sure. Now that 21.4.21 is out there is no real
  128. # evidence that this indeed got fixed, so keep these exceptions
  129. # for now.
  130. use alpha && myconf="${myconf} --with-system-malloc"
  131. use ppc64 && myconf="${myconf} --with-system-malloc"
  132. use ia64 && myconf="${myconf} --with-system-malloc"
  133. # Enabling modules will cause segfaults outside the XEmacs build directory
  134. use ia64 && myconf="${myconf} --without-modules"
  135. # fixes #552044, deprecation warnings fools header detection in configure
  136. myconf="${myconf} --cppflags=-Wno-cpp"
  137. einfo "${myconf}"
  138. # see bug 576512
  139. append-cflags -std=gnu89
  140. # Don't use econf because it uses options which this configure
  141. # script does not understand (like --host).
  142. ./configure ${myconf} ${EXTRA_ECONF} \
  143. $(use_with gif ) \
  144. $(use_with gpm ) \
  145. $(use_with postgres postgresql ) \
  146. $(use_with ldap ) \
  147. $(use_with eolconv file-coding ) \
  148. $(use_with pop ) \
  149. --compiler=$(tc-getCC) \
  150. --prefix=/usr \
  151. --with-ncurses \
  152. --with-msw=no \
  153. --mail-locking=flock \
  154. --with-site-lisp=yes \
  155. --with-site-modules=yes \
  156. || die "The configure script failed to run properly"
  157. }
  158. src_install() {
  159. emake prefix="${D}"/usr \
  160. mandir="${D}"/usr/share/man/man1 \
  161. infodir="${D}"/usr/share/info \
  162. install gzip-el || die "emake install failed"
  163. # Rename some applications installed in bin so that it is clear
  164. # which application installed them and so that conflicting
  165. # packages (emacs) can't clobber the actual applications.
  166. # Addresses bug #62991.
  167. for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
  168. mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
  169. done
  170. # rename man pages
  171. for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
  172. mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
  173. done
  174. # install base packages directories
  175. dodir /usr/lib/xemacs/xemacs-packages/
  176. dodir /usr/lib/xemacs/site-packages/
  177. dodir /usr/lib/xemacs/site-modules/
  178. dodir /usr/lib/xemacs/site-lisp/
  179. if use mule;
  180. then
  181. dodir /usr/lib/xemacs/mule-packages
  182. fi
  183. # remove extraneous info files
  184. cd "${D}"/usr/share/info
  185. rm -f dir info.info texinfo* termcap* standards*
  186. cd "${S}"
  187. dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
  188. dodoc "${FILESDIR}"/README.Gentoo
  189. newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
  190. domenu "${FILESDIR}"/${PN}.desktop
  191. }
  192. pkg_postinst() {
  193. eselect emacs update ifunset
  194. eselect gnuclient update ifunset
  195. }
  196. pkg_postrm() {
  197. eselect emacs update ifunset
  198. eselect gnuclient update ifunset
  199. }