dev-python/csv23: keyworded 0.3.2 for ia64, bug #719700
[gentoo.git] / app-editors / xemacs / xemacs-21.4.24-r2.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=7
8
9 WANT_AUTOCONF="2.1"
10 inherit autotools eutils flag-o-matic toolchain-funcs xdg-utils desktop
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 ~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"
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[berkdb] )
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         eapply "${FILESDIR}"/xemacs-21.4.19-db.patch
63         # see bug 576512
64         eapply "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
65         eapply "${FILESDIR}"/xemacs-21.4.24-glibc-macro.patch
66         # see bug 615544
67         eapply "${FILESDIR}"/xemacs-21.4.24-ncurses-tinfo.patch
68
69         # Convert to utf-8
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
74
75         eapply_user
76
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
83
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
88         eautoconf
89
90         use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
91 }
92
93 src_configure() {
94         local myconf=""
95
96         # Can't build with pie. See bug #75028
97         test-flags -no-pie >/dev/null && append-flags -no-pie
98         filter-flags -pie
99
100         if use X; then
101
102                 myconf="${myconf} --with-widgets=athena"
103                 myconf="${myconf} --with-dialogs=athena"
104                 myconf="${myconf} --with-menubars=lucid"
105                 myconf="${myconf} --with-scrollbars=lucid"
106                 if use motif ; then
107                         myconf="--with-widgets=motif"
108                         myconf="${myconf} --with-dialogs=motif"
109                         myconf="${myconf} --with-scrollbars=motif"
110                         myconf="${myconf} --with-menubars=lucid"
111                 fi
112                 if use athena ; then
113                         myconf="--with-scrollbars=athena"
114                 fi
115
116                 if use Xaw3d; then
117                         myconf="${myconf} --with-athena=3d"
118                 elif use neXt; then
119                         myconf="${myconf} --with-athena=next"
120                 else
121                         myconf="${myconf} --with-athena=xaw"
122                 fi
123
124                 use dnd && myconf="${myconf} --with-dragndrop --with-offix"
125
126                 myconf="${myconf} $(use_with tiff ) $(use_with png )"
127                 myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
128         else
129                 myconf="${myconf}
130                         --without-x
131                         --without-xpm
132                         --without-dragndrop
133                         --with-gif=no"
134         fi
135
136         if use mule ; then
137                 myconf="${myconf} --with-mule"
138
139                 if use xim ; then
140                         if use motif ; then
141                                 myconf="${myconf} --with-xim=motif"
142                         else
143                                 myconf="${myconf} --with-xim=xlib"
144                         fi
145                 else
146                         myconf="${myconf} --with-xim=no"
147                 fi
148
149                 myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
150         fi
151
152         # This determines the type of sounds we are playing
153         local soundconf="native"
154
155         # This determines how these sounds should be played
156         use nas && soundconf="${soundconf},nas"
157
158         myconf="${myconf} --with-sound=${soundconf}"
159
160         if use gdbm || use berkdb ; then
161                 use gdbm && mydb="gdbm"
162
163                 use berkdb && mydb="${mydb},berkdb"
164
165                 myconf="${myconf} --with-database=${mydb}"
166         else
167                 myconf="${myconf} --without-database"
168         fi
169
170         # Enabling modules will cause segfaults outside the XEmacs build directory
171         use ia64  && myconf="${myconf} --without-modules"
172
173         einfo "${myconf}"
174
175         # see bug 576512
176         append-cflags -fgnu89-inline
177
178         # Don't use econf because it uses options which this configure
179         # script does not understand (like --host).
180         ./configure ${myconf} ${EXTRA_ECONF} \
181                 $(use_with gif ) \
182                 $(use_with gpm ) \
183                 $(use_with postgres postgresql ) \
184                 $(use_with ldap ) \
185                 $(use_with eolconv file-coding ) \
186                 $(use_with pop ) \
187                 --compiler=$(tc-getCC) \
188                 --prefix=/usr \
189                 --with-ncurses \
190                 --with-system-malloc \
191                 --with-msw=no \
192                 --mail-locking=flock \
193                 --with-site-lisp=yes \
194                 --with-site-modules=yes \
195                 || die "The configure script failed to run properly"
196 }
197
198 src_install() {
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"
203
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"
210         done
211
212         # rename man pages
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"
215         done
216
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/
222
223         if use mule;
224         then
225                 dodir /usr/lib/xemacs/mule-packages
226         fi
227
228         # remove extraneous info files
229         cd "${D}"/usr/share/info
230         rm -f dir info.info texinfo* termcap* standards*
231
232         cd "${S}"
233         dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
234         dodoc "${FILESDIR}"/README.Gentoo
235
236         newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
237
238         domenu "${FILESDIR}"/${PN}.desktop
239 }
240
241 pkg_postinst() {
242         eselect emacs update ifunset
243         eselect gnuclient update ifunset
244         xdg_desktop_database_update
245 }
246
247 pkg_postrm() {
248         eselect emacs update ifunset
249         eselect gnuclient update ifunset
250         xdg_desktop_database_update
251 }