From 475ded7195fdcf3d73603560321d493c9bf29645 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Sun, 10 Apr 2022 15:01:24 +0900 Subject: [PATCH] mesa: Revert hack for `libandroid-shmem` which is no longer necessary after `libandroid-shmem` update. Effectively reverts commit 671b39bc2c32e04a704b32a3af40edac81ef11b3. %ci:no-build --- x11-packages/mesa/build.sh | 4 +- .../src-mesa-drivers-x11-xm_buffer.c.patch | 84 ------------------- 2 files changed, 2 insertions(+), 86 deletions(-) delete mode 100644 x11-packages/mesa/src-mesa-drivers-x11-xm_buffer.c.patch diff --git a/x11-packages/mesa/build.sh b/x11-packages/mesa/build.sh index 885bcf750..3cafa093a 100644 --- a/x11-packages/mesa/build.sh +++ b/x11-packages/mesa/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE_FILE="docs/license.rst" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=21.3.7 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://archive.mesa3d.org/mesa-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=b4fa9db7aa61bf209ef0b40bef83080999d86ad98df8b8b4fada7c128a1efc3d TERMUX_PKG_DEPENDS="libandroid-shmem, libc++, libx11, libxext, zlib, libexpat" @@ -28,7 +28,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" termux_step_pre_configure() { CPPFLAGS+=" -D__USE_GNU" - # Note: -landroid-shmem in LDFLAGS is not needed because it is dlopen()ed + LDFLAGS+=" -landroid-shmem" } termux_step_post_massage() { diff --git a/x11-packages/mesa/src-mesa-drivers-x11-xm_buffer.c.patch b/x11-packages/mesa/src-mesa-drivers-x11-xm_buffer.c.patch deleted file mode 100644 index 7d7dade16..000000000 --- a/x11-packages/mesa/src-mesa-drivers-x11-xm_buffer.c.patch +++ /dev/null @@ -1,84 +0,0 @@ ---- a/src/mesa/drivers/x11/xm_buffer.c -+++ b/src/mesa/drivers/x11/xm_buffer.c -@@ -45,6 +45,81 @@ - #if defined(USE_XSHM) - static volatile int mesaXErrorFlag = 0; - -+#ifdef __ANDROID__ -+ -+#include -+ -+typedef int (*shmctl_func_t)(int, int, struct shmid_ds *); -+typedef int (*shmget_func_t)(key_t, size_t, int); -+typedef void *(*shmat_func_t)(int, void const *, int); -+typedef int (*shmdt_func_t)(void const *); -+static shmctl_func_t shmctl_func; -+static shmget_func_t shmget_func; -+static shmat_func_t shmat_func; -+static shmdt_func_t shmdt_func; -+#undef shmctl -+#undef shmget -+#undef shmat -+#undef shmdt -+static int libandroid_shmem_funcs_initialized; -+ -+static void -+libandroid_shmem_initialize(void) -+{ -+ if (!libandroid_shmem_funcs_initialized) { -+ void *libandroid_shmem_handle = dlopen("libandroid-shmem.so", RTLD_NOW); -+ if (libandroid_shmem_handle != NULL) { -+ shmctl_func = dlsym(libandroid_shmem_handle, "shmctl"); -+ shmget_func = dlsym(libandroid_shmem_handle, "shmget"); -+ shmat_func = dlsym(libandroid_shmem_handle, "shmat"); -+ shmdt_func = dlsym(libandroid_shmem_handle, "shmdt"); -+ } -+ libandroid_shmem_funcs_initialized = 1; -+ } -+} -+ -+#pragma GCC visibility push(hidden) -+ -+int -+shmctl(int shmid, int cmd, struct shmid_ds *buf) -+{ -+ if (!libandroid_shmem_funcs_initialized) { -+ libandroid_shmem_initialize(); -+ } -+ return shmctl_func(shmid, cmd, buf); -+} -+ -+int -+shmget(key_t key, size_t size, int shmflg) -+{ -+ if (!libandroid_shmem_funcs_initialized) { -+ libandroid_shmem_initialize(); -+ } -+ return shmget_func(key, size, shmflg); -+} -+ -+void * -+shmat(int shmid, void const *shmaddr, int shmflg) -+{ -+ if (!libandroid_shmem_funcs_initialized) { -+ libandroid_shmem_initialize(); -+ } -+ return shmat_func(shmid, shmaddr, shmflg); -+} -+ -+int -+shmdt(void const *shmaddr) -+{ -+ if (!libandroid_shmem_funcs_initialized) { -+ libandroid_shmem_initialize(); -+ } -+ return shmdt_func(shmaddr); -+} -+ -+#pragma GCC visibility pop -+ -+#endif /* __ANDROID__ */ -+ - /** - * Catches potential Xlib errors. - */