[packages/emacs] Up to 31.1

arekm arekm at pld-linux.org
Mon Aug 24 21:24:11 CEST 2026


commit 84e1b60586f150e761ec379f4a1d812f6f80e39d
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Aug 24 21:23:22 2026 +0200

    Up to 31.1
    
    Drop upstreamed patches; SELinux and libsmack now need explicit configure flags.

 emacs-shorthands-code-execution.patch | 59 -----------------------
 emacs-tree-sitter-0.26.patch          | 91 -----------------------------------
 emacs.spec                            | 27 ++++++-----
 3 files changed, 14 insertions(+), 163 deletions(-)
---
diff --git a/emacs.spec b/emacs.spec
index 8fd82a9..f49fd24 100644
--- a/emacs.spec
+++ b/emacs.spec
@@ -1,5 +1,5 @@
 # TODO:
-# - package ctags/etags in subpackage?
+# - package etags in subpackage?
 #
 # Conditional build:
 %bcond_without	athena		# don't build athena version
@@ -16,13 +16,13 @@ Summary(pl.UTF-8):	GNU Emacs - edytor tekstu dla systemu X Window
 Summary(pt_BR.UTF-8):	GNU Emacs
 Summary(tr.UTF-8):	GNU Emacs
 Name:		emacs
-%define	ver	30.2
+%define	ver	31.1
 Version:	%{ver}
-Release:	4
+Release:	1
 License:	GPL v3+
 Group:		Applications/Editors/Emacs
 Source0:	https://ftp.gnu.org/gnu/emacs/%{name}-%{version}.tar.xz
-# Source0-md5:	0adba4843ac864ba8c3c9b2a7deea176
+# Source0-md5:	8ea039d695b91c5c0778f8eb2f1b18fa
 Source1:	%{name}-dot%{name}
 Source2:	%{name}-site-start.el
 Source3:	%{name}.png
@@ -33,10 +33,6 @@ Source7:	%{name}-gtk.desktop
 Source8:	%{name}-motif.desktop
 Source9:	%{name}-nox.desktop
 Patch0:		%{name}-file-expand-wildcards-permission.patch
-# https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-31&id=8466eb44991707d128110bdc549fad14c8e1d61e
-Patch1:		%{name}-shorthands-code-execution.patch
-# https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166
-Patch2:		%{name}-tree-sitter-0.26.patch
 URL:		http://www.gnu.org/software/emacs/
 BuildRequires:	freetype-devel
 BuildRequires:	giflib-devel
@@ -46,6 +42,7 @@ BuildRequires:	harfbuzz-devel
 BuildRequires:	lcms2-devel
 BuildRequires:	libjpeg-devel
 BuildRequires:	libpng-devel
+BuildRequires:	libselinux-devel
 BuildRequires:	libtiff-devel
 BuildRequires:	libwebp-devel
 BuildRequires:	libxml2-devel
@@ -375,8 +372,6 @@ exit 1
 
 %setup -q -n %{name}-%{ver}
 %patch -P0 -p1
-%patch -P1 -p1
-%patch -P2 -p1
 
 %build
 
@@ -394,6 +389,8 @@ mkdir build-athena && cd build-athena
 	--with-gif \
 	--with-png \
 	--with-tree-sitter \
+	--with-selinux \
+	--without-libsmack \
 	--with-x-toolkit=athena \
 	%{?with_bootstrap:--without-gpm}
 
@@ -413,6 +410,8 @@ mkdir build-gtk && cd build-gtk
 	--with-gif \
 	--with-png \
 	--with-tree-sitter \
+	--with-selinux \
+	--without-libsmack \
 	--with-x-toolkit=gtk3 \
 	%{?with_bootstrap:--without-gpm}
 
@@ -436,6 +435,8 @@ mkdir build-motif && cd build-motif
 	--with-gif \
 	--with-png \
 	--with-tree-sitter \
+	--with-selinux \
+	--without-libsmack \
 	--with-x-toolkit=motif \
 	%{?with_bootstrap:--without-gpm}
 
@@ -459,6 +460,8 @@ mkdir build-nox && cd build-nox
 	--without-gif \
 	--without-png \
 	--with-tree-sitter \
+	--with-selinux \
+	--without-libsmack \
 	--with-x=no \
 	%{?with_bootstrap:--without-gpm}
 
