Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/emacs/
Date: Thu, 23 Aug 2018 17:08:54
Message-Id: 1535044117.07ff1a993ea0da2af4f00320d9c49ca1dd2db057.ulm@gentoo
1 commit: 07ff1a993ea0da2af4f00320d9c49ca1dd2db057
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 23 16:48:02 2018 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 23 17:08:37 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07ff1a99
7
8 app-editors/emacs: Update remaining slots to EAPI 7.
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11
12 app-editors/emacs/emacs-23.4-r18.ebuild | 366 +++++++++++++++++++++++++++++++
13 app-editors/emacs/emacs-24.5-r6.ebuild | 358 ++++++++++++++++++++++++++++++
14 app-editors/emacs/emacs-25.3-r5.ebuild | 372 ++++++++++++++++++++++++++++++++
15 3 files changed, 1096 insertions(+)
16
17 diff --git a/app-editors/emacs/emacs-23.4-r18.ebuild b/app-editors/emacs/emacs-23.4-r18.ebuild
18 new file mode 100644
19 index 00000000000..dca287c47b0
20 --- /dev/null
21 +++ b/app-editors/emacs/emacs-23.4-r18.ebuild
22 @@ -0,0 +1,366 @@
23 +# Copyright 1999-2018 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +WANT_AUTOMAKE="none"
28 +
29 +inherit autotools elisp-common flag-o-matic multilib readme.gentoo-r1
30 +
31 +DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
32 +HOMEPAGE="https://www.gnu.org/software/emacs/"
33 +SRC_URI="mirror://gnu/emacs/${P}.tar.bz2
34 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-21.tar.xz"
35 +
36 +LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
37 +SLOT="23"
38 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
39 +IUSE="alsa aqua athena dbus games gconf gif gpm gtk gzip-el jpeg kerberos livecd m17n-lib motif png sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm"
40 +REQUIRED_USE="?? ( aqua X )"
41 +
42 +RDEPEND="sys-libs/ncurses:0=
43 + >=app-eselect/eselect-emacs-1.16
44 + >=app-emacs/emacs-common-gentoo-1.5[games?,X?]
45 + net-libs/liblockfile
46 + kerberos? ( virtual/krb5 )
47 + alsa? ( media-libs/alsa-lib )
48 + gpm? ( sys-libs/gpm )
49 + dbus? ( sys-apps/dbus )
50 + X? (
51 + x11-libs/libICE
52 + x11-libs/libSM
53 + x11-libs/libX11
54 + x11-misc/xbitmaps
55 + gconf? ( >=gnome-base/gconf-2.26.2 )
56 + gif? ( media-libs/giflib:0= )
57 + jpeg? ( virtual/jpeg:0= )
58 + png? ( >=media-libs/libpng-1.4:0= )
59 + svg? ( >=gnome-base/librsvg-2.0 )
60 + tiff? ( media-libs/tiff:0 )
61 + xpm? ( x11-libs/libXpm )
62 + xft? (
63 + media-libs/fontconfig
64 + media-libs/freetype
65 + x11-libs/libXft
66 + x11-libs/libXrender
67 + m17n-lib? (
68 + >=dev-libs/libotf-0.9.4
69 + >=dev-libs/m17n-lib-1.5.1
70 + )
71 + )
72 + gtk? ( x11-libs/gtk+:2 )
73 + !gtk? (
74 + motif? (
75 + >=x11-libs/motif-2.3:0
76 + x11-libs/libXpm
77 + x11-libs/libXext
78 + x11-libs/libXmu
79 + x11-libs/libXt
80 + )
81 + !motif? (
82 + Xaw3d? (
83 + x11-libs/libXaw3d
84 + x11-libs/libXext
85 + x11-libs/libXmu
86 + x11-libs/libXt
87 + )
88 + !Xaw3d? ( athena? (
89 + x11-libs/libXaw
90 + x11-libs/libXext
91 + x11-libs/libXmu
92 + x11-libs/libXt
93 + ) )
94 + )
95 + )
96 + )"
97 +
98 +DEPEND="${RDEPEND}
99 + X? ( x11-base/xorg-proto )"
100 +
101 +BDEPEND="alsa? ( virtual/pkgconfig )
102 + dbus? ( virtual/pkgconfig )
103 + X? ( virtual/pkgconfig )
104 + gzip-el? ( app-arch/gzip )"
105 +# pax_kernel? ( sys-apps/attr )
106 +
107 +RDEPEND="${RDEPEND}
108 + !<app-editors/emacs-vcs-${PV}"
109 +
110 +EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
111 +SITEFILE="20${PN}-${SLOT}-gentoo.el"
112 +# FULL_VERSION keeps the full version number, which is needed in
113 +# order to determine some path information correctly for copy/move
114 +# operations later on
115 +FULL_VERSION="${PV%%_*}"
116 +S="${WORKDIR}/emacs-${FULL_VERSION}"
117 +
118 +src_prepare() {
119 + eapply ../patch
120 + eapply_user
121 +
122 + sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
123 + || die "unable to sed ctags.1"
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 + mv configure.in configure.ac || die
140 + eautoreconf
141 + touch src/stamp-h.in || die
142 +}
143 +
144 +src_configure() {
145 + strip-flags
146 + filter-flags -fstrict-aliasing -pie
147 + append-flags $(test-flags -fno-strict-aliasing)
148 + append-ldflags $(test-flags -no-pie) #639568
149 +
150 + if use sh; then
151 + replace-flags "-O[1-9]" -O0 #262359
152 + elif use ia64; then
153 + replace-flags "-O[2-9]" -O1 #325373
154 + else
155 + replace-flags "-O[3-9]" -O2
156 + fi
157 +
158 + # Don't trigger a floating point exception for NaNs on alpha
159 + use alpha && append-flags -mieee
160 +
161 + local myconf
162 +
163 + if use alsa && ! use sound; then
164 + einfo "Although sound USE flag is disabled you chose to have alsa,"
165 + einfo "so sound is switched on anyway."
166 + myconf+=" --with-sound"
167 + else
168 + myconf+=" $(use_with sound)"
169 + fi
170 +
171 + if use X; then
172 + myconf+=" --with-x --without-ns"
173 + myconf+=" $(use_with gconf)"
174 + myconf+=" $(use_with toolkit-scroll-bars)"
175 + myconf+=" $(use_with gif)"
176 + myconf+=" $(use_with jpeg)"
177 + myconf+=" $(use_with png)"
178 + myconf+=" $(use_with svg rsvg)"
179 + myconf+=" $(use_with tiff)"
180 + myconf+=" $(use_with xpm)"
181 +
182 + if use xft; then
183 + myconf+=" --with-xft"
184 + myconf+=" $(use_with m17n-lib libotf)"
185 + myconf+=" $(use_with m17n-lib m17n-flt)"
186 + else
187 + myconf+=" --without-xft"
188 + myconf+=" --without-libotf --without-m17n-flt"
189 + use m17n-lib && ewarn \
190 + "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
191 + fi
192 +
193 + # GTK+ is the default toolkit if USE=gtk is chosen with other
194 + # possibilities. Emacs upstream thinks this should be standard
195 + # policy on all distributions
196 + local f
197 + if use gtk; then
198 + einfo "Configuring to build with GIMP Toolkit (GTK+)"
199 + myconf+=" --with-x-toolkit=gtk"
200 + for f in motif Xaw3d athena; do
201 + use ${f} && ewarn \
202 + "USE flag \"${f}\" has no effect if \"gtk\" is set."
203 + done
204 + elif use motif; then
205 + einfo "Configuring to build with Motif toolkit"
206 + myconf+=" --with-x-toolkit=motif"
207 + for f in Xaw3d athena; do
208 + use ${f} && ewarn \
209 + "USE flag \"${f}\" has no effect if \"motif\" is set."
210 + done
211 + elif use athena || use Xaw3d; then
212 + einfo "Configuring to build with Athena/Lucid toolkit"
213 + myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
214 + else
215 + einfo "Configuring to build with no toolkit"
216 + myconf+=" --with-x-toolkit=no"
217 + fi
218 + elif use aqua; then
219 + einfo "Configuring to build with Nextstep (Cocoa) support"
220 + myconf+=" --with-ns --disable-ns-self-contained"
221 + myconf+=" --without-x"
222 + else
223 + myconf+=" --without-x --without-ns"
224 + fi
225 +
226 + # According to configure, this option is only used for GNU/Linux
227 + # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
228 + # out the location because $(get_libdir) does not necessarily return
229 + # something that matches the host OS's libdir naming (e.g. RHEL).
230 + local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
231 + crtdir=${crtdir%/*}
232 +
233 + econf \
234 + --program-suffix="-${EMACS_SUFFIX}" \
235 + --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
236 + --localstatedir="${EPREFIX}"/var \
237 + --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
238 + --with-crt-dir="${crtdir}" \
239 + --with-gameuser=":gamestat" \
240 + --without-hesiod \
241 + $(use_with kerberos) $(use_with kerberos kerberos5) \
242 + $(use_with gpm) \
243 + $(use_with dbus) \
244 + ${myconf}
245 +}
246 +
247 +src_compile() {
248 + # Disable sandbox when dumping. For the unbelievers, see bug #131505
249 + emake CC="$(tc-getCC)" \
250 + AR="$(tc-getAR) cq" \
251 + RANLIB="$(tc-getRANLIB)" \
252 + RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
253 +}
254 +
255 +src_install () {
256 + emake DESTDIR="${D}" install
257 +
258 + rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
259 + || die "removing duplicate emacs executable failed"
260 + mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
261 + || die "moving emacs executable failed"
262 +
263 + # move man pages to the correct place
264 + local m
265 + mv "${ED}"/usr/share/man/man1/{emacs,${EMACS_SUFFIX}}.1 \
266 + || die "moving emacs man page failed"
267 + for m in b2m ctags ebrowse emacsclient etags grep-changelog rcs-checkin; do
268 + mv "${ED}"/usr/share/man/man1/${m}{,-${EMACS_SUFFIX}}.1 \
269 + || die "moving ${m} man page failed"
270 + done
271 +
272 + # move info dir to avoid collisions with the dir file generated by portage
273 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
274 + || die "moving info dir failed"
275 + touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
276 + docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
277 +
278 + # avoid collision between slots, see bug #169033 e.g.
279 + rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
280 + rm -rf "${ED}"/usr/share/{applications,icons}
281 + rm -rf "${ED}"/var
282 +
283 + # remove unused <version>/site-lisp dir
284 + rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
285 +
286 + # remove COPYING file (except for etc/COPYING used by describe-copying)
287 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
288 +
289 + local cdir
290 + if use source; then
291 + cdir="/usr/share/emacs/${FULL_VERSION}/src"
292 + insinto "${cdir}"
293 + # This is not meant to install all the source -- just the
294 + # C source you might find via find-function
295 + doins src/*.{c,h,m}
296 + doins -r src/{m,s}
297 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/Makefile.c
298 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README
299 + elif has installsources ${FEATURES}; then
300 + cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
301 + fi
302 +
303 + sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF || die
304 + X
305 + ;;; ${PN}-${SLOT} site-lisp configuration
306 + X
307 + (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
308 + Y (setq find-function-C-source-directory
309 + Y "${EPREFIX}${cdir}")
310 + X (let ((path (getenv "INFOPATH"))
311 + X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
312 + X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
313 + X (and path
314 + X ;; move Emacs Info dir before anything else in /usr/share/info
315 + X (let* ((p (cons nil (split-string path ":" t))) (q p))
316 + X (while (and (cdr q) (not (string-match re (cadr q))))
317 + X (setq q (cdr q)))
318 + X (setcdr q (cons dir (delete dir (cdr q))))
319 + X (setq Info-directory-list (prune-directory-list (cdr p)))))))
320 + EOF
321 + elisp-site-file-install "${T}/${SITEFILE}" || die
322 +
323 + dodoc README BUGS
324 +
325 + if use aqua; then
326 + dodir /Applications/Gentoo
327 + rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
328 + mv nextstep/Emacs.app \
329 + "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
330 + fi
331 +
332 + DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
333 + through the Emacs eselect module, which also redirects man and info
334 + pages. Therefore, several Emacs versions can be installed at the
335 + same time. \"man emacs.eselect\" for details.
336 + \\n\\nIf you upgrade from a previous major version of Emacs, then
337 + it is strongly recommended that you use app-admin/emacs-updater
338 + to rebuild all byte-compiled elisp files of the installed Emacs
339 + packages."
340 + use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
341 + Installing media-fonts/font-adobe-{75,100}dpi on the X server's
342 + machine would satisfy basic Emacs requirements under X11.
343 + See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
344 + for how to enable anti-aliased fonts."
345 + use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
346 + \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
347 + it into /Applications by yourself."
348 + readme.gentoo_create_doc
349 +}
350 +
351 +pkg_preinst() {
352 + # move Info dir file to correct name
353 + local infodir=/usr/share/info/${EMACS_SUFFIX} f
354 + if [[ -f ${ED}${infodir}/dir.orig ]]; then
355 + mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
356 + elif [[ -d "${ED}"${infodir} ]]; then
357 + # this should not happen in EAPI 4
358 + ewarn "Regenerating Info directory index in ${infodir} ..."
359 + rm -f "${ED}"${infodir}/dir{,.*}
360 + for f in "${ED}"${infodir}/*; do
361 + if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
362 + install-info --info-dir="${ED}"${infodir} "${f}" \
363 + || die "install-info failed"
364 + fi
365 + done
366 + fi
367 +}
368 +
369 +pkg_postinst() {
370 + elisp-site-regen
371 + readme.gentoo_print_elog
372 +
373 + if use livecd; then
374 + # force an update of the emacs symlink for the livecd/dvd,
375 + # because some microemacs packages set it with USE=livecd
376 + eselect emacs update
377 + elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
378 + # refresh symlinks in case any installed files have changed
379 + eselect emacs set ${EMACS_SUFFIX}
380 + else
381 + eselect emacs update ifunset
382 + fi
383 +}
384 +
385 +pkg_postrm() {
386 + elisp-site-regen
387 + eselect emacs update ifunset
388 +}
389
390 diff --git a/app-editors/emacs/emacs-24.5-r6.ebuild b/app-editors/emacs/emacs-24.5-r6.ebuild
391 new file mode 100644
392 index 00000000000..60e4ab07cbd
393 --- /dev/null
394 +++ b/app-editors/emacs/emacs-24.5-r6.ebuild
395 @@ -0,0 +1,358 @@
396 +# Copyright 1999-2018 Gentoo Foundation
397 +# Distributed under the terms of the GNU General Public License v2
398 +
399 +EAPI=7
400 +
401 +inherit autotools elisp-common eutils flag-o-matic multilib readme.gentoo-r1
402 +
403 +DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
404 +HOMEPAGE="https://www.gnu.org/software/emacs/"
405 +SRC_URI="mirror://gnu/emacs/${P}.tar.xz
406 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-4.tar.xz"
407 +
408 +LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
409 +SLOT="24"
410 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
411 +IUSE="acl alsa aqua athena dbus games gconf gfile gif gpm gsettings gtk +gtk3 gzip-el imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
412 +REQUIRED_USE="?? ( aqua X )"
413 +
414 +RDEPEND="sys-libs/ncurses:0=
415 + >=app-eselect/eselect-emacs-1.16
416 + >=app-emacs/emacs-common-gentoo-1.5[games?,X?]
417 + net-libs/liblockfile
418 + acl? ( virtual/acl )
419 + alsa? ( media-libs/alsa-lib )
420 + dbus? ( sys-apps/dbus )
421 + gpm? ( sys-libs/gpm )
422 + !inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
423 + kerberos? ( virtual/krb5 )
424 + libxml2? ( >=dev-libs/libxml2-2.2.0 )
425 + selinux? ( sys-libs/libselinux )
426 + ssl? ( net-libs/gnutls:0= )
427 + zlib? ( sys-libs/zlib )
428 + X? (
429 + x11-libs/libICE
430 + x11-libs/libSM
431 + x11-libs/libX11
432 + x11-libs/libXext
433 + x11-libs/libXinerama
434 + x11-libs/libXrandr
435 + x11-misc/xbitmaps
436 + gconf? ( >=gnome-base/gconf-2.26.2 )
437 + gsettings? ( >=dev-libs/glib-2.28.6 )
438 + gif? ( media-libs/giflib:0= )
439 + jpeg? ( virtual/jpeg:0= )
440 + png? ( >=media-libs/libpng-1.4:0= )
441 + svg? ( >=gnome-base/librsvg-2.0 )
442 + tiff? ( media-libs/tiff:0 )
443 + xpm? ( x11-libs/libXpm )
444 + imagemagick? ( >=media-gfx/imagemagick-6.6.2:0= )
445 + xft? (
446 + media-libs/fontconfig
447 + media-libs/freetype
448 + x11-libs/libXft
449 + x11-libs/libXrender
450 + m17n-lib? (
451 + >=dev-libs/libotf-0.9.4
452 + >=dev-libs/m17n-lib-1.5.1
453 + )
454 + )
455 + gtk? (
456 + gtk3? ( x11-libs/gtk+:3 )
457 + !gtk3? ( x11-libs/gtk+:2 )
458 + )
459 + !gtk? (
460 + motif? (
461 + >=x11-libs/motif-2.3:0
462 + x11-libs/libXpm
463 + x11-libs/libXmu
464 + x11-libs/libXt
465 + )
466 + !motif? (
467 + Xaw3d? (
468 + x11-libs/libXaw3d
469 + x11-libs/libXmu
470 + x11-libs/libXt
471 + )
472 + !Xaw3d? ( athena? (
473 + x11-libs/libXaw
474 + x11-libs/libXmu
475 + x11-libs/libXt
476 + ) )
477 + )
478 + )
479 + )"
480 +
481 +DEPEND="${RDEPEND}
482 + X? ( x11-base/xorg-proto )"
483 +
484 +BDEPEND="virtual/pkgconfig
485 + gzip-el? ( app-arch/gzip )"
486 +# pax_kernel? ( sys-apps/attr )
487 +
488 +RDEPEND="${RDEPEND}
489 + !<app-editors/emacs-vcs-${PV}"
490 +
491 +EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
492 +SITEFILE="20${PN}-${SLOT}-gentoo.el"
493 +# FULL_VERSION keeps the full version number, which is needed in
494 +# order to determine some path information correctly for copy/move
495 +# operations later on
496 +FULL_VERSION="${PV%%_*}"
497 +S="${WORKDIR}/emacs-${FULL_VERSION}"
498 +
499 +src_prepare() {
500 + eapply ../patch
501 + eapply_user
502 +
503 + # Fix filename reference in redirected man page
504 + sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
505 + || die "unable to sed ctags.1"
506 +
507 + AT_M4DIR=m4 eautoreconf
508 + touch src/stamp-h.in || die
509 +}
510 +
511 +src_configure() {
512 + strip-flags
513 + filter-flags -pie #526948
514 + append-ldflags $(test-flags -no-pie) #639570
515 +
516 + if use sh; then
517 + replace-flags "-O[1-9]" -O0 #262359
518 + elif use ia64; then
519 + replace-flags "-O[2-9]" -O1 #325373
520 + else
521 + replace-flags "-O[3-9]" -O2
522 + fi
523 +
524 + # Don't trigger a floating point exception for NaNs on alpha
525 + use alpha && append-flags -mieee
526 +
527 + local myconf
528 +
529 + if use alsa; then
530 + use sound || ewarn \
531 + "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
532 + myconf+=" --with-sound=alsa"
533 + else
534 + myconf+=" --with-sound=$(usex sound oss)"
535 + fi
536 +
537 + if use X; then
538 + myconf+=" --with-x --without-ns"
539 + myconf+=" $(use_with gconf)"
540 + myconf+=" $(use_with gsettings)"
541 + myconf+=" $(use_with toolkit-scroll-bars)"
542 + myconf+=" $(use_with gif)"
543 + myconf+=" $(use_with jpeg)"
544 + myconf+=" $(use_with png)"
545 + myconf+=" $(use_with svg rsvg)"
546 + myconf+=" $(use_with tiff)"
547 + myconf+=" $(use_with xpm)"
548 + myconf+=" $(use_with imagemagick)"
549 +
550 + if use xft; then
551 + myconf+=" --with-xft"
552 + myconf+=" $(use_with m17n-lib libotf)"
553 + myconf+=" $(use_with m17n-lib m17n-flt)"
554 + else
555 + myconf+=" --without-xft"
556 + myconf+=" --without-libotf --without-m17n-flt"
557 + use m17n-lib && ewarn \
558 + "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
559 + fi
560 +
561 + local f line
562 + if use gtk; then
563 + einfo "Configuring to build with GIMP Toolkit (GTK+)"
564 + while read line; do ewarn "${line}"; done <<-EOF
565 + Your version of GTK+ will have problems with closing open
566 + displays. This is no problem if you just use one display, but
567 + if you use more than one and close one of them Emacs may crash.
568 + See <https://bugzilla.gnome.org/show_bug.cgi?id=85715>.
569 + If you intend to use more than one display, then it is strongly
570 + recommended that you compile Emacs with the Athena/Lucid or the
571 + Motif toolkit instead.
572 + EOF
573 + myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
574 + for f in motif Xaw3d athena; do
575 + use ${f} && ewarn \
576 + "USE flag \"${f}\" has no effect if \"gtk\" is set."
577 + done
578 + elif use motif; then
579 + einfo "Configuring to build with Motif toolkit"
580 + myconf+=" --with-x-toolkit=motif"
581 + for f in Xaw3d athena; do
582 + use ${f} && ewarn \
583 + "USE flag \"${f}\" has no effect if \"motif\" is set."
584 + done
585 + elif use athena || use Xaw3d; then
586 + einfo "Configuring to build with Athena/Lucid toolkit"
587 + myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
588 + else
589 + einfo "Configuring to build with no toolkit"
590 + myconf+=" --with-x-toolkit=no"
591 + fi
592 + elif use aqua; then
593 + einfo "Configuring to build with Nextstep (Cocoa) support"
594 + myconf+=" --with-ns --disable-ns-self-contained"
595 + myconf+=" --without-x"
596 + else
597 + myconf+=" --without-x --without-ns"
598 + fi
599 +
600 + econf \
601 + --program-suffix="-${EMACS_SUFFIX}" \
602 + --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
603 + --localstatedir="${EPREFIX}"/var \
604 + --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
605 + --with-gameuser=":gamestat" \
606 + --without-compress-install \
607 + --without-hesiod \
608 + --with-file-notification=$(usev inotify || usev gfile || echo no) \
609 + $(use_enable acl) \
610 + $(use_with dbus) \
611 + $(use_with gpm) \
612 + $(use_with kerberos) $(use_with kerberos kerberos5) \
613 + $(use_with libxml2 xml2) \
614 + $(use_with selinux) \
615 + $(use_with ssl gnutls) \
616 + $(use_with wide-int) \
617 + $(use_with zlib) \
618 + ${myconf}
619 +}
620 +
621 +src_compile() {
622 + # Disable sandbox when dumping. For the unbelievers, see bug #131505
623 + emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
624 +}
625 +
626 +src_install () {
627 + emake DESTDIR="${D}" NO_BIN_LINK=t install
628 +
629 + mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
630 + || die "moving emacs executable failed"
631 + mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
632 + || die "moving emacs man page failed"
633 +
634 + # move info dir to avoid collisions with the dir file generated by portage
635 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
636 + || die "moving info dir failed"
637 + touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
638 + docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
639 +
640 + # avoid collision between slots, see bug #169033 e.g.
641 + rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
642 + rm -rf "${ED}"/usr/share/{applications,icons}
643 + rm -rf "${ED}"/var
644 +
645 + # remove unused <version>/site-lisp dir
646 + rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
647 +
648 + # remove COPYING file (except for etc/COPYING used by describe-copying)
649 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
650 +
651 + if use gzip-el; then
652 + # compress .el files when a corresponding .elc exists
653 + find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
654 + -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
655 + assert "gzip .el failed"
656 + fi
657 +
658 + local cdir
659 + if use source; then
660 + cdir="/usr/share/emacs/${FULL_VERSION}/src"
661 + insinto "${cdir}"
662 + # This is not meant to install all the source -- just the
663 + # C source you might find via find-function
664 + doins src/*.{c,h,m}
665 + elif has installsources ${FEATURES}; then
666 + cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
667 + fi
668 +
669 + sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF || die
670 + X
671 + ;;; ${PN}-${SLOT} site-lisp configuration
672 + X
673 + (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
674 + Y (setq find-function-C-source-directory
675 + Y "${EPREFIX}${cdir}")
676 + X (let ((path (getenv "INFOPATH"))
677 + X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
678 + X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
679 + X (and path
680 + X ;; move Emacs Info dir before anything else in /usr/share/info
681 + X (let* ((p (cons nil (split-string path ":" t))) (q p))
682 + X (while (and (cdr q) (not (string-match re (cadr q))))
683 + X (setq q (cdr q)))
684 + X (setcdr q (cons dir (delete dir (cdr q))))
685 + X (setq Info-directory-list (prune-directory-list (cdr p)))))))
686 + EOF
687 + elisp-site-file-install "${T}/${SITEFILE}" || die
688 +
689 + dodoc README BUGS
690 +
691 + if use aqua; then
692 + dodir /Applications/Gentoo
693 + rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
694 + mv nextstep/Emacs.app \
695 + "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
696 + fi
697 +
698 + DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
699 + through the Emacs eselect module, which also redirects man and info
700 + pages. Therefore, several Emacs versions can be installed at the
701 + same time. \"man emacs.eselect\" for details.
702 + \\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
703 + strongly recommended that you use app-admin/emacs-updater to rebuild
704 + all byte-compiled elisp files of the installed Emacs packages."
705 + use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
706 + Installing media-fonts/font-adobe-{75,100}dpi on the X server's
707 + machine would satisfy basic Emacs requirements under X11.
708 + See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
709 + for how to enable anti-aliased fonts."
710 + use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
711 + \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
712 + it into /Applications by yourself."
713 + readme.gentoo_create_doc
714 +}
715 +
716 +pkg_preinst() {
717 + # move Info dir file to correct name
718 + local infodir=/usr/share/info/${EMACS_SUFFIX} f
719 + if [[ -f ${ED}${infodir}/dir.orig ]]; then
720 + mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
721 + elif [[ -d "${ED}"${infodir} ]]; then
722 + # this should not happen in EAPI 4
723 + ewarn "Regenerating Info directory index in ${infodir} ..."
724 + rm -f "${ED}"${infodir}/dir{,.*}
725 + for f in "${ED}"${infodir}/*; do
726 + if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
727 + install-info --info-dir="${ED}"${infodir} "${f}" \
728 + || die "install-info failed"
729 + fi
730 + done
731 + fi
732 +}
733 +
734 +pkg_postinst() {
735 + elisp-site-regen
736 + readme.gentoo_print_elog
737 +
738 + if use livecd; then
739 + # force an update of the emacs symlink for the livecd/dvd,
740 + # because some microemacs packages set it with USE=livecd
741 + eselect emacs update
742 + elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
743 + # refresh symlinks in case any installed files have changed
744 + eselect emacs set ${EMACS_SUFFIX}
745 + else
746 + eselect emacs update ifunset
747 + fi
748 +}
749 +
750 +pkg_postrm() {
751 + elisp-site-regen
752 + eselect emacs update ifunset
753 +}
754
755 diff --git a/app-editors/emacs/emacs-25.3-r5.ebuild b/app-editors/emacs/emacs-25.3-r5.ebuild
756 new file mode 100644
757 index 00000000000..7d43a6b1ab3
758 --- /dev/null
759 +++ b/app-editors/emacs/emacs-25.3-r5.ebuild
760 @@ -0,0 +1,372 @@
761 +# Copyright 1999-2018 Gentoo Foundation
762 +# Distributed under the terms of the GNU General Public License v2
763 +
764 +EAPI=7
765 +
766 +inherit elisp-common flag-o-matic multilib readme.gentoo-r1
767 +
768 +DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
769 +HOMEPAGE="https://www.gnu.org/software/emacs/"
770 +SRC_URI="mirror://gnu/emacs/${P}.tar.xz
771 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-1.tar.xz"
772 +
773 +LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
774 +SLOT="25"
775 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
776 +IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif gpm gsettings gtk +gtk3 gzip-el imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
777 +REQUIRED_USE="?? ( aqua X )"
778 +
779 +RDEPEND="sys-libs/ncurses:0=
780 + >=app-eselect/eselect-emacs-1.16
781 + >=app-emacs/emacs-common-gentoo-1.5[games?,X?]
782 + net-libs/liblockfile
783 + acl? ( virtual/acl )
784 + alsa? ( media-libs/alsa-lib )
785 + dbus? ( sys-apps/dbus )
786 + gpm? ( sys-libs/gpm )
787 + !inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
788 + kerberos? ( virtual/krb5 )
789 + libxml2? ( >=dev-libs/libxml2-2.2.0 )
790 + selinux? ( sys-libs/libselinux )
791 + ssl? ( net-libs/gnutls:0= )
792 + zlib? ( sys-libs/zlib )
793 + X? (
794 + x11-libs/libICE
795 + x11-libs/libSM
796 + x11-libs/libX11
797 + x11-libs/libXext
798 + x11-libs/libXfixes
799 + x11-libs/libXinerama
800 + x11-libs/libXrandr
801 + x11-libs/libxcb
802 + x11-misc/xbitmaps
803 + gconf? ( >=gnome-base/gconf-2.26.2 )
804 + gsettings? ( >=dev-libs/glib-2.28.6 )
805 + gif? ( media-libs/giflib:0= )
806 + jpeg? ( virtual/jpeg:0= )
807 + png? ( >=media-libs/libpng-1.4:0= )
808 + svg? ( >=gnome-base/librsvg-2.0 )
809 + tiff? ( media-libs/tiff:0 )
810 + xpm? ( x11-libs/libXpm )
811 + imagemagick? ( >=media-gfx/imagemagick-6.6.2:0= )
812 + xft? (
813 + media-libs/fontconfig
814 + media-libs/freetype
815 + x11-libs/libXft
816 + x11-libs/libXrender
817 + cairo? ( >=x11-libs/cairo-1.12.18 )
818 + m17n-lib? (
819 + >=dev-libs/libotf-0.9.4
820 + >=dev-libs/m17n-lib-1.5.1
821 + )
822 + )
823 + gtk? (
824 + gtk3? ( x11-libs/gtk+:3 )
825 + !gtk3? ( x11-libs/gtk+:2 )
826 + )
827 + !gtk? (
828 + motif? (
829 + >=x11-libs/motif-2.3:0
830 + x11-libs/libXpm
831 + x11-libs/libXmu
832 + x11-libs/libXt
833 + )
834 + !motif? (
835 + Xaw3d? (
836 + x11-libs/libXaw3d
837 + x11-libs/libXmu
838 + x11-libs/libXt
839 + )
840 + !Xaw3d? ( athena? (
841 + x11-libs/libXaw
842 + x11-libs/libXmu
843 + x11-libs/libXt
844 + ) )
845 + )
846 + )
847 + )"
848 +
849 +DEPEND="${RDEPEND}
850 + X? ( x11-base/xorg-proto )"
851 +
852 +BDEPEND="virtual/pkgconfig
853 + gzip-el? ( app-arch/gzip )"
854 +# pax_kernel? ( sys-apps/attr )
855 +
856 +RDEPEND="${RDEPEND}
857 + !<app-editors/emacs-vcs-${PV}"
858 +
859 +EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
860 +SITEFILE="20${PN}-${SLOT}-gentoo.el"
861 +# FULL_VERSION keeps the full version number, which is needed in
862 +# order to determine some path information correctly for copy/move
863 +# operations later on
864 +FULL_VERSION="${PV%%_*}"
865 +S="${WORKDIR}/emacs-${FULL_VERSION}"
866 +
867 +src_prepare() {
868 + eapply ../patch
869 + eapply_user
870 +
871 + # Fix filename reference in redirected man page
872 + sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
873 + || die "unable to sed ctags.1"
874 +
875 + #AT_M4DIR=m4 eautoreconf
876 + #touch src/stamp-h.in || die
877 +}
878 +
879 +src_configure() {
880 + strip-flags
881 + filter-flags -pie #526948
882 +
883 + if use sh; then
884 + replace-flags "-O[1-9]" -O0 #262359
885 + elif use ia64; then
886 + replace-flags "-O[2-9]" -O1 #325373
887 + else
888 + replace-flags "-O[3-9]" -O2
889 + fi
890 +
891 + # Don't trigger a floating point exception for NaNs on alpha
892 + use alpha && append-flags -mieee
893 +
894 + local myconf
895 +
896 + if use alsa; then
897 + use sound || ewarn \
898 + "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
899 + myconf+=" --with-sound=alsa"
900 + else
901 + myconf+=" --with-sound=$(usex sound oss)"
902 + fi
903 +
904 + if use X; then
905 + myconf+=" --with-x --without-ns"
906 + myconf+=" $(use_with gconf)"
907 + myconf+=" $(use_with gsettings)"
908 + myconf+=" $(use_with toolkit-scroll-bars)"
909 + myconf+=" $(use_with gif)"
910 + myconf+=" $(use_with jpeg)"
911 + myconf+=" $(use_with png)"
912 + myconf+=" $(use_with svg rsvg)"
913 + myconf+=" $(use_with tiff)"
914 + myconf+=" $(use_with xpm)"
915 + myconf+=" $(use_with imagemagick)"
916 +
917 + if use xft; then
918 + myconf+=" --with-xft"
919 + myconf+=" $(use_with cairo)"
920 + myconf+=" $(use_with m17n-lib libotf)"
921 + myconf+=" $(use_with m17n-lib m17n-flt)"
922 + else
923 + myconf+=" --without-xft"
924 + myconf+=" --without-cairo"
925 + myconf+=" --without-libotf --without-m17n-flt"
926 + use cairo && ewarn \
927 + "USE flag \"cairo\" has no effect if \"xft\" is not set."
928 + use m17n-lib && ewarn \
929 + "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
930 + fi
931 +
932 + local f line
933 + if use gtk; then
934 + einfo "Configuring to build with GIMP Toolkit (GTK+)"
935 + while read line; do ewarn "${line}"; done <<-EOF
936 + Your version of GTK+ will have problems with closing open
937 + displays. This is no problem if you just use one display, but
938 + if you use more than one and close one of them Emacs may crash.
939 + See <https://bugzilla.gnome.org/show_bug.cgi?id=85715>.
940 + If you intend to use more than one display, then it is strongly
941 + recommended that you compile Emacs with the Athena/Lucid or the
942 + Motif toolkit instead.
943 + EOF
944 + #if use xwidgets; then
945 + # myconf+=" --with-x-toolkit=gtk3 --with-xwidgets"
946 + #else
947 + myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
948 + myconf+=" --without-xwidgets"
949 + #fi
950 + for f in motif Xaw3d athena; do
951 + use ${f} && ewarn \
952 + "USE flag \"${f}\" has no effect if \"gtk\" is set."
953 + done
954 + elif use motif; then
955 + einfo "Configuring to build with Motif toolkit"
956 + myconf+=" --with-x-toolkit=motif"
957 + for f in Xaw3d athena; do
958 + use ${f} && ewarn \
959 + "USE flag \"${f}\" has no effect if \"motif\" is set."
960 + done
961 + elif use athena || use Xaw3d; then
962 + einfo "Configuring to build with Athena/Lucid toolkit"
963 + myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
964 + else
965 + einfo "Configuring to build with no toolkit"
966 + myconf+=" --with-x-toolkit=no"
967 + fi
968 + #! use gtk && use xwidgets && ewarn \
969 + # "USE flag \"xwidgets\" has no effect if \"gtk\" is not set."
970 + elif use aqua; then
971 + einfo "Configuring to build with Nextstep (Cocoa) support"
972 + myconf+=" --with-ns --disable-ns-self-contained"
973 + myconf+=" --without-x"
974 + else
975 + myconf+=" --without-x --without-ns"
976 + fi
977 +
978 + econf \
979 + --program-suffix="-${EMACS_SUFFIX}" \
980 + --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
981 + --localstatedir="${EPREFIX}"/var \
982 + --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
983 + --with-gameuser=":gamestat" \
984 + --without-compress-install \
985 + --without-hesiod \
986 + --with-file-notification=$(usev inotify || usev gfile || echo no) \
987 + $(use_enable acl) \
988 + $(use_with dbus) \
989 + $(use_with dynamic-loading modules) \
990 + $(use_with gpm) \
991 + $(use_with kerberos) $(use_with kerberos kerberos5) \
992 + $(use_with libxml2 xml2) \
993 + $(use_with selinux) \
994 + $(use_with ssl gnutls) \
995 + $(use_with wide-int) \
996 + $(use_with zlib) \
997 + ${myconf}
998 +}
999 +
1000 +src_compile() {
1001 + # Disable sandbox when dumping. For the unbelievers, see bug #131505
1002 + emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
1003 +}
1004 +
1005 +src_install () {
1006 + emake DESTDIR="${D}" NO_BIN_LINK=t install
1007 +
1008 + mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
1009 + || die "moving emacs executable failed"
1010 + mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
1011 + || die "moving emacs man page failed"
1012 +
1013 + # move info dir to avoid collisions with the dir file generated by portage
1014 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
1015 + || die "moving info dir failed"
1016 + touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
1017 + docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
1018 +
1019 + # avoid collision between slots, see bug #169033 e.g.
1020 + rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
1021 + rm -rf "${ED}"/usr/share/{appdata,applications,icons}
1022 + rm -rf "${ED}"/var
1023 +
1024 + # remove unused <version>/site-lisp dir
1025 + rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
1026 +
1027 + # remove COPYING file (except for etc/COPYING used by describe-copying)
1028 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
1029 +
1030 + if use gzip-el; then
1031 + # compress .el files when a corresponding .elc exists
1032 + find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
1033 + -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
1034 + assert "gzip .el failed"
1035 + fi
1036 +
1037 + local cdir
1038 + if use source; then
1039 + cdir="/usr/share/emacs/${FULL_VERSION}/src"
1040 + insinto "${cdir}"
1041 + # This is not meant to install all the source -- just the
1042 + # C source you might find via find-function
1043 + doins src/*.{c,h,m}
1044 + elif has installsources ${FEATURES}; then
1045 + cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
1046 + fi
1047 +
1048 + sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF || die
1049 + X
1050 + ;;; ${PN}-${SLOT} site-lisp configuration
1051 + X
1052 + (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
1053 + Y (setq find-function-C-source-directory
1054 + Y "${EPREFIX}${cdir}")
1055 + X (let ((path (getenv "INFOPATH"))
1056 + X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
1057 + X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
1058 + X (and path
1059 + X ;; move Emacs Info dir before anything else in /usr/share/info
1060 + X (let* ((p (cons nil (split-string path ":" t))) (q p))
1061 + X (while (and (cdr q) (not (string-match re (cadr q))))
1062 + X (setq q (cdr q)))
1063 + X (setcdr q (cons dir (delete dir (cdr q))))
1064 + X (setq Info-directory-list (prune-directory-list (cdr p)))))))
1065 + EOF
1066 + elisp-site-file-install "${T}/${SITEFILE}" || die
1067 +
1068 + dodoc README BUGS CONTRIBUTE
1069 +
1070 + if use aqua; then
1071 + dodir /Applications/Gentoo
1072 + rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
1073 + mv nextstep/Emacs.app \
1074 + "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
1075 + fi
1076 +
1077 + DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
1078 + through the Emacs eselect module, which also redirects man and info
1079 + pages. Therefore, several Emacs versions can be installed at the
1080 + same time. \"man emacs.eselect\" for details.
1081 + \\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
1082 + strongly recommended that you use app-admin/emacs-updater to rebuild
1083 + all byte-compiled elisp files of the installed Emacs packages."
1084 + use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
1085 + Installing media-fonts/font-adobe-{75,100}dpi on the X server's
1086 + machine would satisfy basic Emacs requirements under X11.
1087 + See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
1088 + for how to enable anti-aliased fonts."
1089 + use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
1090 + \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
1091 + it into /Applications by yourself."
1092 + readme.gentoo_create_doc
1093 +}
1094 +
1095 +pkg_preinst() {
1096 + # move Info dir file to correct name
1097 + local infodir=/usr/share/info/${EMACS_SUFFIX} f
1098 + if [[ -f ${ED}${infodir}/dir.orig ]]; then
1099 + mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
1100 + elif [[ -d "${ED}"${infodir} ]]; then
1101 + # this should not happen in EAPI 4
1102 + ewarn "Regenerating Info directory index in ${infodir} ..."
1103 + rm -f "${ED}"${infodir}/dir{,.*}
1104 + for f in "${ED}"${infodir}/*; do
1105 + if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
1106 + install-info --info-dir="${ED}"${infodir} "${f}" \
1107 + || die "install-info failed"
1108 + fi
1109 + done
1110 + fi
1111 +}
1112 +
1113 +pkg_postinst() {
1114 + elisp-site-regen
1115 + readme.gentoo_print_elog
1116 +
1117 + if use livecd; then
1118 + # force an update of the emacs symlink for the livecd/dvd,
1119 + # because some microemacs packages set it with USE=livecd
1120 + eselect emacs update
1121 + elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
1122 + # refresh symlinks in case any installed files have changed
1123 + eselect emacs set ${EMACS_SUFFIX}
1124 + else
1125 + eselect emacs update ifunset
1126 + fi
1127 +}
1128 +
1129 +pkg_postrm() {
1130 + elisp-site-regen
1131 + eselect emacs update ifunset
1132 +}