Fix so that depdencies can be built correctly with -i option
This commit is contained in:
parent
d87672f1c1
commit
1f170db0ee
|
@ -255,12 +255,13 @@ termux_step_handle_arguments() {
|
||||||
echo " -D Build a disabled package in disabled-packages/."
|
echo " -D Build a disabled package in disabled-packages/."
|
||||||
echo " -f Force build even if package has already been built."
|
echo " -f Force build even if package has already been built."
|
||||||
echo " -i Download and extract dependencies instead of building them."
|
echo " -i Download and extract dependencies instead of building them."
|
||||||
|
echo " -I Download and extract dependencies instead of building them, keep existing files."
|
||||||
echo " -q Quiet build."
|
echo " -q Quiet build."
|
||||||
echo " -s Skip dependency check."
|
echo " -s Skip dependency check."
|
||||||
echo " -o Specify deb directory. Default: debs/."
|
echo " -o Specify deb directory. Default: debs/."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
while getopts :a:hdDfiqso: option; do
|
while getopts :a:hdDfiIqso: option; do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
a) TERMUX_ARCH="$OPTARG";;
|
a) TERMUX_ARCH="$OPTARG";;
|
||||||
h) _show_usage;;
|
h) _show_usage;;
|
||||||
|
@ -268,6 +269,7 @@ termux_step_handle_arguments() {
|
||||||
D) local TERMUX_IS_DISABLED=true;;
|
D) local TERMUX_IS_DISABLED=true;;
|
||||||
f) TERMUX_FORCE_BUILD=true;;
|
f) TERMUX_FORCE_BUILD=true;;
|
||||||
i) export TERMUX_INSTALL_DEPS=true;;
|
i) export TERMUX_INSTALL_DEPS=true;;
|
||||||
|
I) export TERMUX_INSTALL_DEPS=true && export TERMUX_NO_CLEAN=true;;
|
||||||
q) export TERMUX_QUIET_BUILD=true;;
|
q) export TERMUX_QUIET_BUILD=true;;
|
||||||
s) export TERMUX_SKIP_DEPCHECK=true;;
|
s) export TERMUX_SKIP_DEPCHECK=true;;
|
||||||
o) TERMUX_DEBDIR="$(realpath -m $OPTARG)";;
|
o) TERMUX_DEBDIR="$(realpath -m $OPTARG)";;
|
||||||
|
@ -322,6 +324,7 @@ termux_step_setup_variables() {
|
||||||
: "${TERMUX_ANDROID_HOME:="/data/data/com.termux/files/home"}"
|
: "${TERMUX_ANDROID_HOME:="/data/data/com.termux/files/home"}"
|
||||||
: "${TERMUX_DEBUG:=""}"
|
: "${TERMUX_DEBUG:=""}"
|
||||||
: "${TERMUX_PKG_API_LEVEL:="21"}"
|
: "${TERMUX_PKG_API_LEVEL:="21"}"
|
||||||
|
: "${TERMUX_NO_CLEAN:="true"}"
|
||||||
: "${TERMUX_QUIET_BUILD:="false"}"
|
: "${TERMUX_QUIET_BUILD:="false"}"
|
||||||
: "${TERMUX_DEBDIR:="${TERMUX_SCRIPTDIR}/debs"}"
|
: "${TERMUX_DEBDIR:="${TERMUX_SCRIPTDIR}/debs"}"
|
||||||
: "${TERMUX_SKIP_DEPCHECK:="false"}"
|
: "${TERMUX_SKIP_DEPCHECK:="false"}"
|
||||||
|
@ -459,42 +462,44 @@ termux_download_deb() {
|
||||||
|
|
||||||
# Script to download InRelease, verify it's signature and then download Packages.xz by hash
|
# Script to download InRelease, verify it's signature and then download Packages.xz by hash
|
||||||
termux_step_get_repo_files() {
|
termux_step_get_repo_files() {
|
||||||
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ]; then
|
if [ "$TERMUX_INSTALL_DEPS" = true ]; then
|
||||||
# Remove all previously extracted/built files from $TERMUX_PREFIX:
|
if [ "$TERMUX_NO_CLEAN" = false ]; then
|
||||||
rm -rf $TERMUX_PREFIX
|
# Remove all previously extracted/built files from $TERMUX_PREFIX:
|
||||||
rm -f /data/data/.built-packages/*
|
rm -rf $TERMUX_PREFIX
|
||||||
# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)
|
rm -f /data/data/.built-packages/*
|
||||||
mkdir -p "$TERMUX_COMMON_CACHEDIR" \
|
# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)
|
||||||
"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH" \
|
mkdir -p "$TERMUX_COMMON_CACHEDIR" \
|
||||||
"$TERMUX_COMMON_CACHEDIR-all" \
|
"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH" \
|
||||||
"$TERMUX_DEBDIR" \
|
"$TERMUX_COMMON_CACHEDIR-all" \
|
||||||
"$TERMUX_PKG_BUILDDIR" \
|
"$TERMUX_DEBDIR" \
|
||||||
"$TERMUX_PKG_PACKAGEDIR" \
|
"$TERMUX_PKG_BUILDDIR" \
|
||||||
"$TERMUX_PKG_TMPDIR" \
|
"$TERMUX_PKG_PACKAGEDIR" \
|
||||||
"$TERMUX_PKG_CACHEDIR" \
|
"$TERMUX_PKG_TMPDIR" \
|
||||||
"$TERMUX_PKG_MASSAGEDIR" \
|
"$TERMUX_PKG_CACHEDIR" \
|
||||||
$TERMUX_PREFIX/{bin,etc,lib,libexec,share,tmp,include}
|
"$TERMUX_PKG_MASSAGEDIR" \
|
||||||
# Setup bootstrap
|
$TERMUX_PREFIX/{bin,etc,lib,libexec,share,tmp,include}
|
||||||
if [ $TERMUX_ARCH == aarch64 ]; then
|
# Setup bootstrap
|
||||||
local bootstrap_sha256=2944ad699814329007d1f9c056e7c8323243c8b4a257cbd05904216f89fc3746
|
if [ $TERMUX_ARCH == aarch64 ]; then
|
||||||
elif [ $TERMUX_ARCH == i686 ]; then
|
local bootstrap_sha256=2944ad699814329007d1f9c056e7c8323243c8b4a257cbd05904216f89fc3746
|
||||||
local bootstrap_sha256=8f4dee0b1e161689b60f330ac0cc813b56ab479f2cd789eb8459165a3be13bdb
|
elif [ $TERMUX_ARCH == i686 ]; then
|
||||||
elif [ $TERMUX_ARCH == arm ]; then
|
local bootstrap_sha256=8f4dee0b1e161689b60f330ac0cc813b56ab479f2cd789eb8459165a3be13bdb
|
||||||
local bootstrap_sha256=f471c0af326677d87ca4926d54860d10d751dd4f8d615d5b1de902841601b41e
|
elif [ $TERMUX_ARCH == arm ]; then
|
||||||
elif [ $TERMUX_ARCH == x86_64 ]; then
|
local bootstrap_sha256=f471c0af326677d87ca4926d54860d10d751dd4f8d615d5b1de902841601b41e
|
||||||
local bootstrap_sha256=93384f0343c13f604dbacd069276291bd7042fc6d42c6d7514c7e573d968c614
|
elif [ $TERMUX_ARCH == x86_64 ]; then
|
||||||
|
local bootstrap_sha256=93384f0343c13f604dbacd069276291bd7042fc6d42c6d7514c7e573d968c614
|
||||||
|
fi
|
||||||
|
termux_download https://termux.net/bootstrap/bootstrap-${TERMUX_ARCH}.zip \
|
||||||
|
${TERMUX_COMMON_CACHEDIR}/bootstrap-${TERMUX_ARCH}.zip \
|
||||||
|
$bootstrap_sha256
|
||||||
|
unzip -qo ${TERMUX_COMMON_CACHEDIR}/bootstrap-${TERMUX_ARCH}.zip -d $TERMUX_PREFIX
|
||||||
|
(
|
||||||
|
cd $TERMUX_PREFIX
|
||||||
|
while read link; do
|
||||||
|
ln -sf ${link/←/ }
|
||||||
|
done<SYMLINKS.txt
|
||||||
|
rm SYMLINKS.txt
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
termux_download https://termux.net/bootstrap/bootstrap-${TERMUX_ARCH}.zip \
|
|
||||||
${TERMUX_COMMON_CACHEDIR}/bootstrap-${TERMUX_ARCH}.zip \
|
|
||||||
$bootstrap_sha256
|
|
||||||
unzip -qo ${TERMUX_COMMON_CACHEDIR}/bootstrap-${TERMUX_ARCH}.zip -d $TERMUX_PREFIX
|
|
||||||
(
|
|
||||||
cd $TERMUX_PREFIX
|
|
||||||
while read link; do
|
|
||||||
ln -sf ${link/←/ }
|
|
||||||
done<SYMLINKS.txt
|
|
||||||
rm SYMLINKS.txt
|
|
||||||
)
|
|
||||||
# Import Fornwalls key:
|
# Import Fornwalls key:
|
||||||
gpg --import packages/apt/trusted.gpg
|
gpg --import packages/apt/trusted.gpg
|
||||||
(
|
(
|
||||||
|
@ -545,7 +550,7 @@ termux_step_start_build() {
|
||||||
fi
|
fi
|
||||||
if ! termux_download_deb $pkg $dep_arch $dep_version; then
|
if ! termux_download_deb $pkg $dep_arch $dep_version; then
|
||||||
echo "Download of $pkg@$dep_version from $TERMUX_REPO_URL failed, building instead"
|
echo "Download of $pkg@$dep_version from $TERMUX_REPO_URL failed, building instead"
|
||||||
./build-package.sh -a $TERMUX_ARCH -i -s "$pkg"
|
./build-package.sh -a $TERMUX_ARCH -I "$pkg"
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
if [ ! "$TERMUX_QUIET_BUILD" = true ]; then echo "Extracting $pkg..."; fi
|
if [ ! "$TERMUX_QUIET_BUILD" = true ]; then echo "Extracting $pkg..."; fi
|
||||||
|
|
Loading…
Reference in New Issue