@@ -484,7 +487,7 @@ install -d $RPM_BUILD_ROOT{%{_infodir},%{_datadir}/emacs/site-lisp/site-start.d}
 
 %if %{with athena}%{with gtk}%{with motif}%{with nox}
 %make_install -C build-%{bootstrap} \
-	systemdunitdir=%{systemduserunitdir}
+	systemduserunitdir=%{systemduserunitdir}
 %else
 echo 'ERROR: neither athena nor gtk nor motif nor nox emacs was built.' 1>&2
 exit 1
@@ -579,10 +582,8 @@ fi
 %config(noreplace) /etc/skel/.emacs
 %attr(755,root,root) %{_bindir}/ebrowse
 %attr(755,root,root) %{_bindir}/emacsclient
-%attr(755,root,root) %{_bindir}/ctags
 %attr(755,root,root) %{_bindir}/etags
 %{_includedir}/emacs-module.h
-%{_mandir}/man1/ctags.1*
 %{_mandir}/man1/ebrowse*
 %{_mandir}/man1/emacs*
 %{_mandir}/man1/etags*
diff --git a/emacs-shorthands-code-execution.patch b/emacs-shorthands-code-execution.patch
deleted file mode 100644
index d700d04..0000000
--- a/emacs-shorthands-code-execution.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 8466eb44991707d128110bdc549fad14c8e1d61e Mon Sep 17 00:00:00 2001
-From: Eshel Yaron <me at eshelyaron.com>
-Date: Wed, 5 Aug 2026 19:58:32 +0200
-Subject: Mitigate arbitrary code execution vulnerability
-
-This mitigates a vulnerability that allowed a specially
-crafted file to trigger execution of attacker-controlled
-arbitrary Emacs Lisp code immediately when the file is
-visited in Emacs (before the file's malicious contents are
-even displayed).  See demonstration in bug#80574.
-
-* lisp/progmodes/cc-fonts.el (c-compose-keywords-list):
-* lisp/vc/vc-hooks.el (vc-find-backend-function):
-Nullify 'read-symbol-shorthands' around risky 'intern' calls.
-Do not merge to master.
----
- lisp/progmodes/cc-fonts.el | 10 +++++++---
- lisp/vc/vc-hooks.el        |  5 ++++-
- 2 files changed, 11 insertions(+), 4 deletions(-)
-
-diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
-index 9103787df7a..49346f81dfb 100644
---- a/lisp/progmodes/cc-fonts.el
-+++ b/lisp/progmodes/cc-fonts.el
-@@ -2585,9 +2585,13 @@ higher."
-   (let* ((doc-keywords (c-get-doc-comment-style))
- 	 (list (nconc (c--mapcan
- 		       (lambda (doc-style)
--			 (let ((sym (intern
--				     (concat (symbol-name doc-style)
--					     "-font-lock-keywords"))))
-+			 (let ((sym
-+				;; Guard `intern' from potentially
-+				;; malicious shorthands.
-+				(let (read-symbol-shorthands)
-+				  (intern
-+				   (concat (symbol-name doc-style)
-+					   "-font-lock-keywords")))))
- 			   (cond ((fboundp sym)
- 				  (funcall sym))
- 				 ((boundp sym)
-diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
-index 132b9211f88..5775983fd91 100644
---- a/lisp/vc/vc-hooks.el
-+++ b/lisp/vc/vc-hooks.el
-@@ -299,7 +299,10 @@ properties further down the directory hierarchy override ones higher up."
-   "Return BACKEND-specific implementation of FUN.
- If there is no such implementation, return the default implementation;
- if that doesn't exist either, return nil."
--  (let ((f (vc-make-backend-sym backend fun)))
-+  ;; Nullify `read-symbol-shorthands' to guard the `intern' calls below
-+  ;; and in `vc-make-backend-sym' from potentially malicious shorthands.
-+  (let* ((read-symbol-shorthands nil)
-+         (f (vc-make-backend-sym backend fun)))
-     (if (fboundp f) f
-       ;; Load vc-BACKEND.el if needed.
-       (require (intern (concat "vc-" (downcase (symbol-name backend)))))
--- 
-
diff --git a/emacs-tree-sitter-0.26.patch b/emacs-tree-sitter-0.26.patch
deleted file mode 100644
index 9be45dc..0000000
--- a/emacs-tree-sitter-0.26.patch
+++ /dev/null
@@ -1,91 +0,0 @@
---- emacs-30.2/src/treesit.c.orig	2025-08-24 00:00:00.000000000 +0000
-+++ emacs-30.2/src/treesit.c	2026-08-23 00:00:00.000000000 +0000
-@@ -34,7 +34,11 @@
- # include "w32common.h"
- 
- /* In alphabetical order.  */
-+#if TREE_SITTER_LANGUAGE_VERSION >= 15
-+#undef ts_language_abi_version
-+#else
- #undef ts_language_version
-+#endif
- #undef ts_node_child
- #undef ts_node_child_by_field_name
- #undef ts_node_child_count
-@@ -89,7 +93,11 @@
- #undef ts_tree_get_changed_ranges
- #undef ts_tree_root_node
- 
-+#if TREE_SITTER_LANGUAGE_VERSION >= 15
-+DEF_DLL_FN (uint32_t, ts_language_abi_version, (const TSLanguage *));
-+#else
- DEF_DLL_FN (uint32_t, ts_language_version, (const TSLanguage *));
-+#endif
- DEF_DLL_FN (TSNode, ts_node_child, (TSNode, uint32_t));
- DEF_DLL_FN (TSNode, ts_node_child_by_field_name,
- 	    (TSNode, const char *, uint32_t));
-@@ -166,7 +174,11 @@
-   if (!library)
-     return false;
- 
-+#if TREE_SITTER_LANGUAGE_VERSION >= 15
-+  LOAD_DLL_FN (library, ts_language_abi_version);
-+#else
-   LOAD_DLL_FN (library, ts_language_version);
-+#endif
-   LOAD_DLL_FN (library, ts_node_child);
-   LOAD_DLL_FN (library, ts_node_child_by_field_name);
-   LOAD_DLL_FN (library, ts_node_child_count);
-@@ -224,7 +236,11 @@
-   return true;
- }
- 
-+#if TREE_SITTER_LANGUAGE_VERSION >= 15
-+#define ts_language_abi_version fn_ts_language_abi_version
-+#else
- #define ts_language_version fn_ts_language_version
-+#endif
- #define ts_node_child fn_ts_node_child
- #define ts_node_child_by_field_name fn_ts_node_child_by_field_name
- #define ts_node_child_count fn_ts_node_child_count
-@@ -632,6 +648,22 @@
-     }
- }
- 
-+/* This function is a compatibility shim.  Tree-sitter 0.25 introduced
-+   ts_language_abi_version as a replacement for ts_language_version, and
-+   tree-sitter 0.26 removed ts_language_version.  Here we use the fact
-+   that 0.25 bumped TREE_SITTER_LANGUAGE_VERSION to 15, to use the new
-+   function instead of the old one, when Emacs is compiled against
-+   tree-sitter version 0.25 or newer.  */
-+static uint32_t
-+treesit_language_abi_version (const TSLanguage *ts_lang)
-+{
-+#if TREE_SITTER_LANGUAGE_VERSION >= 15
-+  return ts_language_abi_version (ts_lang);
-+#else
-+  return ts_language_version (ts_lang);
-+#endif
-+}
-+
- /* Load the dynamic library of LANGUAGE_SYMBOL and return the pointer
-    to the language definition.
- 
-@@ -746,7 +778,7 @@
-     {
-       *signal_symbol = Qtreesit_load_language_error;
-       *signal_data = list2 (Qversion_mismatch,
--			    make_fixnum (ts_language_version (lang)));
-+			    make_fixnum (treesit_language_abi_version (lang)));
-       return NULL;
-     }
-   return lang;
-@@ -817,7 +849,7 @@
- 						       &signal_data);
-       if (ts_language == NULL)
- 	return Qnil;
--      uint32_t version =  ts_language_version (ts_language);
-+      uint32_t version =  treesit_language_abi_version (ts_language);
-       return make_fixnum((ptrdiff_t) version);
-     }
- }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/emacs.git/commitdiff/84e1b60586f150e761ec379f4a1d812f6f80e39d



More information about the pld-cvs-commit mailing list