SHA256
1
0
forked from pool/emacs

Make emacs script work even with -a emacs

OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=353
This commit is contained in:
Dr. Werner Fink 2023-08-07 08:20:19 +00:00 committed by Git OBS Bridge
parent 20a9cf09ad
commit 69192623d6
3 changed files with 43 additions and 5 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Aug 7 07:37:16 UTC 2023 - Dr. Werner Fink <werner@suse.de>
- Extend patch pdump.patch
* Make various emacs flavours find their pdmp files even if first
argument is simply named "emacs" (slack message, boo#1214008)
-------------------------------------------------------------------
Wed Aug 2 07:30:25 UTC 2023 - Dr. Werner Fink <werner@suse.de>

View File

@ -25,6 +25,8 @@
%bcond_with nativecomp
%endif
%bcond_without cairo
# This generates (after s/with/without/) all refcards below etc/refcards/
# to be stored in emacs-<version>-pdf.tar.xz only once
%bcond_with tex4pdf
%bcond_with memmmap
@ -532,14 +534,12 @@ for i in $(find site-lisp/ -name '*.el'); do
done
cp src/emacs emacs-nox
cp src/emacs.pdmp emacs-nox.pdmp
find -name '*.eln'
make distclean
#
CFLAGS="$CFLAGS -DPDMP_BASE='\"emacs-x11\"'" ./configure ${COMP} ${PREFIX} ${X11} ${SYS} --with-dumping=pdumper
%make_build
cp src/emacs emacs-x11
cp src/emacs.pdmp emacs-x11.pdmp
find -name '*.eln'
make distclean
#
CFLAGS="$CFLAGS -DPDMP_BASE='\"emacs-gtk\"'" ./configure ${COMP} ${PREFIX} ${GTK} ${SYS} --with-dumping=pdumper

View File

@ -1,13 +1,14 @@
From: Andreas Schwab
Port to GNU Emacs 29.1: Werner Fink
Index: src/emacs.c
===================================================================
---
src/emacs.c | 4 ++++
1 file changed, 4 insertions(+)
src/emacs.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
--- src/emacs.c
+++ src/emacs.c 2021-10-08 09:36:17.039806927 +0000
+++ src/emacs.c 2023-08-07 07:30:34.317996305 +0000
@@ -867,12 +867,16 @@ load_pdump (int argc, char **argv)
NULL
#endif
@ -25,3 +26,33 @@ Index: src/emacs.c
;
/* TODO: maybe more thoroughly scrub process environment in order to
@@ -957,6 +961,29 @@ load_pdump (int argc, char **argv)
path_exec = ns_relocate (path_exec);
#endif
+#ifdef PDMP_BASE
+ if (emacs_executable && *emacs_executable)
+ {
+ needed = (strlen (path_exec)
+ + 1
+ + strlen (argv0_base)
+ + 1
+ + strlen (suffix)
+ + 1);
+ if (bufsize < needed)
+ {
+ xfree (dump_file);
+ dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
+ }
+ sprintf (dump_file, "%s%c%s%s",
+ path_exec, DIRECTORY_SEP, argv0_base, suffix);
+ result = pdumper_load (dump_file, emacs_executable);
+
+ if (result == PDUMPER_LOAD_SUCCESS)
+ goto out;
+ }
+#endif
+
/* Look for "emacs-FINGERPRINT.pdmp" in PATH_EXEC. We hardcode
"emacs" in "emacs-FINGERPRINT.pdmp" so that the Emacs binary
still works if the user copies and renames it. */