2019-02-27 19:50:20 +01:00
|
|
|
termux_step_make_install() {
|
2019-08-14 19:29:58 +02:00
|
|
|
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
|
|
|
|
|
2019-02-27 19:50:20 +01:00
|
|
|
if test -f build.ninja; then
|
|
|
|
ninja -w dupbuild=warn -j $TERMUX_MAKE_PROCESSES install
|
2022-03-12 05:55:41 +01:00
|
|
|
elif ls ./*.cabal &>/dev/null; then
|
2022-03-10 19:08:53 +01:00
|
|
|
termux-ghc-setup copy
|
2022-03-12 05:55:41 +01:00
|
|
|
if [ "${TERMUX_PKG_IS_HASKELL_LIB}" = true ]; then
|
2022-03-10 19:08:53 +01:00
|
|
|
termux-ghc-setup register --gen-script
|
|
|
|
termux-ghc-setup unregister --gen-script
|
2022-03-12 05:55:41 +01:00
|
|
|
|
|
|
|
install -Dm744 register.sh "${TERMUX_PREFIX}"/share/haskell/register/"${TERMUX_PKG_NAME}".sh
|
|
|
|
install -Dm744 unregister.sh "${TERMUX_PREFIX}"/share/haskell/unregister/"${TERMUX_PKG_NAME}".sh
|
|
|
|
|
|
|
|
sed -i -r -e "s|$(command -v termux-ghc-pkg)|${TERMUX_PREFIX}/bin/ghc-pkg|g" \
|
|
|
|
-e "s|ghc-pkg.*update[^ ]* |&'--force' |" \
|
|
|
|
-e "s|export PATH=.*||g" \
|
|
|
|
"${TERMUX_PREFIX}"/share/haskell/register/"${TERMUX_PKG_NAME}".sh
|
|
|
|
|
|
|
|
sed -i -r -e "s|$(command -v termux-ghc-pkg)|${TERMUX_PREFIX}/bin/ghc-pkg|g" \
|
|
|
|
-e "s|export PATH=.*||g" \
|
|
|
|
-e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" \
|
|
|
|
"${TERMUX_PREFIX}"/share/haskell/unregister/"${TERMUX_PKG_NAME}".sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif ls ./*akefile &>/dev/null || [ -n "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
|
2019-02-27 19:50:20 +01:00
|
|
|
: "${TERMUX_PKG_MAKE_INSTALL_TARGET:="install"}"
|
|
|
|
# Some packages have problem with parallell install, and it does not buy much, so use -j 1.
|
|
|
|
if [ -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
|
|
|
|
make -j 1 ${TERMUX_PKG_MAKE_INSTALL_TARGET}
|
|
|
|
else
|
|
|
|
make -j 1 ${TERMUX_PKG_EXTRA_MAKE_ARGS} ${TERMUX_PKG_MAKE_INSTALL_TARGET}
|
|
|
|
fi
|
|
|
|
elif test -f Cargo.toml; then
|
|
|
|
termux_setup_rust
|
|
|
|
cargo install \
|
2019-10-24 16:29:56 +02:00
|
|
|
--jobs $TERMUX_MAKE_PROCESSES \
|
2019-02-27 19:50:20 +01:00
|
|
|
--path . \
|
|
|
|
--force \
|
2021-03-10 14:09:26 +01:00
|
|
|
--locked \
|
2021-11-02 21:22:11 +01:00
|
|
|
--no-track \
|
2019-02-27 19:50:20 +01:00
|
|
|
--target $CARGO_TARGET_NAME \
|
|
|
|
--root $TERMUX_PREFIX \
|
|
|
|
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
|
|
|
|
fi
|
|
|
|
}
|