Browse Source

CI: Download Qt5 conditionally on Linux

Qt6 libraries are installed if the package is available on the system.
Uses the inverted condition to install Qt5 libraries to avoid
unnecessarily install both libraries.
Norihiro Kamae 2 years ago
parent
commit
43c7742f8b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      CI/linux/01_install_dependencies.sh

+ 4 - 1
CI/linux/01_install_dependencies.sh

@@ -37,7 +37,10 @@ install_qt5-deps() {
     status "Install Qt5 dependencies"
     trap "caught_error 'install_qt5-deps'" ERR
 
-    sudo apt-get install --no-install-recommends -y $@
+    _QT6_AVAILABLE="$(sudo apt-cache madison qt6-base-dev)"
+    if [ -z "${_QT6_AVAILABLE}" ]; then
+        sudo apt-get install --no-install-recommends -y $@
+    fi
 }
 
 install_qt6-deps() {