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