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