summaryrefslogtreecommitdiffstats
path: root/app-editors
diff options
context:
space:
mode:
Diffstat (limited to 'app-editors')
-rw-r--r--app-editors/emacs/emacs-31.0.9999.ebuild621
1 files changed, 621 insertions, 0 deletions
diff --git a/app-editors/emacs/emacs-31.0.9999.ebuild b/app-editors/emacs/emacs-31.0.9999.ebuild
new file mode 100644
index 0000000..84b562f
--- /dev/null
+++ b/app-editors/emacs/emacs-31.0.9999.ebuild
@@ -0,0 +1,621 @@
1# Copyright 1999-2025 Gentoo Authors
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI=8
5
6inherit autotools eapi9-pipestatus elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
7
8if [[ ${PV##*.} = 9999 ]]; then
9 inherit git-r3
10 EGIT_REPO_URI="https://github.com/emacs-mirror/emacs.git"
11 EGIT_BRANCH="master"
12 EGIT_CHECKOUT_DIR="${WORKDIR}/emacs"
13 S="${EGIT_CHECKOUT_DIR}"
14 SLOT="${PV%%.*}-vcs"
15else
16 # FULL_VERSION keeps the full version number, which is needed in
17 # order to determine some path information correctly for copy/move
18 # operations later on
19 FULL_VERSION="${PV%%_*}"
20 SRC_URI="mirror://gnu/emacs/${P}.tar.xz"
21 S="${WORKDIR}/emacs-${FULL_VERSION}"
22 # PV can be in any of the following formats:
23 # 27.1 released version (slot 27)
24 # 27.1_rc1 upstream release candidate (27)
25 # 27.0.9999 live ebuild (slot 27-vcs)
26 # 27.0.90 upstream prerelease snapshot (27-vcs)
27 # 27.0.50_pre20191223 snapshot by Gentoo developer (27-vcs)
28 if [[ ${PV} == *_pre* ]]; then
29 SRC_URI="https://dev.gentoo.org/~ulm/distfiles/${P}.tar.xz"
30 S="${WORKDIR}/emacs"
31 elif [[ ${PV//[0-9]} != "." ]]; then
32 SRC_URI="https://alpha.gnu.org/gnu/emacs/pretest/${PN}-${PV/_/-}.tar.xz"
33 fi
34 SLOT="${PV%%.*}"
35 [[ ${PV} == *.*.* ]] && SLOT+="-vcs"
36 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
37fi
38
39DESCRIPTION="The advanced, extensible, customizable, self-documenting editor"
40HOMEPAGE="https://www.gnu.org/software/emacs/"
41
42LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
43IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gfile gif +gmp gpm gsettings gtk gui gzip-el harfbuzz imagemagick +inotify jit jpeg kerberos lcms libxml2 livecd m17n-lib mailutils motif png selinux sound source sqlite ssl svg systemd +threads tiff toolkit-scroll-bars tree-sitter valgrind webp wide-int +X xattr Xaw3d xft +xpm zlib"
44
45X_DEPEND="x11-libs/libICE
46 x11-libs/libSM
47 x11-libs/libX11
48 x11-libs/libXcomposite
49 x11-libs/libXext
50 x11-libs/libXfixes
51 x11-libs/libXi
52 x11-libs/libXinerama
53 x11-libs/libXrandr
54 x11-libs/libxcb
55 x11-libs/xcb-util
56 x11-misc/xbitmaps
57 xpm? ( x11-libs/libXpm )
58 xft? (
59 media-libs/fontconfig
60 media-libs/freetype
61 x11-libs/libXrender
62 cairo? ( >=x11-libs/cairo-1.12.18[X] )
63 !cairo? ( x11-libs/libXft )
64 harfbuzz? ( media-libs/harfbuzz:0= )
65 m17n-lib? (
66 >=dev-libs/libotf-0.9.4
67 >=dev-libs/m17n-lib-1.5.1
68 )
69 )
70 gtk? ( x11-libs/gtk+:3[X] )
71 !gtk? (
72 motif? (
73 >=x11-libs/motif-2.3:0
74 x11-libs/libXpm
75 x11-libs/libXmu
76 x11-libs/libXt
77 )
78 !motif? (
79 Xaw3d? (
80 x11-libs/libXaw3d
81 x11-libs/libXmu
82 x11-libs/libXt
83 )
84 !Xaw3d? ( athena? (
85 x11-libs/libXaw
86 x11-libs/libXmu
87 x11-libs/libXt
88 ) )
89 )
90 )"
91
92RDEPEND=">=app-emacs/emacs-common-1.11[games?,gui?]
93 sys-libs/ncurses:0=
94 acl? ( virtual/acl )
95 alsa? ( media-libs/alsa-lib )
96 dbus? ( sys-apps/dbus )
97 games? ( acct-group/gamestat )
98 gmp? ( dev-libs/gmp:0= )
99 gpm? ( sys-libs/gpm )
100 !inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
101 jit? (
102 sys-devel/gcc:=[jit(-)]
103 sys-libs/zlib
104 )
105 kerberos? ( virtual/krb5 )
106 lcms? ( media-libs/lcms:2 )
107 libxml2? ( >=dev-libs/libxml2-2.2.0:= )
108 mailutils? ( net-mail/mailutils[clients] )
109 !mailutils? ( acct-group/mail net-libs/liblockfile )
110 selinux? ( sys-libs/libselinux )
111 sqlite? ( dev-db/sqlite:3 )
112 ssl? ( net-libs/gnutls:0= )
113 systemd? ( sys-apps/systemd )
114 tree-sitter? (
115 dev-libs/tree-sitter:=
116 dev-libs/tree-sitter-jsdoc
117 )
118 valgrind? ( dev-debug/valgrind )
119 xattr? ( sys-apps/attr )
120 zlib? ( sys-libs/zlib )
121 gui? (
122 gif? ( media-libs/giflib:0= )
123 jpeg? ( media-libs/libjpeg-turbo:0= )
124 png? ( >=media-libs/libpng-1.4:0= )
125 svg? ( >=gnome-base/librsvg-2.0 )
126 tiff? ( media-libs/tiff:= )
127 webp? ( media-libs/libwebp:0= )
128 imagemagick? ( media-gfx/imagemagick:0=[jpeg?,png?,svg?,tiff?] )
129 !aqua? (
130 gsettings? (
131 >=app-emacs/emacs-common-1.11[gsettings]
132 >=dev-libs/glib-2.28.6
133 )
134 gtk? ( !X? (
135 media-libs/fontconfig
136 media-libs/freetype
137 >=x11-libs/cairo-1.12.18
138 x11-libs/gtk+:3
139 harfbuzz? ( media-libs/harfbuzz:0= )
140 m17n-lib? (
141 >=dev-libs/libotf-0.9.4
142 >=dev-libs/m17n-lib-1.5.1
143 )
144 ) )
145 !gtk? ( ${X_DEPEND} )
146 X? ( ${X_DEPEND} )
147 )
148 )"
149
150DEPEND="${RDEPEND}
151 gui? ( !aqua? (
152 !gtk? ( x11-base/xorg-proto )
153 X? ( x11-base/xorg-proto )
154 ) )"
155
156BDEPEND="sys-apps/texinfo
157 virtual/pkgconfig
158 gzip-el? ( app-arch/gzip )"
159
160IDEPEND="app-eselect/eselect-emacs"
161
162RDEPEND+=" ${IDEPEND}"
163
164EMACS_SUFFIX="emacs-${SLOT}"
165SITEFILE="20${EMACS_SUFFIX}-gentoo.el"
166
167# Suppress false positive QA warnings #898304 #925091
168QA_CONFIG_IMPL_DECL_SKIP=( malloc_{get,set}_state statvfs64 )
169
170src_prepare() {
171 if [[ ${PV##*.} = 9999 ]]; then
172 FULL_VERSION=$(sed -n 's/^AC_INIT([^,]*,[^0-9.]*\([0-9.]*\).*/\1/p' \
173 configure.ac)
174 [[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
175 einfo "Emacs branch: ${EGIT_BRANCH}"
176 einfo "Commit: ${EGIT_VERSION}"
177 einfo "Emacs version number: ${FULL_VERSION}"
178 [[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \
179 || die "Upstream version number changed to ${FULL_VERSION}"
180 fi
181
182 default
183
184 if use jit; then
185 find lisp -type f -name "*.elc" -delete || die
186
187 # These files ignore LDFLAGS. We assign the variable here, because
188 # for live ebuilds FULL_VERSION doesn't exist in global scope
189 QA_FLAGS_IGNORED="usr/$(get_libdir)/emacs/${FULL_VERSION}/native-lisp/.*"
190
191 # The build system requires gcc for native compilation #874657
192 if ! tc-is-gcc; then
193 ewarn "Emacs must be built with gcc[jit] if USE=jit is enabled."
194 ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc"
195 export CC=${CHOST}-gcc AR=${CHOST}-gcc-ar NM=${CHOST}-gcc-nm \
196 RANLIB=${CHOST}-gcc-ranlib
197 tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}"
198 fi
199
200 # gccjit doesn't play well with ccache or distcc #801580
201 # For now, work around the problem with an explicit LIBRARY_PATH
202 if has ccache ${FEATURES} || has distcc ${FEATURES} && tc-is-gcc; then
203 export LIBRARY_PATH=$("$(tc-getCC)" -print-search-dirs \
204 | sed -n '/^libraries:/{s:^[^/]*::;p}')
205 fi
206 fi
207
208 # libseccomp is detected by configure but doesn't appear to have any
209 # effect on the installed image. Suppress it by supplying pkg-config
210 # with a wrong library name.
211 sed -i -e "/CHECK_MODULES/s/libseccomp/DiSaBlE&/" configure.ac || die
212
213 # Tests that use bubblewrap don't work in the sandbox:
214 # "bwrap: setting up uid map: Permission denied"
215 # So, disrupt the search for the bwrap executable.
216 sed -i -e 's/(executable-find "bwrap")/nil/' test/src/emacs-tests.el \
217 test/lisp/emacs-lisp/bytecomp-tests.el || die
218
219 AT_M4DIR=m4 eautoreconf
220}
221
222src_configure() {
223 # We want floating-point arithmetic to be correct #933380
224 replace-flags -Ofast -O2
225 append-flags -fno-fast-math -ffp-contract=off
226
227 export ac_cv_header_valgrind_valgrind_h=$(usex valgrind)
228 append-cppflags -DUSE_VALGRIND=$(usex valgrind)
229
230 # Prevents e.g. tests interfering with running Emacs.
231 unset EMACS_SOCKET_NAME
232
233 local myconf=(
234 --program-suffix="-${EMACS_SUFFIX}"
235 --includedir="${EPREFIX}"/usr/include/${EMACS_SUFFIX}
236 --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX}
237 --localstatedir="${EPREFIX}"/var
238 --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}"
239 --without-compress-install
240 --without-hesiod
241 --without-pop
242 --without-systemduserunitdir
243 --with-file-notification=$(usev inotify || usev gfile || echo no)
244 --with-pdumper
245 $(use_enable acl)
246 $(use_enable xattr)
247 $(use_with dbus)
248 $(use_with dynamic-loading modules)
249 $(use_with games gameuser ":gamestat")
250 $(use_with gmp libgmp)
251 $(use_with gpm)
252 $(use_with jit native-compilation aot)
253 $(use_with kerberos) $(use_with kerberos kerberos5)
254 $(use_with lcms lcms2)
255 $(use_with libxml2 xml2)
256 $(use_with mailutils)
257 $(use_with selinux)
258 $(use_with sqlite sqlite3)
259 $(use_with ssl gnutls)
260 $(use_with systemd libsystemd)
261 $(use_with threads)
262 $(use_with tree-sitter)
263 $(use_with wide-int)
264 )
265
266 if use alsa; then
267 use sound || ewarn \
268 "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
269 myconf+=( --with-sound=alsa )
270 else
271 myconf+=( --with-sound=$(usex sound oss no) )
272 fi
273
274 if use jit; then
275 use zlib || ewarn \
276 "USE flag \"jit\" overrides \"-zlib\"; enabling zlib support."
277 myconf+=( --with-zlib )
278 else
279 myconf+=( $(use_with zlib) )
280 fi
281
282 # Emacs supports these window systems:
283 # X11, pure GTK (without X11), or Nextstep (Aqua/Cocoa).
284 # General GUI support is enabled by the "gui" USE flag, then
285 # the window system is selected as follows:
286 # "aqua" -> Nextstep
287 # "gtk -X" -> pure GTK
288 # otherwise -> X11
289 # For X11 there is the further choice of toolkits GTK, Motif,
290 # Athena (Lucid), or no toolkit. They are enabled (in order of
291 # preference) with the "gtk", "motif", "Xaw3d", and "athena" flags.
292
293 if ! use gui; then
294 einfo "Configuring to build without window system support"
295 myconf+=(
296 --without-x --without-pgtk --without-ns
297 )
298 elif use aqua; then
299 einfo "Configuring to build with Nextstep (Macintosh Cocoa) support"
300 myconf+=(
301 --with-ns --disable-ns-self-contained
302 --without-x --without-pgtk
303 )
304 elif use gtk && ! use X; then
305 einfo "Configuring to build with pure GTK (without X11) support"
306 myconf+=(
307 --with-pgtk --without-x --without-ns
308 --with-toolkit-scroll-bars #836392
309 --without-gconf
310 --without-xwidgets
311 $(use_with gsettings)
312 $(use_with harfbuzz)
313 $(use_with m17n-lib libotf)
314 $(use_with m17n-lib m17n-flt)
315 )
316 else
317 # X11
318 myconf+=(
319 --with-x --without-pgtk --without-ns
320 --without-gconf
321 $(use_with gsettings)
322 $(use_with toolkit-scroll-bars)
323 $(use_with xpm)
324 )
325
326 if use xft; then
327 myconf+=(
328 --with-xft
329 $(use_with cairo)
330 $(use_with harfbuzz)
331 $(use_with m17n-lib libotf)
332 $(use_with m17n-lib m17n-flt)
333 )
334 else
335 myconf+=(
336 --without-xft
337 --without-cairo
338 --without-libotf --without-m17n-flt
339 )
340 use cairo && ewarn \
341 "USE flag \"cairo\" has no effect if \"xft\" is not set."
342 use m17n-lib && ewarn \
343 "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
344 fi
345
346 local f line
347 if use gtk; then
348 einfo "Configuring to build with GIMP Toolkit (GTK+)"
349 while read line; do ewarn "${line}"; done <<-EOF
350 Your version of GTK+ will have problems with closing open
351 displays. This is no problem if you just use one display, but
352 if you use more than one and close one of them Emacs may crash.
353 See <https://gitlab.gnome.org/GNOME/gtk/-/issues/221> and
354 <https://gitlab.gnome.org/GNOME/gtk/-/issues/2315>.
355 If you intend to use more than one display, then it is strongly
356 recommended that you compile Emacs with the Athena/Lucid or the
357 Motif toolkit instead.
358 EOF
359 myconf+=( --with-x-toolkit=gtk3 --without-xwidgets )
360 for f in motif Xaw3d athena; do
361 use ${f} && ewarn \
362 "USE flag \"${f}\" has no effect if \"gtk\" is set."
363 done
364 elif use motif; then
365 einfo "Configuring to build with Motif toolkit"
366 myconf+=( --with-x-toolkit=motif )
367 for f in Xaw3d athena; do
368 use ${f} && ewarn \
369 "USE flag \"${f}\" has no effect if \"motif\" is set."
370 done
371 elif use athena || use Xaw3d; then
372 einfo "Configuring to build with Athena/Lucid toolkit"
373 myconf+=( --with-x-toolkit=lucid $(use_with Xaw3d xaw3d) )
374 else
375 einfo "Configuring to build with no toolkit"
376 myconf+=( --with-x-toolkit=no )
377 fi
378 fi
379
380 if use gui; then
381 # Common flags recognised for all GUIs
382 myconf+=(
383 $(use_with gif)
384 $(use_with jpeg)
385 $(use_with png)
386 $(use_with svg rsvg)
387 $(use_with tiff)
388 $(use_with webp)
389 $(use_with imagemagick)
390 )
391 fi
392
393 if tc-is-cross-compiler; then
394 # Configure a CBUILD directory when cross-compiling to make tools
395 mkdir -p "${S}-build" && pushd "${S}-build" >/dev/null || die
396 ECONF_SOURCE="${S}" econf_build --without-all --without-x-toolkit
397 popd >/dev/null || die
398 # Don't try to execute the binary for dumping during the build
399 myconf+=( --with-dumping=none )
400 #elif use m68k; then
401 # # Workaround for https://debbugs.gnu.org/44531
402 # myconf+=( --with-dumping=unexec )
403 else
404 myconf+=( --with-dumping=pdumper )
405 fi
406
407 econf "${myconf[@]}"
408}
409
410src_compile() {
411 if tc-is-cross-compiler; then
412 # Build native tools for compiling lisp etc.
413 emake -C "${S}-build" src
414 emake lib # Cross-compile dependencies first for timestamps
415 # Save native build tools in the cross-directory
416 cp "${S}-build"/lib-src/make-{docfile,fingerprint} lib-src || die
417 # Specify the native Emacs to compile lisp
418 EMACS_EMAKE_ARGS=( EMACS="${S}-build/src/emacs" )
419 emake "${EMACS_EMAKE_ARGS[@]}" actual-all
420 else
421 EMACS_EMAKE_ARGS=()
422 emake
423 fi
424}
425
426src_test() {
427 # List .el test files with a comment above listing the exact
428 # subtests which caused failure. Elements should begin with a %.
429 # e.g. %lisp/gnus/mml-sec-tests.el.
430 local exclude_tests=(
431 # Reason: not yet known (we skipped this in the past but finally
432 # dropped it for Emacs 30 as it seemed to be passing again)
433 # mml-secure-select-preferred-keys-4
434 %lisp/gnus/mml-sec-tests.el
435
436 # Reason: permission denied on /nonexistent
437 # (vc-*-bzr only fails if breezy is installed, as they
438 # try to access cache dirs under /nonexistent)
439 #
440 # rmail-undigest-test-multipart-mixed-digest
441 # rmail-undigest-test-rfc1153-less-strict-digest
442 # rmail-undigest-test-rfc1153-sloppy-digest
443 # rmail-undigest-test-rfc934-digest
444 # vc-test-bzr02-state
445 # vc-test-bzr05-rename-file
446 # vc-test-bzr06-version-diff
447 # vc-bzr-test-bug9781
448 %lisp/mail/undigest-tests.el
449 %lisp/vc/vc-tests.el
450 %lisp/vc/vc-bzr-tests.el
451
452 # Reason: flaky (https://bugs.gnu.org/73441, fails even with the fix)
453 # proced-refine-test
454 %lisp/proced-tests.el
455
456 # Reason: flaky (https://bugs.gnu.org/79056)
457 # tab-bar-tests-quit-restore-window
458 %lisp/tab-bar-tests.el
459
460 # Reason: tries to access network
461 # internet-is-working
462 %src/process-tests.el
463 )
464 use threads || exclude_tests+=(
465 %lisp/progmodes/eglot-tests.el
466 %src/emacs-module-tests.el
467 %src/keyboard-tests.el
468 )
469
470 # Redirect GnuPG's sockets, in order not to exceed the 108 char limit
471 # for socket paths on Linux.
472 mkdir -p "${T}"/gpg || die
473 local f
474 for f in browser extra ssh; do
475 printf "%%Assuan%%\nsocket=%s\n" "${T}/gpg/S.${f}" \
476 > "test/lisp/gnus/mml-sec-resources/S.gpg-agent.${f}" || die
477 done
478
479 # See test/README for possible options
480 emake \
481 EMACS_TEST_VERBOSE=1 \
482 EXCLUDE_TESTS="${exclude_tests[*]}" \
483 TERM=dumb \
484 TEST_BACKTRACE_LINE_LENGTH=nil \
485 check
486}
487
488src_install() {
489 emake \
490 "${EMACS_EMAKE_ARGS[@]}" \
491 DESTDIR="${D}" \
492 NO_BIN_LINK=t \
493 BLESSMAIL_TARGET="" \
494 install
495
496 mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} || die
497 mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 || die
498 mv "${ED}"/usr/share/metainfo/{emacs-,}${EMACS_SUFFIX}.metainfo.xml || die
499
500 # dissuade Portage from removing our dir file #257260
501 touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
502 docompress -x /usr/share/info/${EMACS_SUFFIX}/dir
503
504 # movemail must be setgid mail
505 if ! use mailutils; then
506 fowners root:mail /usr/libexec/emacs/${FULL_VERSION}/${CHOST}/movemail
507 fperms 2751 /usr/libexec/emacs/${FULL_VERSION}/${CHOST}/movemail
508 fi
509
510 # avoid collision between slots, see bug #169033 e.g.
511 rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el || die
512 rm -rf "${ED}"/usr/share/{applications,icons} || die
513 rm -rf "${ED}"/usr/share/glib-2.0 || die #911117
514 rm -rf "${ED}"/var || die
515
516 # remove unused <version>/site-lisp dir
517 rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp || die
518
519 # remove COPYING file (except for etc/COPYING used by describe-copying)
520 rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING || die
521
522 if use gzip-el; then
523 # compress .el files when a corresponding .elc exists
524 find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
525 -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
526 pipestatus || die "gzip .el pipeline failed"
527 fi
528
529 local cdir
530 if use source; then
531 cdir="/usr/share/emacs/${FULL_VERSION}/src"
532 insinto "${cdir}"
533 # This is not meant to install all the source -- just the
534 # C source you might find via find-function
535 doins src/*.{c,h,m}
536 elif has installsources ${FEATURES}; then
537 cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
538 fi
539
540 sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF || die
541 ;;; ${EMACS_SUFFIX} site-lisp configuration -*-lexical-binding:t-*-
542 X
543 (when (string-equal emacs-version "${FULL_VERSION}")
544 Y (setq find-function-C-source-directory
545 Y "${EPREFIX}${cdir}")
546 X (let ((path (getenv "INFOPATH"))
547 X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
548 X (re "\\\\\`${EPREFIX}/usr/share\\\\>"))
549 X (and path
550 X ;; move Emacs Info dir before anything else in /usr/share
551 X (let* ((p (cons nil (split-string path ":" t))) (q p))
552 X (while (and (cdr q) (not (string-match re (cadr q))))
553 X (setq q (cdr q)))
554 X (setcdr q (cons dir (delete dir (cdr q))))
555 X (setenv "INFOPATH" (mapconcat #'identity (cdr p) ":"))))))
556 EOF
557 elisp-site-file-install "${T}/${SITEFILE}" || die
558
559 dodoc README BUGS CONTRIBUTE
560
561 if use gui && use aqua; then
562 dodir /Applications/Gentoo
563 rm -rf "${ED}"/Applications/Gentoo/${EMACS_SUFFIX^}.app || die
564 mv nextstep/Emacs.app \
565 "${ED}"/Applications/Gentoo/${EMACS_SUFFIX^}.app || die
566 fi
567
568 local DOC_CONTENTS="You can set the version to be started by
569 /usr/bin/emacs through the Emacs eselect module, which also
570 redirects man and info pages. Therefore, several Emacs versions can
571 be installed at the same time. \"man emacs.eselect\" for details.
572 \\n\\nIf you upgrade from a previous major version of Emacs, then
573 it is strongly recommended that you use app-admin/emacs-updater
574 to rebuild all byte-compiled elisp files of the installed Emacs
575 packages."
576 if use gui; then
577 DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
578 Installing media-fonts/font-adobe-{75,100}dpi on the X server's
579 machine would satisfy basic Emacs requirements under X11.
580 See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
581 for how to enable anti-aliased fonts."
582 use aqua && DOC_CONTENTS+="\\n\\n${EMACS_SUFFIX^}.app is in
583 \"${EPREFIX}/Applications/Gentoo\". You may want to copy or
584 symlink it into /Applications by yourself."
585 fi
586 if ! use mailutils; then
587 DOC_CONTENTS+="\\n\\nThe mailutils USE flag is disabled. If Emacs'
588 own e-mail features are going to be used as an e-mail client
589 (e.g. Rmail), you are strongly encouraged to enable it. If not,
590 Emacs will use its own implementation of movemail; which has
591 fewer features and is less secure. For more information see:
592 https://www.gnu.org/software/emacs/manual/html_node/emacs/Movemail.html"
593 fi
594 tc-is-cross-compiler && DOC_CONTENTS+="\\n\\nEmacs did not write
595 a portable dump file due to being cross-compiled.
596 To create this file at run time, execute the following command:
597 \\n${EMACS_SUFFIX} --batch -Q --eval='(dump-emacs-portable
598 \"/usr/libexec/emacs/${FULL_VERSION}/${CHOST}/emacs.pdmp\")'"
599 readme.gentoo_create_doc
600}
601
602pkg_preinst() {
603 # verify that the PM hasn't removed our Info directory index #257260
604 local infodir="${ED}/usr/share/info/${EMACS_SUFFIX}"
605 [[ -f ${infodir}/dir || ! -d ${infodir} ]] || die
606}
607
608pkg_postinst() {
609 elisp-site-regen
610 readme.gentoo_print_elog
611
612 # Force an update of the emacs symlink for the livecd/dvd,
613 # because some microemacs packages set it with USE=livecd.
614 # Otherwise, create it only when it is not yet set.
615 eselect --root="${ROOT}" emacs update $(usev !livecd ifunset)
616}
617
618pkg_postrm() {
619 elisp-site-regen
620 eselect --root="${ROOT}" emacs update ifunset
621}