Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/ci-flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -77,9 +78,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
Expand All @@ -96,7 +97,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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ 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/wayland \
lang/python314 \
multimedia/libva \
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
35 changes: 4 additions & 31 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -199,37 +203,6 @@ if(NOT ${CUDA_FOUND}
message(FATAL_ERROR "Couldn't find either cuda, libva, pipewire, wayland, x11, or (libdrm and libcap)")
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}")
Expand Down
7 changes: 0 additions & 7 deletions cmake/compile_definitions/macos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 0 additions & 5 deletions cmake/compile_definitions/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 4 additions & 0 deletions cmake/dependencies/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
59 changes: 38 additions & 21 deletions cmake/packaging/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,33 +138,50 @@ 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 "\
if(TRAY_QT_VERSION EQUAL 6)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
libayatana-appindicator3-1, \
libnotify4")
set(CPACK_RPM_PACKAGE_REQUIRES "\
libqt6widgets6, \
libqt6dbus6, \
libqt6svg6"
)
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PACKAGE_REQUIRES}, \
libappindicator-gtk3 >= 12.10.0")
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
devel/libayatana-appindicator
devel/libnotify
)
qt6-qtbase, \
qt6-qtsvg"
)
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
x11-toolkits/qt6-widgets
devel/qt6-dbus
graphics/qt6-svg
)
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
libqt5widgets5, \
libqt5dbus5, \
libqt5svg5"
)
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PACKAGE_REQUIRES}, \
qt5-qtbase, \
qt5-qtsvg"
)
list(APPEND CPACK_FREEBSD_PACKAGE_DEPS
x11-toolkits/qt5-widgets
devel/qt5-dbus
graphics/qt5-svg
)
endif()
endif()

# desktop file
Expand Down
12 changes: 7 additions & 5 deletions cmake/targets/linux.cmake
Original file line number Diff line number Diff line change
@@ -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
-static-libgcc
-static-libstdc++
)
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()
4 changes: 2 additions & 2 deletions docker/clion-toolchain.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ apt-get install -y --no-install-recommends \
gdb \
git \
graphviz \
libayatana-appindicator3-dev \
libcap-dev \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libgbm-dev \
libminiupnpc-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand All @@ -55,6 +53,8 @@ apt-get install -y --no-install-recommends \
libxrandr-dev \
libxtst-dev \
npm \
qt6-base-dev \
qt6-svg-dev \
udev \
wget \
x11-xserver-utils \
Expand Down
4 changes: 2 additions & 2 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ 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 \
Expand Down
4 changes: 2 additions & 2 deletions packaging/linux/Arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ fi
depends=(
'avahi'
'curl'
'libayatana-appindicator'
'libcap'
'libdrm'
'libevdev'
'libmfx'
'libnotify'
'libpipewire'
'libpulse'
'libva'
Expand All @@ -49,6 +47,8 @@ depends=(
'numactl'
'openssl'
'opus'
'qt6-base'
'qt6-svg'
'udev'
'which'
)
Expand Down
Loading
Loading