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