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: Sun, 20 Dec 2015 20:29:57
Message-Id: 1450643379.665048d7715aa97f1a3e64ed5a351e6cc0310985.ulm@gentoo
1 commit: 665048d7715aa97f1a3e64ed5a351e6cc0310985
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 20 20:28:58 2015 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 20 20:29:39 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=665048d7
7
8 app-editors/emacs: Fixes for GCC 5.
9
10 Emacs 18.59: Use system malloc. This fixes hanging at runtime when
11 compiled with GCC 5.3. Fix a couple of compiler warnings.
12
13 Emacs 23.4: Fix jpeg version check to work with gcc >= 5.
14
15 Package-Manager: portage-2.2.26
16
17 app-editors/emacs/Manifest | 2 +
18 app-editors/emacs/emacs-18.59-r11.ebuild | 149 +++++++++++++
19 app-editors/emacs/emacs-23.4-r14.ebuild | 349 +++++++++++++++++++++++++++++++
20 3 files changed, 500 insertions(+)
21
22 diff --git a/app-editors/emacs/Manifest b/app-editors/emacs/Manifest
23 index fecd59c..3f611c4 100644
24 --- a/app-editors/emacs/Manifest
25 +++ b/app-editors/emacs/Manifest
26 @@ -1,7 +1,9 @@
27 DIST emacs-18.59-linux22x-elf-glibc21.diff.gz 15671 SHA256 fb810d893938883d50a3a8d7c43fbeb1604d5454f760b8f1f700326c8ee659dd SHA512 c6c6ea33850dadf08d68fff56fc6aacc80ad1aa36661260715d50b95438942d56e6244094427d50356cfe716f26559feb885254c436399bff7be639637d605b6 WHIRLPOOL cafaa0fb0d06058cac8e445a7a1b5cba145d23186477a9c681efdab8ca0f18a9675dec3a93851fd7138890701f83fab83300c28a548c8fc22478a0cfff95d5da
28 DIST emacs-18.59-patches-8.tar.bz2 19667 SHA256 637542bf5ee07d4abac11b76e742598a60787f3869dbf377eed99ae005fbc59d SHA512 a6564bc16724bfdb22f77b0e21b6064ca5e0e1bc91f3223c1037c26f8a048f28ac7a5da6817dc940a5f00f1f39bbfcda2277645409cd7e143a55fabdc3d3fe5d WHIRLPOOL 6b81f978aef2b429262e79ab1d995cca9237dc9c9d98144d2dc3de07bc2cdcec8547adbaf5ad41d9cce3239554918c04c7b9ff783b7931582a3a7398eb2b66f1
29 +DIST emacs-18.59-patches-9.tar.xz 21380 SHA256 69411c57b20850e8aab1e20614437f9a836c2ddf47c46a833d0262c138fa3270 SHA512 595a4a7a4052c3b3325e4d4952eed24c98d3dd62b7ce89bd149f046552e2dd67ec3e720b7559fbc086b06a667c992bccc60201ef53b263dbd0fc96cbcdceee38 WHIRLPOOL 23f803d940c35fe9519fe7169e6bca7012c2d2db2246dec121fba37e8dbf39f411a9e579a9cbd4193562da72b9ac226286ad687877ccadd7cb78ea7eb615ab3f
30 DIST emacs-18.59.tar.gz 2962652 SHA256 1e27e33f91984a91e9b4c1f21433f931aba03670960ecc147bb6d7b0de0f051e SHA512 03ce565e346e89b7aacb1852f4783e8907f394de7da0c543b475cb038eb89b87f980d0f7ca1841b1d2108b20f211e95113c7214e4a33e5767a1827ff43173f33 WHIRLPOOL 5e98e71518f665e2a8278afe54e0ace6d7fdd9df23ff0a3354ffc1d5cc25cd21b0dd4d82766fcb436d4f24e9291c933295e956e1ffea43cfeedf915175763be6
31 DIST emacs-23.4-patches-17.tar.xz 16164 SHA256 bc9d4a36239f2749e218d903b67102e211a3a62ef162f5ab2801865dab77b752 SHA512 ceccd559b4f53328d75016b64d246ecf6fca7edebd080ce3bbba5f4d000bec38be5da91f3195c972ede0710da14b3be0545891321259b0a0b2963981c8fd62de WHIRLPOOL 4b70ce4d876e92a006e3dc0a31301f604aa8fa53a198515d1cbb3517a94933b1d7a11636494c1bd28ad1049a5a233d4ec13213e74e1eaff1cf96bb1fd095c345
32 +DIST emacs-23.4-patches-18.tar.xz 16512 SHA256 8c783691d61b888ca79d5d7a8319806a3125b656b3406a8834166cd53ba94813 SHA512 ec1092ca9a767035517fdb280fa31684466cf03ce19b3bcaf80ea816ad417fe8bf918787c49f2719bbf535a59594132ef2044c38a810717e8b5119a76d3dc0d2 WHIRLPOOL aac96413b3a76acbf3e9a771d909be42f913a72688e5c11c31534439a242e364d220ef66d23b73cf8ed4693f4a9ed2f5642c155e66b4b49e6ea1c2a16944aaa4
33 DIST emacs-23.4.tar.bz2 38646508 SHA256 26576f9e664397c729f78f5ffcd092969251988461896fe8793062346ee988b9 SHA512 def7a95ecaefae24d8102b96b1d575a23def1b11a8f0bb17b68f7913bd118e2ea4449a8feee76c1bd649f099b70419f0d494ddd9bb32b26f92720cda842b0296 WHIRLPOOL 2384c3f63ff153c3975e373334d6021d46b23ad3cab448ed2e1180501236453a61d13bf1dfbb2e6075bb141dd8511d85f77e37c763b39769f98de48eacc56f3b
34 DIST emacs-24.4-patches-5.tar.xz 6000 SHA256 967dac364282a51933f90c56f368bc3f2741efe0b7ff42d3151bb4824b70fa04 SHA512 0a337ad5b7601f5e453645d1fba99717328c6bc7a5505bcb4bd8e853179cf61be43eb6f3b9370edf0f44aa6485d4847c14554c1592ccc7da87b10dabaaa9d421 WHIRLPOOL 149f3a431d055963c544d9fa6c6447a16aa093840f6bf4086f50506979356a12407af16291c46ee62a92b3ee41767452046f45a7163214be33ab7bdbcd6059dc
35 DIST emacs-24.4.tar.xz 39733124 SHA256 47e391170db4ca0a3c724530c7050655f6d573a711956b4cd84693c194a9d4fd SHA512 f51f88a4736a3f153ef01f3ad710571e967cd3d0c0112b066169a4040725d370ec29b14a4ca8fa3e3f4c657c726ba8e64c3ac4e390b8e911ea47a3afb5ac755c WHIRLPOOL eae38c2382731fecf0ccf8f717f8c96cc130d01a893ff560caecde903294eb843660492761ea8cce9920b79bfc55e821921924e27c040f25355110f56cd2255b
36
37 diff --git a/app-editors/emacs/emacs-18.59-r11.ebuild b/app-editors/emacs/emacs-18.59-r11.ebuild
38 new file mode 100644
39 index 0000000..e78983d
40 --- /dev/null
41 +++ b/app-editors/emacs/emacs-18.59-r11.ebuild
42 @@ -0,0 +1,149 @@
43 +# Copyright 1999-2015 Gentoo Foundation
44 +# Distributed under the terms of the GNU General Public License v2
45 +# $Id$
46 +
47 +EAPI=6
48 +
49 +inherit toolchain-funcs flag-o-matic multilib
50 +
51 +DESCRIPTION="The extensible self-documenting text editor"
52 +HOMEPAGE="https://www.gnu.org/software/emacs/"
53 +SRC_URI="ftp://ftp.gnu.org/old-gnu/emacs/${P}.tar.gz
54 + ftp://ftp.splode.com/pub/users/friedman/emacs/${P}-linux22x-elf-glibc21.diff.gz
55 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-9.tar.xz"
56 +
57 +LICENSE="GPL-1+ GPL-2+ BSD" #HPND
58 +SLOT="18"
59 +KEYWORDS="~amd64 ~x86"
60 +IUSE="abi_x86_x32"
61 +
62 +RDEPEND=">=app-eselect/eselect-emacs-1.16
63 + sys-libs/ncurses:0
64 + amd64? (
65 + abi_x86_x32? ( >=sys-libs/ncurses-5.9-r3:0[abi_x86_x32(-)?] )
66 + !abi_x86_x32? ( >=sys-libs/ncurses-5.9-r3:0[abi_x86_32(-)] )
67 + )"
68 +# X? ( x11-libs/libX11[-xcb] )
69 +DEPEND="${RDEPEND}
70 + virtual/pkgconfig"
71 +
72 +PATCHES="../${P}-linux22x-elf-glibc21.diff ../patch"
73 +
74 +src_configure() {
75 + # autoconf? What's autoconf? We are living in 1992. ;-)
76 + local arch
77 + case ${ARCH} in
78 + amd64)
79 + if use abi_x86_x32; then
80 + arch=x86-x32
81 + multilib_toolchain_setup x32
82 + else
83 + arch=intel386
84 + multilib_toolchain_setup x86
85 + fi
86 + ;;
87 + x86) arch=intel386 ;;
88 + *) die "Architecture ${ARCH} not yet supported" ;;
89 + esac
90 + local cmd="s/\"s-.*\.h\"/\"s-linux.h\"/;s/\"m-.*\.h\"/\"m-${arch}.h\"/"
91 + #use X && cmd="${cmd};s/.*\(#define HAVE_X_WINDOWS\).*/\1/"
92 + sed -e "${cmd}" src/config.h-dist >src/config.h || die
93 +
94 + cat <<-END >src/paths.h
95 + #define PATH_LOADSEARCH "/usr/share/emacs/${PV}/lisp"
96 + #define PATH_EXEC "/usr/share/emacs/${PV}/etc"
97 + #define PATH_LOCK "/var/lib/emacs/lock/"
98 + #define PATH_SUPERLOCK "/var/lib/emacs/lock/!!!SuperLock!!!"
99 + END
100 +
101 + sed -i -e "s:/usr/lib/\([^ ]*\).o:/usr/$(get_libdir)/\1.o:g" \
102 + -e "s:-lncurses:$("$(tc-getPKG_CONFIG)" --libs ncurses):" \
103 + src/s-linux.h || die
104 +
105 + # -O3 and -finline-functions cause segmentation faults at run time.
106 + filter-flags -finline-functions
107 + replace-flags -O[3-9] -O2
108 + strip-flags
109 + # Quieten GCC 5. Feel free to submit a patch adding all those prototypes.
110 + append-flags -Wno-implicit
111 +}
112 +
113 +src_compile() {
114 + # Do not use the sandbox, or the dumped Emacs will be twice as large
115 + export SANDBOX_ON=0
116 + emake --jobs=1 \
117 + CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Demacs" \
118 + LD="$(tc-getCC) -nostdlib" LDFLAGS="${LDFLAGS}"
119 +}
120 +
121 +src_install() {
122 + local basedir="/usr/share/emacs/${PV}" i
123 +
124 + dodir ${basedir}
125 + dodir /usr/share/man/man1
126 + emake --jobs=1 \
127 + LIBDIR="${D}"${basedir} \
128 + BINDIR="${D}"/usr/bin \
129 + MANDIR="${D}"/usr/share/man/man1 \
130 + install
131 +
132 + rmdir "${D}"${basedir}/lock || die
133 + find "${D}"${basedir} -type f \( -name "*.c" -o -name ChangeLog \
134 + -o -name COPYING ! -path "*/etc/COPYING" \) -exec rm "{}" + || die
135 + fperms -R go-w ${basedir}
136 +
137 + # remove duplicate DOC file
138 + rm "${D}"${basedir}/etc/DOC || die
139 +
140 + # move executables to the correct place
141 + mv "${D}"/usr/bin/emacs{,-${SLOT}} || die
142 + for i in etags ctags emacsclient; do
143 + mv "${D}"/usr/bin/${i}{,-emacs-${SLOT}} || die
144 + rm "${D}"${basedir}/etc/${i} || die
145 + done
146 +
147 + dodir /usr/libexec/emacs/${PV}
148 + for i in wakeup digest-doc sorted-doc movemail cvtmail fakemail \
149 + yow env server
150 + do
151 + mv "${D}"${basedir}/etc/${i} "${D}"/usr/libexec/emacs/${PV}/${i} || die
152 + dosym ../../../../libexec/emacs/${PV}/${i} ${basedir}/etc/${i}
153 + done
154 + for i in test-distrib make-docfile; do
155 + rm "${D}"${basedir}/etc/${i} || die
156 + done
157 +
158 + # move man page
159 + mv "${D}"/usr/share/man/man1/emacs{,-${SLOT}}.1 || die
160 +
161 + # move Info files
162 + dodir /usr/share/info
163 + mv "${D}"${basedir}/info "${D}"/usr/share/info/emacs-${SLOT} || die
164 + dosym ../../info/emacs-${SLOT} "${basedir}"/info
165 + docompress -x /usr/share/info
166 +
167 + # move Info dir to avoid collisions with the dir file generated by portage
168 + mv "${D}"/usr/share/info/emacs-${SLOT}/dir{,.orig} || die
169 + touch "${D}"/usr/share/info/emacs-${SLOT}/.keepinfodir
170 +
171 + dodir /var/lib/emacs
172 + diropts -m0777
173 + keepdir /var/lib/emacs/lock
174 +
175 + dodoc README PROBLEMS
176 +}
177 +
178 +pkg_preinst() {
179 + # move Info dir file to correct name
180 + if [[ -d "${D}"/usr/share/info ]]; then
181 + mv "${D}"/usr/share/info/emacs-${SLOT}/dir{.orig,} || die
182 + fi
183 +}
184 +
185 +pkg_postinst() {
186 + eselect emacs update ifunset
187 +}
188 +
189 +pkg_postrm() {
190 + eselect emacs update ifunset
191 +}
192
193 diff --git a/app-editors/emacs/emacs-23.4-r14.ebuild b/app-editors/emacs/emacs-23.4-r14.ebuild
194 new file mode 100644
195 index 0000000..edb1f0d
196 --- /dev/null
197 +++ b/app-editors/emacs/emacs-23.4-r14.ebuild
198 @@ -0,0 +1,349 @@
199 +# Copyright 1999-2015 Gentoo Foundation
200 +# Distributed under the terms of the GNU General Public License v2
201 +# $Id$
202 +
203 +EAPI=6
204 +WANT_AUTOMAKE="none"
205 +
206 +inherit autotools elisp-common flag-o-matic multilib readme.gentoo-r1
207 +
208 +DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
209 +HOMEPAGE="https://www.gnu.org/software/emacs/"
210 +SRC_URI="mirror://gnu/emacs/${P}.tar.bz2
211 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-18.tar.xz"
212 +
213 +LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
214 +SLOT="23"
215 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
216 +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"
217 +REQUIRED_USE="?? ( aqua X )"
218 +
219 +RDEPEND="sys-libs/ncurses:0
220 + >=app-eselect/eselect-emacs-1.16
221 + >=app-emacs/emacs-common-gentoo-1.5[games?,X?]
222 + net-libs/liblockfile
223 + hesiod? ( net-dns/hesiod )
224 + kerberos? ( virtual/krb5 )
225 + alsa? ( media-libs/alsa-lib )
226 + gpm? ( sys-libs/gpm )
227 + dbus? ( sys-apps/dbus )
228 + X? (
229 + x11-libs/libXmu
230 + x11-libs/libXt
231 + x11-misc/xbitmaps
232 + gconf? ( >=gnome-base/gconf-2.26.2 )
233 + gif? ( media-libs/giflib )
234 + jpeg? ( virtual/jpeg:0= )
235 + png? ( >=media-libs/libpng-1.4:0= )
236 + svg? ( >=gnome-base/librsvg-2.0 )
237 + tiff? ( media-libs/tiff:0 )
238 + xpm? ( x11-libs/libXpm )
239 + xft? (
240 + media-libs/fontconfig
241 + media-libs/freetype
242 + x11-libs/libXft
243 + m17n-lib? (
244 + >=dev-libs/libotf-0.9.4
245 + >=dev-libs/m17n-lib-1.5.1
246 + )
247 + )
248 + gtk? ( x11-libs/gtk+:2 )
249 + !gtk? (
250 + motif? ( >=x11-libs/motif-2.3:0 )
251 + !motif? (
252 + Xaw3d? ( x11-libs/libXaw3d )
253 + !Xaw3d? ( athena? ( x11-libs/libXaw ) )
254 + )
255 + )
256 + )"
257 +
258 +DEPEND="${RDEPEND}
259 + alsa? ( virtual/pkgconfig )
260 + dbus? ( virtual/pkgconfig )
261 + X? ( virtual/pkgconfig )
262 + gzip-el? ( app-arch/gzip )
263 + pax_kernel? (
264 + sys-apps/attr
265 + sys-apps/paxctl
266 + )"
267 +
268 +RDEPEND="${RDEPEND}
269 + !<app-editors/emacs-vcs-${PV}"
270 +
271 +EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
272 +SITEFILE="20${PN}-${SLOT}-gentoo.el"
273 +# FULL_VERSION keeps the full version number, which is needed in
274 +# order to determine some path information correctly for copy/move
275 +# operations later on
276 +FULL_VERSION="${PV%%_*}"
277 +S="${WORKDIR}/emacs-${FULL_VERSION}"
278 +
279 +src_prepare() {
280 + eapply ../patch
281 + eapply_user
282 +
283 + sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
284 + || die "unable to sed ctags.1"
285 +
286 + if ! use alsa; then
287 + # ALSA is detected even if not requested by its USE flag.
288 + # Suppress it by supplying pkg-config with a wrong library name.
289 + sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
290 + || die "unable to sed configure.in"
291 + fi
292 + if ! use gzip-el; then
293 + # Emacs' build system automatically detects the gzip binary and
294 + # compresses el files. We don't want that so confuse it with a
295 + # wrong binary name
296 + sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
297 + || die "unable to sed configure.in"
298 + fi
299 +
300 + mv configure.in configure.ac || die
301 + eautoreconf
302 +}
303 +
304 +src_configure() {
305 + strip-flags
306 + filter-flags -fstrict-aliasing -pie
307 + append-flags $(test-flags -fno-strict-aliasing)
308 +
309 + if use sh; then
310 + replace-flags "-O[1-9]" -O0 #262359
311 + elif use ia64; then
312 + replace-flags "-O[2-9]" -O1 #325373
313 + else
314 + replace-flags "-O[3-9]" -O2
315 + fi
316 +
317 + local myconf
318 +
319 + if use alsa && ! use sound; then
320 + einfo "Although sound USE flag is disabled you chose to have alsa,"
321 + einfo "so sound is switched on anyway."
322 + myconf+=" --with-sound"
323 + else
324 + myconf+=" $(use_with sound)"
325 + fi
326 +
327 + if use X; then
328 + myconf+=" --with-x --without-ns"
329 + myconf+=" $(use_with gconf)"
330 + myconf+=" $(use_with toolkit-scroll-bars)"
331 + myconf+=" $(use_with gif)"
332 + myconf+=" $(use_with jpeg)"
333 + myconf+=" $(use_with png)"
334 + myconf+=" $(use_with svg rsvg)"
335 + myconf+=" $(use_with tiff)"
336 + myconf+=" $(use_with xpm)"
337 +
338 + if use xft; then
339 + myconf+=" --with-xft"
340 + myconf+=" $(use_with m17n-lib libotf)"
341 + myconf+=" $(use_with m17n-lib m17n-flt)"
342 + else
343 + myconf+=" --without-xft"
344 + myconf+=" --without-libotf --without-m17n-flt"
345 + use m17n-lib && ewarn \
346 + "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
347 + fi
348 +
349 + # GTK+ is the default toolkit if USE=gtk is chosen with other
350 + # possibilities. Emacs upstream thinks this should be standard
351 + # policy on all distributions
352 + local f
353 + if use gtk; then
354 + einfo "Configuring to build with GIMP Toolkit (GTK+)"
355 + myconf+=" --with-x-toolkit=gtk"
356 + for f in motif Xaw3d athena; do
357 + use ${f} && ewarn \
358 + "USE flag \"${f}\" has no effect if \"gtk\" is set."
359 + done
360 + elif use motif; then
361 + einfo "Configuring to build with Motif toolkit"
362 + myconf+=" --with-x-toolkit=motif"
363 + for f in Xaw3d athena; do
364 + use ${f} && ewarn \
365 + "USE flag \"${f}\" has no effect if \"motif\" is set."
366 + done
367 + elif use athena || use Xaw3d; then
368 + einfo "Configuring to build with Athena/Lucid toolkit"
369 + myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
370 + else
371 + einfo "Configuring to build with no toolkit"
372 + myconf+=" --with-x-toolkit=no"
373 + fi
374 + elif use aqua; then
375 + einfo "Configuring to build with Nextstep (Cocoa) support"
376 + myconf+=" --with-ns --disable-ns-self-contained"
377 + myconf+=" --without-x"
378 + else
379 + myconf+=" --without-x --without-ns"
380 + fi
381 +
382 + # Save version information in the Emacs binary. It will be available
383 + # in variable "system-configuration-options".
384 + myconf+=" GENTOO_PACKAGE=${CATEGORY}/${PF}"
385 +
386 + # According to configure, this option is only used for GNU/Linux
387 + # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
388 + # out the location because $(get_libdir) does not necessarily return
389 + # something that matches the host OS's libdir naming (e.g. RHEL).
390 + local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
391 + crtdir=${crtdir%/*}
392 +
393 + econf \
394 + --program-suffix="-${EMACS_SUFFIX}" \
395 + --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
396 + --localstatedir="${EPREFIX}"/var \
397 + --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
398 + --with-crt-dir="${crtdir}" \
399 + --with-gameuser=":gamestat" \
400 + $(use_with hesiod) \
401 + $(use_with kerberos) $(use_with kerberos kerberos5) \
402 + $(use_with gpm) \
403 + $(use_with dbus) \
404 + ${myconf}
405 +}
406 +
407 +src_compile() {
408 + export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
409 + emake CC="$(tc-getCC)" \
410 + AR="$(tc-getAR) cq" \
411 + RANLIB="$(tc-getRANLIB)"
412 +}
413 +
414 +src_install () {
415 + emake DESTDIR="${D}" install
416 +
417 + rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
418 + || die "removing duplicate emacs executable failed"
419 + mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
420 + || die "moving emacs executable failed"
421 +
422 + # move man pages to the correct place
423 + local m
424 + mv "${ED}"/usr/share/man/man1/{emacs,${EMACS_SUFFIX}}.1 \
425 + || die "moving emacs man page failed"
426 + for m in b2m ctags ebrowse emacsclient etags grep-changelog rcs-checkin; do
427 + mv "${ED}"/usr/share/man/man1/${m}{,-${EMACS_SUFFIX}}.1 \
428 + || die "moving ${m} man page failed"
429 + done
430 +
431 + # move info dir to avoid collisions with the dir file generated by portage
432 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
433 + || die "moving info dir failed"
434 + touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
435 + docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
436 +
437 + # avoid collision between slots, see bug #169033 e.g.
438 + rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
439 + rm -rf "${ED}"/usr/share/{applications,icons}
440 + rm -rf "${ED}"/var
441 +
442 + # remove unused <version>/site-lisp dir
443 + rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
444 +
445 + # remove COPYING file (except for etc/COPYING used by describe-copying)
446 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
447 +
448 + local cdir
449 + if use source; then
450 + cdir="/usr/share/emacs/${FULL_VERSION}/src"
451 + insinto "${cdir}"
452 + # This is not meant to install all the source -- just the
453 + # C source you might find via find-function
454 + doins src/*.{c,h,m}
455 + doins -r src/{m,s}
456 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/Makefile.c
457 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README
458 + elif has installsources ${FEATURES}; then
459 + cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
460 + fi
461 +
462 + sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF
463 + X
464 + ;;; ${PN}-${SLOT} site-lisp configuration
465 + X
466 + (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
467 + Y (setq find-function-C-source-directory
468 + Y "${EPREFIX}${cdir}")
469 + X (let ((path (getenv "INFOPATH"))
470 + X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
471 + X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
472 + X (and path
473 + X ;; move Emacs Info dir before anything else in /usr/share/info
474 + X (let* ((p (cons nil (split-string path ":" t))) (q p))
475 + X (while (and (cdr q) (not (string-match re (cadr q))))
476 + X (setq q (cdr q)))
477 + X (setcdr q (cons dir (delete dir (cdr q))))
478 + X (setq Info-directory-list (prune-directory-list (cdr p)))))))
479 + EOF
480 + elisp-site-file-install "${T}/${SITEFILE}" || die
481 +
482 + dodoc README BUGS
483 +
484 + if use aqua; then
485 + dodir /Applications/Gentoo
486 + rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
487 + mv nextstep/Emacs.app \
488 + "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
489 + fi
490 +
491 + DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
492 + through the Emacs eselect module, which also redirects man and info
493 + pages. Therefore, several Emacs versions can be installed at the
494 + same time. \"man emacs.eselect\" for details.
495 + \\n\\nIf you upgrade from a previous major version of Emacs, then
496 + it is strongly recommended that you use app-admin/emacs-updater
497 + to rebuild all byte-compiled elisp files of the installed Emacs
498 + packages."
499 + use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
500 + Installing media-fonts/font-adobe-{75,100}dpi on the X server's
501 + machine would satisfy basic Emacs requirements under X11.
502 + See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
503 + for how to enable anti-aliased fonts."
504 + use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
505 + \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
506 + it into /Applications by yourself."
507 + readme.gentoo_create_doc
508 +}
509 +
510 +pkg_preinst() {
511 + # move Info dir file to correct name
512 + local infodir=/usr/share/info/${EMACS_SUFFIX} f
513 + if [[ -f ${ED}${infodir}/dir.orig ]]; then
514 + mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
515 + elif [[ -d "${ED}"${infodir} ]]; then
516 + # this should not happen in EAPI 4
517 + ewarn "Regenerating Info directory index in ${infodir} ..."
518 + rm -f "${ED}"${infodir}/dir{,.*}
519 + for f in "${ED}"${infodir}/*; do
520 + if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
521 + install-info --info-dir="${ED}"${infodir} "${f}" \
522 + || die "install-info failed"
523 + fi
524 + done
525 + fi
526 +}
527 +
528 +pkg_postinst() {
529 + elisp-site-regen
530 + readme.gentoo_print_elog
531 +
532 + if use livecd; then
533 + # force an update of the emacs symlink for the livecd/dvd,
534 + # because some microemacs packages set it with USE=livecd
535 + eselect emacs update
536 + elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
537 + # refresh symlinks in case any installed files have changed
538 + eselect emacs set ${EMACS_SUFFIX}
539 + else
540 + eselect emacs update ifunset
541 + fi
542 +}
543 +
544 +pkg_postrm() {
545 + elisp-site-regen
546 + eselect emacs update ifunset
547 +}