dev-python/csv23: keyworded 0.3.2 for ia64, bug #719700
[gentoo.git] / app-editors / xemacs / xemacs-21.4.24.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 # Note: xemacs currently does not work with position independent code
5 # so the build forces the use of the -no-pie option
6
7 EAPI="5"
8
9 WANT_AUTOCONF="2.1"
10 inherit autotools eutils flag-o-matic toolchain-funcs xdg-utils
11
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"
16
17 LICENSE="GPL-2+"
18 SLOT="0"
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"
21
22 X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
23
24 RDEPEND="
25         berkdb? ( sys-libs/db:= )
26         gdbm? ( >=sys-libs/gdbm-1.8.3 )
27         >=sys-libs/zlib-1.1.4
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 ) ) )
35         dnd? ( x11-libs/dnd )
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"
48
49 DEPEND="${RDEPEND}
50         >=sys-apps/texinfo-5"
51
52 PDEPEND="app-xemacs/xemacs-base
53         mule? ( app-xemacs/mule-base )"
54
55 src_unpack() {
56         unpack ${P}.tar.gz
57         use neXt && unpack NeXT_XEmacs.tar.gz
58 }
59
60 src_prepare() {
61         # see bug 58350, 102540 and 143580
62         epatch "${FILESDIR}"/xemacs-21.4.19-db.patch
63         # see bug 576512
64         epatch "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
65         # see bug 615544
66         epatch "${FILESDIR}"/xemacs-21.4.24-ncurses-tinfo.patch
67
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
74
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
79         eautoconf
80
81         use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
82 }
83
84 src_configure() {
85         local myconf=""
86
87         # Can't build with pie. See bug #75028
88         test-flags -no-pie >/dev/null && append-flags -no-pie
89         filter-flags -pie
90
91         if use X; then
92
93                 myconf="${myconf} --with-widgets=athena"
94                 myconf="${myconf} --with-dialogs=athena"
95                 myconf="${myconf} --with-menubars=lucid"
96                 myconf="${myconf} --with-scrollbars=lucid"
97                 if use motif ; then
98                         myconf="--with-widgets=motif"
99                         myconf="${myconf} --with-dialogs=motif"
100                         myconf="${myconf} --with-scrollbars=motif"
101                         myconf="${myconf} --with-menubars=lucid"
102                 fi
103                 if use athena ; then
104                         myconf="--with-scrollbars=athena"
105                 fi
106
107                 if use Xaw3d; then
108                         myconf="${myconf} --with-athena=3d"
109                 elif use neXt; then
110                         myconf="${myconf} --with-athena=next"
111                 else
112                         myconf="${myconf} --with-athena=xaw"
113                 fi
114
115                 use dnd && myconf="${myconf} --with-dragndrop --with-offix"
116
117                 myconf="${myconf} $(use_with tiff ) $(use_with png )"
118                 myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
119         else
120                 myconf="${myconf}
121                         --without-x
122                         --without-xpm
123                         --without-dragndrop
124                         --with-gif=no"
125         fi
126
127         if use mule ; then
128                 myconf="${myconf} --with-mule"
129
130                 if use xim ; then
131                         if use motif ; then
132                                 myconf="${myconf} --with-xim=motif"
133                         else
134                                 myconf="${myconf} --with-xim=xlib"
135                         fi
136                 else
137                         myconf="${myconf} --with-xim=no"
138                 fi
139
140                 myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
141         fi
142
143         # This determines the type of sounds we are playing
144         local soundconf="native"
145
146         # This determines how these sounds should be played
147         use nas && soundconf="${soundconf},nas"
148
149         myconf="${myconf} --with-sound=${soundconf}"
150
151         if use gdbm || use berkdb ; then
152                 use gdbm && mydb="gdbm"
153
154                 use berkdb && mydb="${mydb},berkdb"
155
156                 myconf="${myconf} --with-database=${mydb}"
157         else
158                 myconf="${myconf} --without-database"
159         fi
160
161         # Enabling modules will cause segfaults outside the XEmacs build directory
162         use ia64  && myconf="${myconf} --without-modules"
163
164         # fixes #552044, deprecation warnings fools header detection in configure
165         myconf="${myconf} --cppflags=-Wno-cpp"
166
167         einfo "${myconf}"
168
169         # see bug 576512
170         append-cflags -std=gnu89
171
172         # Don't use econf because it uses options which this configure
173         # script does not understand (like --host).
174         ./configure ${myconf} ${EXTRA_ECONF} \
175                 $(use_with gif ) \
176                 $(use_with gpm ) \
177                 $(use_with postgres postgresql ) \
178                 $(use_with ldap ) \
179                 $(use_with eolconv file-coding ) \
180                 $(use_with pop ) \
181                 --compiler=$(tc-getCC) \
182                 --prefix=/usr \
183                 --with-ncurses \
184                 --with-system-malloc \
185                 --with-msw=no \
186                 --mail-locking=flock \
187                 --with-site-lisp=yes \
188                 --with-site-modules=yes \
189                 || die "The configure script failed to run properly"
190 }
191
192 src_install() {
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"
197
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"
204         done
205
206         # rename man pages
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"
209         done
210
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/
216
217         if use mule;
218         then
219                 dodir /usr/lib/xemacs/mule-packages
220         fi
221
222         # remove extraneous info files
223         cd "${D}"/usr/share/info
224         rm -f dir info.info texinfo* termcap* standards*
225
226         cd "${S}"
227         dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
228         dodoc "${FILESDIR}"/README.Gentoo
229
230         newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
231
232         domenu "${FILESDIR}"/${PN}.desktop
233 }
234
235 pkg_postinst() {
236         eselect emacs update ifunset
237         eselect gnuclient update ifunset
238         xdg_desktop_database_update
239 }
240
241 pkg_postrm() {
242         eselect emacs update ifunset
243         eselect gnuclient update ifunset
244         xdg_desktop_database_update
245 }