Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/emacs:master commit in: app-editors/emacs/
Date: Wed, 30 Nov 2022 18:25:58
Message-Id: 1669826815.60d75ccbf52cea54bf7542d0e78555b58ac0eeb4.ulm@gentoo
1 commit: 60d75ccbf52cea54bf7542d0e78555b58ac0eeb4
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 30 16:46:55 2022 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 30 16:46:55 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/emacs.git/commit/?id=60d75ccb
7
8 app-editors/emacs: Ebuilds for 23.4 and 24.5 copied from Gentoo repo
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 app-editors/emacs/Manifest | 2 +
13 app-editors/emacs/emacs-23.4-r21.ebuild | 354 ++++++++++++++++++++++++++++++++
14 app-editors/emacs/emacs-24.5-r11.ebuild | 346 +++++++++++++++++++++++++++++++
15 app-editors/emacs/metadata.xml | 42 ++--
16 4 files changed, 727 insertions(+), 17 deletions(-)
17
18 diff --git a/app-editors/emacs/Manifest b/app-editors/emacs/Manifest
19 index ae8fb8c..2fc5ee1 100644
20 --- a/app-editors/emacs/Manifest
21 +++ b/app-editors/emacs/Manifest
22 @@ -1,5 +1,7 @@
23 DIST emacs-23.4-patches-23.tar.xz 19932 BLAKE2B 941d939d1a66af162016eb7f4a34a3a6d19736ecbd06e2499ccb0bf8806b2b3583de324308698b00d0b47a3d0b8a046e5d5dcb2d681c2bba90ec40b58b4e9855 SHA512 83e2cef7ebe07fc69806d01946c6e96fa0e92b363e9c6531992593eeb29413518217fef05bba48729356af7d1326c3667748185aad971a625daccb803b2bfe58
24 +DIST emacs-23.4.tar.bz2 38646508 BLAKE2B 33dac5d27a63b7aab6b4053964a0ecf7f7939c7aea5af15103f2da7bd34fbb18dba7a1bf44cc4fcc2e3fb1439cdf7085d8dfc4b0005f5485748996e75ca6872d SHA512 def7a95ecaefae24d8102b96b1d575a23def1b11a8f0bb17b68f7913bd118e2ea4449a8feee76c1bd649f099b70419f0d494ddd9bb32b26f92720cda842b0296
25 DIST emacs-24.3-patches-7.tar.xz 6484 BLAKE2B 42da9c01a6fc7fd44b9281f11e1aed9ccc7273533c6deeab54125cabad9ff25757c410f43e32f55e13fc0d5354688a4fdd7e5c05dd8a98e36d9cd1a87f414ce9 SHA512 6e3f6f053ad66e6d298b4fd904c57a6c2a03269ec53e9dfc56f834672a42c8f48eeb20a7ed1bcfb534eb62e0cca6e01b4a1663bebb046a0ce7325b732a378868
26 DIST emacs-24.3.tar.xz 35565352 BLAKE2B 12474f0d4fb99449bb226834aabcaa15aa4e6c3cd6382786959636d53ea1c9a9662cb158cd6c88589e2760bd3030c3970c919fe35967a90830b77fce9e315df8 SHA512 a1300fa10a9fba2db9735db3d01382bcda89ceec033976c4622796dfdf6d2748ed5fa73edf229182b368190c8acbf706810dd5f344542d2c0d294154bc2d0ca9
27 DIST emacs-24.4-patches-5.tar.xz 6000 BLAKE2B 5a36e15de2237e8c42bbc57038c301ad9548a24af08b072dcfd175f07950605804649c5c4c3fd3504a864bf314d6a742c588cad26b84a1c283de68e4adb139fd SHA512 0a337ad5b7601f5e453645d1fba99717328c6bc7a5505bcb4bd8e853179cf61be43eb6f3b9370edf0f44aa6485d4847c14554c1592ccc7da87b10dabaaa9d421
28 DIST emacs-24.5-patches-5.tar.xz 14796 BLAKE2B 3e097f9cdf96a8b0255ce69770f79259ac9bdddbf5aa77c381973e4348d0900ee6dc6ed4af26021811afbb14eff84bc2a370bc8e803d112476554d03b074ce66 SHA512 fe9f9c19ff760e61dcbf1828d4e9e2806c141b47372bdd736be8237183660a28e2ef86a97034d060e244ff81540a2503a1b47655ef84222fddacb3a87f0f34ae
29 +DIST emacs-24.5.tar.xz 39759804 BLAKE2B aec253528038686822d1f8ed9a52dff276789ef7744053fc9b6176fceba4d4d8684fe979cf97e756b3feaf734d2377baef81f5efaa5450930a4e94d9f3bca355 SHA512 89dee4c3aadb6e505c523f84c65b5e40e5bf28a586cc8a4518a59581c22972f942bb6f3c772df0d5b2685c3e78247c545c6bb2576e981d1ef0f9298c18ad1677
30
31 diff --git a/app-editors/emacs/emacs-23.4-r21.ebuild b/app-editors/emacs/emacs-23.4-r21.ebuild
32 new file mode 100644
33 index 0000000..697eed5
34 --- /dev/null
35 +++ b/app-editors/emacs/emacs-23.4-r21.ebuild
36 @@ -0,0 +1,354 @@
37 +# Copyright 1999-2022 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=8
41 +WANT_AUTOMAKE="none"
42 +
43 +inherit autotools elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
44 +
45 +DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
46 +HOMEPAGE="https://www.gnu.org/software/emacs/"
47 +SRC_URI="mirror://gnu/emacs/${P}.tar.bz2
48 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-23.tar.xz"
49 +
50 +LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
51 +SLOT="23"
52 +KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
53 +IUSE="alsa aqua athena dbus games gconf gif gpm gtk gui gzip-el jpeg kerberos livecd m17n-lib motif png sound source svg tiff toolkit-scroll-bars Xaw3d xft +xpm"
54 +
55 +RDEPEND="acct-group/mail
56 + app-emacs/emacs-common[games?,gui(-)?]
57 + net-libs/liblockfile
58 + sys-libs/ncurses:0=
59 + kerberos? ( virtual/krb5 )
60 + alsa? ( media-libs/alsa-lib )
61 + games? ( acct-group/gamestat )
62 + gpm? ( sys-libs/gpm )
63 + dbus? ( sys-apps/dbus )
64 + gui? ( !aqua? (
65 + x11-libs/libICE
66 + x11-libs/libSM
67 + x11-libs/libX11
68 + x11-misc/xbitmaps
69 + gconf? ( >=gnome-base/gconf-2.26.2 )
70 + gif? ( media-libs/giflib:0= )
71 + jpeg? ( media-libs/libjpeg-turbo:0= )
72 + png? ( >=media-libs/libpng-1.4:0= )
73 + svg? ( >=gnome-base/librsvg-2.0 )
74 + tiff? ( media-libs/tiff:0 )
75 + xpm? ( x11-libs/libXpm )
76 + xft? (
77 + media-libs/fontconfig
78 + media-libs/freetype
79 + x11-libs/libXft
80 + x11-libs/libXrender
81 + m17n-lib? (
82 + >=dev-libs/libotf-0.9.4
83 + >=dev-libs/m17n-lib-1.5.1
84 + )
85 + )
86 + gtk? ( x11-libs/gtk+:2 )
87 + !gtk? (
88 + motif? (
89 + >=x11-libs/motif-2.3:0
90 + x11-libs/libXpm
91 + x11-libs/libXext
92 + x11-libs/libXmu
93 + x11-libs/libXt
94 + )
95 + !motif? (
96 + Xaw3d? (
97 + x11-libs/libXaw3d
98 + x11-libs/libXext
99 + x11-libs/libXmu
100 + x11-libs/libXt
101 + )
102 + !Xaw3d? ( athena? (
103 + x11-libs/libXaw
104 + x11-libs/libXext
105 + x11-libs/libXmu
106 + x11-libs/libXt
107 + ) )
108 + )
109 + )
110 + ) )"
111 +
112 +DEPEND="${RDEPEND}
113 + gui? ( !aqua? ( x11-base/xorg-proto ) )"
114 +
115 +BDEPEND="virtual/pkgconfig
116 + gzip-el? ( app-arch/gzip )"
117 +
118 +IDEPEND="app-eselect/eselect-emacs"
119 +
120 +RDEPEND+=" ${IDEPEND}"
121 +
122 +EMACS_SUFFIX="emacs-${SLOT}"
123 +SITEFILE="20${EMACS_SUFFIX}-gentoo.el"
124 +# FULL_VERSION keeps the full version number, which is needed in
125 +# order to determine some path information correctly for copy/move
126 +# operations later on
127 +FULL_VERSION="${PV%%_*}"
128 +S="${WORKDIR}/emacs-${FULL_VERSION}"
129 +PATCHES=("${WORKDIR}/patch")
130 +
131 +src_prepare() {
132 + default
133 +
134 + sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
135 + || die "unable to sed ctags.1"
136 +
137 + if ! use alsa; then
138 + # ALSA is detected even if not requested by its USE flag.
139 + # Suppress it by supplying pkg-config with a wrong library name.
140 + sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
141 + || die "unable to sed configure.in"
142 + fi
143 + if ! use gzip-el; then
144 + # Emacs' build system automatically detects the gzip binary and
145 + # compresses el files. We don't want that so confuse it with a
146 + # wrong binary name
147 + sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
148 + || die "unable to sed configure.in"
149 + fi
150 +
151 + eautoreconf
152 + touch src/stamp-h.in || die
153 +}
154 +
155 +src_configure() {
156 + strip-flags
157 + filter-flags -fstrict-aliasing -pie
158 + append-flags $(test-flags -fno-strict-aliasing)
159 + append-ldflags $(test-flags -no-pie) #639568
160 +
161 + if use ia64; then
162 + replace-flags "-O[2-9]" -O1 #325373
163 + else
164 + replace-flags "-O[3-9]" -O2
165 + fi
166 +
167 + # Don't trigger a floating point exception for NaNs on alpha
168 + use alpha && append-flags -mieee
169 +
170 + local myconf
171 +
172 + if use alsa && ! use sound; then
173 + einfo "Although sound USE flag is disabled you chose to have alsa,"
174 + einfo "so sound is switched on anyway."
175 + myconf+=" --with-sound"
176 + else
177 + myconf+=" $(use_with sound)"
178 + fi
179 +
180 + if ! use gui; then
181 + einfo "Configuring to build without window system support"
182 + myconf+=" --without-x --without-ns"
183 + elif use aqua; then
184 + einfo "Configuring to build with Nextstep (Macintosh Cocoa) support"
185 + myconf+=" --with-ns --disable-ns-self-contained"
186 + myconf+=" --without-x"
187 + else
188 + myconf+=" --with-x --without-ns"
189 + myconf+=" $(use_with gconf)"
190 + myconf+=" $(use_with toolkit-scroll-bars)"
191 + myconf+=" $(use_with gif)"
192 + myconf+=" $(use_with jpeg)"
193 + myconf+=" $(use_with png)"
194 + myconf+=" $(use_with svg rsvg)"
195 + myconf+=" $(use_with tiff)"
196 + myconf+=" $(use_with xpm)"
197 +
198 + if use xft; then
199 + myconf+=" --with-xft"
200 + myconf+=" $(use_with m17n-lib libotf)"
201 + myconf+=" $(use_with m17n-lib m17n-flt)"
202 + else
203 + myconf+=" --without-xft"
204 + myconf+=" --without-libotf --without-m17n-flt"
205 + use m17n-lib && ewarn \
206 + "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
207 + fi
208 +
209 + # GTK+ is the default toolkit if USE=gtk is chosen with other
210 + # possibilities. Emacs upstream thinks this should be standard
211 + # policy on all distributions
212 + local f
213 + if use gtk; then
214 + einfo "Configuring to build with GIMP Toolkit (GTK+)"
215 + myconf+=" --with-x-toolkit=gtk"
216 + for f in motif Xaw3d athena; do
217 + use ${f} && ewarn \
218 + "USE flag \"${f}\" has no effect if \"gtk\" is set."
219 + done
220 + elif use motif; then
221 + einfo "Configuring to build with Motif toolkit"
222 + myconf+=" --with-x-toolkit=motif"
223 + for f in Xaw3d athena; do
224 + use ${f} && ewarn \
225 + "USE flag \"${f}\" has no effect if \"motif\" is set."
226 + done
227 + elif use athena || use Xaw3d; then
228 + einfo "Configuring to build with Athena/Lucid toolkit"
229 + myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
230 + else
231 + einfo "Configuring to build with no toolkit"
232 + myconf+=" --with-x-toolkit=no"
233 + fi
234 + fi
235 +
236 + # According to configure, this option is only used for GNU/Linux
237 + # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
238 + # out the location because $(get_libdir) does not necessarily return
239 + # something that matches the host OS's libdir naming (e.g. RHEL).
240 + local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
241 + crtdir=${crtdir%/*}
242 +
243 + econf \
244 + --program-suffix="-${EMACS_SUFFIX}" \
245 + --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
246 + --localstatedir="${EPREFIX}"/var \
247 + --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
248 + --with-crt-dir="${crtdir}" \
249 + --with-gameuser=":gamestat" \
250 + --without-hesiod \
251 + $(use_with kerberos) $(use_with kerberos kerberos5) \
252 + $(use_with gpm) \
253 + $(use_with dbus) \
254 + ${myconf}
255 +}
256 +
257 +src_compile() {
258 + # Disable sandbox when dumping. For the unbelievers, see bug #131505
259 + emake CC="$(tc-getCC)" \
260 + AR="$(tc-getAR) cq" \
261 + RANLIB="$(tc-getRANLIB)" \
262 + RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
263 +}
264 +
265 +src_install() {
266 + emake DESTDIR="${D}" install
267 +
268 + rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
269 + || die "removing duplicate emacs executable failed"
270 + mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
271 + || die "moving emacs executable failed"
272 +
273 + # move man pages to the correct place
274 + local m
275 + mv "${ED}"/usr/share/man/man1/{emacs,${EMACS_SUFFIX}}.1 \
276 + || die "moving emacs man page failed"
277 + for m in b2m ctags ebrowse emacsclient etags grep-changelog rcs-checkin; do
278 + mv "${ED}"/usr/share/man/man1/${m}{,-${EMACS_SUFFIX}}.1 \
279 + || die "moving ${m} man page failed"
280 + done
281 +
282 + # move info dir to avoid collisions with the dir file generated by portage
283 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
284 + || die "moving info dir failed"
285 + touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
286 + docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
287 +
288 + # movemail must be setgid mail
289 + fowners root:mail /usr/libexec/emacs/${FULL_VERSION}/${CHOST}/movemail
290 + fperms 2751 /usr/libexec/emacs/${FULL_VERSION}/${CHOST}/movemail
291 +
292 + # avoid collision between slots, see bug #169033 e.g.
293 + rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el || die
294 + rm -rf "${ED}"/usr/share/{applications,icons} || die
295 + rm -rf "${ED}"/var || die
296 +
297 + # remove unused <version>/site-lisp dir
298 + rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp || die
299 +
300 + # remove COPYING file (except for etc/COPYING used by describe-copying)
301 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING || die
302 +
303 + local cdir
304 + if use source; then
305 + cdir="/usr/share/emacs/${FULL_VERSION}/src"
306 + insinto "${cdir}"
307 + # This is not meant to install all the source -- just the
308 + # C source you might find via find-function
309 + doins src/*.{c,h,m}
310 + doins -r src/{m,s}
311 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/Makefile.c || die
312 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README || die
313 + elif has installsources ${FEATURES}; then
314 + cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
315 + fi
316 +
317 + sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF || die
318 + X
319 + ;;; ${EMACS_SUFFIX} site-lisp configuration
320 + X
321 + (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
322 + Y (setq find-function-C-source-directory
323 + Y "${EPREFIX}${cdir}")
324 + X (let ((path (getenv "INFOPATH"))
325 + X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
326 + X (re "\\\\\`${EPREFIX}/usr/share\\\\>"))
327 + X (and path
328 + X ;; move Emacs Info dir before anything else in /usr/share
329 + X (let* ((p (cons nil (split-string path ":" t))) (q p))
330 + X (while (and (cdr q) (not (string-match re (cadr q))))
331 + X (setq q (cdr q)))
332 + X (setcdr q (cons dir (delete dir (cdr q))))
333 + X (setq Info-directory-list (prune-directory-list (cdr p)))))))
334 + EOF
335 + elisp-site-file-install "${T}/${SITEFILE}" || die
336 +
337 + dodoc README BUGS
338 +
339 + if use gui && use aqua; then
340 + dodir /Applications/Gentoo
341 + rm -rf "${ED}"/Applications/Gentoo/${EMACS_SUFFIX^}.app || die
342 + mv nextstep/Emacs.app \
343 + "${ED}"/Applications/Gentoo/${EMACS_SUFFIX^}.app || die
344 + fi
345 +
346 + local DOC_CONTENTS="You can set the version to be started by
347 + /usr/bin/emacs through the Emacs eselect module, which also
348 + redirects man and info pages. Therefore, several Emacs versions can
349 + be installed at the same time. \"man emacs.eselect\" for details.
350 + \\n\\nIf you upgrade from a previous major version of Emacs, then
351 + it is strongly recommended that you use app-admin/emacs-updater
352 + to rebuild all byte-compiled elisp files of the installed Emacs
353 + packages."
354 + if use gui; then
355 + DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
356 + Installing media-fonts/font-adobe-{75,100}dpi on the X server's
357 + machine would satisfy basic Emacs requirements under X11.
358 + See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
359 + for how to enable anti-aliased fonts."
360 + use aqua && DOC_CONTENTS+="\\n\\n${EMACS_SUFFIX^}.app is in
361 + \"${EPREFIX}/Applications/Gentoo\". You may want to copy or
362 + symlink it into /Applications by yourself."
363 + fi
364 + readme.gentoo_create_doc
365 +}
366 +
367 +pkg_preinst() {
368 + # move Info dir file to correct name
369 + if [[ -d ${ED}/usr/share/info ]]; then
370 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{.orig,} || die
371 + fi
372 +}
373 +
374 +pkg_postinst() {
375 + elisp-site-regen
376 + readme.gentoo_print_elog
377 +
378 + if use livecd; then
379 + # force an update of the emacs symlink for the livecd/dvd,
380 + # because some microemacs packages set it with USE=livecd
381 + eselect emacs update
382 + else
383 + eselect emacs update ifunset
384 + fi
385 +}
386 +
387 +pkg_postrm() {
388 + elisp-site-regen
389 + eselect emacs update ifunset
390 +}
391
392 diff --git a/app-editors/emacs/emacs-24.5-r11.ebuild b/app-editors/emacs/emacs-24.5-r11.ebuild
393 new file mode 100644
394 index 0000000..1ae3f49
395 --- /dev/null
396 +++ b/app-editors/emacs/emacs-24.5-r11.ebuild
397 @@ -0,0 +1,346 @@
398 +# Copyright 1999-2022 Gentoo Authors
399 +# Distributed under the terms of the GNU General Public License v2
400 +
401 +EAPI=8
402 +
403 +inherit autotools elisp-common flag-o-matic readme.gentoo-r1
404 +
405 +DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
406 +HOMEPAGE="https://www.gnu.org/software/emacs/"
407 +SRC_URI="mirror://gnu/emacs/${P}.tar.xz
408 + https://dev.gentoo.org/~ulm/emacs/${P}-patches-5.tar.xz"
409 +
410 +LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
411 +SLOT="24"
412 +KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
413 +IUSE="acl alsa aqua athena dbus games gfile gif gpm gsettings gtk gui gzip-el imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars wide-int Xaw3d xft +xpm zlib"
414 +
415 +RDEPEND="acct-group/mail
416 + app-emacs/emacs-common[games?,gui(-)?]
417 + net-libs/liblockfile
418 + sys-libs/ncurses:0=
419 + acl? ( virtual/acl )
420 + alsa? ( media-libs/alsa-lib )
421 + dbus? ( sys-apps/dbus )
422 + games? ( acct-group/gamestat )
423 + gpm? ( sys-libs/gpm )
424 + !inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
425 + kerberos? ( virtual/krb5 )
426 + libxml2? ( >=dev-libs/libxml2-2.2.0 )
427 + selinux? ( sys-libs/libselinux )
428 + ssl? ( net-libs/gnutls:0= )
429 + zlib? ( sys-libs/zlib )
430 + gui? ( !aqua? (
431 + x11-libs/libICE
432 + x11-libs/libSM
433 + x11-libs/libX11
434 + x11-libs/libXext
435 + x11-libs/libXinerama
436 + x11-libs/libXrandr
437 + x11-misc/xbitmaps
438 + gsettings? ( >=dev-libs/glib-2.28.6 )
439 + gif? ( media-libs/giflib:0= )
440 + jpeg? ( media-libs/libjpeg-turbo:0= )
441 + png? ( >=media-libs/libpng-1.4:0= )
442 + svg? ( >=gnome-base/librsvg-2.0 )
443 + tiff? ( media-libs/tiff:0 )
444 + xpm? ( x11-libs/libXpm )
445 + imagemagick? ( >=media-gfx/imagemagick-6.6.2:0= )
446 + xft? (
447 + media-libs/fontconfig
448 + media-libs/freetype
449 + x11-libs/libXft
450 + x11-libs/libXrender
451 + m17n-lib? (
452 + >=dev-libs/libotf-0.9.4
453 + >=dev-libs/m17n-lib-1.5.1
454 + )
455 + )
456 + gtk? ( x11-libs/gtk+:3 )
457 + !gtk? (
458 + motif? (
459 + >=x11-libs/motif-2.3:0
460 + x11-libs/libXpm
461 + x11-libs/libXmu
462 + x11-libs/libXt
463 + )
464 + !motif? (
465 + Xaw3d? (
466 + x11-libs/libXaw3d
467 + x11-libs/libXmu
468 + x11-libs/libXt
469 + )
470 + !Xaw3d? ( athena? (
471 + x11-libs/libXaw
472 + x11-libs/libXmu
473 + x11-libs/libXt
474 + ) )
475 + )
476 + )
477 + ) )"
478 +
479 +DEPEND="${RDEPEND}
480 + gui? ( !aqua? ( x11-base/xorg-proto ) )"
481 +
482 +BDEPEND="virtual/pkgconfig
483 + gzip-el? ( app-arch/gzip )"
484 +
485 +IDEPEND="app-eselect/eselect-emacs"
486 +
487 +RDEPEND+=" ${IDEPEND}"
488 +
489 +EMACS_SUFFIX="emacs-${SLOT}"
490 +SITEFILE="20${EMACS_SUFFIX}-gentoo.el"
491 +# FULL_VERSION keeps the full version number, which is needed in
492 +# order to determine some path information correctly for copy/move
493 +# operations later on
494 +FULL_VERSION="${PV%%_*}"
495 +S="${WORKDIR}/emacs-${FULL_VERSION}"
496 +PATCHES=("${WORKDIR}/patch")
497 +
498 +src_prepare() {
499 + default
500 +
501 + # Fix filename reference in redirected man page
502 + sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
503 + || die "unable to sed ctags.1"
504 +
505 + AT_M4DIR=m4 eautoreconf
506 + touch src/stamp-h.in || die
507 +}
508 +
509 +src_configure() {
510 + strip-flags
511 + filter-flags -pie #526948
512 + append-ldflags $(test-flags -no-pie) #639570
513 +
514 + if use ia64; then
515 + replace-flags "-O[2-9]" -O1 #325373
516 + else
517 + replace-flags "-O[3-9]" -O2
518 + fi
519 +
520 + # Don't trigger a floating point exception for NaNs on alpha
521 + use alpha && append-flags -mieee
522 +
523 + local myconf
524 +
525 + if use alsa; then
526 + use sound || ewarn \
527 + "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
528 + myconf+=" --with-sound=alsa"
529 + else
530 + myconf+=" --with-sound=$(usex sound oss)"
531 + fi
532 +
533 + if ! use gui; then
534 + einfo "Configuring to build without window system support"
535 + myconf+=" --without-x --without-ns"
536 + elif use aqua; then
537 + einfo "Configuring to build with Nextstep (Macintosh Cocoa) support"
538 + myconf+=" --with-ns --disable-ns-self-contained"
539 + myconf+=" --without-x"
540 + else
541 + myconf+=" --with-x --without-ns"
542 + myconf+=" --without-gconf"
543 + myconf+=" $(use_with gsettings)"
544 + myconf+=" $(use_with toolkit-scroll-bars)"
545 + myconf+=" $(use_with gif)"
546 + myconf+=" $(use_with jpeg)"
547 + myconf+=" $(use_with png)"
548 + myconf+=" $(use_with svg rsvg)"
549 + myconf+=" $(use_with tiff)"
550 + myconf+=" $(use_with xpm)"
551 + myconf+=" $(use_with imagemagick)"
552 +
553 + if use xft; then
554 + myconf+=" --with-xft"
555 + myconf+=" $(use_with m17n-lib libotf)"
556 + myconf+=" $(use_with m17n-lib m17n-flt)"
557 + else
558 + myconf+=" --without-xft"
559 + myconf+=" --without-libotf --without-m17n-flt"
560 + use m17n-lib && ewarn \
561 + "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
562 + fi
563 +
564 + local f line
565 + if use gtk; then
566 + einfo "Configuring to build with GIMP Toolkit (GTK+)"
567 + while read line; do ewarn "${line}"; done <<-EOF
568 + Your version of GTK+ will have problems with closing open
569 + displays. This is no problem if you just use one display, but
570 + if you use more than one and close one of them Emacs may crash.
571 + See <https://gitlab.gnome.org/GNOME/gtk/-/issues/221> and
572 + <https://gitlab.gnome.org/GNOME/gtk/-/issues/2315>.
573 + If you intend to use more than one display, then it is strongly
574 + recommended that you compile Emacs with the Athena/Lucid or the
575 + Motif toolkit instead.
576 + EOF
577 + myconf+=" --with-x-toolkit=gtk3"
578 + for f in motif Xaw3d athena; do
579 + use ${f} && ewarn \
580 + "USE flag \"${f}\" has no effect if \"gtk\" is set."
581 + done
582 + elif use motif; then
583 + einfo "Configuring to build with Motif toolkit"
584 + myconf+=" --with-x-toolkit=motif"
585 + for f in Xaw3d athena; do
586 + use ${f} && ewarn \
587 + "USE flag \"${f}\" has no effect if \"motif\" is set."
588 + done
589 + elif use athena || use Xaw3d; then
590 + einfo "Configuring to build with Athena/Lucid toolkit"
591 + myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
592 + else
593 + einfo "Configuring to build with no toolkit"
594 + myconf+=" --with-x-toolkit=no"
595 + fi
596 + fi
597 +
598 + econf \
599 + --program-suffix="-${EMACS_SUFFIX}" \
600 + --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
601 + --localstatedir="${EPREFIX}"/var \
602 + --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
603 + --with-gameuser=":gamestat" \
604 + --without-compress-install \
605 + --without-hesiod \
606 + --with-file-notification=$(usev inotify || usev gfile || echo no) \
607 + $(use_enable acl) \
608 + $(use_with dbus) \
609 + $(use_with gpm) \
610 + $(use_with kerberos) $(use_with kerberos kerberos5) \
611 + $(use_with libxml2 xml2) \
612 + $(use_with selinux) \
613 + $(use_with ssl gnutls) \
614 + $(use_with wide-int) \
615 + $(use_with zlib) \
616 + ${myconf}
617 +}
618 +
619 +src_compile() {
620 + # Disable sandbox when dumping. For the unbelievers, see bug #131505
621 + emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
622 +}
623 +
624 +src_install() {
625 + emake DESTDIR="${D}" NO_BIN_LINK=t BLESSMAIL_TARGET= install
626 +
627 + mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
628 + || die "moving emacs executable failed"
629 + mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
630 + || die "moving emacs man page failed"
631 +
632 + # move info dir to avoid collisions with the dir file generated by portage
633 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
634 + || die "moving info dir failed"
635 + touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
636 + docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
637 +
638 + # movemail must be setgid mail
639 + fowners root:mail /usr/libexec/emacs/${FULL_VERSION}/${CHOST}/movemail
640 + fperms 2751 /usr/libexec/emacs/${FULL_VERSION}/${CHOST}/movemail
641 +
642 + # avoid collision between slots, see bug #169033 e.g.
643 + rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el || die
644 + rm -rf "${ED}"/usr/share/{applications,icons} || die
645 + rm -rf "${ED}"/var || die
646 +
647 + # remove unused <version>/site-lisp dir
648 + rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp || die
649 +
650 + # remove COPYING file (except for etc/COPYING used by describe-copying)
651 + rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING || die
652 +
653 + if use gzip-el; then
654 + # compress .el files when a corresponding .elc exists
655 + find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
656 + -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
657 + assert "gzip .el failed"
658 + fi
659 +
660 + local cdir
661 + if use source; then
662 + cdir="/usr/share/emacs/${FULL_VERSION}/src"
663 + insinto "${cdir}"
664 + # This is not meant to install all the source -- just the
665 + # C source you might find via find-function
666 + doins src/*.{c,h,m}
667 + elif has installsources ${FEATURES}; then
668 + cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
669 + fi
670 +
671 + sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF || die
672 + X
673 + ;;; ${EMACS_SUFFIX} site-lisp configuration
674 + X
675 + (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
676 + Y (setq find-function-C-source-directory
677 + Y "${EPREFIX}${cdir}")
678 + X (let ((path (getenv "INFOPATH"))
679 + X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
680 + X (re "\\\\\`${EPREFIX}/usr/share\\\\>"))
681 + X (and path
682 + X ;; move Emacs Info dir before anything else in /usr/share
683 + X (let* ((p (cons nil (split-string path ":" t))) (q p))
684 + X (while (and (cdr q) (not (string-match re (cadr q))))
685 + X (setq q (cdr q)))
686 + X (setcdr q (cons dir (delete dir (cdr q))))
687 + X (setq Info-directory-list (prune-directory-list (cdr p)))))))
688 + EOF
689 + elisp-site-file-install "${T}/${SITEFILE}" || die
690 +
691 + dodoc README BUGS
692 +
693 + if use gui && use aqua; then
694 + dodir /Applications/Gentoo
695 + rm -rf "${ED}"/Applications/Gentoo/${EMACS_SUFFIX^}.app || die
696 + mv nextstep/Emacs.app \
697 + "${ED}"/Applications/Gentoo/${EMACS_SUFFIX^}.app || die
698 + fi
699 +
700 + local DOC_CONTENTS="You can set the version to be started by
701 + /usr/bin/emacs through the Emacs eselect module, which also
702 + redirects man and info pages. Therefore, several Emacs versions can
703 + be installed at the same time. \"man emacs.eselect\" for details.
704 + \\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
705 + strongly recommended that you use app-admin/emacs-updater to rebuild
706 + all byte-compiled elisp files of the installed Emacs packages."
707 + if use gui; then
708 + DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
709 + Installing media-fonts/font-adobe-{75,100}dpi on the X server's
710 + machine would satisfy basic Emacs requirements under X11.
711 + See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
712 + for how to enable anti-aliased fonts."
713 + use aqua && DOC_CONTENTS+="\\n\\n${EMACS_SUFFIX^}.app is in
714 + \"${EPREFIX}/Applications/Gentoo\". You may want to copy or
715 + symlink it into /Applications by yourself."
716 + fi
717 + readme.gentoo_create_doc
718 +}
719 +
720 +pkg_preinst() {
721 + # move Info dir file to correct name
722 + if [[ -d ${ED}/usr/share/info ]]; then
723 + mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{.orig,} || die
724 + fi
725 +}
726 +
727 +pkg_postinst() {
728 + elisp-site-regen
729 + readme.gentoo_print_elog
730 +
731 + if use livecd; then
732 + # force an update of the emacs symlink for the livecd/dvd,
733 + # because some microemacs packages set it with USE=livecd
734 + eselect emacs update
735 + else
736 + eselect emacs update ifunset
737 + fi
738 +}
739 +
740 +pkg_postrm() {
741 + elisp-site-regen
742 + eselect emacs update ifunset
743 +}
744
745 diff --git a/app-editors/emacs/metadata.xml b/app-editors/emacs/metadata.xml
746 index 3625f6f..098739b 100644
747 --- a/app-editors/emacs/metadata.xml
748 +++ b/app-editors/emacs/metadata.xml
749 @@ -1,11 +1,11 @@
750 <?xml version="1.0" encoding="UTF-8"?>
751 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
752 <pkgmetadata>
753 -<maintainer type="project">
754 - <email>gnu-emacs@g.o</email>
755 - <name>Gentoo GNU Emacs project</name>
756 -</maintainer>
757 -<longdescription>
758 + <maintainer type="project">
759 + <email>gnu-emacs@g.o</email>
760 + <name>Gentoo GNU Emacs project</name>
761 + </maintainer>
762 + <longdescription>
763 GNU Emacs is an extensible, customizable text editor - and more. At its core
764 is an interpreter for Emacs Lisp, a dialect of the Lisp programming language
765 with extensions to support text editing. The features of GNU Emacs include:
766 @@ -18,25 +18,33 @@
767 project planner, mail and news reader, debugger interface, calendar, and
768 more. Many of these extensions are distributed with GNU Emacs; others are
769 available separately.
770 -</longdescription>
771 -<use>
772 - <flag name="athena">Enable the MIT Athena widget set
773 + </longdescription>
774 + <use>
775 + <flag name="athena">Enable the MIT Athena widget set
776 (<pkg>x11-libs/libXaw</pkg>)</flag>
777 - <flag name="gsettings">Use gsettings (<pkg>dev-libs/glib</pkg>) to read the
778 + <flag name="games">Support shared score files for games</flag>
779 + <flag name="gconf">Use <pkg>gnome-base/gconf</pkg> to read the system
780 + font name</flag>
781 + <flag name="gfile">Use gfile (<pkg>dev-libs/glib</pkg>) for file
782 + notification</flag>
783 + <flag name="gsettings">Use gsettings (<pkg>dev-libs/glib</pkg>) to read the
784 system font name</flag>
785 - <flag name="gtk2">Prefer version 2 of the GIMP Toolkit to version 3
786 + <flag name="gtk2">Prefer version 2 of the GIMP Toolkit to version 3
787 (<pkg>x11-libs/gtk+</pkg>)</flag>
788 - <flag name="gzip-el">Compress bundled Emacs Lisp source</flag>
789 - <flag name="imagemagick">Use <pkg>media-gfx/imagemagick</pkg> for image
790 + <flag name="gzip-el">Compress bundled Emacs Lisp source</flag>
791 + <flag name="imagemagick">Use <pkg>media-gfx/imagemagick</pkg> for image
792 processing</flag>
793 - <flag name="libxml2">Use <pkg>dev-libs/libxml2</pkg> to parse XML instead
794 + <flag name="libxml2">Use <pkg>dev-libs/libxml2</pkg> to parse XML instead
795 of the internal Lisp implementations</flag>
796 - <flag name="source">Install C source files and make them available for
797 + <flag name="source">Install C source files and make them available for
798 find-function</flag>
799 - <flag name="toolkit-scroll-bars">Use the selected toolkit's scrollbars in
800 + <flag name="toolkit-scroll-bars">Use the selected toolkit's scrollbars in
801 preference to Emacs' own scrollbars</flag>
802 - <flag name="wide-int">Prefer wide Emacs integers (typically 62-bit).
803 + <flag name="wide-int">Prefer wide Emacs integers (typically 62-bit).
804 This option has an effect only on architectures where "long" and
805 "long long" types have different size.</flag>
806 -</use>
807 + </use>
808 + <upstream>
809 + <remote-id type="savannah">emacs</remote-id>
810 + </upstream>
811 </pkgmetadata>