From 9b73c472de5bc2f38c7e79d6f74c94b3f24c1497 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Thu, 29 Aug 2019 20:27:12 +0200 Subject: [PATCH] emacs: make emacsclient look for socket in $PREFIX/var/run per default --- packages/emacs/build.sh | 1 + packages/emacs/lib-src-emacsclient.c.patch | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/emacs/build.sh b/packages/emacs/build.sh index e7ed447a7..36195eca7 100644 --- a/packages/emacs/build.sh +++ b/packages/emacs/build.sh @@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/emacs/ TERMUX_PKG_DESCRIPTION="Extensible, customizable text editor-and more" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=26.3 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/emacs/emacs-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=4d90e6751ad8967822c6e092db07466b9d383ef1653feb2f95c93e7de66d3485 TERMUX_PKG_DEPENDS="ncurses, gnutls, libxml2" diff --git a/packages/emacs/lib-src-emacsclient.c.patch b/packages/emacs/lib-src-emacsclient.c.patch index c5b1acd83..c779f18b7 100644 --- a/packages/emacs/lib-src-emacsclient.c.patch +++ b/packages/emacs/lib-src-emacsclient.c.patch @@ -1,12 +1,18 @@ -diff -u -r ../emacs-25.0.92/lib-src/emacsclient.c ./lib-src/emacsclient.c ---- ../emacs-25.0.92/lib-src/emacsclient.c 2016-03-02 05:21:42.000000000 -0500 -+++ ./lib-src/emacsclient.c 2016-04-09 01:28:10.881760020 -0400 -@@ -1210,7 +1210,7 @@ +--- ../emacsclient.c.orig 2019-08-29 20:08:48.840624090 +0200 ++++ ./lib-src/emacsclient.c 2019-08-29 20:13:37.425382182 +0200 +@@ -1289,11 +1289,12 @@ } else #endif - tmpdir = "/tmp"; + tmpdir = "@TERMUX_PREFIX@/tmp"; } ++ /* Use $PREFIX/var/run instead of $TMPDIR in termux. */ socket_name_storage = - xmalloc (strlen (tmpdir) + strlen (server_name) + EXTRA_SPACE); +- xmalloc (strlen (tmpdir) + strlen (server_name) + EXTRA_SPACE); +- char *z = stpcpy (socket_name_storage, tmpdir); ++ xmalloc (strlen ("@TERMUX_PREFIX@/var/run") + strlen (server_name) + EXTRA_SPACE); ++ char *z = stpcpy (socket_name_storage, "@TERMUX_PREFIX@/var/run"); + z += sprintf (z, "/emacs%ld/", uid); + strcpy (z, server_name); + local_socket_name = socket_name_storage;