| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-editors/xemacs/xemacs-21.5.29-r2.ebuild,v 1.12 2012/09/05 08:48:48 jlec Exp $
|
| 4 |
|
| 5 |
# Note: xemacs currently does not work with a hardened profile. If you
|
| 6 |
# want to use xemacs on a hardened profile then compile with the
|
| 7 |
# -nopie flag in CFLAGS or help fix bug #75028.
|
| 8 |
|
| 9 |
EAPI="2"
|
| 10 |
|
| 11 |
export WANT_AUTOCONF="2.5"
|
| 12 |
inherit eutils flag-o-matic multilib
|
| 13 |
|
| 14 |
DESCRIPTION="highly customizable open source text editor and application development system"
|
| 15 |
HOMEPAGE="http://www.xemacs.org/"
|
| 16 |
SRC_URI="http://ftp.xemacs.org/xemacs-21.5/${P}.tar.gz
|
| 17 |
http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
|
| 18 |
|
| 19 |
LICENSE="GPL-2"
|
| 20 |
SLOT="0"
|
| 21 |
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
|
| 22 |
IUSE="alsa debug eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xft xim athena neXt Xaw3d gdbm berkdb"
|
| 23 |
|
| 24 |
X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
|
| 25 |
|
| 26 |
RDEPEND="
|
| 27 |
berkdb? ( sys-libs/db )
|
| 28 |
gdbm? ( >=sys-libs/gdbm-1.8.3 )
|
| 29 |
>=sys-libs/zlib-1.1.4
|
| 30 |
>=dev-libs/openssl-0.9.6
|
| 31 |
>=media-libs/audiofile-0.2.3
|
| 32 |
gpm? ( >=sys-libs/gpm-1.19.6 )
|
| 33 |
postgres? ( dev-db/postgresql-base )
|
| 34 |
ldap? ( net-nds/openldap )
|
| 35 |
alsa? ( media-libs/alsa-lib )
|
| 36 |
nas? ( media-libs/nas )
|
| 37 |
X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
|
| 38 |
dnd? ( x11-libs/dnd )
|
| 39 |
motif? ( >=x11-libs/motif-2.3:0[xft=] )
|
| 40 |
athena? ( x11-libs/libXaw )
|
| 41 |
Xaw3d? ( x11-libs/libXaw3d )
|
| 42 |
xft? ( media-libs/freetype x11-libs/libXft x11-libs/libXrender >=media-libs/fontconfig-2.5.0 )
|
| 43 |
neXt? ( x11-libs/neXtaw )
|
| 44 |
xface? ( media-libs/compface )
|
| 45 |
tiff? ( media-libs/tiff )
|
| 46 |
png? ( >=media-libs/libpng-1.2 )
|
| 47 |
jpeg? ( virtual/jpeg )
|
| 48 |
canna? ( app-i18n/canna )
|
| 49 |
freewnn? ( app-i18n/freewnn )
|
| 50 |
>=sys-libs/ncurses-5.2"
|
| 51 |
|
| 52 |
DEPEND="${RDEPEND}
|
| 53 |
>=app-admin/eselect-emacs-1.2"
|
| 54 |
|
| 55 |
PDEPEND="app-xemacs/xemacs-base
|
| 56 |
mule? ( app-xemacs/mule-base )"
|
| 57 |
|
| 58 |
src_unpack() {
|
| 59 |
default_src_unpack
|
| 60 |
|
| 61 |
use neXt && unpack NeXT_XEmacs.tar.gz
|
| 62 |
}
|
| 63 |
|
| 64 |
src_prepare() {
|
| 65 |
# Fix security issue in vcdiff script
|
| 66 |
epatch "${FILESDIR}"/${P}-vcdiff.patch
|
| 67 |
|
| 68 |
# Fix problem caused by improper optimization with GCC 4.1.2 on x86
|
| 69 |
# (and possibly other arches, but only confirmed on x86). See
|
| 70 |
# http://tracker.xemacs.org/XEmacs/its/issue354 for the upstream
|
| 71 |
# bug.
|
| 72 |
epatch "${FILESDIR}"/${P}-optimization-bug.patch
|
| 73 |
|
| 74 |
# Fix for security bug #275397.
|
| 75 |
epatch "${FILESDIR}"/${P}-large-images.patch
|
| 76 |
|
| 77 |
use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
|
| 78 |
}
|
| 79 |
|
| 80 |
src_configure() {
|
| 81 |
local myconf=""
|
| 82 |
|
| 83 |
if use X; then
|
| 84 |
|
| 85 |
myconf="${myconf} --with-widgets=athena"
|
| 86 |
myconf="${myconf} --with-dialogs=athena"
|
| 87 |
myconf="${myconf} --with-menubars=lucid"
|
| 88 |
myconf="${myconf} --with-scrollbars=lucid"
|
| 89 |
if use motif ; then
|
| 90 |
myconf="--with-widgets=motif"
|
| 91 |
myconf="${myconf} --with-dialogs=motif"
|
| 92 |
myconf="${myconf} --with-scrollbars=motif"
|
| 93 |
myconf="${myconf} --with-menubars=lucid"
|
| 94 |
fi
|
| 95 |
if use athena or use Xaw3d ; then
|
| 96 |
myconf="--with-scrollbars=athena"
|
| 97 |
fi
|
| 98 |
|
| 99 |
if use Xaw3d; then
|
| 100 |
myconf="${myconf} --with-athena=3d"
|
| 101 |
elif use neXt; then
|
| 102 |
myconf="${myconf} --with-athena=next"
|
| 103 |
else
|
| 104 |
myconf="${myconf} --with-athena=xaw"
|
| 105 |
fi
|
| 106 |
|
| 107 |
use dnd && myconf="${myconf} --with-dragndrop --with-offix"
|
| 108 |
|
| 109 |
myconf="${myconf} $(use_with tiff )"
|
| 110 |
myconf="${myconf} $(use_with png )"
|
| 111 |
myconf="${myconf} $(use_with jpeg )"
|
| 112 |
myconf="${myconf} $(use_with xface )"
|
| 113 |
|
| 114 |
use xft && myconf="${myconf} --with-xft=emacs,tabs,menubars,gauges" ||
|
| 115 |
myconf="${myconf} --with-xft=no"
|
| 116 |
|
| 117 |
else
|
| 118 |
myconf="${myconf}
|
| 119 |
--without-x
|
| 120 |
--without-xpm
|
| 121 |
--without-dragndrop
|
| 122 |
--with-xft=no
|
| 123 |
--with-gif=no"
|
| 124 |
fi
|
| 125 |
|
| 126 |
if use mule ; then
|
| 127 |
myconf="${myconf} --with-mule"
|
| 128 |
|
| 129 |
if use xim ; then
|
| 130 |
if use motif ; then
|
| 131 |
myconf="${myconf} --with-xim=motif"
|
| 132 |
else
|
| 133 |
myconf="${myconf} --with-xim=xlib"
|
| 134 |
fi
|
| 135 |
else
|
| 136 |
myconf="${myconf} --with-xim=no"
|
| 137 |
fi
|
| 138 |
|
| 139 |
myconf="${myconf} $(use_with canna )"
|
| 140 |
myconf="${myconf} $(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 |
use alsa && soundconf="${soundconf},alsa"
|
| 149 |
|
| 150 |
myconf="${myconf} --with-sound=${soundconf}"
|
| 151 |
|
| 152 |
if use gdbm || use berkdb ; then
|
| 153 |
if use gdbm ; then
|
| 154 |
mydb="gdbm"
|
| 155 |
# We have GDBM in a non-standard location
|
| 156 |
append-flags "-I/usr/include/gdbm"
|
| 157 |
fi
|
| 158 |
|
| 159 |
use berkdb && mydb="${mydb},berkdb"
|
| 160 |
|
| 161 |
myconf="${myconf} --with-database=${mydb}"
|
| 162 |
else
|
| 163 |
myconf="${myconf} --without-database"
|
| 164 |
fi
|
| 165 |
|
| 166 |
use debug && myconf="${myconf} --with-optimization=no --with-debug" ||
|
| 167 |
myconf="${myconf} --with-optimization=yes"
|
| 168 |
|
| 169 |
econf ${myconf} \
|
| 170 |
$(use_with gif ) \
|
| 171 |
$(use_with gpm ) \
|
| 172 |
$(use_with postgres postgresql ) \
|
| 173 |
$(use_with ldap ) \
|
| 174 |
$(use_with eolconv file-coding ) \
|
| 175 |
$(use_with pop ) \
|
| 176 |
--prefix=/usr \
|
| 177 |
--with-ncurses \
|
| 178 |
--with-msw=no \
|
| 179 |
--with-mail-locking=flock \
|
| 180 |
--with-site-lisp=yes \
|
| 181 |
--with-site-modules=yes \
|
| 182 |
--with-newgc \
|
| 183 |
--enable-option-checking=no \
|
| 184 |
--with-last-packages=/usr/lib/xemacs \
|
| 185 |
|| die "configuration failed"
|
| 186 |
}
|
| 187 |
|
| 188 |
src_install() {
|
| 189 |
emake prefix="${D}"/usr \
|
| 190 |
mandir="${D}"/usr/share/man/man1 \
|
| 191 |
infodir="${D}"/usr/share/info \
|
| 192 |
libdir="${D}"/usr/$(get_libdir) \
|
| 193 |
datadir="${D}"/usr/share \
|
| 194 |
install gzip-el || die
|
| 195 |
|
| 196 |
# Rename some applications installed in bin so that it is clear
|
| 197 |
# which application installed them and so that conflicting
|
| 198 |
# packages (emacs) can't clobber the actual applications.
|
| 199 |
# Addresses bug #62991.
|
| 200 |
for i in b2m ctags etags rcs-checkin ; do
|
| 201 |
mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
|
| 202 |
done
|
| 203 |
|
| 204 |
# rename man pages
|
| 205 |
for i in ctags etags; do
|
| 206 |
mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
|
| 207 |
done
|
| 208 |
|
| 209 |
# install base packages directories
|
| 210 |
dodir /usr/lib/xemacs/xemacs-packages/
|
| 211 |
dodir /usr/lib/xemacs/site-packages/
|
| 212 |
dodir /usr/lib/xemacs/site-modules/
|
| 213 |
dodir /usr/lib/xemacs/site-lisp/
|
| 214 |
|
| 215 |
if use mule;
|
| 216 |
then
|
| 217 |
dodir /usr/lib/xemacs/mule-packages
|
| 218 |
fi
|
| 219 |
|
| 220 |
# remove extraneous info files
|
| 221 |
cd "${D}"/usr/share/info
|
| 222 |
rm -f dir info.info texinfo* termcap* standards*
|
| 223 |
|
| 224 |
cd "${S}"
|
| 225 |
dodoc CHANGES-* ChangeLog INSTALL Installation PROBLEMS README*
|
| 226 |
|
| 227 |
newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
|
| 228 |
|
| 229 |
domenu "${FILESDIR}"/${PN}.desktop
|
| 230 |
}
|
| 231 |
|
| 232 |
pkg_postinst() {
|
| 233 |
eselect emacs update ifunset
|
| 234 |
|
| 235 |
einfo "If you are upgrading from XEmacs 21.4 you should note the following"
|
| 236 |
einfo "incompatibilities:"
|
| 237 |
einfo "- Mule-UCS is no longer supported due to proper UTF-8 support in XEmacs 21.5"
|
| 238 |
einfo "- The X resource class has changed from Emacs to XEmacs,"
|
| 239 |
einfo " settings in your .Xdefaults file should be updated accordingly."
|
| 240 |
|
| 241 |
if use xft;
|
| 242 |
then
|
| 243 |
einfo "You have enabled Xft font support. Xft requires font names to be provided"
|
| 244 |
einfo "in a different way, so you may need to adjust your .Xdefaults accordingly."
|
| 245 |
fi
|
| 246 |
}
|
| 247 |
|
| 248 |
pkg_postrm() {
|
| 249 |
eselect emacs update ifunset
|
| 250 |
}
|