fix(main/termux-elf-cleaner): set default api-level to $TERMUX_PKG_API_LEVEL

So that users do not have to specify --api-level 24 or similar when
using the tool on-device.

Reported in termux/termux-packages#11612.
This commit is contained in:
Henrik Grimler 2022-08-29 11:22:37 +02:00
parent 971d64e01b
commit 803ae15df9
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- ./elf-cleaner.cpp~ 2022-07-30 16:02:31.000000000 +0200
+++ ./elf-cleaner.cpp 2022-08-29 11:14:38.502827607 +0200
@@ -50,7 +50,7 @@
/* Default to api level 21 unless arg --api-level given */
uint8_t supported_dt_flags_1 = (DF_1_NOW | DF_1_GLOBAL);
-int api_level = 21;
+int api_level = @TERMUX_PKG_API_LEVEL@;
bool dry_run = false;
bool quiet = false;

View File

@ -5,11 +5,14 @@ TERMUX_PKG_MAINTAINER="@termux"
# Please update checksum in termux_step_start_build.sh as well if
# updating the package.
TERMUX_PKG_VERSION=2.1.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/termux/termux-elf-cleaner/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=104231f91ef6662f80694fc4a59c6bfeae50da21c4fc22adac3c9a5aac00ba98
TERMUX_PKG_DEPENDS="libc++"
termux_step_pre_configure() {
autoreconf -vfi
sed "s%@TERMUX_PKG_API_LEVEL@%$TERMUX_PKG_API_LEVEL%g" \
"$TERMUX_PKG_BUILDER_DIR"/android-api-level.diff | patch --silent -p1
}