debian-setup.sh: Add support for Qt6

One or both Qt version deps can be selected with a command line option.

If no option is given the script will select Qt6 for Ubuntu 22.04 or
later, Qt5 otherwise.
This commit is contained in:
João Valverde 2022-08-23 21:16:04 +01:00 committed by A Wireshark GitLab Utility
parent ffde66ea7c
commit 573a9d0aa4
1 changed files with 60 additions and 8 deletions

View File

@ -20,12 +20,17 @@ function print_usage() {
printf "\\t--install-optional: install optional software as well\\n"
printf "\\t--install-deb-deps: install packages required to build the .deb file\\n"
printf "\\t--install-test-deps: install packages required to run all tests\\n"
printf "\\t--install-qt5-deps: force installation of packages required to use Qt5\\n"
printf "\\t--install-qt6-deps: force installation of packages required to use Qt6\\n"
printf "\\t[other]: other options are passed as-is to apt\\n"
}
ADDITIONAL=0
DEBDEPS=0
TESTDEPS=0
ADD_QT5=0
ADD_QT6=0
HAVE_ADD_QT=0
OPTIONS=
for arg; do
case $arg in
@ -42,6 +47,12 @@ for arg; do
--install-test-deps)
TESTDEPS=1
;;
--install-qt5-deps)
ADD_QT5=1
;;
--install-qt6-deps)
ADD_QT6=1
;;
*)
OPTIONS="$OPTIONS $arg"
;;
@ -58,14 +69,6 @@ fi
BASIC_LIST="gcc \
g++\
libglib2.0-dev \
qttools5-dev \
qttools5-dev-tools \
libqt5svg5-dev \
qtmultimedia5-dev \
qtbase5-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
libc-ares-dev \
libpcap-dev \
libpcre2-dev \
@ -74,6 +77,55 @@ BASIC_LIST="gcc \
python3 \
libgcrypt-dev"
QT5_LIST="qttools5-dev \
qttools5-dev-tools \
libqt5svg5-dev \
qtmultimedia5-dev \
qtbase5-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools"
QT6_LIST="qt6-base-dev \
qt6-multimedia-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
qt6-l10n-tools \
libqt6core5compat6-dev \
freeglut3-dev \
libvulkan-dev \
libxkbcommon-dev"
if [ $ADD_QT5 -ne 0 ]
then
BASIC_LIST="$BASIC_LIST $QT5_LIST"
HAVE_ADD_QT=1
fi
if [ $ADD_QT6 -ne 0 ]
then
BASIC_LIST="$BASIC_LIST $QT6_LIST"
HAVE_ADD_QT=1
fi
if [ $HAVE_ADD_QT -eq 0 ]
then
# Try to select Qt version from distro
test -e /etc/os-release && os_release='/etc/os-release' || os_release='/usr/lib/os-release'
# shellcheck disable=SC1090
. "${os_release}"
# Ubuntu 22.04 (jammy) or later
MAJOR=$(echo "$VERSION_ID" | cut -f1 -d.)
if [ "${ID:-linux}" = "ubuntu" ] && [ "${MAJOR:-0}" -ge "22" ]; then
echo "Installing Qt6."
BASIC_LIST="$BASIC_LIST $QT6_LIST"
else
echo "Installing Qt5."
BASIC_LIST="$BASIC_LIST $QT5_LIST"
fi
fi
ADDITIONAL_LIST="libnl-3-dev \
libkrb5-dev \
libsmi2-dev \