diff --git a/packages/mesa/0003-fix-for-anon-file.patch b/packages/mesa/0003-fix-for-anon-file.patch index f14a6d0a63a9fce..06428da00d90b64 100644 --- a/packages/mesa/0003-fix-for-anon-file.patch +++ b/packages/mesa/0003-fix-for-anon-file.patch @@ -2,15 +2,12 @@ Fallback to `@TERMUX_PREFIX@/tmp` if env `XDG_RUNTIME_DIR` is not set. --- a/src/util/anon_file.c +++ b/src/util/anon_file.c -@@ -137,6 +137,11 @@ - char *name; +@@ -122,7 +122,7 @@ get_or_create_user_temp_dir(char* buf, size_t len) { + return buf; + } - path = getenv("XDG_RUNTIME_DIR"); -+#ifdef __TERMUX__ -+ if (!path) { -+ path = "@TERMUX_PREFIX@/tmp"; -+ } -+#endif - if (!path) { - errno = ENOENT; - return -1; +- snprintf(buf, len, "/tmp/xdg-runtime-mesa-%ld", (long)getuid()); ++ snprintf(buf, len, "@TERMUX_PREFIX@/tmp/xdg-runtime-mesa-%ld", (long)getuid()); + mesa_logd("%s: XDG_RUNTIME_DIR not set; falling back to temp dir %s", + __func__, buf); + if (stat(buf, &st) == 0) { diff --git a/packages/mesa/0008-workaround-fortify-check.patch b/packages/mesa/0008-workaround-fortify-check.patch index cab6deaa43fc227..d0baf53117aba1b 100644 --- a/packages/mesa/0008-workaround-fortify-check.patch +++ b/packages/mesa/0008-workaround-fortify-check.patch @@ -2,7 +2,7 @@ https://github.com/termux/termux-packages/issues/18823 --- a/src/c11/threads.h +++ b/src/c11/threads.h -@@ -117,7 +117,15 @@ +@@ -117,7 +117,15 @@ typedef struct typedef pthread_cond_t cnd_t; typedef pthread_t thrd_t; typedef pthread_key_t tss_t; @@ -15,9 +15,9 @@ https://github.com/termux/termux-packages/issues/18823 +#else typedef pthread_mutex_t mtx_t; +#endif + #ifndef __once_flag_defined typedef pthread_once_t once_flag; # define ONCE_FLAG_INIT PTHREAD_ONCE_INIT - # ifdef PTHREAD_DESTRUCTOR_ITERATIONS --- a/src/c11/impl/threads_posix.c +++ b/src/c11/impl/threads_posix.c @@ -120,7 +120,11 @@ diff --git a/packages/mesa/0016-define-reallocarray.patch b/packages/mesa/0015-define-reallocarray.patch similarity index 100% rename from packages/mesa/0016-define-reallocarray.patch rename to packages/mesa/0015-define-reallocarray.patch diff --git a/packages/mesa/0015-fix-detection-memfd_create-getrandom.patch b/packages/mesa/0015-fix-detection-memfd_create-getrandom.patch deleted file mode 100644 index 918984f68428088..000000000000000 --- a/packages/mesa/0015-fix-detection-memfd_create-getrandom.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 42a78a1aae19f855b049462d7714cd1f07ca12e4 Mon Sep 17 00:00:00 2001 -From: Fafa Kitten -Date: Tue, 30 Sep 2025 01:42:57 -0500 -Subject: [PATCH] meson: detect `memfd_create()` and `getrandom()` from - headers, not system libraries - -When compiling Mesa on Android targeting Android, under some conditions `memfd_create()` and `getrandom()` are detected as available when they are not, so they should not be assumed to be available unless they are detected by Meson as available in the appropriate header passed in the `prefix` argument to Meson's `has_function()` method. - -`memfd_create()` is not available unless the target Android API level is 30 (Android 11) or higher and the define `_GNU_SOURCE` (which in turn sets the define `__USE_GNU`) is set, and Mesa does set `_GNU_SOURCE`, so by setting `args: pre_args` in the appropriate call to `has_function()` (which causes `-D_GNU_SOURCE` to be added to the arguments used by Meson to check the header only if it was detected as necessary for `pre_args` in the earlier condition), `memfd_create()` will be correctly detected as available when targeting (only) Android 11 or newer (and other operating systems that support `memfd_create()`) after this PR, - -and `getrandom()` is not available unless the target Android API level is 28 (Android 9) or higher, so `getrandom()` will be detected as available when targeting (only) Android 9 or newer (and other operating systems that support `getrandom()`) after this PR. - -Related information: - -https://android.googlesource.com/platform/bionic/+/refs/heads/android15-release/libc/include/sys/mman.h#186 - -https://android.googlesource.com/platform/bionic/+/refs/heads/android15-release/libc/include/sys/random.h#55 - -https://android.googlesource.com/platform/bionic/+/refs/heads/android15-release/libc/include/sys/cdefs.h#182 - -https://gitlab.freedesktop.org/mesa/mesa/-/blob/927f65caf359a2e0dda87dd5167fe18d153a9a32/meson.build#L1074 - -https://github.com/mesonbuild/meson/blob/cab3b67cfe04d0e06d4e7c2f50fb4f99cd0dd7eb/docs/markdown/Compiler-properties.md#does-a-function-exist - -Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13566 -Part-of: ---- - meson.build | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 4d0cf1714f234..dab44ad805786 100644 ---- a/meson.build -+++ b/meson.build -@@ -1400,11 +1400,11 @@ endforeach - functions_to_detect = { - 'strtof': '', - 'mkostemp': '', -- 'memfd_create': '', -+ 'memfd_create': '#include ', - 'random_r': '', - 'flock': '', - 'strtok_r': '', -- 'getrandom': '', -+ 'getrandom': '#include ', - 'qsort_s': '', - 'posix_fallocate': '', - 'secure_getenv': '', -@@ -1412,7 +1412,7 @@ functions_to_detect = { - } - - foreach f, prefix: functions_to_detect -- if cc.has_function(f, prefix: prefix) -+ if cc.has_function(f, args: pre_args, prefix: prefix) - pre_args += '-DHAVE_@0@'.format(f.to_upper()) - endif - endforeach --- -GitLab - diff --git a/packages/mesa/0017-unofficial_support_adreno_710_720.patch b/packages/mesa/0016-unofficial_support_adreno_710_720.patch similarity index 100% rename from packages/mesa/0017-unofficial_support_adreno_710_720.patch rename to packages/mesa/0016-unofficial_support_adreno_710_720.patch diff --git a/packages/mesa/0018-preserve-egl-support-in-zink.patch b/packages/mesa/0017-preserve-egl-support-in-zink.patch similarity index 100% rename from packages/mesa/0018-preserve-egl-support-in-zink.patch rename to packages/mesa/0017-preserve-egl-support-in-zink.patch diff --git a/packages/mesa/0019-disable-general-layout-in-zink-for-turnip.patch b/packages/mesa/0018-disable-general-layout-in-zink-for-turnip.patch similarity index 100% rename from packages/mesa/0019-disable-general-layout-in-zink-for-turnip.patch rename to packages/mesa/0018-disable-general-layout-in-zink-for-turnip.patch diff --git a/packages/mesa/build.sh b/packages/mesa/build.sh index 453c084c9d09d3e..21023ed5e50a65e 100644 --- a/packages/mesa/build.sh +++ b/packages/mesa/build.sh @@ -3,11 +3,11 @@ TERMUX_PKG_DESCRIPTION="An open-source implementation of the OpenGL specificatio TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE_FILE="docs/license.rst" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="25.2.5" +TERMUX_PKG_VERSION="25.3.0" _LLVM_MAJOR_VERSION=$(. $TERMUX_SCRIPTDIR/packages/libllvm/build.sh; echo "${LLVM_MAJOR_VERSION}") _LLVM_MAJOR_VERSION_NEXT=$((_LLVM_MAJOR_VERSION + 1)) TERMUX_PKG_SRCURL=https://archive.mesa3d.org/mesa-${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_SHA256=bb6243e7a6f525febfa1e6ab50827ca4d4bfdad73812377b0ca9b6c50998b03e +TERMUX_PKG_SHA256=0fd54fea7dbbddb154df05ac752b18621f26d97e27863db3be951417c6abe8ae TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_DEPENDS="libandroid-shmem, libc++, libdrm, libglvnd, libllvm (<< ${_LLVM_MAJOR_VERSION_NEXT}), libwayland, libx11, libxext, libxfixes, libxshmfence, libxxf86vm, ncurses, vulkan-loader, zlib, zstd" TERMUX_PKG_SUGGESTS="mesa-dev" @@ -37,7 +37,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" " termux_pkg_auto_update() { - read -r latest < <(curl -fsSL "https://archive.mesa3d.org/" | sed -rn 's/.*mesa-([0-9]+(\.[0-9]+)*).*/\1/p' | sort -Vr); + read -r latest < <(curl -fsSL "https://archive.mesa3d.org/" | grep -v rc | sed -rn 's/.*mesa-([0-9]+(\.[0-9]+)*).*/\1/p' | sort -Vr); termux_pkg_upgrade_version "${latest}" }