From 5389a1a4e2b75f79a3345b74cabc593296de5629 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Wed, 27 Feb 2019 19:38:58 +0100 Subject: [PATCH] build-package: mv termux_step_patch_package to scripts/build/ --- build-package.sh | 16 +--------------- scripts/build/termux_step_patch_package.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 scripts/build/termux_step_patch_package.sh diff --git a/build-package.sh b/build-package.sh index fbb935120..86b191bff 100755 --- a/build-package.sh +++ b/build-package.sh @@ -65,21 +65,7 @@ source scripts/build/termux_step_host_build.sh source scripts/build/termux_step_setup_toolchain.sh # Apply all *.patch files for the package. Not to be overridden by packages. -termux_step_patch_package() { - cd "$TERMUX_PKG_SRCDIR" - local DEBUG_PATCHES="" - if [ "$TERMUX_DEBUG" == "true" ] && [ -f $TERMUX_PKG_BUILDER_DIR/*.patch.debug ] ; then - DEBUG_PATCHES="$(ls $TERMUX_PKG_BUILDER_DIR/*.patch.debug)" - fi - # Suffix patch with ".patch32" or ".patch64" to only apply for these bitnesses: - shopt -s nullglob - for patch in $TERMUX_PKG_BUILDER_DIR/*.patch{$TERMUX_ARCH_BITS,} $DEBUG_PATCHES; do - test -f "$patch" && sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" "$patch" | \ - sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" | \ - patch --silent -p1 - done - shopt -u nullglob -} +source scripts/build/termux_step_patch_package.sh # Replace autotools build-aux/config.{sub,guess} with ours to add android targets. termux_step_replace_guess_scripts() { diff --git a/scripts/build/termux_step_patch_package.sh b/scripts/build/termux_step_patch_package.sh new file mode 100644 index 000000000..52da30242 --- /dev/null +++ b/scripts/build/termux_step_patch_package.sh @@ -0,0 +1,15 @@ +termux_step_patch_package() { + cd "$TERMUX_PKG_SRCDIR" + local DEBUG_PATCHES="" + if [ "$TERMUX_DEBUG" == "true" ] && [ -f $TERMUX_PKG_BUILDER_DIR/*.patch.debug ] ; then + DEBUG_PATCHES="$(ls $TERMUX_PKG_BUILDER_DIR/*.patch.debug)" + fi + # Suffix patch with ".patch32" or ".patch64" to only apply for these bitnesses: + shopt -s nullglob + for patch in $TERMUX_PKG_BUILDER_DIR/*.patch{$TERMUX_ARCH_BITS,} $DEBUG_PATCHES; do + test -f "$patch" && sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" "$patch" | \ + sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" | \ + patch --silent -p1 + done + shopt -u nullglob +}