From c9a55aef871f30df33f6fdd4e7867df135a9a710 Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Sun, 5 Oct 2025 20:45:47 +0200 Subject: [PATCH] emacs: upgrade 29.1 -> 30.2 Added a new patch to avoid unexporting some environment variables that are set by the recipe explicitly, to avoid the following build error: | Loading env... | 'bootstrap-emacs' -batch --no-site-file --no-site-lisp -batch -l ja-dic-cnv \ | -f batch-skkdic-convert -dir "../../sources/emacs-29.2/leim/../lisp/leim/ja-dic" --no-reduction "../../sources/emacs-29.2/leim/SKK-DIC/SKK-JISYO.L" <...> | Error: /usr/share/emacs/29.2/etc/charsets: No such file or directory Changelogs: 29.2 - 29.4: https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS.29 30.1 - 30.2: https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS.30 Signed-off-by: Gyorgy Sarvari Signed-off-by: Khem Raj --- .../emacs/{emacs_29.1.bb => emacs_30.2.bb} | 3 ++- ...oid-running-host-binaries-for-sanity.patch | 7 ++++--- .../files/leim_dont-unexport-EMACSDATA.patch | 19 +++++++++++++++++++ ...acs-native-tools-for-cross-compiling.patch | 19 +++++++------------ 4 files changed, 32 insertions(+), 16 deletions(-) rename meta-oe/recipes-support/emacs/{emacs_29.1.bb => emacs_30.2.bb} (99%) create mode 100644 meta-oe/recipes-support/emacs/files/leim_dont-unexport-EMACSDATA.patch diff --git a/meta-oe/recipes-support/emacs/emacs_29.1.bb b/meta-oe/recipes-support/emacs/emacs_30.2.bb similarity index 99% rename from meta-oe/recipes-support/emacs/emacs_29.1.bb rename to meta-oe/recipes-support/emacs/emacs_30.2.bb index 5cbe4551c0..6f9b8a485c 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_30.2.bb @@ -9,9 +9,10 @@ SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \ SRC_URI:append:class-target = " \ file://use-emacs-native-tools-for-cross-compiling.patch \ file://avoid-running-host-binaries-for-sanity.patch \ + file://leim_dont-unexport-EMACSDATA.patch \ " -SRC_URI[sha256sum] = "d2f881a5cc231e2f5a03e86f4584b0438f83edd7598a09d24a21bd8d003e2e01" +SRC_URI[sha256sum] = "b3f36f18a6dd2715713370166257de2fae01f9d38cfe878ced9b1e6ded5befd9" CVE_STATUS[CVE-2007-6109] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions." diff --git a/meta-oe/recipes-support/emacs/files/avoid-running-host-binaries-for-sanity.patch b/meta-oe/recipes-support/emacs/files/avoid-running-host-binaries-for-sanity.patch index 719ee4bce9..bd23358f2a 100644 --- a/meta-oe/recipes-support/emacs/files/avoid-running-host-binaries-for-sanity.patch +++ b/meta-oe/recipes-support/emacs/files/avoid-running-host-binaries-for-sanity.patch @@ -12,14 +12,14 @@ Index: emacs-29.1/Makefile.in =================================================================== --- emacs-29.1.orig/Makefile.in +++ emacs-29.1/Makefile.in -@@ -416,19 +416,10 @@ advice-on-failure: +@@ -420,19 +420,11 @@ @exit ${exit-status} sanity-check: - @[ -f .no-advice-on-failure ] && exit 0; true -- @v=$$(src/emacs${EXEEXT} --batch --eval \ +- @v=`src/emacs${EXEEXT} --batch -Q --eval \ - '(progn (defun f (n) (if (= 0 n) 1 (* n (f (- n 1))))) (princ (f 10)))' \ -- 2> /dev/null); \ +- 2> /dev/null`; \ - [ "X$$v" = "X3628800" ] && exit 0; \ - echo >&2 '***'; \ - echo >&2 '*** '"\"make ${make-target}\" succeeded, but Emacs is not functional."; \ @@ -33,6 +33,7 @@ Index: emacs-29.1/Makefile.in +# this is not going to work since it was (probably) built for a different architecture. +# Avoid calling target binaries from the host and simply assume our build artifacts work. + exit 0 ++ .PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 epaths-force-ns-self-contained etc-emacsver diff --git a/meta-oe/recipes-support/emacs/files/leim_dont-unexport-EMACSDATA.patch b/meta-oe/recipes-support/emacs/files/leim_dont-unexport-EMACSDATA.patch new file mode 100644 index 0000000000..81dd2bde40 --- /dev/null +++ b/meta-oe/recipes-support/emacs/files/leim_dont-unexport-EMACSDATA.patch @@ -0,0 +1,19 @@ +Upstream unexports some environment variables to avoid contamination, +however OE sets these variables specifically to help the build in the +recipe, and they should not be unexported. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Gyorgy Sarvari + +--- ./leim/Makefile.in.orig 2025-10-05 20:22:56.062508393 +0200 ++++ ./leim/Makefile.in 2025-10-05 20:23:05.581046818 +0200 +@@ -42,7 +42,7 @@ + -include ${top_builddir}/src/verbose.mk + + # Prevent any settings in the user environment causing problems. +-unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH ++# unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH + + # Which Emacs to use to convert TIT files to Emacs Lisp files, + # and generate the file leim-list.el. diff --git a/meta-oe/recipes-support/emacs/files/use-emacs-native-tools-for-cross-compiling.patch b/meta-oe/recipes-support/emacs/files/use-emacs-native-tools-for-cross-compiling.patch index df5e4bd258..a1b6ea6ddf 100644 --- a/meta-oe/recipes-support/emacs/files/use-emacs-native-tools-for-cross-compiling.patch +++ b/meta-oe/recipes-support/emacs/files/use-emacs-native-tools-for-cross-compiling.patch @@ -18,12 +18,7 @@ Index: emacs-29.1/src/Makefile.in =================================================================== --- emacs-29.1.orig/src/Makefile.in +++ emacs-29.1/src/Makefile.in -@@ -1,3 +1,4 @@ -+ - ### @configure_input@ - - # Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2023 Free Software -@@ -508,7 +509,7 @@ ifeq ($(CHECK_STRUCTS),true) +@@ -542,7 +542,7 @@ ifeq ($(CHECK_STRUCTS),true) pdumper.o: dmpstruct.h endif dmpstruct.h: $(srcdir)/dmpstruct.awk @@ -32,17 +27,17 @@ Index: emacs-29.1/src/Makefile.in $(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \ $(dmpstruct_headers) > $@ -@@ -610,8 +611,7 @@ SYSTEM_TYPE = @SYSTEM_TYPE@ +@@ -651,8 +651,7 @@ ## 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. -emacs$(EXEEXT): temacs$(EXEEXT) \ -- lisp.mk $(etc)/DOC $(lisp) \ -+emacs$(EXEEXT): lisp.mk $(etc)/DOC $(lisp) \ +- $(abs_top_builddir)/src/lisp.mk $(etc)/DOC $(lisp) \ ++emacs$(EXEEXT): $(abs_top_builddir)/src/lisp.mk $(etc)/DOC $(lisp) \ $(lispsource)/international/charprop.el ${charsets} ifeq ($(SYSTEM_TYPE),cygwin) find ${top_builddir} -name '*.eln' | rebase -v -O -T - -@@ -654,7 +654,7 @@ endif +@@ -695,7 +695,7 @@ endif $(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(doc_obj) $(AM_V_GEN)$(MKDIR_P) $(etc) $(AM_V_at)rm -f $(etc)/DOC @@ -51,7 +46,7 @@ Index: emacs-29.1/src/Makefile.in $(SOME_MACHINE_OBJECTS) $(doc_obj) > $(etc)/DOC $(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \ -@@ -671,7 +671,7 @@ buildobj.h: Makefile +@@ -712,7 +712,7 @@ buildobj.h: Makefile GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) @@ -60,7 +55,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 > $@ -@@ -685,7 +685,7 @@ $(LIBEGNU_ARCHIVE): $(config_h) +@@ -726,7 +726,7 @@ $(LIBEGNU_ARCHIVE): $(config_h) $(MAKE) -C $(dir $@) all ifeq ($(HAVE_PDUMPER),yes)