Skip to content
Merged
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
13 changes: 9 additions & 4 deletions pkgbuilds/sunshine/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
pkgbase = sunshine
pkgdesc = Self-hosted game stream host for Moonlight
pkgver = 2025.924.154138
pkgrel = 3
pkgver = 2026.516.143833
pkgrel = 1
url = https://app.lizardbyte.dev/Sunshine
install = sunshine.install
arch = x86_64
arch = aarch64
license = GPL-3.0-only
checkdepends = gcovr
makedepends = appstream
makedepends = appstream-glib
makedepends = cmake
Expand All @@ -16,6 +17,9 @@ pkgbase = sunshine
makedepends = make
makedepends = nodejs
makedepends = npm
makedepends = python-jinja
makedepends = python-setuptools
makedepends = shaderc
depends = avahi
depends = curl
depends = libayatana-appindicator
Expand All @@ -24,6 +28,7 @@ pkgbase = sunshine
depends = libevdev
depends = libmfx
depends = libnotify
depends = libpipewire
depends = libpulse
depends = libva
depends = libx11
Expand All @@ -36,11 +41,11 @@ pkgbase = sunshine
depends = openssl
depends = opus
depends = udev
depends = vulkan-icd-loader
depends = which
optdepends = cuda: Nvidia GPU encoding support
optdepends = libva-mesa-driver: AMD GPU encoding support
optdepends = xorg-server-xvfb: Virtual X server for headless testing
source = sunshine::git+https://github.com/LizardByte/Sunshine.git#commit=86188d47a7463b0f73b35de18a628353adeaa20e
source = sunshine::git+https://github.com/LizardByte/Sunshine.git#commit=14ffa6fdaa53f7b51512be2b3d24f3939695403c
sha256sums = SKIP

pkgname = sunshine
84 changes: 70 additions & 14 deletions pkgbuilds/sunshine/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Reference: https://wiki.archlinux.org/title/PKGBUILD

## options
: "${_run_unit_tests:=false}" # if set to true; unit tests will be executed post build; useful in CI
: "${_run_unit_tests:=false}" # if set to true; unit tests will be executed post build; useful in CI
: "${_support_headless_testing:=false}"
: "${_use_cuda:=detect}" # nvenc

: "${_commit:=86188d47a7463b0f73b35de18a628353adeaa20e}"
: "${_commit:=14ffa6fdaa53f7b51512be2b3d24f3939695403c}"

