python: define __ANDROID_API__ when compiling on device

Needed for configure check. See also issue 2780.
This commit is contained in:
Henrik Grimler 2020-08-01 12:35:14 +02:00
parent 869edf8bf1
commit 835e7ad1b9
No known key found for this signature in database
GPG Key ID: B0076E490B71616B

View File

@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="PythonPL"
TERMUX_PKG_MAINTAINER="@termux"
_MAJOR_VERSION=3.10
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0
TERMUX_PKG_REVISION=3
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002
TERMUX_PKG_DEPENDS="gdbm, libandroid-support, libbz2, libcrypt, libexpat, libffi, liblzma, libsqlite, ncurses, ncurses-ui-libs, openssl, readline, zlib"
@ -56,6 +56,13 @@ termux_step_pre_configure() {
CPPFLAGS+=" -I$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include"
LDFLAGS+=" -L$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib"
if [ $TERMUX_ARCH = x86_64 ]; then LDFLAGS+=64; fi
if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
# Python's configure script fails with
# Fatal: you must define __ANDROID_API__
# if __ANDROID_API__ is not defined.
CPPFLAGS+=" -D__ANDROID_API__=$(getprop ro.build.version.sdk)"
fi
}
termux_step_post_make_install() {