From bbf2e035082b75d5ef2ecd78c7288c21d23e129b Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Thu, 16 Oct 2025 09:50:26 +0530 Subject: [PATCH] scripts(toolchain): update to NDK r29 --- build-package.sh | 2 +- ndk-patches/28c/c++-v1-module.modulemap.patch | 10 ------- ndk-patches/28c/c++-v1-stdlib.h.patch | 27 ------------------- .../{28c => 29}/bits-struct_file.h.patch | 0 ndk-patches/{28c => 29}/dirent.h.patch | 0 ndk-patches/{28c => 29}/fcntl.h.patch | 0 ndk-patches/{28c => 29}/grp.h.patch | 0 ndk-patches/{28c => 29}/linux-fcntl.h.patch | 0 ndk-patches/{28c => 29}/paths.h.patch | 0 ndk-patches/{28c => 29}/pwd.h.patch | 0 .../{28c => 29}/redefine-TCSAFLUSH.patch | 0 ndk-patches/{28c => 29}/semaphore.h.patch | 0 ndk-patches/{28c => 29}/stdio.h.patch | 0 ndk-patches/{28c => 29}/stdlib.h.patch | 0 ndk-patches/{28c => 29}/sys-cdefs.h.patch | 0 ndk-patches/{28c => 29}/sys-time.h.patch | 0 ndk-patches/{28c => 29}/syslog.patch | 0 ndk-patches/{28c => 29}/time.h.patch | 0 ndk-patches/{28c => 29}/unistd.h.patch | 0 ndk-patches/{28c => 29}/utmp.h.patch | 0 packages/libandroid-stub/build.sh | 2 +- packages/libc++/build.sh | 2 +- packages/ndk-multilib/build.sh | 3 +-- packages/ndk-sysroot/build.sh | 2 +- packages/vulkan-loader-android/build.sh | 3 +-- scripts/build/termux_step_setup_toolchain.sh | 4 +-- ...in_28c.sh => termux_setup_toolchain_29.sh} | 2 +- scripts/properties.sh | 4 +-- scripts/setup-android-sdk.sh | 4 +-- 29 files changed, 13 insertions(+), 52 deletions(-) delete mode 100644 ndk-patches/28c/c++-v1-module.modulemap.patch delete mode 100644 ndk-patches/28c/c++-v1-stdlib.h.patch rename ndk-patches/{28c => 29}/bits-struct_file.h.patch (100%) rename ndk-patches/{28c => 29}/dirent.h.patch (100%) rename ndk-patches/{28c => 29}/fcntl.h.patch (100%) rename ndk-patches/{28c => 29}/grp.h.patch (100%) rename ndk-patches/{28c => 29}/linux-fcntl.h.patch (100%) rename ndk-patches/{28c => 29}/paths.h.patch (100%) rename ndk-patches/{28c => 29}/pwd.h.patch (100%) rename ndk-patches/{28c => 29}/redefine-TCSAFLUSH.patch (100%) rename ndk-patches/{28c => 29}/semaphore.h.patch (100%) rename ndk-patches/{28c => 29}/stdio.h.patch (100%) rename ndk-patches/{28c => 29}/stdlib.h.patch (100%) rename ndk-patches/{28c => 29}/sys-cdefs.h.patch (100%) rename ndk-patches/{28c => 29}/sys-time.h.patch (100%) rename ndk-patches/{28c => 29}/syslog.patch (100%) rename ndk-patches/{28c => 29}/time.h.patch (100%) rename ndk-patches/{28c => 29}/unistd.h.patch (100%) rename ndk-patches/{28c => 29}/utmp.h.patch (100%) rename scripts/build/toolchain/{termux_setup_toolchain_28c.sh => termux_setup_toolchain_29.sh} (99%) diff --git a/build-package.sh b/build-package.sh index 17a379c0586f2b..04c6ebd1dcd265 100755 --- a/build-package.sh +++ b/build-package.sh @@ -270,7 +270,7 @@ source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_host_build.sh" # Setup a standalone Android NDK toolchain. Called from termux_step_setup_toolchain. # shellcheck source=scripts/build/toolchain/termux_setup_toolchain_28c.sh -source "$TERMUX_SCRIPTDIR/scripts/build/toolchain/termux_setup_toolchain_28c.sh" +source "$TERMUX_SCRIPTDIR/scripts/build/toolchain/termux_setup_toolchain_29.sh" # Setup a standalone Android NDK 23c toolchain. Called from termux_step_setup_toolchain. # shellcheck source=scripts/build/toolchain/termux_setup_toolchain_23c.sh diff --git a/ndk-patches/28c/c++-v1-module.modulemap.patch b/ndk-patches/28c/c++-v1-module.modulemap.patch deleted file mode 100644 index eaaa2038b73b7d..00000000000000 --- a/ndk-patches/28c/c++-v1-module.modulemap.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/usr/include/c++/v1/module.modulemap 2024-11-08 20:03:22 -+++ b/usr/include/c++/v1/module.modulemap 2024-11-08 21:27:52 -@@ -1537,6 +1537,7 @@ - module std_private_memory_uninitialized_algorithms [system] { - header "__memory/uninitialized_algorithms.h" - export std_private_algorithm_copy -+ export std_private_memory_voidify - } - module std_private_memory_unique_ptr [system] { - header "__memory/unique_ptr.h" diff --git a/ndk-patches/28c/c++-v1-stdlib.h.patch b/ndk-patches/28c/c++-v1-stdlib.h.patch deleted file mode 100644 index c37044277a1d9d..00000000000000 --- a/ndk-patches/28c/c++-v1-stdlib.h.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/usr/include/c++/v1/stdlib.h 2024-11-08 20:01:18 -+++ b/usr/include/c++/v1/stdlib.h 2024-11-08 20:03:38 -@@ -109,6 +109,7 @@ - # endif - - // MSVCRT already has the correct prototype in if __cplusplus is defined -+# if !defined(__swift__) - # if !defined(_LIBCPP_MSVCRT) - _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long abs(long __x) _NOEXCEPT { return __builtin_labs(__x); } - _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long long abs(long long __x) _NOEXCEPT { -@@ -127,6 +128,7 @@ - _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double abs(long double __lcpp_x) _NOEXCEPT { - return __builtin_fabsl(__lcpp_x); - } -+# endif // !defined(__swift__) - - // div - -@@ -141,7 +143,7 @@ - # endif - - // MSVCRT already has the correct prototype in if __cplusplus is defined --# if !defined(_LIBCPP_MSVCRT) -+# if !defined(_LIBCPP_MSVCRT) && !defined(__swift__) - inline _LIBCPP_HIDE_FROM_ABI ldiv_t div(long __x, long __y) _NOEXCEPT { return ::ldiv(__x, __y); } - # if !(defined(__FreeBSD__) && !defined(__LONG_LONG_SUPPORTED)) - inline _LIBCPP_HIDE_FROM_ABI lldiv_t div(long long __x, long long __y) _NOEXCEPT { return ::lldiv(__x, __y); } diff --git a/ndk-patches/28c/bits-struct_file.h.patch b/ndk-patches/29/bits-struct_file.h.patch similarity index 100% rename from ndk-patches/28c/bits-struct_file.h.patch rename to ndk-patches/29/bits-struct_file.h.patch diff --git a/ndk-patches/28c/dirent.h.patch b/ndk-patches/29/dirent.h.patch similarity index 100% rename from ndk-patches/28c/dirent.h.patch rename to ndk-patches/29/dirent.h.patch diff --git a/ndk-patches/28c/fcntl.h.patch b/ndk-patches/29/fcntl.h.patch similarity index 100% rename from ndk-patches/28c/fcntl.h.patch rename to ndk-patches/29/fcntl.h.patch diff --git a/ndk-patches/28c/grp.h.patch b/ndk-patches/29/grp.h.patch similarity index 100% rename from ndk-patches/28c/grp.h.patch rename to ndk-patches/29/grp.h.patch diff --git a/ndk-patches/28c/linux-fcntl.h.patch b/ndk-patches/29/linux-fcntl.h.patch similarity index 100% rename from ndk-patches/28c/linux-fcntl.h.patch rename to ndk-patches/29/linux-fcntl.h.patch diff --git a/ndk-patches/28c/paths.h.patch b/ndk-patches/29/paths.h.patch similarity index 100% rename from ndk-patches/28c/paths.h.patch rename to ndk-patches/29/paths.h.patch diff --git a/ndk-patches/28c/pwd.h.patch b/ndk-patches/29/pwd.h.patch similarity index 100% rename from ndk-patches/28c/pwd.h.patch rename to ndk-patches/29/pwd.h.patch diff --git a/ndk-patches/28c/redefine-TCSAFLUSH.patch b/ndk-patches/29/redefine-TCSAFLUSH.patch similarity index 100% rename from ndk-patches/28c/redefine-TCSAFLUSH.patch rename to ndk-patches/29/redefine-TCSAFLUSH.patch diff --git a/ndk-patches/28c/semaphore.h.patch b/ndk-patches/29/semaphore.h.patch similarity index 100% rename from ndk-patches/28c/semaphore.h.patch rename to ndk-patches/29/semaphore.h.patch diff --git a/ndk-patches/28c/stdio.h.patch b/ndk-patches/29/stdio.h.patch similarity index 100% rename from ndk-patches/28c/stdio.h.patch rename to ndk-patches/29/stdio.h.patch diff --git a/ndk-patches/28c/stdlib.h.patch b/ndk-patches/29/stdlib.h.patch similarity index 100% rename from ndk-patches/28c/stdlib.h.patch rename to ndk-patches/29/stdlib.h.patch diff --git a/ndk-patches/28c/sys-cdefs.h.patch b/ndk-patches/29/sys-cdefs.h.patch similarity index 100% rename from ndk-patches/28c/sys-cdefs.h.patch rename to ndk-patches/29/sys-cdefs.h.patch diff --git a/ndk-patches/28c/sys-time.h.patch b/ndk-patches/29/sys-time.h.patch similarity index 100% rename from ndk-patches/28c/sys-time.h.patch rename to ndk-patches/29/sys-time.h.patch diff --git a/ndk-patches/28c/syslog.patch b/ndk-patches/29/syslog.patch similarity index 100% rename from ndk-patches/28c/syslog.patch rename to ndk-patches/29/syslog.patch diff --git a/ndk-patches/28c/time.h.patch b/ndk-patches/29/time.h.patch similarity index 100% rename from ndk-patches/28c/time.h.patch rename to ndk-patches/29/time.h.patch diff --git a/ndk-patches/28c/unistd.h.patch b/ndk-patches/29/unistd.h.patch similarity index 100% rename from ndk-patches/28c/unistd.h.patch rename to ndk-patches/29/unistd.h.patch diff --git a/ndk-patches/28c/utmp.h.patch b/ndk-patches/29/utmp.h.patch similarity index 100% rename from ndk-patches/28c/utmp.h.patch rename to ndk-patches/29/utmp.h.patch diff --git a/packages/libandroid-stub/build.sh b/packages/libandroid-stub/build.sh index d07fd6e455fbba..b4e13ce4e31b76 100644 --- a/packages/libandroid-stub/build.sh +++ b/packages/libandroid-stub/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=28c +TERMUX_PKG_VERSION=29 TERMUX_PKG_AUTO_UPDATE=false TERMUX_PKG_CONFLICTS="libandroid" TERMUX_PKG_REPLACES="libandroid" diff --git a/packages/libc++/build.sh b/packages/libc++/build.sh index ed3182600f4095..d8a8133fd9d446 100644 --- a/packages/libc++/build.sh +++ b/packages/libc++/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=28c +TERMUX_PKG_VERSION=29 TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/packages/ndk-multilib/build.sh b/packages/ndk-multilib/build.sh index 7eaf249bd0c972..880eabb4fc72c2 100644 --- a/packages/ndk-multilib/build.sh +++ b/packages/ndk-multilib/build.sh @@ -4,8 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=28c -TERMUX_PKG_REVISION=2 +TERMUX_PKG_VERSION=29 TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/packages/ndk-sysroot/build.sh b/packages/ndk-sysroot/build.sh index ef7b94c62967e0..ca01e62170fbd2 100644 --- a/packages/ndk-sysroot/build.sh +++ b/packages/ndk-sysroot/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=28c +TERMUX_PKG_VERSION=29 TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/packages/vulkan-loader-android/build.sh b/packages/vulkan-loader-android/build.sh index 999a40ae4920c5..38672b17e15c41 100644 --- a/packages/vulkan-loader-android/build.sh +++ b/packages/vulkan-loader-android/build.sh @@ -4,8 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=28c -TERMUX_PKG_REVISION=1 +TERMUX_PKG_VERSION=29 TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/scripts/build/termux_step_setup_toolchain.sh b/scripts/build/termux_step_setup_toolchain.sh index fff165fee3bbbf..ef1b1dd9cd84f3 100644 --- a/scripts/build/termux_step_setup_toolchain.sh +++ b/scripts/build/termux_step_setup_toolchain.sh @@ -6,9 +6,9 @@ termux_step_setup_toolchain() { # Bump TERMUX_STANDALONE_TOOLCHAIN if a change is made in # toolchain setup to ensure that everyone gets an updated # toolchain - if [ "${TERMUX_NDK_VERSION}" = "28c" ]; then + if [ "${TERMUX_NDK_VERSION}" = "29" ]; then TERMUX_STANDALONE_TOOLCHAIN+="-v1" - termux_setup_toolchain_28c + termux_setup_toolchain_29 elif [ "${TERMUX_NDK_VERSION}" = 23c ]; then TERMUX_STANDALONE_TOOLCHAIN+="-v8" termux_setup_toolchain_23c diff --git a/scripts/build/toolchain/termux_setup_toolchain_28c.sh b/scripts/build/toolchain/termux_setup_toolchain_29.sh similarity index 99% rename from scripts/build/toolchain/termux_setup_toolchain_28c.sh rename to scripts/build/toolchain/termux_setup_toolchain_29.sh index debaddbc1e8b61..2066a821777de0 100644 --- a/scripts/build/toolchain/termux_setup_toolchain_28c.sh +++ b/scripts/build/toolchain/termux_setup_toolchain_29.sh @@ -1,4 +1,4 @@ -termux_setup_toolchain_28c() { +termux_setup_toolchain_29() { export CFLAGS="" export CPPFLAGS="" export LDFLAGS="-L${TERMUX__PREFIX__LIB_DIR}" diff --git a/scripts/properties.sh b/scripts/properties.sh index 82b1e6edcafdad..87c836928e79bf 100644 --- a/scripts/properties.sh +++ b/scripts/properties.sh @@ -305,8 +305,8 @@ TERMUX_ANDROID_BUILD_TOOLS_VERSION=33.0.1 # change TERMUX_PKG_VERSION (and remove TERMUX_PKG_REVISION if necessary) in: # apksigner, d8 # and trigger rebuild of them -: "${TERMUX_NDK_VERSION_NUM:="28"}" -: "${TERMUX_NDK_REVISION:="c"}" +: "${TERMUX_NDK_VERSION_NUM:="29"}" +: "${TERMUX_NDK_REVISION:=""}" TERMUX_NDK_VERSION="${TERMUX_NDK_VERSION_NUM}${TERMUX_NDK_REVISION}" # when changing the above: # update version and hashsum in packages diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index 09b11240c4e7a0..24dd7c7ea8ebd4 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -10,9 +10,9 @@ set -e -u ANDROID_SDK_FILE=commandlinetools-linux-${TERMUX_SDK_REVISION}_latest.zip ANDROID_SDK_SHA256=0bebf59339eaa534f4217f8aa0972d14dc49e7207be225511073c661ae01da0a -if [ "$TERMUX_NDK_VERSION" = "28c" ]; then +if [ "$TERMUX_NDK_VERSION" = "29" ]; then ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-linux.zip - ANDROID_NDK_SHA256=dfb20d396df28ca02a8c708314b814a4d961dc9074f9a161932746f815aa552f + ANDROID_NDK_SHA256=4abbbcdc842f3d4879206e9695d52709603e52dd68d3c1fff04b3b5e7a308ecf elif [ "$TERMUX_NDK_VERSION" = 23c ]; then ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-linux.zip ANDROID_NDK_SHA256=6ce94604b77d28113ecd588d425363624a5228d9662450c48d2e4053f8039242