scripts/setup-termux.sh: adding the ability to install packages via pacman (#16368)
build-package.sh: improved work with pacman-conf
This commit is contained in:
parent
2534d50092
commit
cd151f2841
|
@ -350,7 +350,7 @@ if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
|
||||||
# Target architecture must be same as for environment used currently.
|
# Target architecture must be same as for environment used currently.
|
||||||
case "$TERMUX_APP_PACKAGE_MANAGER" in
|
case "$TERMUX_APP_PACKAGE_MANAGER" in
|
||||||
"apt") TERMUX_ARCH=$(dpkg --print-architecture);;
|
"apt") TERMUX_ARCH=$(dpkg --print-architecture);;
|
||||||
"pacman") TERMUX_ARCH=$(pacman-conf | grep Architecture | sed 's/Architecture = //g');;
|
"pacman") TERMUX_ARCH=$(pacman-conf Architecture);;
|
||||||
esac
|
esac
|
||||||
export TERMUX_ARCH
|
export TERMUX_ARCH
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -18,7 +18,7 @@ PACKAGES+=" asciidoctor"
|
||||||
PACKAGES+=" autoconf"
|
PACKAGES+=" autoconf"
|
||||||
PACKAGES+=" automake"
|
PACKAGES+=" automake"
|
||||||
PACKAGES+=" bc"
|
PACKAGES+=" bc"
|
||||||
PACKAGES+=" bison"
|
PACKAGES+=" byacc"
|
||||||
PACKAGES+=" bsdtar" # Needed to create pacman packages
|
PACKAGES+=" bsdtar" # Needed to create pacman packages
|
||||||
PACKAGES+=" cmake"
|
PACKAGES+=" cmake"
|
||||||
PACKAGES+=" ed"
|
PACKAGES+=" ed"
|
||||||
|
@ -45,6 +45,17 @@ PACKAGES+=" valac"
|
||||||
PACKAGES+=" xmlto" # Needed by git's manpage generation
|
PACKAGES+=" xmlto" # Needed by git's manpage generation
|
||||||
PACKAGES+=" zip"
|
PACKAGES+=" zip"
|
||||||
|
|
||||||
apt update
|
# Definition of a package manager
|
||||||
apt dist-upgrade -y
|
. $(dirname "$(realpath "$0")")/properties.sh
|
||||||
apt install -y $PACKAGES
|
source "$TERMUX_PREFIX/bin/termux-setup-package-manager" || true
|
||||||
|
|
||||||
|
if [ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" ]; then
|
||||||
|
apt update
|
||||||
|
apt dist-upgrade -y
|
||||||
|
apt install -y $PACKAGES
|
||||||
|
elif [ "$TERMUX_APP_PACKAGE_MANAGER" = "pacman" ]; then
|
||||||
|
pacman -Syu $PACKAGES --needed --noconfirm
|
||||||
|
else
|
||||||
|
echo "Error: no package manager defined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue