xemacs-21.4.24-r1.ebuild 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. # Copyright 1999-2017 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. epatch "${FILESDIR}"/xemacs-21.4.24-glibc-macro.patch
  56. # Some binaries and man pages are installed under suffixed names
  57. # to avoid collions with their GNU Emacs counterparts (see below).
  58. # Fix internal filename references.
  59. sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
  60. sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
  61. sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
  62. # Run autoconf. XEmacs tries to be smart by providing a stub
  63. # configure.ac file for autoconf 2.59 but this throws our
  64. # autotools eclass so it must be removed first.
  65. rm "${S}"/configure.ac || die
  66. eautoconf
  67. use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
  68. }
  69. src_configure() {
  70. local myconf=""
  71. if use X; then
  72. myconf="${myconf} --with-widgets=athena"
  73. myconf="${myconf} --with-dialogs=athena"
  74. myconf="${myconf} --with-menubars=lucid"
  75. myconf="${myconf} --with-scrollbars=lucid"
  76. if use motif ; then
  77. myconf="--with-widgets=motif"
  78. myconf="${myconf} --with-dialogs=motif"
  79. myconf="${myconf} --with-scrollbars=motif"
  80. myconf="${myconf} --with-menubars=lucid"
  81. fi
  82. if use athena ; then
  83. myconf="--with-scrollbars=athena"
  84. fi
  85. if use Xaw3d; then
  86. myconf="${myconf} --with-athena=3d"
  87. elif use neXt; then
  88. myconf="${myconf} --with-athena=next"
  89. else
  90. myconf="${myconf} --with-athena=xaw"
  91. fi
  92. use dnd && myconf="${myconf} --with-dragndrop --with-offix"
  93. myconf="${myconf} $(use_with tiff ) $(use_with png )"
  94. myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
  95. else
  96. myconf="${myconf}
  97. --without-x
  98. --without-xpm
  99. --without-dragndrop
  100. --with-gif=no"
  101. fi
  102. if use mule ; then
  103. myconf="${myconf} --with-mule"
  104. if use xim ; then
  105. if use motif ; then
  106. myconf="${myconf} --with-xim=motif"
  107. else
  108. myconf="${myconf} --with-xim=xlib"
  109. fi
  110. else
  111. myconf="${myconf} --with-xim=no"
  112. fi
  113. myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
  114. fi
  115. # This determines the type of sounds we are playing
  116. local soundconf="native"
  117. # This determines how these sounds should be played
  118. use nas && soundconf="${soundconf},nas"
  119. myconf="${myconf} --with-sound=${soundconf}"
  120. if use gdbm || use berkdb ; then
  121. use gdbm && mydb="gdbm"
  122. use berkdb && mydb="${mydb},berkdb"
  123. myconf="${myconf} --with-database=${mydb}"
  124. else
  125. myconf="${myconf} --without-database"
  126. fi
  127. # fixes #21264, this should be fixed in 21.4.21 and has been fixed
  128. # in 21.5 for sure. Now that 21.4.21 is out there is no real
  129. # evidence that this indeed got fixed, so keep these exceptions
  130. # for now.
  131. use alpha && myconf="${myconf} --with-system-malloc"
  132. use ppc64 && myconf="${myconf} --with-system-malloc"
  133. use ia64 && myconf="${myconf} --with-system-malloc"
  134. # Enabling modules will cause segfaults outside the XEmacs build directory
  135. use ia64 && myconf="${myconf} --without-modules"
  136. einfo "${myconf}"
  137. # see bug 576512
  138. append-cflags -fgnu89-inline
  139. # Don't use econf because it uses options which this configure
  140. # script does not understand (like --host).
  141. ./configure ${myconf} ${EXTRA_ECONF} \
  142. $(use_with gif ) \
  143. $(use_with gpm ) \
  144. $(use_with postgres postgresql ) \
  145. $(use_with ldap ) \
  146. $(use_with eolconv file-coding ) \
  147. $(use_with pop ) \
  148. --compiler=$(tc-getCC) \
  149. --prefix=/usr \
  150. --with-ncurses \
  151. --with-msw=no \
  152. --mail-locking=flock \
  153. --with-site-lisp=yes \
  154. --with-site-modules=yes \
  155. || die "The configure script failed to run properly"
  156. }
  157. src_install() {
  158. emake prefix="${D}"/usr \
  159. mandir="${D}"/usr/share/man/man1 \
  160. infodir="${D}"/usr/share/info \
  161. install gzip-el || die "emake install failed"
  162. # Rename some applications installed in bin so that it is clear
  163. # which application installed them and so that conflicting
  164. # packages (emacs) can't clobber the actual applications.
  165. # Addresses bug #62991.
  166. for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
  167. mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
  168. done
  169. # rename man pages
  170. for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
  171. mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
  172. done
  173. # install base packages directories
  174. dodir /usr/lib/xemacs/xemacs-packages/
  175. dodir /usr/lib/xemacs/site-packages/
  176. dodir /usr/lib/xemacs/site-modules/
  177. dodir /usr/lib/xemacs/site-lisp/
  178. if use mule;
  179. then
  180. dodir /usr/lib/xemacs/mule-packages
  181. fi
  182. # remove extraneous info files
  183. cd "${D}"/usr/share/info
  184. rm -f dir info.info texinfo* termcap* standards*
  185. cd "${S}"
  186. dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
  187. dodoc "${FILESDIR}"/README.Gentoo
  188. newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
  189. domenu "${FILESDIR}"/${PN}.desktop
  190. }
  191. pkg_postinst() {
  192. eselect emacs update ifunset
  193. eselect gnuclient update ifunset
  194. }
  195. pkg_postrm() {
  196. eselect emacs update ifunset
  197. eselect gnuclient update ifunset
  198. }