pkgname='sunshine'
pkgver=2025.924.154138
pkgrel=3
pkgver=2026.516.143833
pkgrel=1
pkgdesc="Self-hosted game stream host for Moonlight"
arch=('x86_64' 'aarch64')
url=https://app.lizardbyte.dev/Sunshine
Expand All @@ -37,6 +37,7 @@ depends=(
'libevdev'
'libmfx'
'libnotify'
'libpipewire'
'libpulse'
'libva'
'libx11'
Expand All @@ -49,6 +50,7 @@ depends=(
'openssl'
'opus'
'udev'
'vulkan-icd-loader'
'which'
)

Expand All @@ -62,6 +64,13 @@ makedepends=(
'make'
'nodejs'
'npm'
'python-jinja' # required by the glad OpenGL/EGL loader generator
'python-setuptools' # required for glad OpenGL/EGL loader generated, v2.0.0
'shaderc'
)

checkdepends=(
'gcovr'
)

optdepends=(
Expand Down Expand Up @@ -111,7 +120,7 @@ prepare() {

build() {
export BRANCH="master"
export BUILD_VERSION="2025.924.154138"
export BUILD_VERSION="2026.516.143833"
export COMMIT="${_commit}"

export CC="gcc${_gcc_env_suffix}"
Expand All @@ -129,7 +138,6 @@ build() {
-D BUILD_DOCS=OFF
-D BUILD_WERROR=ON
-D CMAKE_INSTALL_PREFIX=/usr
-D SUNSHINE_COMPILE_OPTIONS="-Wno-uninitialized"
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine
-D SUNSHINE_ASSETS_DIR="share/sunshine"
-D SUNSHINE_PUBLISHER_NAME='LizardByte'
Expand All @@ -144,10 +152,14 @@ build() {
# therefore, set them manually to the expected values on Arch Linux
if [ -z "${CUDA_PATH:-}" ] && pacman -Qi cuda &> /dev/null; then
local _cuda_gcc_version
_cuda_gcc_version="$(LC_ALL=C pacman -Si cuda | grep -Pom1 '^Depends On\s*:.*\bgcc\K[0-9]+\b')"
_cuda_gcc_version="$(LC_ALL=C pacman -Si cuda | grep -Pom1 '^Depends On\s*:.*\bgcc\K[0-9]+\b' || true)"

export CUDA_PATH=/opt/cuda
export NVCC_CCBIN="/usr/bin/g++-${_cuda_gcc_version}"
if [ -n "$_cuda_gcc_version" ]; then
export NVCC_CCBIN="/usr/bin/g++-${_cuda_gcc_version}"
else
export NVCC_CCBIN="/usr/bin/g++"
fi
fi
fi

Expand All @@ -162,23 +174,67 @@ build() {
desktop-file-validate "build/dev.lizardbyte.app.Sunshine.desktop"
desktop-file-validate "build/dev.lizardbyte.app.Sunshine.terminal.desktop"

make -C build
cmake --build build
}

check() {
cd "${srcdir}/build"
./sunshine --version

if [[ "${_run_unit_tests::1}" == "t" ]]; then
export CC="gcc${_gcc_env_suffix}"
export CXX="g++${_gcc_env_suffix}"

cd "${srcdir}/build/tests"
./test_sunshine --gtest_color=yes
./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml

# Generate coverage report
# Run gcovr from the build directory (where all .gcda/.gcno files are)
# This matches the pattern used in ci-linux.yml
cd "${srcdir}/build"

# Dynamically find the gcov executable from the selected compiler.
# This ensures we use the same gcov version that produced the .gcno files.
local gcov_path
local gcc_lib_dir

gcc_lib_dir="$("$CC" -print-libgcc-file-name)"
gcc_lib_dir="${gcc_lib_dir%/*}"
gcov_path="${gcc_lib_dir}/gcov"

if [ ! -x "$gcov_path" ]; then
gcov_path="$("$CC" -print-prog-name=gcov)"
fi

if [ -n "$gcov_path" ] && command -v "$gcov_path" > /dev/null 2>&1; then
gcov_path="$(command -v "$gcov_path")"
else
gcov_path="$(command -v "gcov${_gcc_env_suffix}" || command -v gcov || true)"
fi

if [ -z "$gcov_path" ]; then
echo "Unable to find gcov for ${CC}" >&2
return 1
fi

echo "Using gcov at: $gcov_path"

# Use the actual relative path to the source directory
# From ${srcdir}/build, the source is at ../${pkgname}/src
gcovr --gcov-executable "$gcov_path" . -r "../${pkgname}/src" \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--verbose \
--xml-pretty \
-o coverage.xml

# Post-process the coverage XML to strip the absolute path and show only 'src'
sed -i "s|${srcdir}/${pkgname}/src|src|g" coverage.xml
fi

cd "${srcdir}/build"
./sunshine --version
}

package() {
export MAKEFLAGS="${MAKEFLAGS:--j$(nproc)}"
make -C build install DESTDIR="$pkgdir"
DESTDIR="$pkgdir" cmake --install build
}
2 changes: 1 addition & 1 deletion pkgbuilds/sunshine/sunshine.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
do_setcap() {
setcap cap_sys_admin+p $(readlink -f usr/bin/sunshine)
setcap cap_sys_admin,cap_sys_nice+p $(readlink -f usr/bin/sunshine)
}

do_udev_reload() {
Expand Down