mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-11-28 16:24:51 +00:00
build(Linux): harden Qt6 dependency detection (#5679)
This commit is contained in:
1 parent
a903885281
commit
ec09aad6c6
4 files changed
+27
-3
No files matched your search
@@ -56,6 +56,17 @@ if(SUNSHINE_ENABLE_TRAY)
|
||||
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/tray")
|
||||
|
||||
# TRAY_QT_VERSION is scoped to the tray subdirectory, so inspect the target's actual dependencies.
|
||||
get_target_property(_sunshine_tray_link_libraries tray LINK_LIBRARIES)
|
||||
if("Qt6::Widgets" IN_LIST _sunshine_tray_link_libraries)
|
||||
set(SUNSHINE_TRAY_QT_VERSION 6)
|
||||
elseif("Qt5::Widgets" IN_LIST _sunshine_tray_link_libraries)
|
||||
set(SUNSHINE_TRAY_QT_VERSION 5)
|
||||
else()
|
||||
message(FATAL_ERROR "Could not determine the Qt version used by the tray target.")
|
||||
endif()
|
||||
unset(_sunshine_tray_link_libraries)
|
||||
|
||||
if(BUILD_TESTS)
|
||||
target_compile_definitions(tray PRIVATE TRAY_ENABLE_TEST_HOOKS)
|
||||
endif()
|
||||
|
||||
@@ -163,7 +163,7 @@ if(${SUNSHINE_TRAY} STREQUAL 1)
|
||||
# Icons used by the Qt tray backend are no longer installed to the hicolor icon theme,
|
||||
# because Qt6 will not allow icons not part of the theme... so we will use icons from our web directory instead
|
||||
|
||||
if(TRAY_QT_VERSION EQUAL 6)
|
||||
if(SUNSHINE_TRAY_QT_VERSION EQUAL 6)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
|
||||
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
|
||||
libqt6widgets6, \
|
||||
@@ -178,7 +178,7 @@ if(${SUNSHINE_TRAY} STREQUAL 1)
|
||||
devel/qt6-base
|
||||
graphics/qt6-svg
|
||||
)
|
||||
else()
|
||||
elseif(SUNSHINE_TRAY_QT_VERSION EQUAL 5)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
|
||||
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
|
||||
libqt5widgets5, \
|
||||
@@ -193,6 +193,8 @@ if(${SUNSHINE_TRAY} STREQUAL 1)
|
||||
x11-toolkits/qt5-widgets
|
||||
graphics/qt5-svg
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported tray Qt version: ${SUNSHINE_TRAY_QT_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -78,6 +78,17 @@ set -e
|
||||
./scripts/linux_build.sh \
|
||||
--step=package \
|
||||
--sudo-off
|
||||
|
||||
package_dependencies="$(dpkg-deb --field build/cpack_artifacts/*.deb Depends)"
|
||||
package_dependencies_valid=false
|
||||
case "${package_dependencies}" in
|
||||
*libqt5*) ;;
|
||||
*libqt6widgets6*libqt6svg6* | *libqt6svg6*libqt6widgets6*) package_dependencies_valid=true ;;
|
||||
esac
|
||||
if [ "${package_dependencies_valid}" = false ]; then
|
||||
echo "Unexpected Qt package dependencies: ${package_dependencies}"
|
||||
exit 1
|
||||
fi
|
||||
_BUILD
|
||||
|
||||
# run tests
|
||||
|
||||
@@ -202,7 +202,7 @@ sudo apt install sunshine
|
||||
|
||||
Download `sunshine_{version}-1+{distro}{distro-version}_{arch}.deb` and run the following command.
|
||||
```bash
|
||||
sudo dpkg -i ./sunshine_{version}-1+{distro}{distro-version}_{arch}.deb
|
||||
sudo apt install ./sunshine_{version}-1+{distro}{distro-version}_{arch}.deb
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
|
||||
Reference in new issue
Block a user