fix(linux): migrate to qt tray (#4907)

Co-authored-by: Kishi <41839133+Kishi85@users.noreply.github.com>
This commit is contained in:
David Lane
2026-05-24 22:21:24 -04:00
committed by GitHub
parent 0bc26a3f17
commit dbce229174
22 changed files with 206 additions and 119 deletions
+6 -5
View File
@@ -17,9 +17,10 @@ jobs:
name: ${{ matrix.arch }}
env:
APP_ID: dev.lizardbyte.app.Sunshine
FREEDESKTOP_SDK_VERSION: "25.08"
KDE_PLATFORM_VERSION: "6.10"
MATRIX_ARCH: ${{ matrix.arch }}
NODE_VERSION: "20"
PLATFORM_VERSION: "24.08"
permissions:
contents: read
runs-on: ${{ matrix.runner }}
@@ -65,9 +66,9 @@ jobs:
sudo su "$(whoami)" -c "flatpak --user install -y flathub \
org.flatpak.Builder \
org.freedesktop.Platform/${MATRIX_ARCH}/${PLATFORM_VERSION} \
org.freedesktop.Sdk/${MATRIX_ARCH}/${PLATFORM_VERSION} \
org.freedesktop.Sdk.Extension.node${NODE_VERSION}/${MATRIX_ARCH}/${PLATFORM_VERSION} \
org.kde.Platform/${MATRIX_ARCH}/${KDE_PLATFORM_VERSION} \
org.kde.Sdk/${MATRIX_ARCH}/${KDE_PLATFORM_VERSION} \
org.freedesktop.Sdk.Extension.node${NODE_VERSION}/${MATRIX_ARCH}/${FREEDESKTOP_SDK_VERSION} \
"
flatpak run org.flatpak.Builder --version
@@ -84,7 +85,7 @@ jobs:
run: |
python \
./packaging/linux/flatpak/deps/flatpak-builder-tools/pip/flatpak-pip-generator.py \
--runtime="org.freedesktop.Sdk//${PLATFORM_VERSION}" \
--runtime="org.kde.Sdk//${KDE_PLATFORM_VERSION}" \
--output glad-dependencies \
--build-only \
--requirements-file=./third-party/glad/requirements.txt
+2 -1
View File
@@ -105,14 +105,15 @@ jobs:
devel/cmake-core \
devel/evdev-proto \
devel/git \
devel/libayatana-appindicator \
devel/libevdev \
devel/libnotify \
devel/llvm${{ env.FREEBSD_CLANG_VERSION }} \
devel/ninja \
devel/pkgconf \
devel/qt6-base \
ftp/curl \
graphics/libdrm \
graphics/qt6-svg \
graphics/shaderc \
graphics/vulkan-headers \
graphics/vulkan-loader \
-4
View File
@@ -2,10 +2,6 @@
path = packaging/linux/flatpak/deps/flatpak-builder-tools
url = https://github.com/flatpak/flatpak-builder-tools.git
branch = master
[submodule "packaging/linux/flatpak/deps/shared-modules"]
path = packaging/linux/flatpak/deps/shared-modules
url = https://github.com/flathub/shared-modules.git
branch = master
[submodule "third-party/build-deps"]
path = third-party/build-deps
url = https://github.com/LizardByte/build-deps.git
+8 -1
View File
@@ -62,7 +62,6 @@ set(SUNSHINE_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Rtsp.h"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/RtspParser.c"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Video.h"
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray.h"
"${CMAKE_SOURCE_DIR}/src/upnp.cpp"
"${CMAKE_SOURCE_DIR}/src/upnp.h"
"${CMAKE_SOURCE_DIR}/src/cbs.cpp"
@@ -159,3 +158,11 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${PLATFORM_LIBRARIES})
# tray icon
if(SUNSHINE_ENABLE_TRAY)
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES tray::tray)
else()
set(SUNSHINE_TRAY 0)
message(STATUS "Tray icon disabled")
endif()
+4 -31
View File
@@ -2,6 +2,10 @@
if(FREEBSD)
add_compile_definitions(SUNSHINE_PLATFORM="freebsd")
# FreeBSD installs packages to /usr/local/lib, which is not in the default linker search path.
# link_directories() is directory-scoped and propagates to all subdirectories (including tests/),
# so all targets (sunshine, test_sunshine) can resolve libraries found via pkg_check_modules.
link_directories(/usr/local/lib)
else()
add_compile_definitions(SUNSHINE_PLATFORM="linux")
endif()
@@ -293,37 +297,6 @@ if(NOT ${CUDA_FOUND}
message(FATAL_ERROR "Couldn't find either cuda, (libdrm and libcap), libva, kwin, pipewire, portal, wayland or x11")
endif()
# tray icon
if(${SUNSHINE_ENABLE_TRAY})
pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1)
if(APPINDICATOR_FOUND)
list(APPEND SUNSHINE_DEFINITIONS TRAY_AYATANA_APPINDICATOR=1)
else()
pkg_check_modules(APPINDICATOR appindicator3-0.1)
if(APPINDICATOR_FOUND)
list(APPEND SUNSHINE_DEFINITIONS TRAY_LEGACY_APPINDICATOR=1)
endif ()
endif()
pkg_check_modules(LIBNOTIFY libnotify)
if(NOT APPINDICATOR_FOUND OR NOT LIBNOTIFY_FOUND)
message(STATUS "APPINDICATOR_FOUND: ${APPINDICATOR_FOUND}")
message(STATUS "LIBNOTIFY_FOUND: ${LIBNOTIFY_FOUND}")
message(FATAL_ERROR "Couldn't find either appindicator or libnotify")
else()
include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS})
link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS})
list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_linux.c")
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES ${APPINDICATOR_LIBRARIES} ${LIBNOTIFY_LIBRARIES})
endif()
set(SUNSHINE_TRAY_PREFIX "${PROJECT_FQDN}")
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_TRAY_PREFIX="${SUNSHINE_TRAY_PREFIX}")
else()
set(SUNSHINE_TRAY 0)
message(STATUS "Tray icon disabled")
endif()
# These need to be set before adding the inputtino subdirectory in order for them to be picked up
set(LIBEVDEV_CUSTOM_INCLUDE_DIR "${EVDEV_INCLUDE_DIR}")
set(LIBEVDEV_CUSTOM_LIBRARY "${EVDEV_LIBRARY}")
-7
View File
@@ -58,10 +58,3 @@ set(PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/TPCircularBuffer/TPCircularBuffer.c"
"${CMAKE_SOURCE_DIR}/third-party/TPCircularBuffer/TPCircularBuffer.h"
${APPLE_PLIST_FILE})
if(SUNSHINE_ENABLE_TRAY)
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${COCOA})
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_darwin.m")
endif()
-5
View File
@@ -105,8 +105,3 @@ list(PREPEND PLATFORM_LIBRARIES
ws2_32
wsock32
)
if(SUNSHINE_ENABLE_TRAY)
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_windows.c")
endif()
+4
View File
@@ -19,6 +19,10 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/Simple-Web-Server")
# libdisplaydevice
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/libdisplaydevice")
if(SUNSHINE_ENABLE_TRAY)
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/tray")
endif()
# common dependencies
include("${CMAKE_MODULE_PATH}/dependencies/nlohmann_json.cmake")
find_package(PkgConfig REQUIRED)
+40 -16
View File
@@ -138,33 +138,57 @@ set(CPACK_RPM_PACKAGE_AUTOREQ ON)
install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps"
RENAME "${PROJECT_FQDN}.svg")
install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg"
DESTINATION "${SUNSHINE_ASSETS_DIR}/web/images"
RENAME "logo-sunshine.svg")
# tray icon
if(${SUNSHINE_TRAY} STREQUAL 1)
install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status"
RENAME "${PROJECT_FQDN}-tray.svg")
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-playing.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status"
RENAME "${PROJECT_FQDN}-playing.svg")
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-pausing.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status"
RENAME "${PROJECT_FQDN}-pausing.svg")
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-locked.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status"
RENAME "${PROJECT_FQDN}-locked.svg")
# 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}, \
libayatana-appindicator3-1, \
libnotify4")
libnotify4"
)
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PACKAGE_REQUIRES}, \
libappindicator-gtk3 >= 12.10.0")
libnotify >= 0.8.0"
)
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
devel/libayatana-appindicator
devel/libnotify
)
if(TRAY_QT_VERSION EQUAL 6)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
libqt6widgets6, \
libqt6svg6"
)
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PACKAGE_REQUIRES}, \
qt6-qtbase, \
qt6-qtsvg"
)
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
x11-toolkits/qt6-widgets
graphics/qt6-svg
)
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
libqt5widgets5, \
libqt5svg5"
)
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PACKAGE_REQUIRES}, \
qt5-qtbase, \
qt5-qtsvg"
)
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
x11-toolkits/qt5-widgets
graphics/qt5-svg
)
endif()
endif()
# desktop file
+5 -3
View File
@@ -1,7 +1,9 @@
# linux specific target definitions
# Using newer c++ compilers / features on older distros causes runtime dyn link errors
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
if(NOT FREEBSD)
# Using newer c++ compilers / features on older distros causes runtime dyn link errors
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
-static-libgcc
-static-libstdc++
)
)
endif()
+2 -1
View File
@@ -33,7 +33,6 @@ apt-get install -y --no-install-recommends \
gdb \
git \
graphviz \
libayatana-appindicator3-dev \
libcap-dev \
libcurl4-openssl-dev \
libdrm-dev \
@@ -55,6 +54,8 @@ apt-get install -y --no-install-recommends \
libxrandr-dev \
libxtst-dev \
npm \
qt6-base-dev \
qt6-svg-dev \
udev \
wget \
x11-xserver-utils \
+2 -1
View File
@@ -26,13 +26,14 @@ pkg install -y \
devel/cmake \
devel/evdev-proto \
devel/git \
devel/libayatana-appindicator \
devel/libevdev \
devel/libnotify \
devel/ninja \
devel/pkgconf \
devel/qt6-base \
ftp/curl \
graphics/libdrm \
graphics/qt6-svg \
graphics/wayland \
multimedia/libva \
net/miniupnpc \
+2 -1
View File
@@ -31,7 +31,6 @@ fi
depends=(
'avahi'
'curl'
'libayatana-appindicator'
'libcap'
'libdrm'
'libevdev'
@@ -49,6 +48,8 @@ depends=(
'numactl'
'openssl'
'opus'
'qt6-base'
'qt6-svg'
'udev'
'vulkan-icd-loader'
'which'
+20 -6
View File
@@ -30,7 +30,7 @@ BuildRequires: libcap-devel
BuildRequires: libcurl-devel
BuildRequires: libdrm-devel
BuildRequires: libevdev-devel
BuildRequires: libnotify-devel
BuildRequires: libnotify-devel >= 0.8.0
BuildRequires: libva-devel
BuildRequires: libX11-devel
BuildRequires: libxcb-devel
@@ -58,7 +58,6 @@ BuildRequires: vulkan-loader-devel
# needed for npm from nvm
BuildRequires: libatomic
%endif
BuildRequires: libayatana-appindicator3-devel
BuildRequires: libgudev
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libgbm-devel
@@ -71,6 +70,8 @@ BuildRequires: opus-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: python3-jinja2
BuildRequires: python3-setuptools
BuildRequires: qt6-qtbase-devel
BuildRequires: qt6-qtsvg-devel
BuildRequires: systemd-udev
%{?sysusers_requires_compat}
# for unit tests
@@ -81,7 +82,6 @@ BuildRequires: xorg-x11-server-Xvfb
# OpenSUSE-specific BuildRequires
BuildRequires: AppStream
BuildRequires: appstream-glib
BuildRequires: libappindicator3-devel
BuildRequires: libgudev-1_0-devel
BuildRequires: Mesa-libGL-devel
BuildRequires: libgbm-devel
@@ -132,6 +132,9 @@ BuildRequires: gcc15-c++
# OpenSUSE Leap 15.x
BuildRequires: gcc14
BuildRequires: gcc14-c++
# OpenSUSE Leap: Qt6 not in standard repos, use Qt5
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qtsvg-devel
%global gcc_version 14
%global cuda_version 12.9.1
%global cuda_build 575.57.08
@@ -139,6 +142,8 @@ BuildRequires: gcc14-c++
# OpenSUSE Tumbleweed
BuildRequires: gcc14
BuildRequires: gcc14-c++
BuildRequires: libqt6-qtbase-devel
BuildRequires: libqt6-qtsvg-devel
%global gcc_version 14
%global cuda_version 12.9.1
%global cuda_build 575.57.08
@@ -148,12 +153,12 @@ BuildRequires: gcc14-c++
%global cuda_dir %{_builddir}/cuda
# Common runtime requirements
Requires: libnotify >= 0.8.0
Requires: miniupnpc >= 2.2.4
Requires: which >= 2.21
%if 0%{?fedora}
# Fedora runtime requirements
Requires: libayatana-appindicator3 >= 0.5.3
Requires: libcap >= 2.22
Requires: libcurl >= 7.0
Requires: libdrm > 2.4.97
@@ -165,12 +170,13 @@ Requires: libX11 >= 1.7.3.1
Requires: numactl-libs >= 2.0.14
Requires: openssl >= 3.0.2
Requires: pulseaudio-libs >= 10.0
Requires: qt6-qtbase
Requires: qt6-qtsvg
Requires: vulkan-loader
%endif
%if 0%{?suse_version}
# OpenSUSE runtime requirements
Requires: libappindicator3-1
Requires: libcap2
Requires: libcurl4
Requires: libdrm2
@@ -185,6 +191,15 @@ Requires: libpulse0
%if !0%{?sle_version}
Requires: libvulkan1
%endif
%if 0%{?suse_version} <= 1699
# OpenSUSE Leap: built with Qt5
Requires: libQt5Svg5
Requires: libQt5Widgets5
%else
# OpenSUSE Tumbleweed: built with Qt6
Requires: libQt6Svg6
Requires: libQt6Widgets6
%endif
%endif
%description
@@ -421,7 +436,6 @@ fi
# Icons
%{_datadir}/icons/hicolor/scalable/apps/*.Sunshine.svg
%{_datadir}/icons/hicolor/scalable/status/*.Sunshine-*.svg
# Metainfo
%{_datadir}/metainfo/*.metainfo.xml
@@ -1,10 +1,14 @@
---
app-id: "@PROJECT_FQDN@"
runtime: org.freedesktop.Platform
runtime-version: "24.08"
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.node20
runtime: org.kde.Platform
runtime-version: "6.10"
sdk: org.kde.Sdk
add-build-extensions:
org.freedesktop.Sdk.Extension.node20:
directory: lib/sdk/node20
version: "25.08"
no-autodownload: true
autodelete: false
command: sunshine
separate-locales: false
finish-args:
@@ -37,7 +41,6 @@ modules:
- "modules/nlohmann_json.json"
# Runtime dependencies
- shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json
- "modules/avahi.json"
- "modules/boost.json"
- "modules/libevdev.json"
@@ -79,13 +82,13 @@ modules:
- -DGLAD_SKIP_PIP_INSTALL=ON
- -DSUNSHINE_ASSETS_DIR=share/sunshine
- -DSUNSHINE_BUILD_FLATPAK=ON
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
- -DSUNSHINE_ENABLE_CUDA=ON
- -DSUNSHINE_ENABLE_DRM=ON
- -DSUNSHINE_ENABLE_KWIN=ON
- -DSUNSHINE_ENABLE_PORTAL=ON
- -DSUNSHINE_ENABLE_WAYLAND=ON
- -DSUNSHINE_ENABLE_X11=ON
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
- -DSUNSHINE_PUBLISHER_NAME='LizardByte'
- -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev'
- -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
+31 -7
View File
@@ -1,7 +1,8 @@
{
"name": "cuda",
"build-options": {
"no_debuginfo": true
"no_debuginfo": true,
"prepend-ld-library-path": "/app/lib:/app/lib64"
},
"buildsystem": "simple",
"cleanup": [
@@ -9,18 +10,41 @@
],
"build-commands": [
"chmod u+x ./cuda.run",
"./cuda.run --silent --toolkit --toolkitpath=$FLATPAK_DEST/cuda --no-opengl-libs --no-man-page --no-drm --tmpdir=$FLATPAK_BUILDER_BUILDDIR",
"rm -r $FLATPAK_DEST/cuda/nsight-systems-*",
"./cuda.run --silent --toolkit --toolkitpath=$FLATPAK_DEST/cuda --no-opengl-libs --no-man-page --no-drm --tmpdir=$FLATPAK_BUILDER_BUILDDIR || { echo '=== cuda-installer.log ==='; cat /tmp/cuda-installer.log 2>/dev/null; true; }",
"test -f $FLATPAK_DEST/cuda/bin/nvcc",
"rm -rf $FLATPAK_DEST/cuda/nsight-systems-*",
"rm ./cuda.run"
],
"modules": [
{
"name": "libxml2",
"config-opts": [
"--without-python",
"--without-debug",
"--without-history"
],
"cleanup": [
"/share",
"/include",
"/bin"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.9.tar.xz",
"sha256": "a2c9ae7b770da34860050c309f903221c67830c86e4a7e760692b803df95143a"
}
]
}
],
"sources": [
{
"type": "file",
"only-arches": [
"x86_64"
],
"url": "https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda_12.9.1_575.57.08_linux.run",
"sha256": "0f6d806ddd87230d2adbe8a6006a9d20144fdbda9de2d6acc677daa5d036417a",
"url": "https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run",
"sha256": "c599b651582c8f345ebde7bcf089b7dcfcd8afd7d3ea7f50525698c563a239d7",
"dest-filename": "cuda.run"
},
{
@@ -28,8 +52,8 @@
"only-arches": [
"aarch64"
],
"url": "https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda_12.9.1_575.57.08_linux_sbsa.run",
"sha256": "64f47ab791a76b6889702425e0755385f5fa216c5a9f061875c7deed5f08cdb6",
"url": "https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux_sbsa.run",
"sha256": "9684ebc64988f71ef1c70846cc9d158fb27950c1355bf37c8795c346346b6a72",
"dest-filename": "cuda.run"
}
]
@@ -99,6 +99,9 @@
},
{
"name": "libtirpc",
"build-options": {
"cflags": "-std=gnu17"
},
"config-opts": [
"--disable-gssapi"
],
+2 -5
View File
@@ -66,17 +66,12 @@ class Sunshine < Formula
depends_on "python3" => :build
depends_on "at-spi2-core"
depends_on "avahi"
depends_on "ayatana-ido"
depends_on "cairo"
depends_on "gdk-pixbuf"
depends_on "glib"
depends_on "gnu-which"
depends_on "gtk+3"
depends_on "harfbuzz"
depends_on "libayatana-appindicator"
depends_on "libayatana-indicator"
depends_on "libcap"
depends_on "libdbusmenu"
depends_on "libdrm"
depends_on "libice"
depends_on "libnotify"
@@ -96,6 +91,8 @@ 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"
+22 -7
View File
@@ -2,8 +2,8 @@
set -e
# Version requirements - centralized for easy maintenance
cmake_min="3.25.0"
target_cmake_version="3.30.1"
cmake_min="4.0.0"
target_cmake_version="4.3.0"
doxygen_min="1.10.0"
_doxygen_min="${doxygen_min//\./_}" # Convert dots to underscores for URL
doxygen_max="1.12.0"
@@ -279,7 +279,6 @@ function add_arch_deps() {
"gcc${gcc_version}-libs"
'git'
'graphviz'
'libayatana-appindicator'
'libcap'
'libdrm'
'libevdev'
@@ -301,6 +300,8 @@ function add_arch_deps() {
'opus'
'python-jinja' # glad OpenGL/EGL loader generator
'python-setuptools' # glad OpenGL/EGL loader generated, v2.0.0
'qt6-base'
'qt6-svg'
'shaderc'
'udev'
'vulkan-icd-loader'
@@ -335,8 +336,8 @@ function add_debian_based_deps() {
"gcc-${gcc_version}"
"g++-${gcc_version}"
"git"
"glslang-tools" # Vulkan shader compiler
"graphviz"
"libayatana-appindicator3-dev"
"libcap-dev" # KMS
"libcurl4-openssl-dev"
"libdrm-dev" # KMS
@@ -360,17 +361,27 @@ function add_debian_based_deps() {
"libxrandr-dev" # X11
"libxtst-dev" # X11
"libvulkan-dev" # Vulkan
"glslang-tools" # Vulkan shader compiler
"ninja-build"
"npm" # web-ui
"python3-jinja2" # glad OpenGL/EGL loader generator
"python3-setuptools" # glad OpenGL/EGL loader generated, v2.0.0
"qt6-base-dev"
"systemd"
"udev"
"wget" # necessary for cuda install with `run` file
"xvfb" # necessary for headless unit testing
)
# Ubuntu 22.04 uses a different package name for Qt6 SVG
if [[ "$distro" == "ubuntu" ]] && [[ "$version" == "22.04" ]]; then
dependencies+=(
"libgl-dev" # OpenGL development headers, needed for qt6-svg
"libqt6svg6-dev"
)
else
dependencies+=("qt6-svg-dev")
fi
if [[ "$skip_libva" == 0 ]]; then
dependencies+=(
"libva-dev" # VA-API
@@ -397,6 +408,9 @@ function add_debian_deps() {
}
function add_ubuntu_deps() {
# Enable universe; qt6-base-dev and several other required packages live there.
$package_install_command "software-properties-common"
${sudo_cmd} add-apt-repository universe -y
add_test_ppa
add_debian_based_deps
@@ -429,8 +443,8 @@ function add_fedora_deps() {
"gcc${gcc_version}"
"gcc${gcc_version}-c++"
"git"
"glslc"
"graphviz"
"libappindicator-gtk3-devel"
"libappstream-glib"
"libcap-devel"
"libcurl-devel"
@@ -457,9 +471,10 @@ function add_fedora_deps() {
"pulseaudio-libs-devel"
"python3-jinja2" # glad OpenGL/EGL loader generator
"python3-setuptools" # glad OpenGL/EGL loader generated, v2.0.0
"qt6-qtbase-devel"
"qt6-qtsvg-devel"
"rpm-build" # if you want to build an RPM binary package
"vulkan-loader-devel"
"glslc"
"wget" # necessary for cuda install with `run` file
"which" # necessary for cuda install with `run` file
"xorg-x11-server-Xvfb" # necessary for headless unit testing
+38 -5
View File
@@ -14,10 +14,10 @@
#define TRAY_ICON_PAUSING WEB_DIR "images/sunshine-pausing.ico"
#define TRAY_ICON_LOCKED WEB_DIR "images/sunshine-locked.ico"
#elif defined(__linux__) || defined(linux) || defined(__linux) || defined(__FreeBSD__)
#define TRAY_ICON SUNSHINE_TRAY_PREFIX "-tray"
#define TRAY_ICON_PLAYING SUNSHINE_TRAY_PREFIX "-playing"
#define TRAY_ICON_PAUSING SUNSHINE_TRAY_PREFIX "-pausing"
#define TRAY_ICON_LOCKED SUNSHINE_TRAY_PREFIX "-locked"
#define TRAY_ICON WEB_DIR "images/logo-sunshine.svg"
#define TRAY_ICON_PLAYING WEB_DIR "images/sunshine-playing.svg"
#define TRAY_ICON_PAUSING WEB_DIR "images/sunshine-pausing.svg"
#define TRAY_ICON_LOCKED WEB_DIR "images/sunshine-locked.svg"
#elif defined(__APPLE__) || defined(__MACH__)
#define TRAY_ICON WEB_DIR "images/logo-sunshine-16.png"
#define TRAY_ICON_PLAYING WEB_DIR "images/sunshine-playing-16.png"
@@ -39,7 +39,7 @@
// lib includes
#include <boost/filesystem.hpp>
#include <boost/process/v1/environment.hpp>
#include <tray/src/tray.h>
#include <tray.h>
// local includes
#include "confighttp.h"
@@ -72,6 +72,33 @@ namespace system_tray {
platf::open_url("https://www.paypal.com/paypalme/ReenigneArcher");
}
#if defined(__linux__) || defined(linux) || defined(__linux) || defined(__FreeBSD__)
/**
* @brief Forwards Qt log messages to Sunshine's BOOST_LOG logger.
* @param level Log level: 0=debug, 1=info, 2=warning, 3=error.
* @param msg The message string from Qt.
*/
static void qt_log_to_boost(int level, const char *msg) {
if (msg == nullptr) {
return;
}
switch (level) {
case 0:
BOOST_LOG(debug) << "Qt: " << msg;
break;
case 1:
BOOST_LOG(info) << "Qt: " << msg;
break;
case 2:
BOOST_LOG(warning) << "Qt: " << msg;
break;
default:
BOOST_LOG(error) << "Qt: " << msg;
break;
}
}
#endif
void tray_reset_display_device_config_cb([[maybe_unused]] struct tray_menu *item) {
BOOST_LOG(info) << "Resetting display device config from system tray"sv;
@@ -254,6 +281,12 @@ namespace system_tray {
tray.icon = tray.allIconPaths[0];
#endif
#if defined(__linux__) || defined(linux) || defined(__linux) || defined(__FreeBSD__)
tray_set_log_callback(qt_log_to_boost);
#endif
tray_set_app_info(PROJECT_NAME, PROJECT_NAME, PROJECT_FQDN);
if (tray_init(&tray) < 0) {
BOOST_LOG(warning) << "Failed to create system tray"sv;
return 1;