From 538f19b0b706995380364e94a8eaf97095f928e3 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 12 Feb 2024 19:31:15 +0100 Subject: [PATCH] depends: android_ndk: update to 18b --- contrib/depends/packages/android_ndk.mk | 10 ++++++++-- .../patches/android_ndk/api_definition.patch | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 contrib/depends/patches/android_ndk/api_definition.patch diff --git a/contrib/depends/packages/android_ndk.mk b/contrib/depends/packages/android_ndk.mk index 9b8a5332f..65fa89de6 100644 --- a/contrib/depends/packages/android_ndk.mk +++ b/contrib/depends/packages/android_ndk.mk @@ -1,8 +1,9 @@ package=android_ndk -$(package)_version=17b +$(package)_version=18b $(package)_download_path=https://dl.google.com/android/repository/ $(package)_file_name=android-ndk-r$($(package)_version)-linux-x86_64.zip -$(package)_sha256_hash=5dfbbdc2d3ba859fed90d0e978af87c71a91a5be1f6e1c40ba697503d48ccecd +$(package)_sha256_hash=4f61cbe4bbf6406aa5ef2ae871def78010eed6271af72de83f8bd0b07a9fd3fd +$(package)_patches=api_definition.patch define $(package)_set_vars $(package)_config_opts_arm=--arch arm @@ -14,6 +15,11 @@ define $(package)_extract_cmds unzip -q $($(1)_source_dir)/$($(package)_file_name) endef +define $(package)_preprocess_cmds + cd android-ndk-r$($(package)_version) && \ + patch -p1 < $($(package)_patch_dir)/api_definition.patch +endef + define $(package)_stage_cmds android-ndk-r$($(package)_version)/build/tools/make_standalone_toolchain.py --api 21 \ --install-dir $(build_prefix) --stl=libc++ $($(package)_config_opts) &&\ diff --git a/contrib/depends/patches/android_ndk/api_definition.patch b/contrib/depends/patches/android_ndk/api_definition.patch new file mode 100644 index 000000000..82ef9bad3 --- /dev/null +++ b/contrib/depends/patches/android_ndk/api_definition.patch @@ -0,0 +1,15 @@ +CMake 3.10.2 compatibility, see: +https://github.com/Kitware/CMake/blob/c1e087a9d3af74299d7681c9f9de59e5977a1539/Modules/Platform/Android-Determine.cmake#L105 + +diff --git a/build/tools/make_standalone_toolchain.py b/build/tools/make_standalone_toolchain.py +index b8172b2..1984595 100755 +--- a/build/tools/make_standalone_toolchain.py ++++ b/build/tools/make_standalone_toolchain.py +@@ -208,6 +208,7 @@ def make_clang_scripts(install_dir, triple, api, windows): + + target = '-'.join([arch, 'none', os_name, env]) + common_flags = '-target {}{}'.format(target, api) ++ common_flags += ' -D__ANDROID_API__={}'.format(api) + + # We only need mstackrealign to fix issues on 32-bit x86 pre-24. After 24, + # this consumes an extra register unnecessarily, which can cause issues for