From ad12c9eb63c1bee09d55824985622f2b717e02f5 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 6 Jun 2026 20:18:06 -0400 Subject: [PATCH 1/5] chore: migrate to qt tray for all platforms --- .github/workflows/ci-freebsd.yml | 1 - .github/workflows/ci-macos.yml | 4 +++- .github/workflows/ci-windows.yml | 2 ++ cmake/packaging/linux.cmake | 11 ----------- docker/clion-toolchain.dockerfile | 1 - docs/building.md | 7 ++++++- packaging/linux/Arch/PKGBUILD | 1 - packaging/linux/copr/Sunshine.spec | 2 -- packaging/sunshine.rb | 5 ++--- scripts/linux_build.sh | 3 --- scripts/macos_build.sh | 2 ++ third-party/tray | 2 +- 12 files changed, 16 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-freebsd.yml b/.github/workflows/ci-freebsd.yml index a8765773253..c390fd6ead5 100644 --- a/.github/workflows/ci-freebsd.yml +++ b/.github/workflows/ci-freebsd.yml @@ -107,7 +107,6 @@ jobs: devel/evdev-proto \ devel/git \ devel/libevdev \ - devel/libnotify \ devel/llvm${{ env.FREEBSD_CLANG_VERSION }} \ devel/ninja \ devel/pkgconf \ diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 3e320595d2b..e56d81d3220 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -90,7 +90,9 @@ jobs: icu4c@78 \ miniupnpc \ openssl@3 \ - opus + opus \ + qtbase \ + qtsvg - name: Setup Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index a2a6a0500b1..19256451ee9 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -108,6 +108,8 @@ jobs: "mingw-w64-${TOOLCHAIN}-openssl" "mingw-w64-${TOOLCHAIN}-opus" "mingw-w64-${TOOLCHAIN}-toolchain" + "mingw-w64-${TOOLCHAIN}-qt6-base" + "mingw-w64-${TOOLCHAIN}-qt6-svg" ) if [[ "${MATRIX_MSYSTEM}" == "ucrt64" ]]; then diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index 8f493b0757c..b3f675d295a 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -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}, \ diff --git a/docker/clion-toolchain.dockerfile b/docker/clion-toolchain.dockerfile index e08a2db5025..c2a468736a5 100644 --- a/docker/clion-toolchain.dockerfile +++ b/docker/clion-toolchain.dockerfile @@ -39,7 +39,6 @@ apt-get install -y --no-install-recommends \ libevdev-dev \ libgbm-dev \ libminiupnpc-dev \ - libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/docs/building.md b/docs/building.md index 2cb0b6d3d3b..5931ea48057 100644 --- a/docs/building.md +++ b/docs/building.md @@ -27,7 +27,6 @@ pkg install -y \ devel/evdev-proto \ devel/git \ devel/libevdev \ - devel/libnotify \ devel/llvm19 \ devel/ninja \ devel/pkgconf \ @@ -102,6 +101,8 @@ dependencies=( "openssl@3" "opus" "pkg-config" + "qtbase" + "qtsvg" ) brew install "${dependencies[@]}" ``` @@ -130,6 +131,8 @@ dependencies=( "ninja" "npm9" "pkgconfig" + "qt6-qtbase" + "qt6-qtsvg" ) sudo port install "${dependencies[@]}" ``` @@ -174,6 +177,8 @@ dependencies=( "mingw-w64-${TOOLCHAIN}-openssl" "mingw-w64-${TOOLCHAIN}-opus" "mingw-w64-${TOOLCHAIN}-toolchain" + "mingw-w64-${TOOLCHAIN}-qt6-base" + "mingw-w64-${TOOLCHAIN}-qt6-svg" ) if [[ "${MSYSTEM}" == "UCRT64" ]]; then dependencies+=( diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index 6cd89f9d3e9..11e45bfe257 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -39,7 +39,6 @@ depends=( 'libdrm' 'libevdev' 'libmfx' - 'libnotify' 'libpipewire' 'libpulse' 'libva' diff --git a/packaging/linux/copr/Sunshine.spec b/packaging/linux/copr/Sunshine.spec index ee48e8c4736..362ddf6c8af 100644 --- a/packaging/linux/copr/Sunshine.spec +++ b/packaging/linux/copr/Sunshine.spec @@ -31,7 +31,6 @@ BuildRequires: libcap-devel BuildRequires: libcurl-devel BuildRequires: libdrm-devel BuildRequires: libevdev-devel -BuildRequires: libnotify-devel >= 0.8.0 BuildRequires: libva-devel BuildRequires: libX11-devel BuildRequires: libxcb-devel @@ -152,7 +151,6 @@ BuildRequires: libqt6-qtsvg-devel %global cuda_dir %{_builddir}/cuda # Common runtime requirements -Requires: libnotify >= 0.8.0 Requires: miniupnpc >= 2.2.4 Requires: which >= 2.21 diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index 30d07095de5..1787e723e0e 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -58,6 +58,8 @@ class Sunshine < Formula depends_on "miniupnpc" depends_on "openssl@3" depends_on "opus" + depends_on "qtbase" + depends_on "qtsvg" on_sonoma do depends_on xcode: ["16.2", :build] # required for jthreads on macos-14 @@ -78,7 +80,6 @@ class Sunshine < Formula depends_on "libcap" depends_on "libdrm" depends_on "libice" - depends_on "libnotify" depends_on "libsm" depends_on "libva" depends_on "libx11" @@ -95,8 +96,6 @@ class Sunshine < Formula depends_on "pango" depends_on "pipewire" depends_on "pulseaudio" - depends_on "qtbase" - depends_on "qtsvg" depends_on "shaderc" depends_on "systemd" depends_on "vulkan-loader" diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index f987902d2b2..94737827973 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -283,7 +283,6 @@ function add_arch_deps() { 'libdrm' 'libevdev' 'libmfx' - 'libnotify' 'libpulse' 'libva' 'libx11' @@ -343,7 +342,6 @@ function add_debian_based_deps() { "libevdev-dev" "libgbm-dev" "libminiupnpc-dev" - "libnotify-dev" "libnuma-dev" "libopus-dev" "libpipewire-0.3-dev" @@ -448,7 +446,6 @@ function add_fedora_deps() { "libcurl-devel" "libdrm-devel" "libevdev-devel" - "libnotify-devel" "libX11-devel" # X11 "libxcb-devel" # X11 "libXcursor-devel" # X11 diff --git a/scripts/macos_build.sh b/scripts/macos_build.sh index 7c24209836d..5a27f2b78d6 100755 --- a/scripts/macos_build.sh +++ b/scripts/macos_build.sh @@ -37,6 +37,8 @@ required_formulas=( "openssl@3" "opus" "llvm" + "qtbase" + "qtsvg" ) function _usage() { diff --git a/third-party/tray b/third-party/tray index 8ea4c6835d6..f1ff1447b15 160000 --- a/third-party/tray +++ b/third-party/tray @@ -1 +1 @@ -Subproject commit 8ea4c6835d623b1095a6c8885d70e6c836ca2307 +Subproject commit f1ff1447b15ed6125a86f2434200f19e950ddba8 From 63615d24c9d922b37ed25b3050b771266065948d Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 27 Jul 2026 15:21:41 -0400 Subject: [PATCH 2/5] chore: fix qt link issues --- .github/workflows/ci-windows.yml | 7 +++--- cmake/dependencies/common.cmake | 42 ++++++++++++++++++++++++++++++++ cmake/packaging/macos.cmake | 18 +++++++++++++- cmake/prep/options.cmake | 5 ++++ docs/building.md | 11 +++++++-- 5 files changed, 77 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 19256451ee9..36346607ac3 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -108,8 +108,7 @@ jobs: "mingw-w64-${TOOLCHAIN}-openssl" "mingw-w64-${TOOLCHAIN}-opus" "mingw-w64-${TOOLCHAIN}-toolchain" - "mingw-w64-${TOOLCHAIN}-qt6-base" - "mingw-w64-${TOOLCHAIN}-qt6-svg" + "mingw-w64-${TOOLCHAIN}-qt6-static" ) if [[ "${MATRIX_MSYSTEM}" == "ucrt64" ]]; then @@ -241,10 +240,12 @@ jobs: -S . \ -DBUILD_WERROR=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_PREFIX_PATH="${MINGW_PREFIX}/qt6-static" \ -DSUNSHINE_ASSETS_DIR=assets \ -DSUNSHINE_PUBLISHER_NAME="${GITHUB_REPOSITORY_OWNER}" \ -DSUNSHINE_PUBLISHER_WEBSITE="https://app.lizardbyte.dev" \ - -DSUNSHINE_PUBLISHER_ISSUE_URL="https://app.lizardbyte.dev/support" + -DSUNSHINE_PUBLISHER_ISSUE_URL="https://app.lizardbyte.dev/support" \ + -DSUNSHINE_USE_STATIC_QT=ON echo "::add-matcher::.github/matchers/gcc.json" ninja -C build echo "::remove-matcher owner=gcc::" diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index 34c182cff6f..ba13f5cb365 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -25,7 +25,49 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/lizardbyte-common") add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/libdisplaydevice") if(SUNSHINE_ENABLE_TRAY) + if(SUNSHINE_USE_STATIC_QT) + set(_sunshine_find_library_suffixes "${CMAKE_FIND_LIBRARY_SUFFIXES}") + set(_sunshine_import_library_suffix "${CMAKE_IMPORT_LIBRARY_SUFFIX}") + set(_sunshine_pkg_config_argn "${PKG_CONFIG_ARGN}") + set(_sunshine_disable_find_package_harfbuzz "${CMAKE_DISABLE_FIND_PACKAGE_harfbuzz}") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(CMAKE_IMPORT_LIBRARY_SUFFIX ".a") + set(PKG_CONFIG_ARGN --static) + + # HarfBuzz's config-file target omits dependencies needed by its static archive. + # Use Qt's pkg-config fallback so --static supplies the complete link interface. + set(CMAKE_DISABLE_FIND_PACKAGE_harfbuzz TRUE) + + # CMake's FindTIFF module does not propagate dependencies of the static archive. + # Provide its standard target from pkg-config before Qt imports the TIFF plugin. + find_package(PkgConfig REQUIRED) + pkg_check_modules(SUNSHINE_STATIC_TIFF REQUIRED IMPORTED_TARGET libtiff-4) + add_library(TIFF::TIFF INTERFACE IMPORTED) + target_link_libraries(TIFF::TIFF INTERFACE PkgConfig::SUNSHINE_STATIC_TIFF) + + set(_sunshine_module_path "${CMAKE_MODULE_PATH}") + find_package(Qt6 REQUIRED COMPONENTS Widgets Svg) + get_target_property(_sunshine_qt_core_type Qt6::Core TYPE) + if(NOT _sunshine_qt_core_type STREQUAL "STATIC_LIBRARY") + message(FATAL_ERROR "SUNSHINE_USE_STATIC_QT requires a static Qt 6 installation.") + endif() + set(CMAKE_MODULE_PATH "${_sunshine_module_path}") + endif() + add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/tray") + + if(SUNSHINE_USE_STATIC_QT) + set(CMAKE_FIND_LIBRARY_SUFFIXES "${_sunshine_find_library_suffixes}") + set(CMAKE_IMPORT_LIBRARY_SUFFIX "${_sunshine_import_library_suffix}") + set(PKG_CONFIG_ARGN "${_sunshine_pkg_config_argn}") + set(CMAKE_DISABLE_FIND_PACKAGE_harfbuzz "${_sunshine_disable_find_package_harfbuzz}") + unset(_sunshine_disable_find_package_harfbuzz) + unset(_sunshine_find_library_suffixes) + unset(_sunshine_import_library_suffix) + unset(_sunshine_module_path) + unset(_sunshine_pkg_config_argn) + unset(_sunshine_qt_core_type) + endif() endif() # common dependencies diff --git a/cmake/packaging/macos.cmake b/cmake/packaging/macos.cmake index 623541043d1..dec0cdf972c 100644 --- a/cmake/packaging/macos.cmake +++ b/cmake/packaging/macos.cmake @@ -22,6 +22,21 @@ 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_app_script( + TARGET sunshine + OUTPUT_SCRIPT SUNSHINE_QT_DEPLOY_SCRIPT + 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) @@ -61,12 +76,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) diff --git a/cmake/prep/options.cmake b/cmake/prep/options.cmake index 50bca32b115..ac20de4a644 100644 --- a/cmake/prep/options.cmake +++ b/cmake/prep/options.cmake @@ -18,6 +18,11 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF) option(SUNSHINE_ENABLE_TRAY "Enable system tray icon." ON) +if(WIN32) + option(SUNSHINE_USE_STATIC_QT + "Require static Qt libraries and their static third-party dependencies." OFF) +endif() + option(SUNSHINE_SYSTEM_VULKAN_HEADERS "Use system installation of vulkan-headers rather than the submodule." OFF) option(SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS "Use system installation of wayland-protocols rather than the submodule." OFF) diff --git a/docs/building.md b/docs/building.md index 5931ea48057..b9b551d2a52 100644 --- a/docs/building.md +++ b/docs/building.md @@ -177,8 +177,7 @@ dependencies=( "mingw-w64-${TOOLCHAIN}-openssl" "mingw-w64-${TOOLCHAIN}-opus" "mingw-w64-${TOOLCHAIN}-toolchain" - "mingw-w64-${TOOLCHAIN}-qt6-base" - "mingw-w64-${TOOLCHAIN}-qt6-svg" + "mingw-w64-${TOOLCHAIN}-qt6-static" ) if [[ "${MSYSTEM}" == "UCRT64" ]]; then dependencies+=( @@ -190,6 +189,14 @@ fi pacman -S "${dependencies[@]}" ``` +The static Qt package is installed under a separate prefix. Add the following options when configuring a Windows +build so Sunshine and Qt's third-party dependencies are linked statically: + +```bash +-DCMAKE_PREFIX_PATH="${MINGW_PREFIX}/qt6-static" \ +-DSUNSHINE_USE_STATIC_QT=ON +``` + To create a WiX installer, you also need to install [.NET](https://dotnet.microsoft.com/download). For ARM64: To build frontend, you also need to install [Node.JS](https://nodejs.org/en/download) From ee460d91c9b689e010b0f96fa55aec9cb32ff211 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 27 Jul 2026 15:40:02 -0400 Subject: [PATCH 3/5] fix: resolve deployed macOS Qt frameworks --- cmake/packaging/macos.cmake | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/cmake/packaging/macos.cmake b/cmake/packaging/macos.cmake index dec0cdf972c..21ba7d0637d 100644 --- a/cmake/packaging/macos.cmake +++ b/cmake/packaging/macos.cmake @@ -29,11 +29,16 @@ else() set(CMAKE_MODULE_PATH "${_sunshine_module_path}") unset(_sunshine_module_path) - qt6_generate_deploy_app_script( + qt6_generate_deploy_script( TARGET sunshine OUTPUT_SCRIPT SUNSHINE_QT_DEPLOY_SCRIPT - NO_TRANSLATIONS - DEPLOY_TOOL_OPTIONS -no-codesign) + CONTENT " +qt6_deploy_runtime_dependencies( + EXECUTABLE \"$.app\" + NO_APP_STORE_COMPLIANCE + NO_TRANSLATIONS + DEPLOY_TOOL_OPTIONS -no-codesign +)") install(SCRIPT "${SUNSHINE_QT_DEPLOY_SCRIPT}" COMPONENT Runtime) endif() @@ -59,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. From 921e481f5f261624cd106b7acac4cfc70849f691 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:14:53 -0400 Subject: [PATCH 4/5] fix: allow static Qt ARM64 import thunk --- cmake/compile_definitions/windows.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/compile_definitions/windows.cmake b/cmake/compile_definitions/windows.cmake index e3e57339f18..f255d38ab67 100644 --- a/cmake/compile_definitions/windows.cmake +++ b/cmake/compile_definitions/windows.cmake @@ -14,6 +14,13 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64") list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-dll-attribute-on-redeclaration) # Boost list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-unknown-warning-option) # ViGEmClient list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-unused-variable) # Boost + + # Qt's static qwindows plugin and MinGW's Windowsapp import library both provide the + # UiaRaiseNotificationEvent import thunk on ARM64. Keep both required libraries while + # permitting lld to coalesce their identical definitions. + if(SUNSHINE_USE_STATIC_QT AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") + list(APPEND SUNSHINE_LINK_OPTIONS -Wl,--allow-multiple-definition) + endif() endif() # see gcc bug 98723 From 1055f15a4bddc80db670eb81ad46d90986f2a5eb Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 27 Jul 2026 18:35:44 -0400 Subject: [PATCH 5/5] Update tray --- third-party/tray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/tray b/third-party/tray index f1ff1447b15..1d0d69623fe 160000 --- a/third-party/tray +++ b/third-party/tray @@ -1 +1 @@ -Subproject commit f1ff1447b15ed6125a86f2434200f19e950ddba8 +Subproject commit 1d0d69623fe7ddb3da180db4b99417f9497d4f79