1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # Note: xemacs currently does not work with position independent code
5 # so the build forces the use of the -no-pie option
10 inherit autotools eutils flag-o-matic toolchain-funcs xdg-utils desktop
12 DESCRIPTION="highly customizable open source text editor and application development system"
13 HOMEPAGE="http://www.xemacs.org/"
14 SRC_URI="http://ftp.xemacs.org/xemacs-21.4/${P}.tar.gz
15 http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
19 KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
20 IUSE="eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xim athena neXt Xaw3d gdbm berkdb"
22 X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
25 berkdb? ( sys-libs/db:= )
26 gdbm? ( >=sys-libs/gdbm-1.8.3[berkdb] )
28 >=dev-libs/openssl-0.9.6:0
29 >=media-libs/audiofile-0.2.3
30 gpm? ( >=sys-libs/gpm-1.19.6 )
31 postgres? ( dev-db/postgresql:= )
32 ldap? ( net-nds/openldap )
33 nas? ( media-libs/nas )
34 X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
36 motif? ( >=x11-libs/motif-2.3:0 )
37 athena? ( x11-libs/libXaw )
38 Xaw3d? ( x11-libs/libXaw3d )
39 neXt? ( x11-libs/neXtaw )
40 xface? ( media-libs/compface )
41 tiff? ( media-libs/tiff:0 )
42 png? ( >=media-libs/libpng-1.2:0 )
43 jpeg? ( virtual/jpeg:0 )
44 canna? ( app-i18n/canna )
45 !amd64? ( freewnn? ( app-i18n/freewnn ) )
46 >=sys-libs/ncurses-5.2:=
47 >=app-eselect/eselect-emacs-1.15"
52 PDEPEND="app-xemacs/xemacs-base
53 mule? ( app-xemacs/mule-base )"
57 use neXt && unpack NeXT_XEmacs.tar.gz
61 # see bug 58350, 102540 and 143580
62 eapply "${FILESDIR}"/xemacs-21.4.19-db.patch
64 eapply "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
65 eapply "${FILESDIR}"/xemacs-21.4.24-glibc-macro.patch
67 eapply "${FILESDIR}"/xemacs-21.4.24-ncurses-tinfo.patch
70 iconv -f iso-8859-1 -t utf-8 -o man/xemacs-faq.texi.tmp man/xemacs-faq.texi \
71 && mv -f man/xemacs-faq.texi.tmp man/xemacs-faq.texi || die
72 iconv -f iso-8859-1 -t utf-8 -o man/lispref/ldap.texi.tmp man/lispref/ldap.texi \
73 && mv -f man/lispref/ldap.texi.tmp man/lispref/ldap.texi || die
77 # Some binaries and man pages are installed under suffixed names
78 # to avoid collions with their GNU Emacs counterparts (see below).
79 # Fix internal filename references.
80 sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
81 sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
82 sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
84 # Run autoconf. XEmacs tries to be smart by providing a stub
85 # configure.ac file for autoconf 2.59 but this throws our
86 # autotools eclass so it must be removed first.
87 rm "${S}"/configure.ac || die
90 use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
96 # Can't build with pie. See bug #75028
97 test-flags -no-pie >/dev/null && append-flags -no-pie
102 myconf="${myconf} --with-widgets=athena"
103 myconf="${myconf} --with-dialogs=athena"
104 myconf="${myconf} --with-menubars=lucid"
105 myconf="${myconf} --with-scrollbars=lucid"
107 myconf="--with-widgets=motif"
108 myconf="${myconf} --with-dialogs=motif"
109 myconf="${myconf} --with-scrollbars=motif"
110 myconf="${myconf} --with-menubars=lucid"
113 myconf="--with-scrollbars=athena"
117 myconf="${myconf} --with-athena=3d"
119 myconf="${myconf} --with-athena=next"
121 myconf="${myconf} --with-athena=xaw"
124 use dnd && myconf="${myconf} --with-dragndrop --with-offix"
126 myconf="${myconf} $(use_with tiff ) $(use_with png )"
127 myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
137 myconf="${myconf} --with-mule"
141 myconf="${myconf} --with-xim=motif"
143 myconf="${myconf} --with-xim=xlib"
146 myconf="${myconf} --with-xim=no"
149 myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
152 # This determines the type of sounds we are playing
153 local soundconf="native"
155 # This determines how these sounds should be played
156 use nas && soundconf="${soundconf},nas"
158 myconf="${myconf} --with-sound=${soundconf}"
160 if use gdbm || use berkdb ; then
161 use gdbm && mydb="gdbm"
163 use berkdb && mydb="${mydb},berkdb"
165 myconf="${myconf} --with-database=${mydb}"
167 myconf="${myconf} --without-database"
170 # Enabling modules will cause segfaults outside the XEmacs build directory
171 use ia64 && myconf="${myconf} --without-modules"
176 append-cflags -fgnu89-inline
178 # Don't use econf because it uses options which this configure
179 # script does not understand (like --host).
180 ./configure ${myconf} ${EXTRA_ECONF} \
183 $(use_with postgres postgresql ) \
185 $(use_with eolconv file-coding ) \
187 --compiler=$(tc-getCC) \
190 --with-system-malloc \
192 --mail-locking=flock \
193 --with-site-lisp=yes \
194 --with-site-modules=yes \
195 || die "The configure script failed to run properly"
199 emake prefix="${D}"/usr \
200 mandir="${D}"/usr/share/man/man1 \
201 infodir="${D}"/usr/share/info \
202 install gzip-el || die "emake install failed"
204 # Rename some applications installed in bin so that it is clear
205 # which application installed them and so that conflicting
206 # packages (emacs) can't clobber the actual applications.
207 # Addresses bug #62991.
208 for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
209 mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
213 for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
214 mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
217 # install base packages directories
218 dodir /usr/lib/xemacs/xemacs-packages/
219 dodir /usr/lib/xemacs/site-packages/
220 dodir /usr/lib/xemacs/site-modules/
221 dodir /usr/lib/xemacs/site-lisp/
225 dodir /usr/lib/xemacs/mule-packages
228 # remove extraneous info files
229 cd "${D}"/usr/share/info
230 rm -f dir info.info texinfo* termcap* standards*
233 dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
234 dodoc "${FILESDIR}"/README.Gentoo
236 newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
238 domenu "${FILESDIR}"/${PN}.desktop
242 eselect emacs update ifunset
243 eselect gnuclient update ifunset
244 xdg_desktop_database_update
248 eselect emacs update ifunset
249 eselect gnuclient update ifunset
250 xdg_desktop_database_update