feat(linux)!: Support streaming through XDG portals and Pipewire (#4417)

Co-authored-by: Carlos Garnacho <carlosg@gnome.org>
Co-authored-by: Carson Katri <Carson.katri@gmail.com>
Co-authored-by: Bond <bond-d@ukr.net>
Co-authored-by: d.bondarev <d.bondarev@crm-onebox.com>
Co-authored-by: Conn O'Griofa <connogriofa@gmail.com>
This commit is contained in:
David Lane 2026-02-03 08:19:02 -05:00 committed by GitHub
commit 874880e5ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1338 additions and 68 deletions

View file

@ -168,12 +168,29 @@ if(X11_FOUND)
"${CMAKE_SOURCE_DIR}/src/platform/linux/x11grab.cpp")
endif()
# XDG portal
if(${SUNSHINE_ENABLE_PORTAL})
pkg_check_modules(GIO gio-2.0 gio-unix-2.0 REQUIRED)
pkg_check_modules(PIPEWIRE libpipewire-0.3 REQUIRED)
else()
set(GIO_FOUND OFF)
set(PIPEWIRE_FOUND OFF)
endif()
if(PIPEWIRE_FOUND)
add_compile_definitions(SUNSHINE_BUILD_PORTAL)
include_directories(SYSTEM ${GIO_INCLUDE_DIRS} ${PIPEWIRE_INCLUDE_DIRS})
list(APPEND PLATFORM_LIBRARIES ${GIO_LIBRARIES} ${PIPEWIRE_LIBRARIES})
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/platform/linux/portalgrab.cpp")
endif()
if(NOT ${CUDA_FOUND}
AND NOT ${WAYLAND_FOUND}
AND NOT ${X11_FOUND}
AND NOT ${PIPEWIRE_FOUND}
AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND})
AND NOT ${LIBVA_FOUND})
message(FATAL_ERROR "Couldn't find either cuda, wayland, x11, (libdrm and libcap), or libva")
message(FATAL_ERROR "Couldn't find either cuda, libva, pipewire, wayland, x11, or (libdrm and libcap)")
endif()
# tray icon