diff --git a/packages/emacs/Makefile.patch b/packages/emacs/Makefile.patch index a6fcd8d188..1d1a82ea42 100644 --- a/packages/emacs/Makefile.patch +++ b/packages/emacs/Makefile.patch @@ -1,20 +1,20 @@ ---- ./Makefile.in.org 2023-09-04 19:40:51.160939201 +0200 -+++ ./Makefile.in 2023-09-04 19:43:20.271975033 +0200 -@@ -417,7 +417,7 @@ +--- ./Makefile.in.orig 2025-02-26 23:06:02.726299956 +0100 ++++ ./Makefile.in 2025-02-26 23:08:04.440643754 +0100 +@@ -421,7 +421,7 @@ sanity-check: @[ -f .no-advice-on-failure ] && exit 0; true -- @v=$$(src/emacs${EXEEXT} --batch --eval \ -+ @v=$$(src/bootstrap-emacs${EXEEXT} --batch --eval \ +- @v=`src/emacs${EXEEXT} --batch -Q --eval \ ++ @v=`src/bootstrap-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; \ -@@ -471,7 +471,7 @@ - -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \ - -e 's;\(#.*PATH_REL_LOADSEARCH\).*$$;\1 "${lispdirrel}";' \ - -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \ -- -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \ -+ -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${standardlisppath}";' \ - -e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \ - -e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \ - -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ +@@ -475,7 +475,7 @@ + -e 's;\(#define.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \ + -e 's;\(#define.*PATH_REL_LOADSEARCH\).*$$;\1 "${lispdirrel}";' \ + -e 's;\(#define.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \ +- -e 's;\(#define.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \ ++ -e 's;\(#define.*PATH_DUMPLOADSEARCH\).*$$;\1 "${standardlisppath}";' \ + -e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \ + -e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \ + -e 's;\(#define.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ diff --git a/packages/emacs/build.sh b/packages/emacs/build.sh index 00f8cede93..e16846c5ca 100644 --- a/packages/emacs/build.sh +++ b/packages/emacs/build.sh @@ -3,14 +3,13 @@ TERMUX_PKG_DESCRIPTION="Extensible, customizable text editor-and more" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" # Update both emacs and emacs-x to the same version in one PR. -TERMUX_PKG_VERSION=29.4 -TERMUX_PKG_REVISION=3 +TERMUX_PKG_VERSION=30.1 TERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/emacs/emacs-${TERMUX_PKG_VERSION}.tar.xz if [[ $TERMUX_PKG_VERSION == *-rc* ]]; then TERMUX_PKG_SRCURL=https://alpha.gnu.org/gnu/emacs/pretest/emacs-${TERMUX_PKG_VERSION#*:}.tar.xz fi -TERMUX_PKG_SHA256=ba897946f94c36600a7e7bb3501d27aa4112d791bfe1445c61ed28550daca235 -TERMUX_PKG_DEPENDS="libgmp, libgnutls, libjansson, libsqlite, libxml2, ncurses, tree-sitter, zlib" +TERMUX_PKG_SHA256=6ccac1ae76e6af93c6de1df175e8eb406767c23da3dd2a16aa67e3124a6f138f +TERMUX_PKG_DEPENDS="libgmp, libgnutls, libsqlite, libxml2, ncurses, tree-sitter, zlib" TERMUX_PKG_BREAKS="emacs-dev" TERMUX_PKG_REPLACES="emacs-dev" TERMUX_PKG_SERVICE_SCRIPT=("emacsd" 'exec emacs --fg-daemon 2>&1') @@ -20,7 +19,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-gif=no --with-gnutls --with-jpeg=no ---with-json --with-modules --with-pdumper=yes --with-png=no diff --git a/packages/emacs/lib-src-Makefile.in.patch.beforehostbuild b/packages/emacs/lib-src-Makefile.in.patch.beforehostbuild new file mode 100644 index 0000000000..b43f6ce790 --- /dev/null +++ b/packages/emacs/lib-src-Makefile.in.patch.beforehostbuild @@ -0,0 +1,11 @@ +--- ./lib-src/Makefile.in.orig 2025-02-27 00:35:21.311248115 +0100 ++++ ./lib-src/Makefile.in 2025-03-01 17:24:21.095051336 +0100 +@@ -24,7 +24,7 @@ + unexport EMACSDATA EMACSDOC EMACSLOADPATH EMACSPATH + + # Following ../lisp/Makefile.in. +-EMACS = ../src/emacs${EXEEXT} ++EMACS = ../src/bootstrap-emacs${EXEEXT} + EMACSOPT = -batch --no-site-file --no-site-lisp + + # ==================== Things 'configure' will edit ==================== diff --git a/packages/emacs/lib-src-emacsclient.c.patch b/packages/emacs/lib-src-emacsclient.c.patch index 45b7d6165a..e03a165efa 100644 --- a/packages/emacs/lib-src-emacsclient.c.patch +++ b/packages/emacs/lib-src-emacsclient.c.patch @@ -1,8 +1,6 @@ -diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c -index 73c8e45a8653..a6c548f05306 100644 ---- a/lib-src/emacsclient.c -+++ b/lib-src/emacsclient.c -@@ -1485,23 +1485,17 @@ set_local_socket (char const *server_name) +--- ./lib-src/emacsclient.c.orig 2025-02-26 22:49:12.950947522 +0100 ++++ ./lib-src/emacsclient.c 2025-02-26 22:54:45.610570924 +0100 +@@ -1520,11 +1520,6 @@ } else { @@ -14,24 +12,17 @@ index 73c8e45a8653..a6c548f05306 100644 # ifdef DARWIN_OS # ifndef _CS_DARWIN_USER_TEMP_DIR # define _CS_DARWIN_USER_TEMP_DIR 65537 - # endif -- size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, -+ size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, - sockname, socknamesize); -- if (0 < n && n < (size_t) -1) -- tmpdirlen = min (n - 1, socknamesize); -+ if (0 < n && n < (size_t) -1) -+ tmpdirlen = min (n - 1, socknamesize); +@@ -1535,8 +1530,7 @@ + tmpdirlen = min (n - 1, socknamesize); # endif -- if (tmpdirlen < 0) + if (tmpdirlen < 0) - tmpdirlen = snprintf (sockname, socknamesize, "/tmp"); - } -+ if (tmpdirlen < 0) -+ tmpdirlen = snprintf (sockname, socknamesize, "@TERMUX_PREFIX@/var/run"); ++ tmpdirlen = snprintf (sockname, socknamesize, "@TERMUX_PREFIX@/var/run"); + sock_status = local_sockname (s, sockname, tmpdirlen, uid, server_name); - tmpdir_used = true; -@@ -1563,7 +1557,7 @@ set_local_socket (char const *server_name) +@@ -1623,7 +1617,7 @@ uintmax_t id = uid; char sockdirname[socknamesize]; int sockdirnamelen = snprintf (sockdirname, sizeof sockdirname, diff --git a/packages/emacs/lib-stdio-impl.h.patch b/packages/emacs/lib-stdio-impl.h.patch deleted file mode 100644 index 0fd3ee7c4a..0000000000 --- a/packages/emacs/lib-stdio-impl.h.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/lib/stdio-impl.h -+++ b/lib/stdio-impl.h -@@ -68,8 +68,10 @@ - # elif defined __ANDROID__ /* Android */ - # ifdef __LP64__ - # define _gl_flags_file_t int -+# define _gl_struct_file_off_t int64_t - # else - # define _gl_flags_file_t short -+# define _gl_struct_file_off_t __kernel_off_t - # endif - /* Up to this commit from 2015-10-12 - -@@ -96,7 +98,7 @@ - unsigned char _nbuf[1]; \ - struct { unsigned char *_base; size_t _size; } _lb; \ - int _blksize; \ -- fpos_t _offset; \ -+ _gl_struct_file_off_t _offset; \ - /* More fields, not relevant here. */ \ - } *) fp) - # else diff --git a/packages/emacs/lisp-net-tramp.el.patch.beforehostbuild b/packages/emacs/lisp-net-tramp.el.patch.beforehostbuild index 19daf31366..1c93a8eb0e 100644 --- a/packages/emacs/lisp-net-tramp.el.patch.beforehostbuild +++ b/packages/emacs/lisp-net-tramp.el.patch.beforehostbuild @@ -1,11 +1,11 @@ ---- ./lisp/net/tramp.el.orig 2020-07-29 23:40:41.000000000 +0200 -+++ ./lisp/net/tramp.el 2020-09-14 21:34:59.593435521 +0200 -@@ -133,7 +133,7 @@ - ;; Suppress `shell-file-name' for w32 systems. - (defcustom tramp-encoding-shell - (let (shell-file-name) -- (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh")) -+ (or (tramp-compat-funcall 'w32-shell-name) "@TERMUX_PREFIX@/bin/sh")) +--- ./lisp/net/tramp.el.orig 2025-02-26 22:32:22.454577713 +0100 ++++ ./lisp/net/tramp.el 2025-02-26 22:33:41.658564222 +0100 +@@ -156,7 +156,7 @@ + ;; The shell is located at /system/bin/sh on Android + ;; systems. + "/system/bin/sh" +- "/bin/sh"))) ++ "@TERMUX_PREFIX@/bin/sh"))) "Use this program for encoding and decoding commands on the local host. This shell is used to execute the encoding and decoding command on the local host, so if you want to use \"~\" in those commands, you should diff --git a/packages/emacs/lisp-term.el.patch.beforehostbuild b/packages/emacs/lisp-term.el.patch.beforehostbuild index 5355d7cd02..3cc6d673cb 100644 --- a/packages/emacs/lisp-term.el.patch.beforehostbuild +++ b/packages/emacs/lisp-term.el.patch.beforehostbuild @@ -1,11 +1,11 @@ ---- ./lisp/term.el.orig 2022-04-06 12:29:31.256831618 +0200 -+++ ./lisp/term.el 2022-04-06 12:29:59.820373057 +0200 -@@ -1651,7 +1651,7 @@ - (push (format "EMACS=%s (term:%s)" emacs-version term-protocol-version) - process-environment)) - (apply #'start-process name buffer -- "/bin/sh" "-c" -+ "@TERMUX_PREFIX@/bin/sh" "-c" +--- ./lisp/term.el.orig 2025-02-26 22:40:48.382660611 +0100 ++++ ./lisp/term.el 2025-02-26 22:42:12.160211487 +0100 +@@ -1776,7 +1776,7 @@ + ;; found as /system/bin/sh. + (if (eq system-type 'android) + "/system/bin/sh" +- "/bin/sh") ++ "@TERMUX_PREFIX@/bin/sh") + "-c" (format "stty -nl echo rows %d columns %d sane 2>%s;\ if [ $1 = .. ]; then shift; fi; exec \"$@\"" - term-height term-width null-device) diff --git a/packages/emacs/no-procent_n-android.patch b/packages/emacs/no-procent_n-android.patch deleted file mode 100644 index 98721c675c..0000000000 --- a/packages/emacs/no-procent_n-android.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ./src/emacs.c.org 2023-09-04 19:14:48.656907177 +0200 -+++ ./src/emacs.c 2023-09-04 19:16:06.510742013 +0200 -@@ -2958,17 +2958,17 @@ - reset_all_sys_modes (); - if (sig && sig != SIGTERM) - { -- static char const fmt[] = "Fatal error %d: %n%s\n"; -+ static char const fmt[] = "Fatal error %d: %s\n"; - #ifdef HAVE_HAIKU - if (haiku_debug_on_fatal_error) - debugger ("Fatal error in Emacs"); - #endif -- char buf[max ((sizeof fmt - sizeof "%d%n%s\n" -+ char buf[max ((sizeof fmt - sizeof "%d%s\n" - + INT_STRLEN_BOUND (int) + 1), - min (PIPE_BUF, MAX_ALLOCA))]; - char const *sig_desc = safe_strsignal (sig); - int nlen; -- int buflen = snprintf (buf, sizeof buf, fmt, sig, &nlen, sig_desc); -+ int buflen = snprintf (buf, sizeof buf, fmt, sig, sig_desc); - if (0 <= buflen && buflen < sizeof buf) - emacs_write (STDERR_FILENO, buf, buflen); - else diff --git a/packages/emacs/no_user_fullname.patch b/packages/emacs/no_user_fullname.patch index b3c513202e..a09b290ce1 100644 --- a/packages/emacs/no_user_fullname.patch +++ b/packages/emacs/no_user_fullname.patch @@ -1,11 +1,11 @@ ---- ./src/editfns.c.orig 2022-04-06 12:34:24.052297271 +0200 -+++ ./src/editfns.c 2022-04-06 12:34:54.075849159 +0200 -@@ -1266,7 +1266,7 @@ +--- ./src/editfns.c.orig 2025-02-26 23:19:22.260985198 +0100 ++++ ./src/editfns.c 2025-02-26 23:21:57.449209328 +0100 +@@ -1247,7 +1247,7 @@ if (!pw) return Qnil; - p = USER_FULL_NAME; + p = "termux"; - /* Chop off everything after the first comma, since 'pw_gecos' is a - comma-separated list. */ - q = strchr (p, ','); + if (!p) + return Qnil; + diff --git a/packages/emacs/src-callproc.c.patch b/packages/emacs/src-callproc.c.patch index f6588203af..37bb38fda3 100644 --- a/packages/emacs/src-callproc.c.patch +++ b/packages/emacs/src-callproc.c.patch @@ -1,11 +1,11 @@ ---- ./src/callproc.c.orig 2020-07-29 23:40:42.000000000 +0200 -+++ ./src/callproc.c 2020-09-14 21:36:04.897296897 +0200 -@@ -1621,7 +1621,7 @@ - dir_warning ("arch-independent data dir", Vdata_directory); - - sh = getenv ("SHELL"); +--- ./src/callproc.c.orig 2025-02-26 23:31:19.411148666 +0100 ++++ ./src/callproc.c 2025-02-26 23:32:52.385321663 +0100 +@@ -2042,7 +2042,7 @@ + /* The Android shell is found under /system/bin, not /bin. */ + Vshell_file_name = build_string (sh ? sh : "/system/bin/sh"); + #else - Vshell_file_name = build_string (sh ? sh : "/bin/sh"); + Vshell_file_name = build_string (sh ? sh : "@TERMUX_PREFIX@/bin/sh"); + #endif Lisp_Object gamedir = Qnil; - if (PATH_GAME) diff --git a/packages/emacs/src-fileio.c.patch b/packages/emacs/src-fileio.c.patch index 499625b7cd..189eca6cf9 100644 --- a/packages/emacs/src-fileio.c.patch +++ b/packages/emacs/src-fileio.c.patch @@ -1,18 +1,18 @@ ---- ../fileio.c.orig 2020-07-11 20:22:17.937310671 +0200 -+++ ./src/fileio.c 2020-07-11 20:22:44.147310684 +0200 -@@ -2617,7 +2617,7 @@ - encoded_file = ENCODE_FILE (file); - encoded_newname = ENCODE_FILE (newname); +--- ./src/fileio.c.orig 2025-02-26 23:39:17.075413404 +0100 ++++ ./src/fileio.c 2025-02-26 23:41:19.133155637 +0100 +@@ -2888,7 +2888,7 @@ + check_vfs_filename (encoded_newname, "Trying to create hard link" + " within special directory"); - if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) + if (symlink (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) return Qnil; if (errno == EEXIST) -@@ -2627,7 +2627,7 @@ +@@ -2898,7 +2898,7 @@ barf_or_query_if_file_exists (newname, true, "make it a new name", FIXNUMP (ok_if_already_exists), false); - unlink (SSDATA (newname)); + emacs_unlink (SSDATA (newname)); - if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) + if (symlink (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) return Qnil; diff --git a/packages/emacs/src-filelock.c.patch b/packages/emacs/src-filelock.c.patch deleted file mode 100644 index ebc7b163a3..0000000000 --- a/packages/emacs/src-filelock.c.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ./src/filelock.c.org 2023-09-04 19:19:14.282110171 +0200 -+++ ./src/filelock.c 2023-09-04 19:21:09.469561631 +0200 -@@ -62,11 +62,11 @@ - /* A file whose last-modified time is just after the most recent boot. - Define this to be NULL to disable checking for this file. */ - #ifndef BOOT_TIME_FILE --#define BOOT_TIME_FILE "/var/run/random-seed" -+#define BOOT_TIME_FILE "@TERMUX_PREFIX@/var/run/random-seed" - #endif - - #if !defined WTMP_FILE && !defined WINDOWSNT && defined BOOT_TIME --#define WTMP_FILE "/var/log/wtmp" -+#define WTMP_FILE "@TERMUX_PREFIX@/var/log/wtmp" - #endif - - /* Normally use a symbolic link to represent a lock. -@@ -126,14 +126,14 @@ - static time_t boot_time; - static bool boot_time_initialized; - --#ifdef BOOT_TIME -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - static void get_boot_time_1 (const char *, bool); - #endif - - static time_t - get_boot_time (void) - { --#if defined (BOOT_TIME) -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - int counter; - #endif - -@@ -169,7 +169,7 @@ - } - } - --#if defined (BOOT_TIME) -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - /* The utmp routines maintain static state. Don't touch that state - if we are going to dump, since it might not survive dumping. */ - if (will_dump_p ()) -@@ -228,7 +228,7 @@ - #endif - } - --#ifdef BOOT_TIME -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - /* Try to get the boot time from wtmp file FILENAME. - This succeeds if that file contains a reboot record. - diff --git a/x11-packages/emacs-x/Makefile.patch b/x11-packages/emacs-x/Makefile.patch deleted file mode 100644 index 3ac8ca9366..0000000000 --- a/x11-packages/emacs-x/Makefile.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ./Makefile.in.org 2023-09-04 19:40:51.160939201 +0200 -+++ ./Makefile.in 2023-09-04 19:43:20.271975033 +0200 -@@ -417,7 +417,7 @@ - - sanity-check: - @[ -f .no-advice-on-failure ] && exit 0; true -- @v=$$(src/emacs${EXEEXT} --batch --eval \ -+ @v=$$(src/bootstrap-emacs${EXEEXT} --batch --eval \ - '(progn (defun f (n) (if (= 0 n) 1 (* n (f (- n 1))))) (princ (f 10)))' \ - 2> /dev/null); \ - [ "X$$v" = "X3628800" ] && exit 0; \ -@@ -471,7 +471,7 @@ - -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \ - -e 's;\(#.*PATH_REL_LOADSEARCH\).*$$;\1 "${lispdirrel}";' \ - -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \ -- -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \ -+ -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${standardlisppath}";' \ - -e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \ - -e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \ - -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ diff --git a/x11-packages/emacs-x/Makefile.patch b/x11-packages/emacs-x/Makefile.patch new file mode 120000 index 0000000000..73ad0e1982 --- /dev/null +++ b/x11-packages/emacs-x/Makefile.patch @@ -0,0 +1 @@ +../../packages/emacs/Makefile.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/build.sh b/x11-packages/emacs-x/build.sh index ab9e81371a..2176eff862 100644 --- a/x11-packages/emacs-x/build.sh +++ b/x11-packages/emacs-x/build.sh @@ -3,14 +3,13 @@ TERMUX_PKG_DESCRIPTION="Extensible, customizable text editor-and more" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" # Update both emacs and emacs-x to the same version in one PR. -TERMUX_PKG_VERSION=29.4 -TERMUX_PKG_REVISION=3 +TERMUX_PKG_VERSION=30.1 TERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/emacs/emacs-${TERMUX_PKG_VERSION}.tar.xz if [[ $TERMUX_PKG_VERSION == *-rc* ]]; then TERMUX_PKG_SRCURL=https://alpha.gnu.org/gnu/emacs/pretest/emacs-${TERMUX_PKG_VERSION#*:}.tar.xz fi -TERMUX_PKG_SHA256=ba897946f94c36600a7e7bb3501d27aa4112d791bfe1445c61ed28550daca235 -TERMUX_PKG_DEPENDS="fontconfig, freetype, gdk-pixbuf, giflib, glib, harfbuzz, libgmp, libgnutls, libice, libjansson, libjpeg-turbo, libpng, librsvg, libsm, libsqlite, libtiff, libx11, libxaw, libxcb, libxext, libxfixes, libxft, libxinerama, libxml2, libxmu, libxpm, libxrandr, libxrender, libxt, littlecms, ncurses, tree-sitter, zlib" +TERMUX_PKG_SHA256=6ccac1ae76e6af93c6de1df175e8eb406767c23da3dd2a16aa67e3124a6f138f +TERMUX_PKG_DEPENDS="fontconfig, freetype, gdk-pixbuf, giflib, glib, harfbuzz, libgmp, libgnutls, libice, libjpeg-turbo, libpng, librsvg, libsm, libsqlite, libtiff, libx11, libxaw, libxcb, libxext, libxfixes, libxft, libxinerama, libxml2, libxmu, libxpm, libxrandr, libxrender, libxt, littlecms, ncurses, tree-sitter, zlib" TERMUX_PKG_CONFLICTS="emacs" TERMUX_PKG_REPLACES="emacs" TERMUX_PKG_PROVIDES="emacs" @@ -31,7 +30,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-modules --with-pdumper=yes --with-dumping=none ---with-json --with-tree-sitter " diff --git a/x11-packages/emacs-x/disable-fdsan.patch b/x11-packages/emacs-x/disable-fdsan.patch deleted file mode 100644 index 0a1c1f49bd..0000000000 --- a/x11-packages/emacs-x/disable-fdsan.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -uNr emacs-27.2/src/emacs.c emacs-27.2.mod/src/emacs.c ---- emacs-27.2/src/emacs.c 2021-01-28 19:52:38.000000000 +0200 -+++ emacs-27.2.mod/src/emacs.c 2021-04-10 17:04:56.744343967 +0300 -@@ -120,6 +120,11 @@ - #include "pdumper.h" - #include "epaths.h" - -+#ifdef __ANDROID__ -+#include -+#include -+#endif -+ - static const char emacs_version[] = PACKAGE_VERSION; - static const char emacs_copyright[] = COPYRIGHT; - static const char emacs_bugreport[] = PACKAGE_BUGREPORT; -@@ -954,6 +959,18 @@ - /* Record (approximately) where the stack begins. */ - stack_bottom = (char *) &stack_bottom_variable; - -+#ifdef __ANDROID__ -+ // For Android 11+. -+ void *lib_handle = dlopen("libc.so", RTLD_LAZY); -+ if (lib_handle) { -+ void (*set_fdsan_error_level)(enum android_fdsan_error_level newlevel) = dlsym(lib_handle, "android_fdsan_set_error_level"); -+ if (set_fdsan_error_level) { -+ set_fdsan_error_level(ANDROID_FDSAN_ERROR_LEVEL_DISABLED); -+ } -+ dlclose(lib_handle); -+ } -+#endif -+ - const char *dump_mode = NULL; - int skip_args = 0; - char *temacs = NULL; diff --git a/x11-packages/emacs-x/disable-fdsan.patch b/x11-packages/emacs-x/disable-fdsan.patch new file mode 120000 index 0000000000..abd7706614 --- /dev/null +++ b/x11-packages/emacs-x/disable-fdsan.patch @@ -0,0 +1 @@ +../../packages/emacs/disable-fdsan.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/lib-src-Makefile.in.patch.beforehostbuild b/x11-packages/emacs-x/lib-src-Makefile.in.patch.beforehostbuild new file mode 120000 index 0000000000..f2892db91f --- /dev/null +++ b/x11-packages/emacs-x/lib-src-Makefile.in.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lib-src-Makefile.in.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lib-src-emacsclient.c.patch b/x11-packages/emacs-x/lib-src-emacsclient.c.patch deleted file mode 100644 index ebdacb9ebf..0000000000 --- a/x11-packages/emacs-x/lib-src-emacsclient.c.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ./lib-src/emacsclient.c.orig 2020-07-29 23:40:41.000000000 +0200 -+++ ./lib-src/emacsclient.c 2020-09-14 21:36:04.883963456 +0200 -@@ -1411,7 +1411,7 @@ - tmpdirlen = min (n - 1, socknamesize); - # endif - if (tmpdirlen < 0) -- tmpdirlen = snprintf (sockname, socknamesize, "/tmp"); -+ tmpdirlen = snprintf (sockname, socknamesize, "@TERMUX_PREFIX@/tmp"); - } - socknamelen = local_sockname (sockname, socknamesize, tmpdirlen, - uid, server_name); -@@ -1495,7 +1495,7 @@ - uintmax_t id = uid; - char sockdirname[socknamesize]; - int sockdirnamelen = snprintf (sockdirname, sizeof sockdirname, -- "/run/user/%"PRIuMAX, id); -+ "@TERMUX_PREFIX@/var/run/user/%"PRIuMAX, id); - if (0 <= sockdirnamelen && sockdirnamelen < sizeof sockdirname - && faccessat (AT_FDCWD, sockdirname, X_OK, AT_EACCESS) == 0) - message diff --git a/x11-packages/emacs-x/lib-src-emacsclient.c.patch b/x11-packages/emacs-x/lib-src-emacsclient.c.patch new file mode 120000 index 0000000000..bb8992b6f6 --- /dev/null +++ b/x11-packages/emacs-x/lib-src-emacsclient.c.patch @@ -0,0 +1 @@ +../../packages/emacs/lib-src-emacsclient.c.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/lib-stdio-impl.h.patch b/x11-packages/emacs-x/lib-stdio-impl.h.patch deleted file mode 100644 index 0fd3ee7c4a..0000000000 --- a/x11-packages/emacs-x/lib-stdio-impl.h.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/lib/stdio-impl.h -+++ b/lib/stdio-impl.h -@@ -68,8 +68,10 @@ - # elif defined __ANDROID__ /* Android */ - # ifdef __LP64__ - # define _gl_flags_file_t int -+# define _gl_struct_file_off_t int64_t - # else - # define _gl_flags_file_t short -+# define _gl_struct_file_off_t __kernel_off_t - # endif - /* Up to this commit from 2015-10-12 - -@@ -96,7 +98,7 @@ - unsigned char _nbuf[1]; \ - struct { unsigned char *_base; size_t _size; } _lb; \ - int _blksize; \ -- fpos_t _offset; \ -+ _gl_struct_file_off_t _offset; \ - /* More fields, not relevant here. */ \ - } *) fp) - # else diff --git a/x11-packages/emacs-x/lisp-cus-start.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-cus-start.el.patch.beforehostbuild deleted file mode 100644 index 4ff5fec4c1..0000000000 --- a/x11-packages/emacs-x/lisp-cus-start.el.patch.beforehostbuild +++ /dev/null @@ -1,11 +0,0 @@ ---- ./lisp/cus-start.el.orig 2020-07-27 23:21:49.000000000 +0200 -+++ ./lisp/cus-start.el 2020-09-14 21:34:59.583435440 +0200 -@@ -290,7 +290,7 @@ - "/tmp")) - (t - (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") -- "/tmp")))) -+ "@TERMUX_PREFIX@/tmp")))) - :initialize custom-initialize-delay) - ;; fns.c - (use-dialog-box menu boolean "21.1") diff --git a/x11-packages/emacs-x/lisp-cus-start.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-cus-start.el.patch.beforehostbuild new file mode 120000 index 0000000000..1d241049c7 --- /dev/null +++ b/x11-packages/emacs-x/lisp-cus-start.el.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lisp-cus-start.el.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lisp-loadup.el-2.patch.beforehostbuild b/x11-packages/emacs-x/lisp-loadup.el-2.patch.beforehostbuild deleted file mode 100644 index 4f328fc286..0000000000 --- a/x11-packages/emacs-x/lisp-loadup.el-2.patch.beforehostbuild +++ /dev/null @@ -1,15 +0,0 @@ ---- ./lisp/loadup.el.orig 2020-07-27 23:21:49.000000000 +0200 -+++ ./lisp/loadup.el 2020-09-14 21:34:59.586768800 +0200 -@@ -423,7 +423,11 @@ - (message "Warning: Change in load-path due to site-init will be \ - lost after dumping"))) - --(setq current-load-list nil) -+;; On an emacs that runs undumped, i.e. Android, this causes bogus -+;; entries to appear in load-history. Commenting this out causes an entry -+;; for loadup.el with a bogus filename to appear instead, but since it -+;; neither provides nor requires anything, it appears to be safe. -+;;(setq current-load-list nil) - ;; Avoid storing references to build directory in the binary. - (setq custom-current-group-alist nil) - diff --git a/x11-packages/emacs-x/lisp-loadup.el-2.patch.beforehostbuild b/x11-packages/emacs-x/lisp-loadup.el-2.patch.beforehostbuild new file mode 120000 index 0000000000..b9194431ea --- /dev/null +++ b/x11-packages/emacs-x/lisp-loadup.el-2.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lisp-loadup.el-2.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lisp-net-tramp.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-net-tramp.el.patch.beforehostbuild deleted file mode 100644 index 19daf31366..0000000000 --- a/x11-packages/emacs-x/lisp-net-tramp.el.patch.beforehostbuild +++ /dev/null @@ -1,11 +0,0 @@ ---- ./lisp/net/tramp.el.orig 2020-07-29 23:40:41.000000000 +0200 -+++ ./lisp/net/tramp.el 2020-09-14 21:34:59.593435521 +0200 -@@ -133,7 +133,7 @@ - ;; Suppress `shell-file-name' for w32 systems. - (defcustom tramp-encoding-shell - (let (shell-file-name) -- (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh")) -+ (or (tramp-compat-funcall 'w32-shell-name) "@TERMUX_PREFIX@/bin/sh")) - "Use this program for encoding and decoding commands on the local host. - This shell is used to execute the encoding and decoding command on the - local host, so if you want to use \"~\" in those commands, you should diff --git a/x11-packages/emacs-x/lisp-net-tramp.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-net-tramp.el.patch.beforehostbuild new file mode 120000 index 0000000000..8d31fa5c5a --- /dev/null +++ b/x11-packages/emacs-x/lisp-net-tramp.el.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lisp-net-tramp.el.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lisp-server.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-server.el.patch.beforehostbuild deleted file mode 100644 index 817c292670..0000000000 --- a/x11-packages/emacs-x/lisp-server.el.patch.beforehostbuild +++ /dev/null @@ -1,11 +0,0 @@ ---- ./lisp/server.el.orig 2022-04-06 12:26:52.889010658 +0200 -+++ ./lisp/server.el 2022-04-06 12:28:46.006501888 +0200 -@@ -282,7 +282,7 @@ - (if runtime-dir - (expand-file-name "emacs" runtime-dir) - (expand-file-name (format "emacs%d" (user-uid)) -- (or (getenv "TMPDIR") "/tmp")))))) -+ "@TERMUX_PREFIX@/var/run"))))) - "The directory in which to place the server socket. - If local sockets are not supported, this is nil.") - diff --git a/x11-packages/emacs-x/lisp-server.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-server.el.patch.beforehostbuild new file mode 120000 index 0000000000..e803447973 --- /dev/null +++ b/x11-packages/emacs-x/lisp-server.el.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lisp-server.el.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lisp-term.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-term.el.patch.beforehostbuild deleted file mode 100644 index 5355d7cd02..0000000000 --- a/x11-packages/emacs-x/lisp-term.el.patch.beforehostbuild +++ /dev/null @@ -1,11 +0,0 @@ ---- ./lisp/term.el.orig 2022-04-06 12:29:31.256831618 +0200 -+++ ./lisp/term.el 2022-04-06 12:29:59.820373057 +0200 -@@ -1651,7 +1651,7 @@ - (push (format "EMACS=%s (term:%s)" emacs-version term-protocol-version) - process-environment)) - (apply #'start-process name buffer -- "/bin/sh" "-c" -+ "@TERMUX_PREFIX@/bin/sh" "-c" - (format "stty -nl echo rows %d columns %d sane 2>%s;\ - if [ $1 = .. ]; then shift; fi; exec \"$@\"" - term-height term-width null-device) diff --git a/x11-packages/emacs-x/lisp-term.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-term.el.patch.beforehostbuild new file mode 120000 index 0000000000..deb1d2e788 --- /dev/null +++ b/x11-packages/emacs-x/lisp-term.el.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lisp-term.el.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lisp-textmodes-ispell.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-textmodes-ispell.el.patch.beforehostbuild deleted file mode 100644 index b947dc403e..0000000000 --- a/x11-packages/emacs-x/lisp-textmodes-ispell.el.patch.beforehostbuild +++ /dev/null @@ -1,25 +0,0 @@ ---- ./lisp/textmodes/ispell.el.org 2023-04-15 12:13:36.000000000 +0200 -+++ ./lisp/textmodes/ispell.el 2023-09-11 17:47:05.535597368 +0200 -@@ -206,14 +206,14 @@ - (ispell-set-spellchecker-params)))) - - (defcustom ispell-alternate-dictionary -- (cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2") -- ((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2") -- ((file-readable-p "/usr/dict/words") "/usr/dict/words") -- ((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words") -- ((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words") -- ((file-readable-p "/usr/share/lib/dict/words") -- "/usr/share/lib/dict/words") -- ((file-readable-p "/sys/dict") "/sys/dict")) -+ (cond ((file-readable-p "@TERMUX_PREFIX@/dict/web2") "@TERMUX_PREFIX@/dict/web2") -+ ((file-readable-p "@TERMUX_PREFIX@/share/dict/web2") "@TERMUX_PREFIX@/share/dict/web2") -+ ((file-readable-p "@TERMUX_PREFIX@/dict/words") "@TERMUX_PREFIX@/dict/words") -+ ((file-readable-p "@TERMUX_PREFIX@/lib/dict/words") "@TERMUX_PREFIX@/lib/dict/words") -+ ((file-readable-p "@TERMUX_PREFIX@/share/dict/words") "@TERMUX_PREFIX@/share/dict/words") -+ ((file-readable-p "@TERMUX_PREFIX@/share/lib/dict/words") -+ "@TERMUX_PREFIX@/share/lib/dict/words") -+ ((file-readable-p "@TERMUX_PREFIX@/sys/dict") "@TERMUX_PREFIX@/sys/dict")) - "Alternate plain word-list dictionary for spelling help. - This is also used by `ispell-lookup-words' and `ispell-complete-word'." - :type '(choice file (const :tag "None" nil))) diff --git a/x11-packages/emacs-x/lisp-textmodes-ispell.el.patch.beforehostbuild b/x11-packages/emacs-x/lisp-textmodes-ispell.el.patch.beforehostbuild new file mode 120000 index 0000000000..bb77f97a52 --- /dev/null +++ b/x11-packages/emacs-x/lisp-textmodes-ispell.el.patch.beforehostbuild @@ -0,0 +1 @@ +../../packages/emacs/lisp-textmodes-ispell.el.patch.beforehostbuild \ No newline at end of file diff --git a/x11-packages/emacs-x/lisp.Makefile.in.patch b/x11-packages/emacs-x/lisp.Makefile.in.patch deleted file mode 100644 index 23599203b1..0000000000 --- a/x11-packages/emacs-x/lisp.Makefile.in.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./lisp/Makefile.in.org 2023-09-04 19:48:23.587360819 +0200 -+++ ./lisp/Makefile.in 2023-09-04 19:49:06.504313622 +0200 -@@ -53,7 +53,7 @@ - # 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 = ../src/bootstrap-emacs${EXEEXT} - - # Command line flags for Emacs. - diff --git a/x11-packages/emacs-x/lisp.Makefile.in.patch b/x11-packages/emacs-x/lisp.Makefile.in.patch new file mode 120000 index 0000000000..050603659b --- /dev/null +++ b/x11-packages/emacs-x/lisp.Makefile.in.patch @@ -0,0 +1 @@ +../../packages/emacs/lisp.Makefile.in.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/no-procent_n-android.patch b/x11-packages/emacs-x/no-procent_n-android.patch deleted file mode 100644 index 98721c675c..0000000000 --- a/x11-packages/emacs-x/no-procent_n-android.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ./src/emacs.c.org 2023-09-04 19:14:48.656907177 +0200 -+++ ./src/emacs.c 2023-09-04 19:16:06.510742013 +0200 -@@ -2958,17 +2958,17 @@ - reset_all_sys_modes (); - if (sig && sig != SIGTERM) - { -- static char const fmt[] = "Fatal error %d: %n%s\n"; -+ static char const fmt[] = "Fatal error %d: %s\n"; - #ifdef HAVE_HAIKU - if (haiku_debug_on_fatal_error) - debugger ("Fatal error in Emacs"); - #endif -- char buf[max ((sizeof fmt - sizeof "%d%n%s\n" -+ char buf[max ((sizeof fmt - sizeof "%d%s\n" - + INT_STRLEN_BOUND (int) + 1), - min (PIPE_BUF, MAX_ALLOCA))]; - char const *sig_desc = safe_strsignal (sig); - int nlen; -- int buflen = snprintf (buf, sizeof buf, fmt, sig, &nlen, sig_desc); -+ int buflen = snprintf (buf, sizeof buf, fmt, sig, sig_desc); - if (0 <= buflen && buflen < sizeof buf) - emacs_write (STDERR_FILENO, buf, buflen); - else diff --git a/x11-packages/emacs-x/no_user_fullname.patch b/x11-packages/emacs-x/no_user_fullname.patch deleted file mode 100644 index b3c513202e..0000000000 --- a/x11-packages/emacs-x/no_user_fullname.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./src/editfns.c.orig 2022-04-06 12:34:24.052297271 +0200 -+++ ./src/editfns.c 2022-04-06 12:34:54.075849159 +0200 -@@ -1266,7 +1266,7 @@ - if (!pw) - return Qnil; - -- p = USER_FULL_NAME; -+ p = "termux"; - /* Chop off everything after the first comma, since 'pw_gecos' is a - comma-separated list. */ - q = strchr (p, ','); diff --git a/x11-packages/emacs-x/no_user_fullname.patch b/x11-packages/emacs-x/no_user_fullname.patch new file mode 120000 index 0000000000..0420832a72 --- /dev/null +++ b/x11-packages/emacs-x/no_user_fullname.patch @@ -0,0 +1 @@ +../../packages/emacs/no_user_fullname.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/src-callproc.c.patch b/x11-packages/emacs-x/src-callproc.c.patch deleted file mode 100644 index f6588203af..0000000000 --- a/x11-packages/emacs-x/src-callproc.c.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./src/callproc.c.orig 2020-07-29 23:40:42.000000000 +0200 -+++ ./src/callproc.c 2020-09-14 21:36:04.897296897 +0200 -@@ -1621,7 +1621,7 @@ - dir_warning ("arch-independent data dir", Vdata_directory); - - sh = getenv ("SHELL"); -- Vshell_file_name = build_string (sh ? sh : "/bin/sh"); -+ Vshell_file_name = build_string (sh ? sh : "@TERMUX_PREFIX@/bin/sh"); - - Lisp_Object gamedir = Qnil; - if (PATH_GAME) diff --git a/x11-packages/emacs-x/src-callproc.c.patch b/x11-packages/emacs-x/src-callproc.c.patch new file mode 120000 index 0000000000..db9e5f8b2a --- /dev/null +++ b/x11-packages/emacs-x/src-callproc.c.patch @@ -0,0 +1 @@ +../../packages/emacs/src-callproc.c.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/src-fileio.c.patch b/x11-packages/emacs-x/src-fileio.c.patch deleted file mode 100644 index 499625b7cd..0000000000 --- a/x11-packages/emacs-x/src-fileio.c.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../fileio.c.orig 2020-07-11 20:22:17.937310671 +0200 -+++ ./src/fileio.c 2020-07-11 20:22:44.147310684 +0200 -@@ -2617,7 +2617,7 @@ - encoded_file = ENCODE_FILE (file); - encoded_newname = ENCODE_FILE (newname); - -- if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) -+ if (symlink (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) - return Qnil; - - if (errno == EEXIST) -@@ -2627,7 +2627,7 @@ - barf_or_query_if_file_exists (newname, true, "make it a new name", - FIXNUMP (ok_if_already_exists), false); - unlink (SSDATA (newname)); -- if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) -+ if (symlink (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) - return Qnil; - } - diff --git a/x11-packages/emacs-x/src-fileio.c.patch b/x11-packages/emacs-x/src-fileio.c.patch new file mode 120000 index 0000000000..4b1017083a --- /dev/null +++ b/x11-packages/emacs-x/src-fileio.c.patch @@ -0,0 +1 @@ +../../packages/emacs/src-fileio.c.patch \ No newline at end of file diff --git a/x11-packages/emacs-x/src-filelock.c.patch b/x11-packages/emacs-x/src-filelock.c.patch deleted file mode 100644 index ebc7b163a3..0000000000 --- a/x11-packages/emacs-x/src-filelock.c.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ./src/filelock.c.org 2023-09-04 19:19:14.282110171 +0200 -+++ ./src/filelock.c 2023-09-04 19:21:09.469561631 +0200 -@@ -62,11 +62,11 @@ - /* A file whose last-modified time is just after the most recent boot. - Define this to be NULL to disable checking for this file. */ - #ifndef BOOT_TIME_FILE --#define BOOT_TIME_FILE "/var/run/random-seed" -+#define BOOT_TIME_FILE "@TERMUX_PREFIX@/var/run/random-seed" - #endif - - #if !defined WTMP_FILE && !defined WINDOWSNT && defined BOOT_TIME --#define WTMP_FILE "/var/log/wtmp" -+#define WTMP_FILE "@TERMUX_PREFIX@/var/log/wtmp" - #endif - - /* Normally use a symbolic link to represent a lock. -@@ -126,14 +126,14 @@ - static time_t boot_time; - static bool boot_time_initialized; - --#ifdef BOOT_TIME -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - static void get_boot_time_1 (const char *, bool); - #endif - - static time_t - get_boot_time (void) - { --#if defined (BOOT_TIME) -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - int counter; - #endif - -@@ -169,7 +169,7 @@ - } - } - --#if defined (BOOT_TIME) -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - /* The utmp routines maintain static state. Don't touch that state - if we are going to dump, since it might not survive dumping. */ - if (will_dump_p ()) -@@ -228,7 +228,7 @@ - #endif - } - --#ifdef BOOT_TIME -+#if defined (BOOT_TIME) && !defined(__ANDROID__) - /* Try to get the boot time from wtmp file FILENAME. - This succeeds if that file contains a reboot record. -