| 1 |
ulm |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
ulm |
1.5 |
# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.1.9999-r1.ebuild,v 1.4 2012/06/10 16:54:09 ulm Exp $ |
| 4 |
ulm |
1.1 |
|
| 5 |
|
|
EAPI=4 |
| 6 |
|
|
|
| 7 |
|
|
inherit autotools elisp-common eutils flag-o-matic multilib |
| 8 |
|
|
|
| 9 |
|
|
if [[ ${PV##*.} = 9999 ]]; then |
| 10 |
|
|
EBZR_PROJECT="emacs" |
| 11 |
|
|
EBZR_BRANCH="trunk" |
| 12 |
|
|
EBZR_REPO_URI="bzr://bzr.savannah.gnu.org/emacs/${EBZR_BRANCH}/" |
| 13 |
|
|
# "Nosmart" is much faster for initial branching. |
| 14 |
|
|
EBZR_INITIAL_URI="nosmart+${EBZR_REPO_URI}" |
| 15 |
|
|
inherit bzr |
| 16 |
|
|
SRC_URI="" |
| 17 |
|
|
else |
| 18 |
|
|
SRC_URI="mirror://gentoo/emacs-${PV}.tar.gz |
| 19 |
|
|
mirror://gnu-alpha/emacs/pretest/emacs-${PV}.tar.gz" |
| 20 |
|
|
# FULL_VERSION keeps the full version number, which is needed in |
| 21 |
|
|
# order to determine some path information correctly for copy/move |
| 22 |
|
|
# operations later on |
| 23 |
|
|
FULL_VERSION="${PV%%_*}" |
| 24 |
|
|
S="${WORKDIR}/emacs-${FULL_VERSION}" |
| 25 |
|
|
fi |
| 26 |
|
|
|
| 27 |
|
|
DESCRIPTION="The extensible, customizable, self-documenting real-time display editor" |
| 28 |
|
|
HOMEPAGE="http://www.gnu.org/software/emacs/" |
| 29 |
|
|
|
| 30 |
|
|
LICENSE="GPL-3 FDL-1.3 BSD as-is MIT W3C unicode PSF-2" |
| 31 |
|
|
SLOT="24" |
| 32 |
|
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" |
| 33 |
ulm |
1.2 |
IUSE="alsa athena dbus gconf gif gnutls gpm gsettings gtk gtk3 gzip-el hesiod imagemagick jpeg kerberos libxml2 m17n-lib motif pax_kernel png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm" |
| 34 |
ulm |
1.1 |
|
| 35 |
|
|
RDEPEND="sys-libs/ncurses |
| 36 |
|
|
>=app-admin/eselect-emacs-1.2 |
| 37 |
ulm |
1.3 |
>=app-emacs/emacs-common-gentoo-1.3[X?] |
| 38 |
ulm |
1.1 |
net-libs/liblockfile |
| 39 |
|
|
hesiod? ( net-dns/hesiod ) |
| 40 |
|
|
kerberos? ( virtual/krb5 ) |
| 41 |
|
|
alsa? ( media-libs/alsa-lib ) |
| 42 |
|
|
gpm? ( sys-libs/gpm ) |
| 43 |
|
|
dbus? ( sys-apps/dbus ) |
| 44 |
|
|
gnutls? ( net-libs/gnutls ) |
| 45 |
|
|
libxml2? ( >=dev-libs/libxml2-2.2.0 ) |
| 46 |
|
|
selinux? ( sys-libs/libselinux ) |
| 47 |
|
|
X? ( |
| 48 |
|
|
x11-libs/libXmu |
| 49 |
|
|
x11-libs/libXt |
| 50 |
|
|
x11-misc/xbitmaps |
| 51 |
|
|
gconf? ( >=gnome-base/gconf-2.26.2 ) |
| 52 |
|
|
gsettings? ( >=dev-libs/glib-2.28.6 ) |
| 53 |
|
|
gif? ( media-libs/giflib ) |
| 54 |
|
|
jpeg? ( virtual/jpeg ) |
| 55 |
|
|
png? ( >=media-libs/libpng-1.4:0 ) |
| 56 |
|
|
svg? ( >=gnome-base/librsvg-2.0 ) |
| 57 |
|
|
tiff? ( media-libs/tiff ) |
| 58 |
|
|
xpm? ( x11-libs/libXpm ) |
| 59 |
|
|
imagemagick? ( >=media-gfx/imagemagick-6.6.2 ) |
| 60 |
|
|
xft? ( |
| 61 |
|
|
media-libs/fontconfig |
| 62 |
|
|
media-libs/freetype |
| 63 |
|
|
x11-libs/libXft |
| 64 |
|
|
m17n-lib? ( |
| 65 |
|
|
>=dev-libs/libotf-0.9.4 |
| 66 |
|
|
>=dev-libs/m17n-lib-1.5.1 |
| 67 |
|
|
) |
| 68 |
|
|
) |
| 69 |
|
|
gtk? ( |
| 70 |
|
|
gtk3? ( x11-libs/gtk+:3 ) |
| 71 |
|
|
!gtk3? ( x11-libs/gtk+:2 ) |
| 72 |
|
|
) |
| 73 |
|
|
!gtk? ( |
| 74 |
|
|
Xaw3d? ( x11-libs/libXaw3d ) |
| 75 |
|
|
!Xaw3d? ( |
| 76 |
|
|
athena? ( x11-libs/libXaw ) |
| 77 |
|
|
!athena? ( motif? ( >=x11-libs/openmotif-2.3:0 ) ) |
| 78 |
|
|
) |
| 79 |
|
|
) |
| 80 |
|
|
)" |
| 81 |
|
|
|
| 82 |
|
|
DEPEND="${RDEPEND} |
| 83 |
|
|
alsa? ( virtual/pkgconfig ) |
| 84 |
|
|
dbus? ( virtual/pkgconfig ) |
| 85 |
|
|
gnutls? ( virtual/pkgconfig ) |
| 86 |
|
|
libxml2? ( virtual/pkgconfig ) |
| 87 |
|
|
X? ( virtual/pkgconfig ) |
| 88 |
ulm |
1.2 |
gzip-el? ( app-arch/gzip ) |
| 89 |
|
|
pax_kernel? ( sys-apps/paxctl )" |
| 90 |
ulm |
1.1 |
|
| 91 |
ulm |
1.2 |
EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}" |
| 92 |
ulm |
1.1 |
SITEFILE="20${PN}-${SLOT}-gentoo.el" |
| 93 |
|
|
|
| 94 |
|
|
src_prepare() { |
| 95 |
|
|
if [[ ${PV##*.} = 9999 ]]; then |
| 96 |
|
|
FULL_VERSION=$(sed -n 's/^AC_INIT(emacs,[ \t]*\([^ \t,)]*\).*/\1/p' \ |
| 97 |
|
|
configure.in) |
| 98 |
|
|
[[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version" |
| 99 |
|
|
einfo "Emacs branch: ${EBZR_BRANCH}" |
| 100 |
|
|
einfo "Revision: ${EBZR_REVISION:-${EBZR_REVNO}}" |
| 101 |
|
|
einfo "Emacs version number: ${FULL_VERSION}" |
| 102 |
|
|
[[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \ |
| 103 |
|
|
|| die "Upstream version number changed to ${FULL_VERSION}" |
| 104 |
|
|
fi |
| 105 |
|
|
|
| 106 |
|
|
epatch_user |
| 107 |
|
|
|
| 108 |
|
|
if ! use alsa; then |
| 109 |
|
|
# ALSA is detected even if not requested by its USE flag. |
| 110 |
|
|
# Suppress it by supplying pkg-config with a wrong library name. |
| 111 |
|
|
sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \ |
| 112 |
|
|
|| die "unable to sed configure.in" |
| 113 |
|
|
fi |
| 114 |
|
|
if ! use gzip-el; then |
| 115 |
|
|
# Emacs' build system automatically detects the gzip binary and |
| 116 |
|
|
# compresses el files. We don't want that so confuse it with a |
| 117 |
|
|
# wrong binary name |
| 118 |
|
|
sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \ |
| 119 |
|
|
|| die "unable to sed configure.in" |
| 120 |
|
|
fi |
| 121 |
|
|
|
| 122 |
|
|
AT_M4DIR=m4 eautoreconf |
| 123 |
|
|
} |
| 124 |
|
|
|
| 125 |
|
|
src_configure() { |
| 126 |
|
|
strip-flags |
| 127 |
|
|
|
| 128 |
|
|
if use sh; then |
| 129 |
|
|
replace-flags "-O[1-9]" -O0 #262359 |
| 130 |
|
|
elif use ia64; then |
| 131 |
|
|
replace-flags "-O[2-9]" -O1 #325373 |
| 132 |
|
|
else |
| 133 |
|
|
replace-flags "-O[3-9]" -O2 |
| 134 |
|
|
fi |
| 135 |
|
|
|
| 136 |
|
|
local myconf |
| 137 |
|
|
|
| 138 |
|
|
if use alsa && ! use sound; then |
| 139 |
|
|
einfo "Although sound USE flag is disabled you chose to have alsa," |
| 140 |
|
|
einfo "so sound is switched on anyway." |
| 141 |
|
|
myconf="${myconf} --with-sound" |
| 142 |
|
|
else |
| 143 |
|
|
myconf="${myconf} $(use_with sound)" |
| 144 |
|
|
fi |
| 145 |
|
|
|
| 146 |
|
|
if use X; then |
| 147 |
|
|
myconf="${myconf} --with-x --without-ns" |
| 148 |
|
|
myconf="${myconf} $(use_with gconf)" |
| 149 |
|
|
myconf="${myconf} $(use_with gsettings)" |
| 150 |
|
|
myconf="${myconf} $(use_with toolkit-scroll-bars)" |
| 151 |
|
|
myconf="${myconf} $(use_with gif) $(use_with jpeg)" |
| 152 |
|
|
myconf="${myconf} $(use_with png) $(use_with svg rsvg)" |
| 153 |
|
|
myconf="${myconf} $(use_with tiff) $(use_with xpm)" |
| 154 |
|
|
myconf="${myconf} $(use_with imagemagick)" |
| 155 |
|
|
|
| 156 |
|
|
if use xft; then |
| 157 |
|
|
myconf="${myconf} --with-xft" |
| 158 |
|
|
myconf="${myconf} $(use_with m17n-lib libotf)" |
| 159 |
|
|
myconf="${myconf} $(use_with m17n-lib m17n-flt)" |
| 160 |
|
|
else |
| 161 |
|
|
myconf="${myconf} --without-xft" |
| 162 |
|
|
myconf="${myconf} --without-libotf --without-m17n-flt" |
| 163 |
|
|
use m17n-lib && ewarn \ |
| 164 |
|
|
"USE flag \"m17n-lib\" has no effect if \"xft\" is not set." |
| 165 |
|
|
fi |
| 166 |
|
|
|
| 167 |
|
|
if use gtk; then |
| 168 |
|
|
einfo "Configuring to build with GIMP Toolkit (GTK+)" |
| 169 |
|
|
myconf="${myconf} --with-x-toolkit=$(usev gtk3 || echo gtk)" |
| 170 |
|
|
local f |
| 171 |
|
|
for f in athena Xaw3d motif; do |
| 172 |
|
|
use ${f} && ewarn "USE flag \"${f}\" ignored" \ |
| 173 |
|
|
"(superseded by \"gtk\")" |
| 174 |
|
|
done |
| 175 |
|
|
elif use athena || use Xaw3d; then |
| 176 |
|
|
einfo "Configuring to build with Athena/Lucid toolkit" |
| 177 |
|
|
myconf="${myconf} --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)" |
| 178 |
|
|
use motif && ewarn "USE flag \"motif\" ignored" \ |
| 179 |
|
|
"(superseded by \"athena\" or \"Xaw3d\")" |
| 180 |
|
|
elif use motif; then |
| 181 |
|
|
einfo "Configuring to build with Motif toolkit" |
| 182 |
|
|
myconf="${myconf} --with-x-toolkit=motif" |
| 183 |
|
|
else |
| 184 |
|
|
einfo "Configuring to build with no toolkit" |
| 185 |
|
|
myconf="${myconf} --with-x-toolkit=no" |
| 186 |
|
|
fi |
| 187 |
|
|
|
| 188 |
|
|
! use gtk && use gtk3 \ |
| 189 |
|
|
&& ewarn "USE flag \"gtk3\" has no effect if \"gtk\" is not set." |
| 190 |
|
|
else |
| 191 |
|
|
myconf="${myconf} --without-x --without-ns" |
| 192 |
|
|
fi |
| 193 |
|
|
|
| 194 |
|
|
if [[ ${PV##*.} = 9999 ]]; then |
| 195 |
|
|
# These variables are not needed for building. We add them to |
| 196 |
|
|
# configure options because they are stored in the Emacs binary |
| 197 |
|
|
# and available in variable "system-configuration-options". |
| 198 |
|
|
myconf="${myconf} EBZR_BRANCH=${EBZR_BRANCH} EBZR_REVNO=${EBZR_REVNO}" |
| 199 |
|
|
fi |
| 200 |
|
|
|
| 201 |
|
|
# According to configure, this option is only used for GNU/Linux |
| 202 |
|
|
# (x86_64 and s390). For Gentoo Prefix we have to explicitly spell |
| 203 |
|
|
# out the location because $(get_libdir) does not necessarily return |
| 204 |
|
|
# something that matches the host OS's libdir naming (e.g. RHEL). |
| 205 |
|
|
local crtdir=$($(tc-getCC) -print-file-name=crt1.o) |
| 206 |
|
|
crtdir=${crtdir%/*} |
| 207 |
|
|
|
| 208 |
|
|
econf \ |
| 209 |
|
|
--program-suffix=-${EMACS_SUFFIX} \ |
| 210 |
|
|
--infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \ |
| 211 |
|
|
--enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \ |
| 212 |
|
|
--with-crt-dir="${crtdir}" \ |
| 213 |
|
|
--with-gameuser="${GAMES_USER_DED:-games}" \ |
| 214 |
|
|
--without-compress-info \ |
| 215 |
|
|
$(use_with hesiod) \ |
| 216 |
|
|
$(use_with kerberos) $(use_with kerberos kerberos5) \ |
| 217 |
|
|
$(use_with gpm) \ |
| 218 |
|
|
$(use_with dbus) \ |
| 219 |
|
|
$(use_with gnutls) \ |
| 220 |
|
|
$(use_with libxml2 xml2) \ |
| 221 |
|
|
$(use_with selinux) \ |
| 222 |
ulm |
1.5 |
$(use_with wide-int) \ |
| 223 |
ulm |
1.1 |
${myconf} |
| 224 |
|
|
} |
| 225 |
|
|
|
| 226 |
|
|
src_compile() { |
| 227 |
|
|
export SANDBOX_ON=0 # for the unbelievers, see Bug #131505 |
| 228 |
|
|
if [[ ${PV##*.} = 9999 ]]; then |
| 229 |
|
|
emake CC="$(tc-getCC)" bootstrap |
| 230 |
|
|
# cleanup, otherwise emacs will be dumped again in src_install |
| 231 |
|
|
(cd src; emake versionclean) |
| 232 |
|
|
fi |
| 233 |
|
|
# set last component of emacs-version to (package revision + 1) |
| 234 |
|
|
touch src/emacs-${FULL_VERSION}.${PR#r} |
| 235 |
|
|
emake CC="$(tc-getCC)" |
| 236 |
|
|
} |
| 237 |
|
|
|
| 238 |
|
|
src_install () { |
| 239 |
|
|
emake install DESTDIR="${D}" |
| 240 |
|
|
|
| 241 |
|
|
rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \ |
| 242 |
|
|
|| die "removing duplicate emacs executable failed" |
| 243 |
|
|
mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \ |
| 244 |
|
|
|| die "moving Emacs executable failed" |
| 245 |
|
|
|
| 246 |
|
|
# move man pages to the correct place |
| 247 |
|
|
local m |
| 248 |
|
|
for m in "${ED}"/usr/share/man/man1/* ; do |
| 249 |
|
|
mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed" |
| 250 |
|
|
done |
| 251 |
|
|
|
| 252 |
|
|
# move info dir to avoid collisions with the dir file generated by portage |
| 253 |
|
|
mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \ |
| 254 |
|
|
|| die "moving info dir failed" |
| 255 |
|
|
touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir |
| 256 |
|
|
docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig |
| 257 |
|
|
|
| 258 |
|
|
# avoid collision between slots, see bug #169033 e.g. |
| 259 |
|
|
rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el |
| 260 |
|
|
rm -rf "${ED}"/usr/share/{applications,icons} |
| 261 |
ulm |
1.3 |
rm -rf "${ED}"/var |
| 262 |
ulm |
1.1 |
|
| 263 |
|
|
# remove unused <version>/site-lisp dir |
| 264 |
|
|
rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp |
| 265 |
|
|
|
| 266 |
|
|
local c=";;" |
| 267 |
|
|
if use source; then |
| 268 |
|
|
insinto /usr/share/emacs/${FULL_VERSION}/src |
| 269 |
|
|
# This is not meant to install all the source -- just the |
| 270 |
|
|
# C source you might find via find-function |
| 271 |
|
|
doins src/*.{c,h,m} |
| 272 |
|
|
doins -r src/s |
| 273 |
|
|
rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/s/README |
| 274 |
|
|
c="" |
| 275 |
|
|
fi |
| 276 |
|
|
|
| 277 |
|
|
sed 's/^X//' >"${T}/${SITEFILE}" <<-EOF |
| 278 |
|
|
X |
| 279 |
|
|
;;; ${PN}-${SLOT} site-lisp configuration |
| 280 |
|
|
X |
| 281 |
|
|
(when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version) |
| 282 |
|
|
X ${c}(setq find-function-C-source-directory |
| 283 |
|
|
X ${c} "${EPREFIX}/usr/share/emacs/${FULL_VERSION}/src") |
| 284 |
|
|
X (let ((path (getenv "INFOPATH")) |
| 285 |
|
|
X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}") |
| 286 |
|
|
X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>")) |
| 287 |
|
|
X (and path |
| 288 |
|
|
X ;; move Emacs Info dir before anything else in /usr/share/info |
| 289 |
|
|
X (let* ((p (cons nil (split-string path ":" t))) (q p)) |
| 290 |
|
|
X (while (and (cdr q) (not (string-match re (cadr q)))) |
| 291 |
|
|
X (setq q (cdr q))) |
| 292 |
|
|
X (setcdr q (cons dir (delete dir (cdr q)))) |
| 293 |
|
|
X (setq Info-directory-list (prune-directory-list (cdr p))))))) |
| 294 |
|
|
EOF |
| 295 |
|
|
elisp-site-file-install "${T}/${SITEFILE}" || die |
| 296 |
|
|
|
| 297 |
|
|
dodoc README BUGS |
| 298 |
|
|
} |
| 299 |
|
|
|
| 300 |
|
|
pkg_preinst() { |
| 301 |
|
|
# move Info dir file to correct name |
| 302 |
|
|
local infodir=/usr/share/info/${EMACS_SUFFIX} f |
| 303 |
|
|
if [[ -f ${ED}${infodir}/dir.orig ]]; then |
| 304 |
|
|
mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed" |
| 305 |
|
|
elif [[ -d "${ED}"${infodir} ]]; then |
| 306 |
|
|
# this should not happen in EAPI 4 |
| 307 |
|
|
ewarn "Regenerating Info directory index in ${infodir} ..." |
| 308 |
|
|
rm -f "${ED}"${infodir}/dir{,.*} |
| 309 |
|
|
for f in "${ED}"${infodir}/*; do |
| 310 |
|
|
if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then |
| 311 |
|
|
install-info --info-dir="${ED}"${infodir} "${f}" \ |
| 312 |
|
|
|| die "install-info failed" |
| 313 |
|
|
fi |
| 314 |
|
|
done |
| 315 |
|
|
fi |
| 316 |
|
|
} |
| 317 |
|
|
|
| 318 |
|
|
pkg_postinst() { |
| 319 |
|
|
elisp-site-regen |
| 320 |
|
|
eselect emacs update ifunset |
| 321 |
|
|
|
| 322 |
|
|
if use X; then |
| 323 |
|
|
elog "You need to install some fonts for Emacs." |
| 324 |
|
|
elog "Installing media-fonts/font-adobe-{75,100}dpi on the X server's" |
| 325 |
|
|
elog "machine would satisfy basic Emacs requirements under X11." |
| 326 |
|
|
elog "See also http://www.gentoo.org/proj/en/lisp/emacs/xft.xml" |
| 327 |
|
|
elog "for how to enable anti-aliased fonts." |
| 328 |
|
|
elog |
| 329 |
|
|
fi |
| 330 |
|
|
|
| 331 |
|
|
elog "You can set the version to be started by /usr/bin/emacs through" |
| 332 |
|
|
elog "the Emacs eselect module, which also redirects man and info pages." |
| 333 |
|
|
elog "Therefore, several Emacs versions can be installed at the same time." |
| 334 |
|
|
elog "\"man emacs.eselect\" for details." |
| 335 |
|
|
elog |
| 336 |
|
|
elog "If you upgrade from a previous major version of Emacs, then it is" |
| 337 |
|
|
elog "strongly recommended that you use app-admin/emacs-updater to rebuild" |
| 338 |
|
|
elog "all byte-compiled elisp files of the installed Emacs packages." |
| 339 |
|
|
} |
| 340 |
|
|
|
| 341 |
|
|
pkg_postrm() { |
| 342 |
|
|
elisp-site-regen |
| 343 |
|
|
eselect emacs update ifunset |
| 344 |
|
|
} |