similarity index 98%
rename from meta-oe/recipes-support/emacs/emacs_30.2.bb
rename to meta-oe/recipes-support/emacs/emacs_31.1.bb
@@ -4,10 +4,7 @@ HOMEPAGE = "https://www.gnu.org/software/emacs/"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
-SRC_URI = " \
- ${GNU_MIRROR}/emacs/${BP}.tar.xz \
- file://0001-Support-Tree-sitter-version-0.26-and-later.patch \
-"
+SRC_URI = "${GNU_MIRROR}/emacs/${BP}.tar.xz"
UPSTREAM_CHECK_URI = "${GNU_MIRROR}/emacs/"
SRC_URI:append:class-target = " \
@@ -16,7 +13,7 @@ SRC_URI:append:class-target = " \
file://leim_dont-unexport-EMACSDATA.patch \
"
-SRC_URI[sha256sum] = "b3f36f18a6dd2715713370166257de2fae01f9d38cfe878ced9b1e6ded5befd9"
+SRC_URI[sha256sum] = "1da5790d9580c81932b5bf700633114468da7b3412d69faa767daebf974f4586"
CVE_STATUS[CVE-2007-6109] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions."
deleted file mode 100644
@@ -1,118 +0,0 @@
-From d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166 Mon Sep 17 00:00:00 2001
-From: Eli Zaretskii <eliz@gnu.org>
-Date: Fri, 17 Oct 2025 14:15:41 +0300
-Subject: [PATCH] Support Tree-sitter version 0.26 and later
-
-* src/treesit.c (init_treesit_functions)
-[TREE_SITTER_LANGUAGE_VERSION >= 15]: Define prototype for, and
-load 'ts_language_abi_version' instead of the deprecated (and
-removed in tree-sitter 0.26) 'ts_language_version'.
-(ts_language_abi_version) [TREE_SITTER_LANGUAGE_VERSION >= 15]:
-Define on WINDOWSNT, instead of 'ts_language_version'.
-(treesit_language_abi_version): New compatibility function.
-(treesit_load_language, Ftreesit_language_abi_version): Use
-'treesit_language_abi_version' instead of 'ts_language_version'.
-(Bug#79627)
-
-Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166]
-
-Signed-off-by: Markus Volk <f_l_k@t-online.de>
-
-The hunk for treesit_load_language was applied by hand, the code around
-it differs in 30.2.
----
- src/treesit.c | 36 ++++++++++++++++++++++++++++++++++--
- 1 file changed, 34 insertions(+), 2 deletions(-)
-
-diff --git a/src/treesit.c b/src/treesit.c
---- a/src/treesit.c
-+++ b/src/treesit.c
-@@ -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);
- }
- }
@@ -14,20 +14,55 @@ version of the recipe instead.
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
-Index: emacs-29.1/src/Makefile.in
-===================================================================
---- emacs-29.1.orig/src/Makefile.in
-+++ emacs-29.1/src/Makefile.in
-@@ -542,7 +542,7 @@ ifeq ($(CHECK_STRUCTS),true)
+diff --git a/Makefile.in b/Makefile.in
+index 04c21fc..912d455 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -320,7 +320,7 @@ GLIB_COMPILE_SCHEMAS = glib-compile-schemas
+ TRANSFORM = @program_transform_name@
+
+ # Prevent any settings in the user environment causing problems.
+-unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH
++unexport EMACSDOC EMACSPATH
+
+ # What emacs should be called when installed.
+ EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
+diff --git a/lisp/Makefile.in b/lisp/Makefile.in
+index 1142147..f1cd99b 100644
+--- a/lisp/Makefile.in
++++ b/lisp/Makefile.in
+@@ -53,7 +53,7 @@ FIND_DELETE = @FIND_DELETE@
+ # We never change directory before running Emacs, so a relative file
+ # name is fine, and makes life easier. If we need to change
+ # directory, we can use emacs --chdir.
+-EMACS = ../src/emacs${EXEEXT}
++EMACS = bootstrap-emacs
+
+ # Command line flags for Emacs.
+
+@@ -112,7 +112,7 @@ MAIN_FIRST = ./emacs-lisp/eieio.el ./emacs-lisp/eieio-base.el \
+ ./org/oc.el ./org/ol.el ./emacs-lisp/cl-lib.el
+
+ # Prevent any settings in the user environment causing problems.
+-unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH
++unexport EMACSDOC EMACSPATH
+
+ # The actual Emacs command run in the targets below.
+ emacs = '$(EMACS)' $(EMACSOPT)
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 111f94f..d30c854 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -518,7 +518,7 @@ ifeq ($(CHECK_STRUCTS),true)
pdumper.o: dmpstruct.h
endif
dmpstruct.h: $(srcdir)/dmpstruct.awk
-dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers)
+dmpstruct.h: $(dmpstruct_headers)
- $(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \
+ $(AM_V_GEN)POSIXLY_CORRECT=1 $(AWK) -f $(srcdir)/dmpstruct.awk \
$(dmpstruct_headers) > $@
-@@ -651,8 +651,7 @@
+@@ -627,8 +627,7 @@ SYSTEM_TYPE = @SYSTEM_TYPE@
## Strictly speaking, emacs does not depend directly on all of $lisp,
## since not all pieces are used on all platforms. But DOC depends
## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
@@ -37,7 +72,7 @@ Index: emacs-29.1/src/Makefile.in
$(lispsource)/international/charprop.el ${charsets}
ifeq ($(SYSTEM_TYPE),cygwin)
find ${top_builddir} -name '*.eln' | rebase -v -O -T -
-@@ -695,7 +695,7 @@ endif
+@@ -663,7 +662,7 @@ endif
$(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(doc_obj)
$(AM_V_GEN)$(MKDIR_P) $(etc)
$(AM_V_at)rm -f $(etc)/DOC
@@ -46,7 +81,7 @@ Index: emacs-29.1/src/Makefile.in
$(SOME_MACHINE_OBJECTS) $(doc_obj) > $(etc)/DOC
$(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \
-@@ -712,7 +712,7 @@ buildobj.h: Makefile
+@@ -680,7 +679,7 @@ buildobj.h: Makefile
GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
@@ -55,7 +90,7 @@ Index: emacs-29.1/src/Makefile.in
$(AM_V_at)$(top_srcdir)/build-aux/move-if-change globals.tmp globals.h
$(AM_V_at)echo timestamp > $@
-@@ -726,7 +726,7 @@ $(LIBEGNU_ARCHIVE): $(config_h)
+@@ -694,7 +693,7 @@ $(LIBEGNU_ARCHIVE): $(config_h)
$(MAKE) -C $(dir $@) all
ifeq ($(HAVE_PDUMPER),yes)
@@ -64,38 +99,3 @@ Index: emacs-29.1/src/Makefile.in
else
MAKE_PDUMPER_FINGERPRINT =
endif
-Index: emacs-29.1/lisp/Makefile.in
-===================================================================
---- emacs-29.1.orig/lisp/Makefile.in
-+++ emacs-29.1/lisp/Makefile.in
-@@ -53,7 +53,7 @@ FIND_DELETE = @FIND_DELETE@
- # We never change directory before running Emacs, so a relative file
- # name is fine, and makes life easier. If we need to change
- # directory, we can use emacs --chdir.
--EMACS = ../src/emacs${EXEEXT}
-+EMACS = bootstrap-emacs
-
- # Command line flags for Emacs.
-
-@@ -109,7 +109,7 @@ MAIN_FIRST = ./emacs-lisp/eieio.el ./ema
- ./org/oc.el ./org/ol.el ./emacs-lisp/cl-lib.el
-
- # Prevent any settings in the user environment causing problems.
--unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH
-+unexport EMACSDOC EMACSPATH
-
- # The actual Emacs command run in the targets below.
- emacs = '$(EMACS)' $(EMACSOPT)
-Index: emacs-29.1/Makefile.in
-===================================================================
---- emacs-29.1.orig/Makefile.in
-+++ emacs-29.1/Makefile.in
-@@ -328,7 +328,7 @@ GLIB_COMPILE_SCHEMAS = glib-compile-sche
- TRANSFORM = @program_transform_name@
-
- # Prevent any settings in the user environment causing problems.
--unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH
-+unexport EMACSDOC EMACSPATH
-
- # What emacs should be called when installed.
- EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
Upstream changes (etc/NEWS): - The unexec dumper is removed, and the old 'ctags' program is no longer built or installed (etags remains). - New configure option --with-systemduserunitdir. - xterm-mouse-mode is on by default in compatible terminals; child frames are supported on TTY frames. - site-start.el now loads before the early init file. - Org updated to 9.8; IDLWAVE moved to GNU ELPA. Drop the tree-sitter 0.26 support patch, it is part of 31.1. Refresh use-emacs-native-tools-for-cross-compiling.patch: the dmpstruct.h rule now calls $(AWK) instead of awk, so the first src/Makefile.in hunk no longer applied. The other patches apply without fuzz. The recipe already uses --with-dumping=none, so the unexec removal does not affect it. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> --- .../emacs/{emacs_30.2.bb => emacs_31.1.bb} | 7 +- ...t-Tree-sitter-version-0.26-and-later.patch | 118 ------------------ ...acs-native-tools-for-cross-compiling.patch | 90 ++++++------- 3 files changed, 47 insertions(+), 168 deletions(-) rename meta-oe/recipes-support/emacs/{emacs_30.2.bb => emacs_31.1.bb} (98%) delete mode 100644 meta-oe/recipes-support/emacs/files/0001-Support-Tree-sitter-version-0.26-and-later.patch