2019-02-03 15:02:06 +01:00
|
|
|
termux_extract_dep_info() {
|
2019-03-02 23:34:54 +01:00
|
|
|
PKG=$1
|
|
|
|
PKG_DIR=$2
|
|
|
|
if [ "$PKG" != "$(basename ${PKG_DIR})" ]; then
|
2019-02-03 15:02:06 +01:00
|
|
|
# We are dealing with a subpackage
|
|
|
|
TERMUX_ARCH=$(
|
2021-05-05 21:20:39 +02:00
|
|
|
# set TERMUX_SUBPKG_PLATFORM_INDEPENDENT to
|
|
|
|
# parent package's value and override if
|
|
|
|
# needed
|
2019-08-12 17:28:41 +02:00
|
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=false
|
2019-03-02 23:34:54 +01:00
|
|
|
source ${PKG_DIR}/build.sh
|
2019-02-03 15:02:06 +01:00
|
|
|
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=$TERMUX_PKG_PLATFORM_INDEPENDENT
|
2021-05-05 21:20:39 +02:00
|
|
|
if [ "$TERMUX_INSTALL_DEPS" = "false" ] || \
|
|
|
|
[ "$TERMUX_PKG_NO_STATICSPLIT" = "true" ] || \
|
|
|
|
[ "${PKG/-static/}-static" != "${PKG}" ]; then
|
2019-03-20 19:46:03 +01:00
|
|
|
source ${PKG_DIR}/${PKG}.subpackage.sh
|
|
|
|
fi
|
2019-08-12 23:16:07 +02:00
|
|
|
if [ "$TERMUX_SUBPKG_PLATFORM_INDEPENDENT" = "true" ]; then
|
2019-02-03 15:02:06 +01:00
|
|
|
echo all
|
|
|
|
else
|
|
|
|
echo $TERMUX_ARCH
|
|
|
|
fi
|
|
|
|
)
|
2021-05-05 21:20:39 +02:00
|
|
|
else
|
|
|
|
TERMUX_ARCH=$(
|
|
|
|
source ${PKG_DIR}/build.sh
|
|
|
|
if [ "$TERMUX_PKG_PLATFORM_INDEPENDENT" = "true" ]; then
|
|
|
|
echo all
|
|
|
|
else
|
|
|
|
echo $TERMUX_ARCH
|
|
|
|
fi
|
|
|
|
)
|
2019-02-03 15:02:06 +01:00
|
|
|
fi
|
|
|
|
(
|
|
|
|
TERMUX_PKG_REVISION="0"
|
2019-03-02 23:34:54 +01:00
|
|
|
source ${PKG_DIR}/build.sh
|
2021-05-05 21:20:39 +02:00
|
|
|
if [ "$TERMUX_PKG_REVISION" != "0" ] || \
|
|
|
|
[ "$TERMUX_PKG_VERSION" != "${TERMUX_PKG_VERSION/-/}" ]; then
|
2019-02-03 15:02:06 +01:00
|
|
|
TERMUX_PKG_VERSION+="-$TERMUX_PKG_REVISION"
|
|
|
|
fi
|
|
|
|
echo ${TERMUX_ARCH} ${TERMUX_PKG_VERSION}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make script standalone executable as well as sourceable
|
|
|
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
|
|
termux_extract_dep_info "$@"
|
|
|
|
fi
|