From 3f1b2964993d9c4045ebd37bd60cf0d2fdc02e0e Mon Sep 17 00:00:00 2001 From: juliosanz Date: Sat, 17 Jan 2026 17:29:06 +0100 Subject: [PATCH 1/2] enhanced arch support for linux build script --- docs/building.md | 2 +- scripts/linux_build.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 56febbce8ed..494122cd1a7 100644 --- a/docs/building.md +++ b/docs/building.md @@ -50,7 +50,7 @@ pkg install -y \ #### Linux Dependencies vary depending on the distribution. You can reference our [linux_build.sh](https://github.com/LizardByte/Sunshine/blob/master/scripts/linux_build.sh) script for a list of -dependencies we use in Debian-based and Fedora-based distributions. Please submit a PR if you would like to extend the +dependencies we use in Debian-based, Fedora-based and Arch-based distributions. Please submit a PR if you would like to extend the script to support other distributions. ##### CUDA Toolkit diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 520b616402d..146001e0d2c 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -157,6 +157,7 @@ dependencies=() function add_arch_deps() { dependencies+=( + 'appstream-glib' 'avahi' 'base-devel' 'cmake' @@ -596,6 +597,12 @@ function run_step_build() { # Build the project ninja -C "build" + + # Prepare binary with setcap for execution + sudo cp build/sunshine /tmp + sudo setcap cap_sys_admin+p /tmp/sunshine + sudo getcap /tmp/sunshine + sudo mv /tmp/sunshine build/sunshine } function run_step_package() { From 75379bfac53753970f07e4b7e057112ff5c701fd Mon Sep 17 00:00:00 2001 From: juliosanz Date: Sun, 18 Jan 2026 10:50:00 +0100 Subject: [PATCH 2/2] add setcap section to build instructions --- docs/building.md | 11 +++++++++++ scripts/linux_build.sh | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/building.md b/docs/building.md index 494122cd1a7..67b2066cd49 100644 --- a/docs/building.md +++ b/docs/building.md @@ -53,6 +53,17 @@ Dependencies vary depending on the distribution. You can reference our dependencies we use in Debian-based, Fedora-based and Arch-based distributions. Please submit a PR if you would like to extend the script to support other distributions. +##### KMS Capture +If you are using KMS, patching the Sunshine binary with `setcap` is required. Some post-install scripts handle this. If building +from source and using the binary directly, this will also work: + +```bash +sudo cp build/sunshine /tmp +sudo setcap cap_sys_admin+p /tmp/sunshine +sudo getcap /tmp/sunshine +sudo mv /tmp/sunshine build/sunshine +``` + ##### CUDA Toolkit Sunshine requires CUDA Toolkit for NVFBC capture. There are two caveats to CUDA: diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 146001e0d2c..055e7796193 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -597,12 +597,6 @@ function run_step_build() { # Build the project ninja -C "build" - - # Prepare binary with setcap for execution - sudo cp build/sunshine /tmp - sudo setcap cap_sys_admin+p /tmp/sunshine - sudo getcap /tmp/sunshine - sudo mv /tmp/sunshine build/sunshine } function run_step_package() {