chore: migrate to qt tray for all platforms (#5260)
This commit is contained in:
@@ -154,17 +154,6 @@ 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
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
|
||||
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
|
||||
libnotify4"
|
||||
)
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "\
|
||||
${CPACK_RPM_PACKAGE_REQUIRES}, \
|
||||
libnotify >= 0.8.0"
|
||||
)
|
||||
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
|
||||
devel/libnotify
|
||||
)
|
||||
if(TRAY_QT_VERSION EQUAL 6)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
|
||||
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
|
||||
|
||||
@@ -22,6 +22,26 @@ else()
|
||||
BUNDLE DESTINATION .
|
||||
COMPONENT Runtime)
|
||||
|
||||
if(SUNSHINE_ENABLE_TRAY)
|
||||
# Import Qt in this directory so its deployment commands and targets are visible here.
|
||||
set(_sunshine_module_path "${CMAKE_MODULE_PATH}")
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core)
|
||||
set(CMAKE_MODULE_PATH "${_sunshine_module_path}")
|
||||
unset(_sunshine_module_path)
|
||||
|
||||
qt6_generate_deploy_script(
|
||||
TARGET sunshine
|
||||
OUTPUT_SCRIPT SUNSHINE_QT_DEPLOY_SCRIPT
|
||||
CONTENT "
|
||||
qt6_deploy_runtime_dependencies(
|
||||
EXECUTABLE \"$<TARGET_FILE_NAME:sunshine>.app\"
|
||||
NO_APP_STORE_COMPLIANCE
|
||||
NO_TRANSLATIONS
|
||||
DEPLOY_TOOL_OPTIONS -no-codesign
|
||||
)")
|
||||
install(SCRIPT "${SUNSHINE_QT_DEPLOY_SCRIPT}" COMPONENT Runtime)
|
||||
endif()
|
||||
|
||||
install(FILES "${APPLE_PLIST_FILE}"
|
||||
DESTINATION "${MAC_BUNDLE_CONTENTS}"
|
||||
COMPONENT Runtime)
|
||||
@@ -44,6 +64,18 @@ else()
|
||||
message(STATUS \"Running fixup_bundle for: \${_app}\")
|
||||
include(BundleUtilities)
|
||||
set(BU_CHMOD_BUNDLE_ITEMS TRUE)
|
||||
|
||||
# Resolve @rpath items that Qt already deployed into the app bundle.
|
||||
function(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
|
||||
if(\"\${item}\" MATCHES \"^@rpath/(.+)$\")
|
||||
set(_embedded_item \"\${_app}/Contents/Frameworks/\${CMAKE_MATCH_1}\")
|
||||
if(EXISTS \"\${_embedded_item}\")
|
||||
set(\${resolved_item_var} \"\${_embedded_item}\" PARENT_SCOPE)
|
||||
set(\${resolved_var} TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
fixup_bundle(\"\${_app}\" \"\" \"\")
|
||||
|
||||
# Remove Finder/resource-fork metadata that breaks codesign.
|
||||
@@ -61,12 +93,13 @@ else()
|
||||
|
||||
# SHOULD_SIGN is set only when publish_release is true or when manually building
|
||||
if(\"\$ENV{SHOULD_SIGN}\" STREQUAL \"true\")
|
||||
# Sign anything inside Contents/Frameworks
|
||||
# Sign bundled frameworks and plugins before signing the app itself.
|
||||
set(_fw_dir \"\${_app}/Contents/Frameworks\")
|
||||
if(EXISTS \"\${_fw_dir}\")
|
||||
file(GLOB_RECURSE _sign_items
|
||||
\"\${_fw_dir}/*.framework\"
|
||||
\"\${_fw_dir}/*.dylib\"
|
||||
\"\${_app}/Contents/PlugIns/*.dylib\"
|
||||
)
|
||||
|
||||
foreach(item IN LISTS _sign_items)
|
||||
|
||||
Reference in New Issue
Block a user