2019-02-26 21:36:42 +01:00
|
|
|
termux_step_setup_variables() {
|
|
|
|
: "${TERMUX_MAKE_PROCESSES:="$(nproc)"}"
|
|
|
|
: "${TERMUX_TOPDIR:="$HOME/.termux-build"}"
|
|
|
|
: "${TERMUX_ARCH:="aarch64"}" # arm, aarch64, i686 or x86_64.
|
|
|
|
: "${TERMUX_PREFIX:="/data/data/com.termux/files/usr"}"
|
|
|
|
: "${TERMUX_ANDROID_HOME:="/data/data/com.termux/files/home"}"
|
|
|
|
: "${TERMUX_DEBUG:=""}"
|
2019-03-03 02:52:05 +01:00
|
|
|
: "${TERMUX_PKG_API_LEVEL:="24"}"
|
2019-02-26 21:36:42 +01:00
|
|
|
: "${TERMUX_NO_CLEAN:="false"}"
|
|
|
|
: "${TERMUX_QUIET_BUILD:="false"}"
|
|
|
|
: "${TERMUX_DEBDIR:="${TERMUX_SCRIPTDIR}/debs"}"
|
|
|
|
: "${TERMUX_SKIP_DEPCHECK:="false"}"
|
|
|
|
: "${TERMUX_INSTALL_DEPS:="false"}"
|
2019-03-02 23:47:13 +01:00
|
|
|
: "${TERMUX_PACKAGES_DIRECTORIES:="packages"}"
|
2019-02-26 21:36:42 +01:00
|
|
|
|
2019-08-06 14:39:42 +02:00
|
|
|
if [ -n "$TERMUX_ON_DEVICE_BUILD" ]; then
|
|
|
|
# For on-device builds cross-compiling is not supported so we can
|
|
|
|
# store information about built packages under $TERMUX_TOPDIR.
|
|
|
|
TERMUX_BUILT_PACKAGES_DIRECTORY="$TERMUX_TOPDIR/.built-packages"
|
2019-08-10 00:18:42 +02:00
|
|
|
|
|
|
|
# These variables should not be configurable for on-device builds.
|
|
|
|
# TERMUX_ARCH already set in build-package.sh
|
|
|
|
TERMUX_PREFIX="/data/data/com.termux/files/usr"
|
|
|
|
TERMUX_ANDROID_HOME="/data/data/com.termux/files/home"
|
|
|
|
TERMUX_NO_CLEAN="true"
|
2019-08-10 00:23:17 +02:00
|
|
|
|
|
|
|
# On device builds are considered as unofficial.
|
|
|
|
# Using device-specific value as default for maintainer field.
|
|
|
|
: "${TERMUX_PKG_MAINTAINER:="Termux ($(whoami))"}"
|
2019-08-10 01:01:22 +02:00
|
|
|
|
|
|
|
# On-device builds without termux-exec are unsupported.
|
|
|
|
if ! grep -q "${TERMUX_PREFIX}/lib/libtermux-exec.so" <<< "${LD_PRELOAD-x}"; then
|
|
|
|
termux_error_exit "On-device builds without termux-exec are not supported."
|
|
|
|
fi
|
2019-08-06 14:39:42 +02:00
|
|
|
else
|
|
|
|
TERMUX_BUILT_PACKAGES_DIRECTORY="/data/data/.built-packages"
|
2019-08-10 00:23:17 +02:00
|
|
|
: "${TERMUX_PKG_MAINTAINER:="Fredrik Fornwall @fornwall"}"
|
2019-08-06 14:39:42 +02:00
|
|
|
fi
|
|
|
|
|
2019-03-20 01:57:52 +01:00
|
|
|
TERMUX_REPO_URL=(
|
|
|
|
https://dl.bintray.com/termux/termux-packages-24
|
2019-03-20 16:27:33 +01:00
|
|
|
https://dl.bintray.com/grimler/game-packages-24
|
|
|
|
https://dl.bintray.com/grimler/science-packages-24
|
|
|
|
https://dl.bintray.com/grimler/termux-root-packages-24
|
2019-03-20 01:57:52 +01:00
|
|
|
https://dl.bintray.com/xeffyr/unstable-packages-24
|
|
|
|
https://dl.bintray.com/xeffyr/x11-packages-24
|
|
|
|
)
|
|
|
|
|
|
|
|
TERMUX_REPO_DISTRIBUTION=(
|
|
|
|
stable
|
2019-03-20 16:27:33 +01:00
|
|
|
games
|
|
|
|
science
|
|
|
|
root
|
2019-03-20 01:57:52 +01:00
|
|
|
unstable
|
|
|
|
x11
|
|
|
|
)
|
|
|
|
|
|
|
|
TERMUX_REPO_COMPONENT=(
|
|
|
|
main
|
2019-03-20 16:27:33 +01:00
|
|
|
stable
|
|
|
|
stable
|
|
|
|
stable
|
2019-03-20 01:57:52 +01:00
|
|
|
main
|
|
|
|
main
|
|
|
|
)
|
2019-02-26 21:36:42 +01:00
|
|
|
|
|
|
|
if [ "x86_64" = "$TERMUX_ARCH" ] || [ "aarch64" = "$TERMUX_ARCH" ]; then
|
|
|
|
TERMUX_ARCH_BITS=64
|
|
|
|
else
|
|
|
|
TERMUX_ARCH_BITS=32
|
|
|
|
fi
|
|
|
|
|
|
|
|
TERMUX_HOST_PLATFORM="${TERMUX_ARCH}-linux-android"
|
|
|
|
if [ "$TERMUX_ARCH" = "arm" ]; then TERMUX_HOST_PLATFORM="${TERMUX_HOST_PLATFORM}eabi"; fi
|
|
|
|
|
2019-08-06 14:39:42 +02:00
|
|
|
if [ -z "$TERMUX_ON_DEVICE_BUILD" ] && [ ! -d "$NDK" ]; then
|
2019-02-26 21:36:42 +01:00
|
|
|
termux_error_exit 'NDK not pointing at a directory!'
|
|
|
|
fi
|
2019-08-06 14:39:42 +02:00
|
|
|
|
|
|
|
if [ -z "$TERMUX_ON_DEVICE_BUILD" ] && ! grep -s -q "Pkg.Revision = $TERMUX_NDK_VERSION_NUM" "$NDK/source.properties"; then
|
2019-02-26 21:36:42 +01:00
|
|
|
termux_error_exit "Wrong NDK version - we need $TERMUX_NDK_VERSION"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The build tuple that may be given to --build configure flag:
|
|
|
|
TERMUX_BUILD_TUPLE=$(sh "$TERMUX_SCRIPTDIR/scripts/config.guess")
|
|
|
|
|
|
|
|
# We do not put all of build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/ into PATH
|
|
|
|
# to avoid stuff like arm-linux-androideabi-ld there to conflict with ones from
|
|
|
|
# the standalone toolchain.
|
|
|
|
TERMUX_D8=$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/d8
|
|
|
|
|
|
|
|
TERMUX_COMMON_CACHEDIR="$TERMUX_TOPDIR/_cache"
|
|
|
|
TERMUX_ELF_CLEANER=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner
|
|
|
|
|
|
|
|
export prefix=${TERMUX_PREFIX}
|
|
|
|
export PREFIX=${TERMUX_PREFIX}
|
|
|
|
|
|
|
|
TERMUX_PKG_BUILDDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/build
|
|
|
|
TERMUX_PKG_CACHEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/cache
|
|
|
|
TERMUX_PKG_MASSAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/massage
|
|
|
|
TERMUX_PKG_PACKAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/package
|
|
|
|
TERMUX_PKG_SRCDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/src
|
|
|
|
TERMUX_PKG_SHA256=""
|
|
|
|
TERMUX_PKG_TMPDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/tmp
|
|
|
|
TERMUX_PKG_HOSTBUILD_DIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/host-build
|
|
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=""
|
2019-07-20 10:42:33 +02:00
|
|
|
TERMUX_PKG_NO_STATICSPLIT=""
|
2019-02-26 21:36:42 +01:00
|
|
|
TERMUX_PKG_REVISION="0" # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
|
|
|
|
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=""
|
|
|
|
TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=""
|
|
|
|
TERMUX_PKG_EXTRA_MAKE_ARGS=""
|
|
|
|
TERMUX_PKG_BUILD_IN_SRC=""
|
|
|
|
TERMUX_PKG_RM_AFTER_INSTALL=""
|
|
|
|
TERMUX_PKG_BREAKS="" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
|
2019-05-06 19:38:12 +02:00
|
|
|
TERMUX_PKG_PRE_DEPENDS=""
|
2019-02-26 21:36:42 +01:00
|
|
|
TERMUX_PKG_DEPENDS=""
|
|
|
|
TERMUX_PKG_BUILD_DEPENDS=""
|
|
|
|
TERMUX_PKG_HOMEPAGE=""
|
|
|
|
TERMUX_PKG_DESCRIPTION="FIXME:Add description"
|
2019-08-06 14:39:42 +02:00
|
|
|
TERMUX_PKG_LICENSE_FILE="" # Relative path from $TERMUX_PKG_SRCDIR to LICENSE file. It is installed to $TERMUX_PREFIX/share/$TERMUX_PKG_NAME.
|
2019-02-26 21:36:42 +01:00
|
|
|
TERMUX_PKG_ESSENTIAL=""
|
|
|
|
TERMUX_PKG_CONFLICTS="" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
|
|
|
|
TERMUX_PKG_RECOMMENDS="" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
|
|
|
|
TERMUX_PKG_SUGGESTS=""
|
|
|
|
TERMUX_PKG_REPLACES=""
|
|
|
|
TERMUX_PKG_PROVIDES="" #https://www.debian.org/doc/debian-policy/#virtual-packages-provides
|
|
|
|
TERMUX_PKG_CONFFILES=""
|
|
|
|
# Set if a host build should be done in TERMUX_PKG_HOSTBUILD_DIR:
|
|
|
|
TERMUX_PKG_HOSTBUILD=""
|
|
|
|
TERMUX_PKG_FORCE_CMAKE=no # if the package has autotools as well as cmake, then set this to prefer cmake
|
|
|
|
TERMUX_CMAKE_BUILD=Ninja # Which cmake generator to use
|
|
|
|
TERMUX_PKG_HAS_DEBUG=yes # set to no if debug build doesn't exist or doesn't work, for example for python based packages
|
|
|
|
|
|
|
|
unset CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
|
|
|
|
}
|