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
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 ~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 )
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 epatch "${FILESDIR}"/xemacs-21.4.19-db.patch
64 epatch "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
66 epatch "${FILESDIR}"/xemacs-21.4.24-ncurses-tinfo.patch
68 # Some binaries and man pages are installed under suffixed names
69 # to avoid collions with their GNU Emacs counterparts (see below).
70 # Fix internal filename references.
71 sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
72 sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
73 sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
75 # Run autoconf. XEmacs tries to be smart by providing a stub
76 # configure.ac file for autoconf 2.59 but this throws our
77 # autotools eclass so it must be removed first.
78 rm "${S}"/configure.ac || die
81 use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
87 # Can't build with pie. See bug #75028
88 test-flags -no-pie >/dev/null && append-flags -no-pie
93 myconf="${myconf} --with-widgets=athena"
94 myconf="${myconf} --with-dialogs=athena"
95 myconf="${myconf} --with-menubars=lucid"
96 myconf="${myconf} --with-scrollbars=lucid"
98 myconf="--with-widgets=motif"
99 myconf="${myconf} --with-dialogs=motif"
100 myconf="${myconf} --with-scrollbars=motif"
101 myconf="${myconf} --with-menubars=lucid"
104 myconf="--with-scrollbars=athena"
108 myconf="${myconf} --with-athena=3d"
110 myconf="${myconf} --with-athena=next"
112 myconf="${myconf} --with-athena=xaw"
115 use dnd && myconf="${myconf} --with-dragndrop --with-offix"
117 myconf="${myconf} $(use_with tiff ) $(use_with png )"
118 myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
128 myconf="${myconf} --with-mule"
132 myconf="${myconf} --with-xim=motif"
134 myconf="${myconf} --with-xim=xlib"
137 myconf="${myconf} --with-xim=no"
140 myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
143 # This determines the type of sounds we are playing
144 local soundconf="native"
146 # This determines how these sounds should be played
147 use nas && soundconf="${soundconf},nas"
149 myconf="${myconf} --with-sound=${soundconf}"
151 if use gdbm || use berkdb ; then
152 use gdbm && mydb="gdbm"
154 use berkdb && mydb="${mydb},berkdb"
156 myconf="${myconf} --with-database=${mydb}"
158 myconf="${myconf} --without-database"
161 # Enabling modules will cause segfaults outside the XEmacs build directory
162 use ia64 && myconf="${myconf} --without-modules"
164 # fixes #552044, deprecation warnings fools header detection in configure
165 myconf="${myconf} --cppflags=-Wno-cpp"
170 append-cflags -std=gnu89
172 # Don't use econf because it uses options which this configure
173 # script does not understand (like --host).
174 ./configure ${myconf} ${EXTRA_ECONF} \
177 $(use_with postgres postgresql ) \
179 $(use_with eolconv file-coding ) \
181 --compiler=$(tc-getCC) \
184 --with-system-malloc \
186 --mail-locking=flock \
187 --with-site-lisp=yes \
188 --with-site-modules=yes \
189 || die "The configure script failed to run properly"
193 emake prefix="${D}"/usr \
194 mandir="${D}"/usr/share/man/man1 \
195 infodir="${D}"/usr/share/info \
196 install gzip-el || die "emake install failed"
198 # Rename some applications installed in bin so that it is clear
199 # which application installed them and so that conflicting
200 # packages (emacs) can't clobber the actual applications.
201 # Addresses bug #62991.
202 for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
203 mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
207 for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
208 mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
211 # install base packages directories
212 dodir /usr/lib/xemacs/xemacs-packages/
213 dodir /usr/lib/xemacs/site-packages/
214 dodir /usr/lib/xemacs/site-modules/
215 dodir /usr/lib/xemacs/site-lisp/
219 dodir /usr/lib/xemacs/mule-packages
222 # remove extraneous info files
223 cd "${D}"/usr/share/info
224 rm -f dir info.info texinfo* termcap* standards*
227 dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
228 dodoc "${FILESDIR}"/README.Gentoo
230 newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
232 domenu "${FILESDIR}"/${PN}.desktop
236 eselect emacs update ifunset
237 eselect gnuclient update ifunset
238 xdg_desktop_database_update
242 eselect emacs update ifunset
243 eselect gnuclient update ifunset
244 xdg_desktop_database_update