build-package: Apply `$PREFIX/bin/sh` hack appropriately

This commit is contained in:
Tee KOBAYASHI 2022-04-13 15:52:34 +09:00 committed by Henrik Grimler
parent 61d08372ff
commit 07d9bba56a
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,13 @@
termux_step_override_config_scripts() {
if [ "$TERMUX_ON_DEVICE_BUILD" == true ] || [ "$TERMUX_INSTALL_DEPS" == false ]; then
if [ "$TERMUX_ON_DEVICE_BUILD" = true ]; then
return
fi
# Make $TERMUX_PREFIX/bin/sh executable on the builder, so that build
# scripts can assume that it works on both builder and host later on:
ln -sf /bin/sh "$TERMUX_PREFIX/bin/sh"
if [ "$TERMUX_INSTALL_DEPS" = false ]; then
return
fi
@ -33,8 +41,4 @@ termux_step_override_config_scripts() {
-e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" > $TERMUX_PREFIX/bin/pg_config
chmod 755 $TERMUX_PREFIX/bin/pg_config
fi
# Make $TERMUX_PREFIX/bin/sh executable on the builder, so that build
# scripts can assume that it works on both builder and host later on:
[ "$TERMUX_ON_DEVICE_BUILD" = "false" ] && ln -sf /bin/sh "$TERMUX_PREFIX/bin/sh"
}