update ./installdeps for Fedora rawhide

Try to install both pkgconfig.i686 and pkgconfig.x86_64 silently because
fc26+ does not have a separate 32 bit package.

If installing 32 bit packages fails on amd64, fall back to installing 64
bit packages only.
This commit is contained in:
Rafael Kitover 2017-02-16 03:39:51 -08:00
parent 99c6c4f938
commit 92e3a826a4
1 changed files with 25 additions and 5 deletions

View File

@ -111,7 +111,7 @@ check() {
"$@" "$@"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
error 'command failed' NOQUIT error 'command failed' NOQUIT
printf '%s:\n' 'The failing command was' echo 'The failing command was:'
echo "$@" echo "$@"
quit 1 quit 1
fi fi
@ -248,12 +248,19 @@ fedora_installdeps() {
check sudo su -c 'dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm' check sudo su -c 'dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'
# non-multiarch packages first # non-multiarch packages first
check sudo dnf -y install gcc gcc-c++ make cmake git nasm redhat-rpm-config check sudo dnf -y install gcc gcc-c++ make cmake git nasm redhat-rpm-config pkgconfig
# older fedora has separate 32 bit and 64 bit pkgconfig packages
# try to install both, ignoring errors
if [ -n "$amd64" ]; then
sudo dnf -y install pkgconfig.x86_64 >/dev/null 2>&1
sudo dnf -y install pkgconfig.i686 >/dev/null 2>&1
fi
set -- set --
if [ -z "$target" ]; then if [ -z "$target" ]; then
# install both 64bit and 32bit versions on 64 bit hosts # try to install both 64 bit and 32 bit versions on 64 bit hosts (see below)
for pkg in pkgconfig zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libjpeg-turbo-devel libpng-devel libtiff-devel SDL2-devel SFML-devel openal-soft-devel wxGTK3-devel; do for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libjpeg-turbo-devel libpng-devel libtiff-devel SDL2-devel SFML-devel openal-soft-devel wxGTK3-devel; do
if [ -n "$amd64" ]; then if [ -n "$amd64" ]; then
set -- "$@" "${pkg}.x86_64" "${pkg}.i686" set -- "$@" "${pkg}.x86_64" "${pkg}.i686"
else else
@ -287,7 +294,20 @@ fedora_installdeps() {
warning='SFML is required for LINK support, Fedora does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually' warning='SFML is required for LINK support, Fedora does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually'
fi fi
check sudo dnf -y install "$@" if ! sudo dnf -y install "$@"; then
if [ -n "$amd64" ]; then
# try without 32 bit packages, this is a problem on rawhide currently
warning 'installing 32 bit packages failed, trying to install 64 bit only packages...'
unset amd64
fedora_installdeps
return $?
else
error 'installing dependencies for Fedora failed' NOQUIT
echo 'The failing command was:'
echo sudo dnf -y install "$@"
quit 1
fi
fi
warning "$warning" warning "$warning"