installdeps: use correct package name for libsdl2

The actual package name for libsdl2 is libsdl2-2.0-0 not libsdl2-2.0 in
Debian/Ubuntu and probably others, and this only worked by accident
due to apt doing a regex search for packages.

Get the correct package for the latest version of libsdl2 from
apt-cache.

Also fix the other lib package searches via apt-cache to return the
latest version.

Resolve #882.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Deen O'Connor 2022-07-04 19:32:09 +00:00 committed by Rafael Kitover
parent f132e15511
commit 76bf554161
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 9 additions and 3 deletions

View File

@ -320,9 +320,15 @@ debian_installdeps() {
if [ -z "$target" ]; then if [ -z "$target" ]; then
sudo apt-get -qq -y update sudo apt-get -qq -y update
sfml_libs=$(apt-cache search libsfml | grep -E 'graphics|window|network' | sed 's/ - .*//') sfml_libs=
glew_lib=$(apt-cache search libglew | grep '^libglew[0-9]' | sed 's/ - .*//') for lib in graphics window network; do
sfml_libs="$sfml_libs $(apt-cache search "libsfml-$lib" | sed 's/ - .*//' | sort -r | head -1)"
done
glew_lib=$(apt-cache search libglew | grep '^libglew[0-9]' | sed 's/ - .*//' | sort -r | head -1)
sdl_lib=$(apt-cache search '^libsdl2-2.0' | sed 's/ - .*//' | sort -r | head -1)
# not present in trusty # not present in trusty
if [ -n "$ENABLE_FFMPEG" ]; then if [ -n "$ENABLE_FFMPEG" ]; then
@ -338,7 +344,7 @@ debian_installdeps() {
wx_lib_dev=libwxgtk3.0-dev wx_lib_dev=libwxgtk3.0-dev
fi fi
pkgs="build-essential g++ nasm cmake ccache gettext zlib1g-dev libgl1-mesa-dev libgettextpo-dev libsdl2-dev libsdl2-2.0 libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev libsfml-dev $sfml_libs $glew_lib $wx_lib $wx_lib_dev libgtk2.0-dev libgtk-3-dev ccache zip ninja-build" pkgs="build-essential g++ nasm cmake ccache gettext zlib1g-dev libgl1-mesa-dev libgettextpo-dev libsdl2-dev $sdl_lib libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev libsfml-dev $sfml_libs $glew_lib $wx_lib $wx_lib_dev libgtk2.0-dev libgtk-3-dev ccache zip ninja-build"
[ -n "$ENABLE_OPENAL" ] && pkgs="$pkgs libopenal-dev" [ -n "$ENABLE_OPENAL" ] && pkgs="$pkgs libopenal-dev"
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs libavcodec-dev libavformat-dev libswscale-dev libavutil-dev $libswresample_dev" [ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs libavcodec-dev libavformat-dev libswscale-dev libavutil-dev $libswresample_dev"