@ -6,12 +6,26 @@ set -e -o pipefail -u
: " ${ TMPDIR : =/tmp } "
: " ${ TMPDIR : =/tmp } "
export TMPDIR
export TMPDIR
cd " $( realpath " $( dirname " $0 " ) " ) "
TERMUX_SCRIPTDIR = $( pwd )
export TERMUX_SCRIPTDIR
# Lock file to prevent parallel running in the same environment.
TERMUX_BUILD_LOCK_FILE = " ${ TMPDIR } /.termux-build.lck "
if [ ! -e " $TERMUX_BUILD_LOCK_FILE " ] ; then
touch " $TERMUX_BUILD_LOCK_FILE "
fi
if [ " $( uname -o) " = "Android" ] || [ -e "/system/bin/app_process" ] ; then
if [ " $( uname -o) " = "Android" ] || [ -e "/system/bin/app_process" ] ; then
if [ " $( id -u) " = "0" ] ; then
if [ " $( id -u) " = "0" ] ; then
echo "On-device execution of this script as root is disabled."
echo "On-device execution of this script as root is disabled."
exit 1
exit 1
fi
fi
# termux-build-chroot sets up a new PREFIX with proot to which
# the built package can be installed without modifying $PREFIX
source " $TERMUX_SCRIPTDIR /scripts/termux-build-chroot.sh "
# This variable tells all parts of build system that build
# This variable tells all parts of build system that build
# is performed on device.
# is performed on device.
export TERMUX_ON_DEVICE_BUILD = true
export TERMUX_ON_DEVICE_BUILD = true
@ -19,16 +33,6 @@ else
export TERMUX_ON_DEVICE_BUILD = false
export TERMUX_ON_DEVICE_BUILD = false
fi
fi
cd " $( realpath " $( dirname " $0 " ) " ) "
TERMUX_SCRIPTDIR = $( pwd )
export TERMUX_SCRIPTDIR
# Lock file to prevent parallel running in the same environment.
TERMUX_BUILD_LOCK_FILE = " ${ TMPDIR } /.termux-build.lck "
if [ ! -e " $TERMUX_BUILD_LOCK_FILE " ] ; then
touch " $TERMUX_BUILD_LOCK_FILE "
fi
# Special variable for internal use. It forces script to ignore
# Special variable for internal use. It forces script to ignore
# lock file.
# lock file.
: " ${ TERMUX_BUILD_IGNORE_LOCK : =false } "
: " ${ TERMUX_BUILD_IGNORE_LOCK : =false } "
@ -328,13 +332,16 @@ while (($# > 0)); do
cd " $TERMUX_PKG_BUILDDIR "
cd " $TERMUX_PKG_BUILDDIR "
termux_step_make
termux_step_make
cd " $TERMUX_PKG_BUILDDIR "
cd " $TERMUX_PKG_BUILDDIR "
mkdir -p " $TERMUX_PKG_MASSAGEDIR /data "
termux_step_make_install
termux_step_make_install
cd " $TERMUX_PKG_BUILDDIR "
cd " $TERMUX_PKG_BUILDDIR "
termux_step_post_make_install
termux_step_post_make_install
termux_step_install_service_scripts
termux_step_install_service_scripts
termux_step_install_license
termux_step_install_license
cd " $TERMUX_PKG_MASSAGEDIR "
if [ " $TERMUX_ON_DEVICE_BUILD " = "false" ] ; then
termux_step_extract_into_massagedir
cd " $TERMUX_PKG_MASSAGEDIR "
termux_step_extract_into_massagedir
fi
cd " $TERMUX_PKG_MASSAGEDIR "
cd " $TERMUX_PKG_MASSAGEDIR "
termux_step_massage
termux_step_massage
cd " $TERMUX_PKG_MASSAGEDIR / $TERMUX_PREFIX "
cd " $TERMUX_PKG_MASSAGEDIR / $TERMUX_PREFIX "