2019-02-26 21:36:42 +01:00
termux_step_setup_variables( ) {
2022-02-19 10:00:53 +01:00
: " ${ TERMUX_PACKAGE_FORMAT : = " $( [ ! -z " ${ TERMUX_MAIN_PACKAGE_FORMAT +x } " ] && echo " $TERMUX_MAIN_PACKAGE_FORMAT " || echo "debian" ) " } " # debian, pacman
2019-02-26 21:36:42 +01:00
: " ${ TERMUX_ARCH : = "aarch64" } " # arm, aarch64, i686 or x86_64.
2021-09-10 18:10:02 +02:00
: " ${ TERMUX_OUTPUT_DIR : = " ${ TERMUX_SCRIPTDIR } /output " } "
2021-08-21 16:50:05 +02:00
: " ${ TERMUX_DEBUG_BUILD : = "false" } "
2021-08-21 16:46:47 +02:00
: " ${ TERMUX_FORCE_BUILD : = "false" } "
: " ${ TERMUX_INSTALL_DEPS : = "false" } "
: " ${ TERMUX_MAKE_PROCESSES : = " $( nproc) " } "
2019-02-26 21:36:42 +01:00
: " ${ TERMUX_NO_CLEAN : = "false" } "
2021-08-21 16:46:47 +02:00
: " ${ TERMUX_PKG_API_LEVEL : = "24" } "
2021-08-21 18:08:57 +02:00
: " ${ TERMUX_CONTINUE_BUILD : = "false" } "
2019-02-26 21:36:42 +01:00
: " ${ TERMUX_QUIET_BUILD : = "false" } "
: " ${ TERMUX_SKIP_DEPCHECK : = "false" } "
2021-08-21 16:46:47 +02:00
: " ${ TERMUX_TOPDIR : = " $HOME /.termux-build " } "
2021-09-10 18:10:02 +02:00
: " ${ TERMUX_PACMAN_PACKAGE_COMPRESSION : = "xz" } "
2019-02-26 21:36:42 +01:00
2019-08-12 23:16:07 +02:00
if [ " $TERMUX_ON_DEVICE_BUILD " = "true" ] ; then
2019-08-06 14:39:42 +02:00
# 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
TERMUX_NO_CLEAN = "true"
2019-08-10 00:23:17 +02:00
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"
fi
2020-12-20 14:16:34 +01:00
# TERMUX_PKG_MAINTAINER should be explicitly set in build.sh of the package.
: " ${ TERMUX_PKG_MAINTAINER : = "default" } "
2019-03-20 01:57:52 +01:00
TERMUX_REPO_URL = (
2022-04-04 08:07:23 +02:00
https://packages-cf.termux.org/apt/termux-main
https://packages-cf.termux.org/apt/termux-root
https://packages-cf.termux.org/apt/termux-x11
2019-03-20 01:57:52 +01:00
)
TERMUX_REPO_DISTRIBUTION = (
stable
2019-03-20 16:27:33 +01:00
root
2020-06-23 14:25:11 +02:00
x11
2019-03-20 01:57:52 +01:00
)
TERMUX_REPO_COMPONENT = (
main
2019-03-20 16:27:33 +01:00
stable
2019-03-20 01:57:52 +01:00
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-12 23:16:07 +02:00
if [ " $TERMUX_ON_DEVICE_BUILD " = "false" ] && [ ! -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
2019-08-12 23:16:07 +02:00
if [ " $TERMUX_ON_DEVICE_BUILD " = "false" ] && ! 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 }
2020-10-22 23:27:56 +02:00
if [ " ${ TERMUX_PACKAGES_OFFLINE -false } " = "true" ] ; then
# In "offline" mode store/pick cache from directory with
# build.sh script.
TERMUX_PKG_CACHEDIR = $TERMUX_PKG_BUILDER_DIR /cache
else
TERMUX_PKG_CACHEDIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /cache
fi
2021-08-21 16:46:47 +02:00
TERMUX_CMAKE_BUILD = Ninja # Which cmake generator to use
TERMUX_PKG_BREAKS = "" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
2019-02-26 21:36:42 +01:00
TERMUX_PKG_BUILDDIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /build
2021-08-21 16:46:47 +02:00
TERMUX_PKG_BUILD_DEPENDS = ""
2019-08-12 17:28:41 +02:00
TERMUX_PKG_BUILD_IN_SRC = false
2021-08-21 16:46:47 +02:00
TERMUX_PKG_CONFFILES = ""
TERMUX_PKG_CONFLICTS = "" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
2019-02-26 21:36:42 +01:00
TERMUX_PKG_DEPENDS = ""
TERMUX_PKG_DESCRIPTION = "FIXME:Add description"
2019-08-12 17:28:41 +02:00
TERMUX_PKG_ESSENTIAL = false
2021-08-21 16:46:47 +02:00
TERMUX_PKG_EXTRA_CONFIGURE_ARGS = ""
TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS = ""
TERMUX_PKG_EXTRA_MAKE_ARGS = ""
2019-08-12 17:28:41 +02:00
TERMUX_PKG_FORCE_CMAKE = false # if the package has autotools as well as cmake, then set this to prefer cmake
2021-08-21 16:46:47 +02:00
TERMUX_PKG_GIT_BRANCH = "" # branch defaults to 'v$TERMUX_PKG_VERSION' unless this variable is defined
2019-08-12 17:28:41 +02:00
TERMUX_PKG_HAS_DEBUG = true # set to false if debug build doesn't exist or doesn't work, for example for python based packages
2021-08-21 16:46:47 +02:00
TERMUX_PKG_HOMEPAGE = ""
TERMUX_PKG_HOSTBUILD = false # Set if a host build should be done in TERMUX_PKG_HOSTBUILD_DIR:
TERMUX_PKG_HOSTBUILD_DIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /host-build
TERMUX_PKG_LICENSE_FILE = "" # Relative path from $TERMUX_PKG_SRCDIR to LICENSE file. It is installed to $TERMUX_PREFIX/share/$TERMUX_PKG_NAME.
TERMUX_PKG_MASSAGEDIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /massage
2019-08-14 19:29:58 +02:00
TERMUX_PKG_METAPACKAGE = false
2020-10-01 18:33:58 +02:00
TERMUX_PKG_NO_ELF_CLEANER = false # set this to true to disable running of termux-elf-cleaner on built binaries
2021-08-21 16:46:47 +02:00
TERMUX_PKG_NO_STATICSPLIT = false
2022-03-07 11:33:00 +01:00
TERMUX_PKG_STATICSPLIT_EXTRA_PATTERNS = ""
2021-08-21 16:46:47 +02:00
TERMUX_PKG_PACKAGEDIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /package
TERMUX_PKG_PLATFORM_INDEPENDENT = false
TERMUX_PKG_PRE_DEPENDS = ""
TERMUX_PKG_PROVIDES = "" #https://www.debian.org/doc/debian-policy/#virtual-packages-provides
TERMUX_PKG_RECOMMENDS = "" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
TERMUX_PKG_REPLACES = ""
TERMUX_PKG_REVISION = "0" # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
TERMUX_PKG_RM_AFTER_INSTALL = ""
TERMUX_PKG_SHA256 = ""
TERMUX_PKG_SRCDIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /src
TERMUX_PKG_SUGGESTS = ""
TERMUX_PKG_TMPDIR = $TERMUX_TOPDIR /$TERMUX_PKG_NAME /tmp
TERMUX_PKG_SERVICE_SCRIPT = ( ) # Fill with entries like: ("daemon name" 'script to execute'). Script is echoed with -e so can contain \n for multiple lines
2021-09-28 11:48:55 +02:00
TERMUX_PKG_GROUPS = "" # https://wiki.archlinux.org/title/Pacman#Installing_package_groups
2021-10-25 11:47:13 +02:00
TERMUX_PKG_NO_SHEBANG_FIX = false # if true, skip fixing shebang accordingly to TERMUX_PREFIX
2022-03-07 11:33:00 +01:00
TERMUX_PKG_IS_HASKELL_LIB = true # by default assume haskell package is lib package as most of them will always be libs.
2019-02-26 21:36:42 +01:00
unset CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
}