Accepting request 1236885 from editors

- Add patch emacs-29.4-boo1234673.patch
  * Avoid that Emacs recompiles some packages on every startup (boo#1234673)

OBS-URL: https://build.opensuse.org/request/show/1236885
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/emacs?expand=0&rev=197
This commit is contained in:
Ana Guerrero 2025-01-12 10:08:56 +00:00 committed by Git OBS Bridge
commit 5e1c280c74
4 changed files with 52 additions and 6 deletions

View File

@ -10,11 +10,12 @@ even if the Xauthority file is not the default expected by XCloseDisplay()
2 files changed, 45 insertions(+), 2 deletions(-) 2 files changed, 45 insertions(+), 2 deletions(-)
--- etc/emacs.service --- etc/emacs.service
+++ etc/emacs.service 2024-04-11 06:46:29.320172754 +0000 +++ etc/emacs.service 2025-01-09 13:32:23.071591602 +0000
@@ -5,9 +5,11 @@ @@ -5,9 +5,12 @@
[Unit] [Unit]
Description=Emacs text editor Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/ Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
+PartOf=graphical-session.target
+After=graphical-session.target +After=graphical-session.target
[Service] [Service]
@ -23,6 +24,12 @@ even if the Xauthority file is not the default expected by XCloseDisplay()
ExecStart=emacs --fg-daemon ExecStart=emacs --fg-daemon
# Emacs will exit with status 15 after having received SIGTERM, which # Emacs will exit with status 15 after having received SIGTERM, which
@@ -20,4 +23,4 @@ SuccessExitStatus=15
Restart=on-failure
[Install]
-WantedBy=default.target
+WantedBy=graphical-session.target
--- lisp/server.el --- lisp/server.el
+++ lisp/server.el 2024-04-11 06:17:17.692578500 +0000 +++ lisp/server.el 2024-04-11 06:17:17.692578500 +0000
@@ -289,6 +289,11 @@ If nil, no instructions are displayed." @@ -289,6 +289,11 @@ If nil, no instructions are displayed."

View File

@ -0,0 +1,27 @@
https://emacs.stackexchange.com/questions/82010/why-is-emacs-recompiling-some-packages-on-every-startup
---
lisp/emacs-lisp/comp.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- lisp/emacs-lisp/comp.el
+++ lisp/emacs-lisp/comp.el 2025-01-09 09:34:45.706219439 +0000
@@ -4177,6 +4177,18 @@ LOAD and SELECTOR work as described in `
(cl-some (lambda (re)
(string-match-p re file))
native-comp-jit-compilation-deny-list))))
+;; SUSE boo#1234673 -- Emacs freeze for a few seconds when opening any python file, with 100% Xorg usage
+(defun fixed-native-compile-async-skip-p
+ (native-compile-async-skip-p file load selector)
+ (let* ((naive-elc-file (file-name-with-extension file "elc"))
+ (elc-file (replace-regexp-in-string
+ "\\.el\\.elc$" ".elc" naive-elc-file)))
+ (or (gethash elc-file comp--no-native-compile)
+ (funcall native-compile-async-skip-p file load selector))))
+
+(advice-add 'native-compile-async-skip-p
+ :around 'fixed-native-compile-async-skip-p)
+;; SUSE boo#1234673 -- end
(defun native--compile-async (files &optional recursively load selector)
;; BEWARE, this function is also called directly from C.

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 9 12:26:03 UTC 2025 - Dr. Werner Fink <werner@suse.de>
- Add patch emacs-29.4-boo1234673.patch
* Avoid that Emacs recompiles some packages on every startup (boo#1234673)
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Dec 13 14:42:16 UTC 2024 - Dr. Werner Fink <werner@suse.de> Fri Dec 13 14:42:16 UTC 2024 - Dr. Werner Fink <werner@suse.de>

View File

@ -1,7 +1,7 @@
# #
# spec file for package emacs # spec file for package emacs
# #
# Copyright (c) 2024 SUSE LLC # Copyright (c) 2025 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -218,6 +218,7 @@ Patch25: emacs-26.1-xft4x11.patch
Patch26: emacs-27.1-pdftex.patch Patch26: emacs-27.1-pdftex.patch
Patch29: emacs-27.1-Xauthority4server.patch Patch29: emacs-27.1-Xauthority4server.patch
Patch30: emacs-CVE-2024-53920.patch Patch30: emacs-CVE-2024-53920.patch
Patch31: emacs-29.4-boo1234673.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)} %{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)}
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)} %{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
@ -325,7 +326,7 @@ Summary: Info files for GNU Emacs
Group: Documentation/Other Group: Documentation/Other
%if 0%{?suse_version} <= 1500 %if 0%{?suse_version} <= 1500
Requires(post): %install_info_prereq Requires(post): %install_info_prereq
Requires(preun):%install_info_prereq Requires(preun): %install_info_prereq
%endif %endif
BuildArch: noarch BuildArch: noarch
@ -353,7 +354,7 @@ group called "games".
Summary: Generate Tag Files for Use with Emacs Summary: Generate Tag Files for Use with Emacs
Group: Development/Tools/Navigators Group: Development/Tools/Navigators
Requires(post): coreutils update-alternatives Requires(post): coreutils update-alternatives
Requires(preun):coreutils update-alternatives Requires(preun): coreutils update-alternatives
Provides: ctags:/usr/bin/etags Provides: ctags:/usr/bin/etags
%description -n etags %description -n etags
@ -381,6 +382,7 @@ and most assembler-like syntaxes.
%patch -P26 -p0 -b .fmt %patch -P26 -p0 -b .fmt
%patch -P29 -p0 -b .xauth %patch -P29 -p0 -b .xauth
%patch -P30 -p0 -b .cve202453920 %patch -P30 -p0 -b .cve202453920
%patch -P31 -p0 -b .boo1234673
%patch -P0 -p0 -b .0 %patch -P0 -p0 -b .0
%if %{without tex4pdf} %if %{without tex4pdf}
pushd etc/refcards/ pushd etc/refcards/
@ -755,6 +757,7 @@ rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/server.el.xauth
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/htmlfontify.el.cve202248339 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/htmlfontify.el.cve202248339
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/progmodes/elisp-mode.el.el.cve202453920 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/progmodes/elisp-mode.el.el.cve202453920
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/progmodes/ruby-mode.el.cve202248338 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/progmodes/ruby-mode.el.cve202248338
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/emacs-lisp/comp.el.boo1234673
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient-mail.desktop.cve202327985 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient-mail.desktop.cve202327985
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient-mail.desktop.cve202327986 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient-mail.desktop.cve202327986
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient.desktop.cve202327985 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient.desktop.cve202327985
@ -869,7 +872,10 @@ export AR=gcc-ar-13
export RANLIB=gcc-ranlib-13 export RANLIB=gcc-ranlib-13
%endif %endif
%endif %endif
make check sed -ri '/sleep 2/{ s/sleep 2/sleep 6/ }' test/lisp/eshell/eshell-tests.el
sed -ri '/\(sleep-for/{ s/1/5/ }' test/lisp/net/network-stream-tests.el
export MAKEFLAGS="--jobs=1"
make -k check
%endif %endif
%if %{with games} && "%{gattr}" == "02755" %if %{with games} && "%{gattr}" == "02755"