0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-07-01 20:27:36 +00:00
Files
termux-packages/scripts/build/termux_step_make_install.sh
Maxython 78f58da107 scripts: multilib-compilation implementation (compilation of 32-bit programs for 64-bit arch)
- New variables have been implemented:
 - TERMUX_PKG_BUILD_MULTILIB - Enables or disables multilib-compilation of the package.
 - TERMUX_PKG_BUILD_ONLY_MULTILIB - Specifies that the package is compiled only via multilib-compilation. Enabled automatically if multilib-compilation is enabled and the `TERMUX_PKG_EXCLUDED_ARCHES` variable contains `arm` and `i686` values.
 - TERMUX_PKG_MULTILIB_BUILDDIR - Path to compiled multilib-package components.
 - TERMUX__PREFIX__BASE_LIB_DIR - Path to the base libraries directory.
 - TERMUX__PREFIX__MULTI_LIB_DIR - Path to the multi-libraries directory.
 - TERMUX__PREFIX__LIB_DIR - Path to the libraries which changes depending on the compilation type (non-multilib - TERMUX__PREFIX__BASE_LIB_DIR, multilib - TERMUX__PREFIX__MULTI_LIB_DIR).
 - TERMUX__PREFIX__BASE_INCLUDE_DIR - Path to the base headers directory.
 - TERMUX__PREFIX__MULTI_INCLUDE_DIR - Path to the multi-headers directory.
 - TERMUX__PREFIX__INCLUDE_DIR - Path to the headers which changes depending on the compilation type (non-multilib - TERMUX__PREFIX__BASE_INCLUDE_DIR, multilib - TERMUX__PREFIX__MULTI_INCLUDE_DIR).
 - TERMUX__PREFIX_GLIBC - Path (prefix) for glibc-based packages.
- Implemented multilib-functions (termux_step_configure_multilib, termux_step_make_multilib and termux_step_make_install_multilib). By default (i.e. when not reconfigured in a package), each function runs a non-multilib function (termux_step_configure, termux_step_make and termux_step_make_install).
- The application environment setup scheme has been updated to ensure that cgct works properly. It now sets up temporary glibc, glibc32 packages, and libgcc symbolic links from cgct when needed. The updated scheme also allows forks to easily build glibc packages for their applications.
- The `properties.sh` has been standardized and a prefix transition method has been implemented (thanks agnostic-apollo for help).
- Added multi-include directory sorting scheme and pkgconfig files configuration for multilib-packages to `termux_step_massage.sh`.

Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2025-05-12 15:44:38 +03:00

41 lines
1.5 KiB
Bash

# shellcheck disable=SC2086
termux_step_make_install() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
if test -f build.ninja; then
ninja -j $TERMUX_PKG_MAKE_PROCESSES install
elif test -f setup.py || test -f pyproject.toml || test -f setup.cfg; then
pip install --no-deps . --prefix $TERMUX_PREFIX
elif ls ./*.cabal &>/dev/null; then
# Workaround until `cabal install` is fixed.
while read -r bin; do
[[ -f "$bin" ]] || termux_error_exit "'$bin', no such file. Has build completed?"
echo "INFO: Installing '$bin' component..."
cp "$bin" "$TERMUX_PREFIX/bin"
done< <(cat ./dist-newstyle/cache/plan.json | jq -r '."install-plan"[]|select(."component-name"? and (."component-name"|test("exe:.*")) and (.style == "local") )|."bin-file"')
elif ls ./*akefile &>/dev/null || [ -n "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
: "${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 \
--jobs $TERMUX_PKG_MAKE_PROCESSES \
--path . \
--force \
--locked \
--no-track \
--target $CARGO_TARGET_NAME \
--root $TERMUX_PREFIX \
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
fi
}
termux_step_make_install_multilib() {
termux_step_make_install
}