From c19fd73c97aec370708c3974a1fd781d5d3c85d3 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Tue, 26 Feb 2019 21:27:00 +0100 Subject: [PATCH] build-package: mv termux_step_handle_hostbuild to scripts/build/ --- build-package.sh | 18 +----------------- scripts/build/termux_step_handle_hostbuild.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 scripts/build/termux_step_handle_hostbuild.sh diff --git a/build-package.sh b/build-package.sh index dc422e1d4..5b28fdb06 100755 --- a/build-package.sh +++ b/build-package.sh @@ -746,23 +746,7 @@ termux_step_post_extract_package() { } # Optional host build. Not to be overridden by packages. -termux_step_handle_hostbuild() { - if [ "x$TERMUX_PKG_HOSTBUILD" = "x" ]; then return; fi - - cd "$TERMUX_PKG_SRCDIR" - for patch in $TERMUX_PKG_BUILDER_DIR/*.patch.beforehostbuild; do - 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" - cd "$TERMUX_PKG_HOSTBUILD_DIR" - termux_step_host_build - touch "$TERMUX_HOSTBUILD_MARKER" - fi -} +source scripts/build/termux_step_handle_hostbuild.sh # Perform a host build. Will be called in $TERMUX_PKG_HOSTBUILD_DIR. # After termux_step_post_extract_package() and before termux_step_patch_package() diff --git a/scripts/build/termux_step_handle_hostbuild.sh b/scripts/build/termux_step_handle_hostbuild.sh new file mode 100644 index 000000000..ea1563bcc --- /dev/null +++ b/scripts/build/termux_step_handle_hostbuild.sh @@ -0,0 +1,17 @@ +termux_step_handle_hostbuild() { + if [ "x$TERMUX_PKG_HOSTBUILD" = "x" ]; then return; fi + + cd "$TERMUX_PKG_SRCDIR" + for patch in $TERMUX_PKG_BUILDER_DIR/*.patch.beforehostbuild; do + 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" + cd "$TERMUX_PKG_HOSTBUILD_DIR" + termux_step_host_build + touch "$TERMUX_HOSTBUILD_MARKER" + fi +}