Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-editors/emacs-vcs: ChangeLog emacs-vcs-24.0.9999-r50.ebuild emacs-vcs-24.0.9999-r4.ebuild emacs-vcs-24.0.9999-r3.ebuild emacs-vcs-23.4.9999.ebuild
Date: Sat, 07 Apr 2012 15:44:05
Message-Id: 20120407154349.B76F02004B@flycatcher.gentoo.org
1 ulm 12/04/07 15:43:49
2
3 Modified: ChangeLog
4 Added: emacs-vcs-24.0.9999-r50.ebuild
5 emacs-vcs-24.0.9999-r4.ebuild
6 Removed: emacs-vcs-24.0.9999-r3.ebuild
7 emacs-vcs-23.4.9999.ebuild
8 Log:
9 The upstream repository has been branched for the 24.1 release. 24.0.9999-r4
10 is the live ebuild for the emacs-24 branch, 24.0.9999-r50 for the trunk.
11 Remove emacs-23 live ebuild.
12
13 (Portage version: 2.1.10.56/cvs/Linux x86_64)
14
15 Revision Changes Path
16 1.86 app-editors/emacs-vcs/ChangeLog
17
18 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/ChangeLog?rev=1.86&view=markup
19 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/ChangeLog?rev=1.86&content-type=text/plain
20 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/ChangeLog?r1=1.85&r2=1.86
21
22 Index: ChangeLog
23 ===================================================================
24 RCS file: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/ChangeLog,v
25 retrieving revision 1.85
26 retrieving revision 1.86
27 diff -u -r1.85 -r1.86
28 --- ChangeLog 2 Apr 2012 17:29:27 -0000 1.85
29 +++ ChangeLog 7 Apr 2012 15:43:49 -0000 1.86
30 @@ -1,6 +1,16 @@
31 # ChangeLog for app-editors/emacs-vcs
32 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
33 -# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/ChangeLog,v 1.85 2012/04/02 17:29:27 ulm Exp $
34 +# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/ChangeLog,v 1.86 2012/04/07 15:43:49 ulm Exp $
35 +
36 +*emacs-vcs-24.0.9999-r50 (07 Apr 2012)
37 +*emacs-vcs-24.0.9999-r4 (07 Apr 2012)
38 +
39 + 07 Apr 2012; Ulrich Müller <ulm@g.o> -emacs-vcs-23.4.9999.ebuild,
40 + -emacs-vcs-24.0.9999-r3.ebuild, +emacs-vcs-24.0.9999-r4.ebuild,
41 + +emacs-vcs-24.0.9999-r50.ebuild:
42 + The upstream repository has been branched for the 24.1 release. 24.0.9999-r4
43 + is the live ebuild for the emacs-24 branch, 24.0.9999-r50 for the trunk.
44 + Remove emacs-23 live ebuild.
45
46 *emacs-vcs-24.0.95 (02 Apr 2012)
47
48
49
50
51 1.1 app-editors/emacs-vcs/emacs-vcs-24.0.9999-r50.ebuild
52
53 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.0.9999-r50.ebuild?rev=1.1&view=markup
54 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.0.9999-r50.ebuild?rev=1.1&content-type=text/plain
55
56 Index: emacs-vcs-24.0.9999-r50.ebuild
57 ===================================================================
58 # Copyright 1999-2012 Gentoo Foundation
59 # Distributed under the terms of the GNU General Public License v2
60 # $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.0.9999-r50.ebuild,v 1.1 2012/04/07 15:43:49 ulm Exp $
61
62 EAPI=4
63
64 inherit autotools elisp-common eutils flag-o-matic multilib
65
66 if [[ ${PV##*.} = 9999 ]]; then
67 EBZR_PROJECT="emacs"
68 EBZR_BRANCH="trunk"
69 EBZR_REPO_URI="bzr://bzr.savannah.gnu.org/emacs/${EBZR_BRANCH}/"
70 # "Nosmart" is much faster for initial branching.
71 EBZR_INITIAL_URI="nosmart+${EBZR_REPO_URI}"
72 inherit bzr
73 SRC_URI=""
74 else
75 SRC_URI="mirror://gentoo/emacs-${PV}.tar.gz
76 mirror://gnu-alpha/emacs/pretest/emacs-${PV}.tar.gz"
77 # FULL_VERSION keeps the full version number, which is needed in
78 # order to determine some path information correctly for copy/move
79 # operations later on
80 FULL_VERSION="${PV%%_*}"
81 S="${WORKDIR}/emacs-${FULL_VERSION}"
82 fi
83
84 DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
85 HOMEPAGE="http://www.gnu.org/software/emacs/"
86
87 LICENSE="GPL-3 FDL-1.3 BSD as-is MIT W3C unicode PSF-2"
88 SLOT="24"
89 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
90 IUSE="alsa athena dbus gconf gif gnutls gpm gsettings gtk gtk3 gzip-el hesiod imagemagick jpeg kerberos libxml2 m17n-lib motif png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm"
91
92 RDEPEND="sys-libs/ncurses
93 >=app-admin/eselect-emacs-1.2
94 net-libs/liblockfile
95 hesiod? ( net-dns/hesiod )
96 kerberos? ( virtual/krb5 )
97 alsa? ( media-libs/alsa-lib )
98 gpm? ( sys-libs/gpm )
99 dbus? ( sys-apps/dbus )
100 gnutls? ( net-libs/gnutls )
101 libxml2? ( >=dev-libs/libxml2-2.2.0 )
102 selinux? ( sys-libs/libselinux )
103 X? (
104 x11-libs/libXmu
105 x11-libs/libXt
106 x11-misc/xbitmaps
107 gconf? ( >=gnome-base/gconf-2.26.2 )
108 gsettings? ( >=dev-libs/glib-2.28.6 )
109 gif? ( media-libs/giflib )
110 jpeg? ( virtual/jpeg )
111 png? ( >=media-libs/libpng-1.4:0 )
112 svg? ( >=gnome-base/librsvg-2.0 )
113 tiff? ( media-libs/tiff )
114 xpm? ( x11-libs/libXpm )
115 imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
116 xft? (
117 media-libs/fontconfig
118 media-libs/freetype
119 x11-libs/libXft
120 m17n-lib? (
121 >=dev-libs/libotf-0.9.4
122 >=dev-libs/m17n-lib-1.5.1
123 )
124 )
125 gtk? (
126 gtk3? ( x11-libs/gtk+:3 )
127 !gtk3? ( x11-libs/gtk+:2 )
128 )
129 !gtk? (
130 Xaw3d? ( x11-libs/libXaw3d )
131 !Xaw3d? (
132 athena? ( x11-libs/libXaw )
133 !athena? ( motif? ( >=x11-libs/openmotif-2.3:0 ) )
134 )
135 )
136 )"
137
138 DEPEND="${RDEPEND}
139 alsa? ( dev-util/pkgconfig )
140 dbus? ( dev-util/pkgconfig )
141 gnutls? ( dev-util/pkgconfig )
142 libxml2? ( dev-util/pkgconfig )
143 X? ( dev-util/pkgconfig )
144 gzip-el? ( app-arch/gzip )"
145
146 RDEPEND="${RDEPEND}
147 >=app-emacs/emacs-common-gentoo-1.3[X?]"
148
149 EMACS_SUFFIX="emacs-${SLOT}"
150 SITEFILE="20${PN}-${SLOT}-gentoo.el"
151
152 src_prepare() {
153 if [[ ${PV##*.} = 9999 ]]; then
154 FULL_VERSION=$(sed -n 's/^AC_INIT(emacs,[ \t]*\([^ \t,)]*\).*/\1/p' \
155 configure.in)
156 [[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
157 einfo "Emacs branch: ${EBZR_BRANCH}"
158 einfo "Revision: ${EBZR_REVISION:-${EBZR_REVNO}}"
159 einfo "Emacs version number: ${FULL_VERSION}"
160 [[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \
161 || die "Upstream version number changed to ${FULL_VERSION}"
162 fi
163
164 if ! use alsa; then
165 # ALSA is detected even if not requested by its USE flag.
166 # Suppress it by supplying pkg-config with a wrong library name.
167 sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
168 || die "unable to sed configure.in"
169 fi
170 if ! use gzip-el; then
171 # Emacs' build system automatically detects the gzip binary and
172 # compresses el files. We don't want that so confuse it with a
173 # wrong binary name
174 sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
175 || die "unable to sed configure.in"
176 fi
177
178 AT_M4DIR=m4 eautoreconf
179 }
180
181 src_configure() {
182 ALLOWED_FLAGS=""
183 strip-flags
184
185 if use sh; then
186 replace-flags -O[1-9] -O0 #262359
187 elif use ia64; then
188 replace-flags -O[2-9] -O1 #325373
189 else
190 replace-flags -O[3-9] -O2
191 fi
192
193 local myconf
194
195 if use alsa && ! use sound; then
196 einfo "Although sound USE flag is disabled you chose to have alsa,"
197 einfo "so sound is switched on anyway."
198 myconf="${myconf} --with-sound"
199 else
200 myconf="${myconf} $(use_with sound)"
201 fi
202
203 if use X; then
204 myconf="${myconf} --with-x --without-ns"
205 myconf="${myconf} $(use_with gconf)"
206 myconf="${myconf} $(use_with gsettings)"
207 myconf="${myconf} $(use_with toolkit-scroll-bars)"
208 myconf="${myconf} $(use_with wide-int)"
209 myconf="${myconf} $(use_with gif) $(use_with jpeg)"
210 myconf="${myconf} $(use_with png) $(use_with svg rsvg)"
211 myconf="${myconf} $(use_with tiff) $(use_with xpm)"
212 myconf="${myconf} $(use_with imagemagick)"
213
214 if use xft; then
215 myconf="${myconf} --with-xft"
216 myconf="${myconf} $(use_with m17n-lib libotf)"
217 myconf="${myconf} $(use_with m17n-lib m17n-flt)"
218 else
219 myconf="${myconf} --without-xft"
220 myconf="${myconf} --without-libotf --without-m17n-flt"
221 use m17n-lib && ewarn \
222 "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
223 fi
224
225 if use gtk; then
226 einfo "Configuring to build with GIMP Toolkit (GTK+)"
227 myconf="${myconf} --with-x-toolkit=$(usev gtk3 || echo gtk)"
228 local f
229 for f in athena Xaw3d motif; do
230 use ${f} && ewarn "USE flag \"${f}\" ignored" \
231 "(superseded by \"gtk\")"
232 done
233 elif use athena || use Xaw3d; then
234 einfo "Configuring to build with Athena/Lucid toolkit"
235 myconf="${myconf} --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
236 use motif && ewarn "USE flag \"motif\" ignored" \
237 "(superseded by \"athena\" or \"Xaw3d\")"
238 elif use motif; then
239 einfo "Configuring to build with Motif toolkit"
240 myconf="${myconf} --with-x-toolkit=motif"
241 else
242 einfo "Configuring to build with no toolkit"
243 myconf="${myconf} --with-x-toolkit=no"
244 fi
245
246 ! use gtk && use gtk3 \
247 && ewarn "USE flag \"gtk3\" has no effect if \"gtk\" is not set."
248 else
249 myconf="${myconf} --without-x --without-ns"
250 fi
251
252 if [[ ${PV##*.} = 9999 ]]; then
253 # These variables are not needed for building. We add them to
254 # configure options because they are stored in the Emacs binary
255 # and available in variable "system-configuration-options".
256 myconf="${myconf} EBZR_BRANCH=${EBZR_BRANCH} EBZR_REVNO=${EBZR_REVNO}"
257 fi
258
259 # According to configure, this option is only used for GNU/Linux
260 # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
261 # out the location because $(get_libdir) does not necessarily return
262 # something that matches the host OS's libdir naming (e.g. RHEL).
263 local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
264 crtdir=${crtdir%/*}
265
266 econf \
267 --program-suffix=-${EMACS_SUFFIX} \
268 --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
269 --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
270 --with-crt-dir="${crtdir}" \
271 --with-gameuser="${GAMES_USER_DED:-games}" \
272 --without-compress-info \
273 --disable-maintainer-mode \
274 $(use_with hesiod) \
275 $(use_with kerberos) $(use_with kerberos kerberos5) \
276 $(use_with gpm) \
277 $(use_with dbus) \
278 $(use_with gnutls) \
279 $(use_with libxml2 xml2) \
280 $(use_with selinux) \
281 ${myconf}
282 }
283
284 src_compile() {
285 export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
286 if [[ ${PV##*.} = 9999 ]]; then
287 emake CC="$(tc-getCC)" bootstrap
288 # cleanup, otherwise emacs will be dumped again in src_install
289 (cd src; emake versionclean)
290 fi
291 # set last component of emacs-version to (package revision + 1)
292 touch src/emacs-${FULL_VERSION}.${PR#r}
293 emake CC="$(tc-getCC)"
294 }
295
296 src_install () {
297 local i m
298
299 emake install DESTDIR="${D}"
300
301 rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
302 || die "removing duplicate emacs executable failed"
303 mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
304 || die "moving Emacs executable failed"
305
306 # move man pages to the correct place
307 for m in "${ED}"/usr/share/man/man1/* ; do
308 mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed"
309 done
310
311 # move info dir to avoid collisions with the dir file generated by portage
312 mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
313 || die "moving info dir failed"
314 touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
315 docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
316
317 # avoid collision between slots, see bug #169033 e.g.
318 rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
319 rm -rf "${ED}"/usr/share/{applications,icons}
320 rm "${ED}"/var/lib/games/emacs/{snake,tetris}-scores
321 keepdir /var/lib/games/emacs
322
323 # remove unused <version>/site-lisp dir
324 rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
325
326 local c=";;"
327 if use source; then
328 insinto /usr/share/emacs/${FULL_VERSION}/src
329 # This is not meant to install all the source -- just the
330 # C source you might find via find-function
331 doins src/*.{c,h,m}
332 doins -r src/{m,s}
333 rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README
334 c=""
335 fi
336
337 sed 's/^X//' >"${T}/${SITEFILE}" <<-EOF
338 X
339 ;;; ${PN}-${SLOT} site-lisp configuration
340 X
341 (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
342 X ${c}(setq find-function-C-source-directory
343 X ${c} "${EPREFIX}/usr/share/emacs/${FULL_VERSION}/src")
344 X (let ((path (getenv "INFOPATH"))
345 X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
346 X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
347 X (and path
348 X ;; move Emacs Info dir before anything else in /usr/share/info
349 X (let* ((p (cons nil (split-string path ":" t))) (q p))
350 X (while (and (cdr q) (not (string-match re (cadr q))))
351 X (setq q (cdr q)))
352 X (setcdr q (cons dir (delete dir (cdr q))))
353 X (setq Info-directory-list (prune-directory-list (cdr p)))))))
354 EOF
355 elisp-site-file-install "${T}/${SITEFILE}" || die
356
357 dodoc README BUGS
358 }
359
360 pkg_preinst() {
361 # move Info dir file to correct name
362 local infodir=/usr/share/info/${EMACS_SUFFIX} f
363 if [[ -f ${ED}${infodir}/dir.orig ]]; then
364 mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
365 else
366 # this should not happen in EAPI 4
367 ewarn "Regenerating Info directory index in ${infodir} ..."
368 rm -f "${ED}"${infodir}/dir{,.*}
369 for f in "${ED}"${infodir}/*; do
370 if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
371 install-info --info-dir="${ED}"${infodir} "${f}" \
372 || die "install-info failed"
373 fi
374 done
375 fi
376 }
377
378 pkg_postinst() {
379 local f
380 for f in "${EROOT}"/var/lib/games/emacs/{snake,tetris}-scores; do
381 [[ -e ${f} ]] || touch "${f}"
382 done
383 chown "${GAMES_USER_DED:-games}" "${EROOT}"/var/lib/games/emacs
384
385 elisp-site-regen
386 eselect emacs update ifunset
387
388 if use X; then
389 elog "You need to install some fonts for Emacs."
390 elog "Installing media-fonts/font-adobe-{75,100}dpi on the X server's"
391 elog "machine would satisfy basic Emacs requirements under X11."
392 elog "See also http://www.gentoo.org/proj/en/lisp/emacs/xft.xml"
393 elog "for how to enable anti-aliased fonts."
394 elog
395 fi
396
397 elog "You can set the version to be started by /usr/bin/emacs through"
398 elog "the Emacs eselect module, which also redirects man and info pages."
399 elog "Therefore, several Emacs versions can be installed at the same time."
400 elog "\"man emacs.eselect\" for details."
401 elog
402 elog "If you upgrade from a previous major version of Emacs, then it is"
403 elog "strongly recommended that you use app-admin/emacs-updater to rebuild"
404 elog "all byte-compiled elisp files of the installed Emacs packages."
405 }
406
407 pkg_postrm() {
408 elisp-site-regen
409 eselect emacs update ifunset
410 }
411
412
413
414 1.1 app-editors/emacs-vcs/emacs-vcs-24.0.9999-r4.ebuild
415
416 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.0.9999-r4.ebuild?rev=1.1&view=markup
417 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.0.9999-r4.ebuild?rev=1.1&content-type=text/plain
418
419 Index: emacs-vcs-24.0.9999-r4.ebuild
420 ===================================================================
421 # Copyright 1999-2012 Gentoo Foundation
422 # Distributed under the terms of the GNU General Public License v2
423 # $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.0.9999-r4.ebuild,v 1.1 2012/04/07 15:43:49 ulm Exp $
424
425 EAPI=4
426
427 inherit autotools elisp-common eutils flag-o-matic multilib
428
429 if [[ ${PV##*.} = 9999 ]]; then
430 EBZR_PROJECT="emacs"
431 EBZR_BRANCH="emacs-24"
432 EBZR_REPO_URI="bzr://bzr.savannah.gnu.org/emacs/${EBZR_BRANCH}/"
433 # "Nosmart" is much faster for initial branching.
434 EBZR_INITIAL_URI="nosmart+${EBZR_REPO_URI}"
435 inherit bzr
436 SRC_URI=""
437 else
438 SRC_URI="mirror://gentoo/emacs-${PV}.tar.gz
439 mirror://gnu-alpha/emacs/pretest/emacs-${PV}.tar.gz"
440 # FULL_VERSION keeps the full version number, which is needed in
441 # order to determine some path information correctly for copy/move
442 # operations later on
443 FULL_VERSION="${PV%%_*}"
444 S="${WORKDIR}/emacs-${FULL_VERSION}"
445 fi
446
447 DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
448 HOMEPAGE="http://www.gnu.org/software/emacs/"
449
450 LICENSE="GPL-3 FDL-1.3 BSD as-is MIT W3C unicode PSF-2"
451 SLOT="24"
452 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
453 IUSE="alsa athena dbus gconf gif gnutls gpm gsettings gtk gtk3 gzip-el hesiod imagemagick jpeg kerberos libxml2 m17n-lib motif png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm"
454
455 RDEPEND="sys-libs/ncurses
456 >=app-admin/eselect-emacs-1.2
457 net-libs/liblockfile
458 hesiod? ( net-dns/hesiod )
459 kerberos? ( virtual/krb5 )
460 alsa? ( media-libs/alsa-lib )
461 gpm? ( sys-libs/gpm )
462 dbus? ( sys-apps/dbus )
463 gnutls? ( net-libs/gnutls )
464 libxml2? ( >=dev-libs/libxml2-2.2.0 )
465 selinux? ( sys-libs/libselinux )
466 X? (
467 x11-libs/libXmu
468 x11-libs/libXt
469 x11-misc/xbitmaps
470 gconf? ( >=gnome-base/gconf-2.26.2 )
471 gsettings? ( >=dev-libs/glib-2.28.6 )
472 gif? ( media-libs/giflib )
473 jpeg? ( virtual/jpeg )
474 png? ( >=media-libs/libpng-1.4:0 )
475 svg? ( >=gnome-base/librsvg-2.0 )
476 tiff? ( media-libs/tiff )
477 xpm? ( x11-libs/libXpm )
478 imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
479 xft? (
480 media-libs/fontconfig
481 media-libs/freetype
482 x11-libs/libXft
483 m17n-lib? (
484 >=dev-libs/libotf-0.9.4
485 >=dev-libs/m17n-lib-1.5.1
486 )
487 )
488 gtk? (
489 gtk3? ( x11-libs/gtk+:3 )
490 !gtk3? ( x11-libs/gtk+:2 )
491 )
492 !gtk? (
493 Xaw3d? ( x11-libs/libXaw3d )
494 !Xaw3d? (
495 athena? ( x11-libs/libXaw )
496 !athena? ( motif? ( >=x11-libs/openmotif-2.3:0 ) )
497 )
498 )
499 )"
500
501 DEPEND="${RDEPEND}
502 alsa? ( dev-util/pkgconfig )
503 dbus? ( dev-util/pkgconfig )
504 gnutls? ( dev-util/pkgconfig )
505 libxml2? ( dev-util/pkgconfig )
506 X? ( dev-util/pkgconfig )
507 gzip-el? ( app-arch/gzip )"
508
509 RDEPEND="${RDEPEND}
510 >=app-emacs/emacs-common-gentoo-1.3[X?]"
511
512 EMACS_SUFFIX="emacs-${SLOT}"
513 SITEFILE="20${PN}-${SLOT}-gentoo.el"
514
515 src_prepare() {
516 if [[ ${PV##*.} = 9999 ]]; then
517 FULL_VERSION=$(sed -n 's/^AC_INIT(emacs,[ \t]*\([^ \t,)]*\).*/\1/p' \
518 configure.in)
519 [[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
520 einfo "Emacs branch: ${EBZR_BRANCH}"
521 einfo "Revision: ${EBZR_REVISION:-${EBZR_REVNO}}"
522 einfo "Emacs version number: ${FULL_VERSION}"
523 [[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \
524 || die "Upstream version number changed to ${FULL_VERSION}"
525 fi
526
527 if ! use alsa; then
528 # ALSA is detected even if not requested by its USE flag.
529 # Suppress it by supplying pkg-config with a wrong library name.
530 sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
531 || die "unable to sed configure.in"
532 fi
533 if ! use gzip-el; then
534 # Emacs' build system automatically detects the gzip binary and
535 # compresses el files. We don't want that so confuse it with a
536 # wrong binary name
537 sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
538 || die "unable to sed configure.in"
539 fi
540
541 AT_M4DIR=m4 eautoreconf
542 }
543
544 src_configure() {
545 ALLOWED_FLAGS=""
546 strip-flags
547
548 if use sh; then
549 replace-flags -O[1-9] -O0 #262359
550 elif use ia64; then
551 replace-flags -O[2-9] -O1 #325373
552 else
553 replace-flags -O[3-9] -O2
554 fi
555
556 local myconf
557
558 if use alsa && ! use sound; then
559 einfo "Although sound USE flag is disabled you chose to have alsa,"
560 einfo "so sound is switched on anyway."
561 myconf="${myconf} --with-sound"
562 else
563 myconf="${myconf} $(use_with sound)"
564 fi
565
566 if use X; then
567 myconf="${myconf} --with-x --without-ns"
568 myconf="${myconf} $(use_with gconf)"
569 myconf="${myconf} $(use_with gsettings)"
570 myconf="${myconf} $(use_with toolkit-scroll-bars)"
571 myconf="${myconf} $(use_with wide-int)"
572 myconf="${myconf} $(use_with gif) $(use_with jpeg)"
573 myconf="${myconf} $(use_with png) $(use_with svg rsvg)"
574 myconf="${myconf} $(use_with tiff) $(use_with xpm)"
575 myconf="${myconf} $(use_with imagemagick)"
576
577 if use xft; then
578 myconf="${myconf} --with-xft"
579 myconf="${myconf} $(use_with m17n-lib libotf)"
580 myconf="${myconf} $(use_with m17n-lib m17n-flt)"
581 else
582 myconf="${myconf} --without-xft"
583 myconf="${myconf} --without-libotf --without-m17n-flt"
584 use m17n-lib && ewarn \
585 "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
586 fi
587
588 if use gtk; then
589 einfo "Configuring to build with GIMP Toolkit (GTK+)"
590 myconf="${myconf} --with-x-toolkit=$(usev gtk3 || echo gtk)"
591 local f
592 for f in athena Xaw3d motif; do
593 use ${f} && ewarn "USE flag \"${f}\" ignored" \
594 "(superseded by \"gtk\")"
595 done
596 elif use athena || use Xaw3d; then
597 einfo "Configuring to build with Athena/Lucid toolkit"
598 myconf="${myconf} --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
599 use motif && ewarn "USE flag \"motif\" ignored" \
600 "(superseded by \"athena\" or \"Xaw3d\")"
601 elif use motif; then
602 einfo "Configuring to build with Motif toolkit"
603 myconf="${myconf} --with-x-toolkit=motif"
604 else
605 einfo "Configuring to build with no toolkit"
606 myconf="${myconf} --with-x-toolkit=no"
607 fi
608
609 ! use gtk && use gtk3 \
610 && ewarn "USE flag \"gtk3\" has no effect if \"gtk\" is not set."
611 else
612 myconf="${myconf} --without-x --without-ns"
613 fi
614
615 if [[ ${PV##*.} = 9999 ]]; then
616 # These variables are not needed for building. We add them to
617 # configure options because they are stored in the Emacs binary
618 # and available in variable "system-configuration-options".
619 myconf="${myconf} EBZR_BRANCH=${EBZR_BRANCH} EBZR_REVNO=${EBZR_REVNO}"
620 fi
621
622 # According to configure, this option is only used for GNU/Linux
623 # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
624 # out the location because $(get_libdir) does not necessarily return
625 # something that matches the host OS's libdir naming (e.g. RHEL).
626 local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
627 crtdir=${crtdir%/*}
628
629 econf \
630 --program-suffix=-${EMACS_SUFFIX} \
631 --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
632 --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
633 --with-crt-dir="${crtdir}" \
634 --with-gameuser="${GAMES_USER_DED:-games}" \
635 --without-compress-info \
636 --disable-maintainer-mode \
637 $(use_with hesiod) \
638 $(use_with kerberos) $(use_with kerberos kerberos5) \
639 $(use_with gpm) \
640 $(use_with dbus) \
641 $(use_with gnutls) \
642 $(use_with libxml2 xml2) \
643 $(use_with selinux) \
644 ${myconf}
645 }
646
647 src_compile() {
648 export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
649 if [[ ${PV##*.} = 9999 ]]; then
650 emake CC="$(tc-getCC)" bootstrap
651 # cleanup, otherwise emacs will be dumped again in src_install
652 (cd src; emake versionclean)
653 fi
654 # set last component of emacs-version to (package revision + 1)
655 touch src/emacs-${FULL_VERSION}.${PR#r}
656 emake CC="$(tc-getCC)"
657 }
658
659 src_install () {
660 local i m
661
662 emake install DESTDIR="${D}"
663
664 rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
665 || die "removing duplicate emacs executable failed"
666 mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
667 || die "moving Emacs executable failed"
668
669 # move man pages to the correct place
670 for m in "${ED}"/usr/share/man/man1/* ; do
671 mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed"
672 done
673
674 # move info dir to avoid collisions with the dir file generated by portage
675 mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
676 || die "moving info dir failed"
677 touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
678 docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
679
680 # avoid collision between slots, see bug #169033 e.g.
681 rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
682 rm -rf "${ED}"/usr/share/{applications,icons}
683 rm "${ED}"/var/lib/games/emacs/{snake,tetris}-scores
684 keepdir /var/lib/games/emacs
685
686 # remove unused <version>/site-lisp dir
687 rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
688
689 local c=";;"
690 if use source; then
691 insinto /usr/share/emacs/${FULL_VERSION}/src
692 # This is not meant to install all the source -- just the
693 # C source you might find via find-function
694 doins src/*.{c,h,m}
695 doins -r src/{m,s}
696 rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README
697 c=""
698 fi
699
700 sed 's/^X//' >"${T}/${SITEFILE}" <<-EOF
701 X
702 ;;; ${PN}-${SLOT} site-lisp configuration
703 X
704 (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
705 X ${c}(setq find-function-C-source-directory
706 X ${c} "${EPREFIX}/usr/share/emacs/${FULL_VERSION}/src")
707 X (let ((path (getenv "INFOPATH"))
708 X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
709 X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
710 X (and path
711 X ;; move Emacs Info dir before anything else in /usr/share/info
712 X (let* ((p (cons nil (split-string path ":" t))) (q p))
713 X (while (and (cdr q) (not (string-match re (cadr q))))
714 X (setq q (cdr q)))
715 X (setcdr q (cons dir (delete dir (cdr q))))
716 X (setq Info-directory-list (prune-directory-list (cdr p)))))))
717 EOF
718 elisp-site-file-install "${T}/${SITEFILE}" || die
719
720 dodoc README BUGS
721 }
722
723 pkg_preinst() {
724 # move Info dir file to correct name
725 local infodir=/usr/share/info/${EMACS_SUFFIX} f
726 if [[ -f ${ED}${infodir}/dir.orig ]]; then
727 mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
728 else
729 # this should not happen in EAPI 4
730 ewarn "Regenerating Info directory index in ${infodir} ..."
731 rm -f "${ED}"${infodir}/dir{,.*}
732 for f in "${ED}"${infodir}/*; do
733 if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
734 install-info --info-dir="${ED}"${infodir} "${f}" \
735 || die "install-info failed"
736 fi
737 done
738 fi
739 }
740
741 pkg_postinst() {
742 local f
743 for f in "${EROOT}"/var/lib/games/emacs/{snake,tetris}-scores; do
744 [[ -e ${f} ]] || touch "${f}"
745 done
746 chown "${GAMES_USER_DED:-games}" "${EROOT}"/var/lib/games/emacs
747
748 elisp-site-regen
749 eselect emacs update ifunset
750
751 if use X; then
752 elog "You need to install some fonts for Emacs."
753 elog "Installing media-fonts/font-adobe-{75,100}dpi on the X server's"
754 elog "machine would satisfy basic Emacs requirements under X11."
755 elog "See also http://www.gentoo.org/proj/en/lisp/emacs/xft.xml"
756 elog "for how to enable anti-aliased fonts."
757 elog
758 fi
759
760 elog "You can set the version to be started by /usr/bin/emacs through"
761 elog "the Emacs eselect module, which also redirects man and info pages."
762 elog "Therefore, several Emacs versions can be installed at the same time."
763 elog "\"man emacs.eselect\" for details."
764 elog
765 elog "If you upgrade from a previous major version of Emacs, then it is"
766 elog "strongly recommended that you use app-admin/emacs-updater to rebuild"
767 elog "all byte-compiled elisp files of the installed Emacs packages."
768 }
769
770 pkg_postrm() {
771 elisp-site-regen
772 eselect emacs update ifunset
773 }