Diff emacs-27.2-r13 with a emacs-28.2-r9

/usr/portage/app-editors/emacs/emacs-28.2-r9.ebuild 2023-10-09 14:52:28.276368319 +0300
3 3

  
4 4
EAPI=8
5 5

  
6
inherit autotools elisp-common readme.gentoo-r1 toolchain-funcs
6
inherit autotools elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
7 7

  
8 8
if [[ ${PV##*.} = 9999 ]]; then
9 9
	inherit git-r3
10 10
	EGIT_REPO_URI="https://git.savannah.gnu.org/git/emacs.git"
11
	EGIT_BRANCH="emacs-27"
11
	EGIT_BRANCH="emacs-28"
12 12
	EGIT_CHECKOUT_DIR="${WORKDIR}/emacs"
13 13
	S="${EGIT_CHECKOUT_DIR}"
14 14
	SLOT="${PV%%.*}-vcs"
......
32 32
		SRC_URI="https://alpha.gnu.org/gnu/emacs/pretest/${PN}-${PV/_/-}.tar.xz"
33 33
	fi
34 34
	# Patchset from proj/emacs-patches.git
35
	SRC_URI+=" https://dev.gentoo.org/~ulm/emacs/${P}-patches-6.tar.xz"
35
	SRC_URI+=" https://dev.gentoo.org/~ulm/emacs/${P}-patches-4.tar.xz"
36 36
	PATCHES=("${WORKDIR}/patch")
37 37
	SLOT="${PV%%.*}"
38 38
	[[ ${PV} == *.*.* ]] && SLOT+="-vcs"
......
43 43
HOMEPAGE="https://www.gnu.org/software/emacs/"
44 44

  
45 45
LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
46
IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gfile gif +gmp gpm gsettings gtk gui gzip-el harfbuzz imagemagick +inotify jpeg json kerberos lcms libxml2 livecd m17n-lib mailutils motif png selinux sound source ssl svg systemd +threads tiff toolkit-scroll-bars valgrind wide-int Xaw3d xft +xpm xwidgets zlib"
47
RESTRICT="test"
46
IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gfile gif +gmp gpm gsettings gtk gui gzip-el harfbuzz imagemagick +inotify jit jpeg json kerberos lcms libxml2 livecd m17n-lib mailutils motif png selinux sound source ssl svg systemd +threads tiff toolkit-scroll-bars valgrind wide-int Xaw3d xft +xpm xwidgets zlib"
48 47

  
49 48
RDEPEND="app-emacs/emacs-common[games?,gui(-)?]
50 49
	sys-libs/ncurses:0=
......
55 54
	gmp? ( dev-libs/gmp:0= )
56 55
	gpm? ( sys-libs/gpm )
57 56
	!inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
57
	jit? (
58
		sys-devel/gcc:=[jit(-)]
59
		sys-libs/zlib
60
	)
58 61
	json? ( dev-libs/jansson:= )
59 62
	kerberos? ( virtual/krb5 )
60 63
	lcms? ( media-libs/lcms:2 )
......
141 144

  
142 145
src_prepare() {
143 146
	if [[ ${PV##*.} = 9999 ]]; then
144
		FULL_VERSION=$(sed -n 's/^AC_INIT([^,]*,[ \t]*\([^ \t,)]*\).*/\1/p' \
147
		FULL_VERSION=$(sed -n 's/^AC_INIT([^,]*,[^0-9.]*\([0-9.]*\).*/\1/p' \
145 148
			configure.ac)
146 149
		[[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
147 150
		einfo "Emacs branch: ${EGIT_BRANCH}"
......
151 154
			|| die "Upstream version number changed to ${FULL_VERSION}"
152 155
	fi
153 156

  
157
	if use jit; then
158
		export NATIVE_FULL_AOT=1
159
		find lisp -type f -name "*.elc" -delete || die
160

  
161
		# These files ignore LDFLAGS. We assign the variable here, because
162
		# for live ebuilds FULL_VERSION doesn't exist in global scope
163
		QA_FLAGS_IGNORED="usr/$(get_libdir)/emacs/${FULL_VERSION}/native-lisp/.*"
164

  
165
		# gccjit doesn't play well with ccache or distcc #801580
166
		# For now, work around the problem with an explicit LIBRARY_PATH
167
		has ccache ${FEATURES} || has distcc ${FEATURES} && tc-is-gcc \
168
			&& export LIBRARY_PATH=$("$(tc-getCC)" -print-search-dirs \
169
				| sed -n '/^libraries:/{s:^[^/]*::;p}')
170
	fi
171

  
154 172
	default
155 173

  
156 174
	# Fix filename reference in redirected man page
......
162 180
src_configure() {
163 181
	local myconf
164 182

  
183
	# Prevents e.g. tests interfering with running Emacs.
184
	unset EMACS_SOCKET_NAME
185

  
165 186
	if use alsa; then
166 187
		use sound || ewarn \
167 188
			"USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
......
170 191
		myconf+=" --with-sound=$(usex sound oss)"
171 192
	fi
172 193

  
194
	if use jit; then
195
		use zlib || ewarn \
196
			"USE flag \"jit\" overrides \"-zlib\"; enabling zlib support."
197
		myconf+=" --with-zlib"
198
	else
199
		myconf+=" $(use_with zlib)"
200
	fi
201

  
173 202
	if ! use gui; then
174 203
		einfo "Configuring to build without window system support"
175 204
		myconf+=" --without-x --without-ns"
......
273 302
		$(use_with games gameuser ":gamestat") \
274 303
		$(use_with gmp libgmp) \
275 304
		$(use_with gpm) \
305
		$(use_with jit native-compilation) \
276 306
		$(use_with json) \
277 307
		$(use_with kerberos) $(use_with kerberos kerberos5) \
278 308
		$(use_with lcms lcms2) \
......
283 313
		$(use_with systemd libsystemd) \
284 314
		$(use_with threads) \
285 315
		$(use_with wide-int) \
286
		$(use_with zlib) \
287 316
		${myconf}
288 317
}
289 318

  
290 319
src_compile() {
291 320
	export ac_cv_header_valgrind_valgrind_h=$(usex valgrind)
321
	append-cppflags -DUSE_VALGRIND=$(usex valgrind)
292 322

  
293 323
	if tc-is-cross-compiler; then
294 324
		# Build native tools for compiling lisp etc.
......
303 333
	emake
304 334
}
305 335

  
336
src_test() {
337
	# List .el test files with a comment above listing the exact
338
	# subtests which caused failure. Elements should begin with a %.
339
	# e.g. %lisp/gnus/mml-sec-tests.el.
340
	local exclude_tests=(
341
		# Reason: not yet known
342
		# mml-secure-en-decrypt-{1,2,3,4}
343
		# mml-secure-find-usable-keys-{1,2}
344
		# mml-secure-key-checks
345
		# mml-secure-select-preferred-keys-4
346
		# mml-secure-sign-verify-1
347
		%lisp/gnus/mml-sec-tests.el
348

  
349
		# Reason: race condition
350
		# Looks like it should be fixed in 29.x at least:
351
		# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55706
352
		# files-tests-file-name-non-special-file-in-directory-p
353
		%lisp/files-tests.el
354

  
355
		# Reason: permission denied on /nonexistent
356
		# (vc-*-bzr only fails if breezy is installed, as they
357
		# try to access cache dirs under /nonexistent)
358
		#
359
		# rmail-undigest-test-multipart-mixed-digest
360
		# rmail-undigest-test-rfc1153-less-strict-digest
361
		# rmail-undigest-test-rfc1153-sloppy-digest
362
		# rmail-undigest-test-rfc934-digest
363
		# vc-test-bzr02-state
364
		# vc-test-bzr05-rename-file
365
		# vc-test-bzr06-version-diff
366
		# vc-bzr-test-bug9781
367
		%lisp/mail/undigest-tests.el
368
		%lisp/vc/vc-tests.el
369
		%lisp/vc/vc-bzr-tests.el
370

  
371
		# Reason: fails if bubblewrap (bwrap) is installed
372
		# "bwrap: setting up uid map: Permission denied"
373
		#
374
		# bytecomp-tests--dest-mountpoint
375
		%lisp/emacs-lisp/bytecomp-tests.el
376
	)
377

  
378
	# See test/README for possible options
379
	emake \
380
		EMACS_TEST_VERBOSE=1 \
381
		EXCLUDE_TESTS="${exclude_tests[*]}" \
382
		TEST_BACKTRACE_LINE_LENGTH=nil \
383
		check
384
}
385

  
306 386
src_install() {
307 387
	emake DESTDIR="${D}" NO_BIN_LINK=t BLESSMAIL_TARGET= install
308 388

  
309 389
	mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} || die
310 390
	mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 || die
311
	mv "${ED}"/usr/share/metainfo/{emacs-,}${EMACS_SUFFIX}.appdata.xml || die
391
	mv "${ED}"/usr/share/metainfo/{emacs-,}${EMACS_SUFFIX}.metainfo.xml || die
312 392

  
313 393
	# dissuade Portage from removing our dir file #257260
314 394
	touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
......
323 403
	# avoid collision between slots, see bug #169033 e.g.
324 404
	rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el || die
325 405
	rm -rf "${ED}"/usr/share/{applications,icons} || die
326
	rm -rf "${ED}/usr/$(get_libdir)" || die
406
	rm -rf "${ED}/usr/$(get_libdir)/systemd" || die
327 407
	rm -rf "${ED}"/var || die
328 408

  
329 409
	# remove unused <version>/site-lisp dir
Thank you!