From b2bef64d90f25f22ea59d60d590a00204ea8358a Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Tue, 16 Nov 2021 14:30:30 +0100 Subject: [PATCH] emacs-x: avoid system faccessat Just setting ac_cv_func_faccessat=no just leads to emacs hanging when trying to use that function, so we need to modify m4 script as well. Fixes https://github.com/termux/x11-packages/issues/497. --- x11-packages/emacs-x/build.sh | 6 +++++- x11-packages/emacs-x/replace_faccessat.patch | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 x11-packages/emacs-x/replace_faccessat.patch diff --git a/x11-packages/emacs-x/build.sh b/x11-packages/emacs-x/build.sh index 2c105d001..55324b3ab 100644 --- a/x11-packages/emacs-x/build.sh +++ b/x11-packages/emacs-x/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Extensible, customizable text editor-and more" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=27.2 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/emacs/emacs-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=b4a7cc4e78e63f378624e0919215b910af5bb2a0afc819fad298272e9f40c1b9 TERMUX_PKG_DEPENDS="fontconfig, freetype, gdk-pixbuf, giflib, glib, libgnutls, libice, libjpeg-turbo, libpng, librsvg, libsm, libtiff, libx11, libxaw, libxcb, libxext, libxfixes, libxft, libxinerama, libxml2, libxmu, libxpm, libxrandr, libxrender, libxt, littlecms, ncurses, zlib" @@ -47,6 +47,10 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_elf_elf_begin=no" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" gl_cv_func_dup2_works=no" # disable setrlimit function to make termux-am work from within emacs TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_setrlimit=no" +# for some reason faccessat calls fails with "invalid argument" +# starting from ndk-r23 +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_faccessat=no" + TERMUX_PKG_HOSTBUILD=true # Remove some irrelevant files: diff --git a/x11-packages/emacs-x/replace_faccessat.patch b/x11-packages/emacs-x/replace_faccessat.patch new file mode 100644 index 000000000..def295f3d --- /dev/null +++ b/x11-packages/emacs-x/replace_faccessat.patch @@ -0,0 +1,12 @@ +diff --git a/m4/faccessat.m4 b/m4/faccessat.m4 +index 9d6b3635117..ff1f803d405 100644 +--- a/m4/faccessat.m4 ++++ b/m4/faccessat.m4 +@@ -19,6 +19,7 @@ AC_DEFUN([gl_FUNC_FACCESSAT], + AC_CHECK_FUNCS_ONCE([faccessat]) + if test $ac_cv_func_faccessat = no; then + HAVE_FACCESSAT=0 ++ REPLACE_FACCESSAT=1 + else + case $gl_cv_func_lstat_dereferences_slashed_symlink in + *yes) ;;