2019-02-27 19:38:58 +01:00
|
|
|
termux_step_patch_package() {
|
2019-08-14 19:29:58 +02:00
|
|
|
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
|
|
|
|
|
2019-02-27 19:38:58 +01:00
|
|
|
cd "$TERMUX_PKG_SRCDIR"
|
|
|
|
local DEBUG_PATCHES=""
|
2019-08-13 00:39:35 +02:00
|
|
|
if [ "$TERMUX_DEBUG" = "true" ]; then
|
|
|
|
DEBUG_PATCHES=$(find $TERMUX_PKG_BUILDER_DIR -mindepth 1 -maxdepth 1 -name \*.patch.debug)
|
2019-02-27 19:38:58 +01:00
|
|
|
fi
|
2020-04-02 21:32:31 +02:00
|
|
|
if [ "$TERMUX_PKG_QUICK_REBUILD" = "false" ]; then
|
2020-02-15 08:19:37 +01:00
|
|
|
# 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
|
2020-05-21 17:50:14 +02:00
|
|
|
echo "Applying patch: $(basename $patch)"
|
2020-10-30 21:28:44 +01:00
|
|
|
test -f "$patch" && sed \
|
|
|
|
-e "s%\@TERMUX_APP_PACKAGE\@%${TERMUX_APP_PACKAGE}%g" \
|
|
|
|
-e "s%\@TERMUX_BASE_DIR\@%${TERMUX_BASE_DIR}%g" \
|
|
|
|
-e "s%\@TERMUX_CACHE_DIR\@%${TERMUX_CACHE_DIR}%g" \
|
|
|
|
-e "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" \
|
|
|
|
-e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" \
|
|
|
|
"$patch" | patch --silent -p1
|
2020-02-15 08:19:37 +01:00
|
|
|
done
|
|
|
|
shopt -u nullglob
|
|
|
|
fi
|
2019-02-27 19:38:58 +01:00
|
|
|
}
|