build-package: error if hostbuilt tools are missing

This commit is contained in:
Henrik Grimler 2021-08-21 19:18:37 +02:00
parent ecd214881a
commit 3407018962
2 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,6 @@ termux_step_handle_hostbuild() {
test -f "$patch" && sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" "$patch" | patch --silent -p1
done
local TERMUX_HOSTBUILD_MARKER="$TERMUX_PKG_HOSTBUILD_DIR/TERMUX_BUILT_FOR_$TERMUX_PKG_VERSION"
if [ ! -f "$TERMUX_HOSTBUILD_MARKER" ]; then
rm -Rf "$TERMUX_PKG_HOSTBUILD_DIR"
mkdir -p "$TERMUX_PKG_HOSTBUILD_DIR"

View File

@ -6,6 +6,8 @@ termux_step_start_build() {
# shellcheck source=/dev/null
source "$TERMUX_PKG_BUILDER_SCRIPT"
# Path to hostbuild marker, for use if package has hostbuild step
TERMUX_HOSTBUILD_MARKER="$TERMUX_PKG_HOSTBUILD_DIR/TERMUX_BUILT_FOR_$TERMUX_PKG_VERSION"
if [ "$TERMUX_PKG_METAPACKAGE" = "true" ]; then
# Metapackage has no sources and therefore platform-independent.
@ -59,6 +61,11 @@ termux_step_start_build() {
fi
if [ "$TERMUX_CONTINUE_BUILD" == "true" ]; then
# If the package has a hostbuild step, verify that it has been built
if [ "$TERMUX_PKG_HOSTBUILD" == "true" ] && [ ! -f "$TERMUX_HOSTBUILD_MARKER" ]; then
termux_error_exit "Cannot continue this build, hostbuilt tools are missing"
fi
# Do not remove source dir on continued builds, the
# rest in this function can be skipped in this case
return