File sunshine.spec of Package sunshine
#
# spec file for package sunshine
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define appid dev.lizardbyte.app.Sunshine
Name: sunshine
Version: 2025.930.130407
Release: 0
Summary: Server for the Moonlight game streaming client
License: GPL-3.0-only
URL: https://github.com/LizardByte/sunshine
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.firewalld
Source2: %{name}-webui.firewalld
Source3: package-lock.json
Source4: node_modules.spec.inc
Source5: README.SUSE
Source99: get-sources.sh
%include %{_sourcedir}/node_modules.spec.inc
Patch0: fix-boost-1.88.patch
#fix-boost-1.89: Remove boost_system linkage dependency
#The boost::system component is now header-only in Boost 1.89.0 and later. Remove explicit linkage to Boost::system in the Simple-Web-Server CMakeLists.txt to allow building against recent Boost versions (e.g., in OpenSUSE Tumbleweed).
Patch1: fix-boost-1.89.patch
Patch2: fix-libs-sonames.patch
Patch3: fix-force-output-name.patch
BuildRequires: boost-devel >= 1.89.0
BuildRequires: c++_compiler
BuildRequires: cmake >= 3.20
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: firewall-macros
BuildRequires: firewalld
BuildRequires: git-core
BuildRequires: graphviz
BuildRequires: hicolor-icon-theme
BuildRequires: icu
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_headers-devel
BuildRequires: libboost_locale-devel
BuildRequires: libboost_log-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_thread-devel
BuildRequires: local-npm-registry
BuildRequires: pkgconfig
BuildRequires: pkgconfig(ayatana-appindicator3-0.1)
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(libcap)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libevdev)
BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(miniupnpc)
BuildRequires: pkgconfig(nlohmann_json)
BuildRequires: pkgconfig(numa)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(vdpau)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xtst)
Provides: bundled(libinputtino)
Recommends: %{name}-firewalld
ExclusiveArch: %{arm64} %{x86_64}
%description
Sunshine is a self-hosted game stream host for Moonlight. It has low
latency, cloud gaming server capabilities with support for hardware
encoding on AMD, Intel, and Nvidia GPUs. Software encoding is also
available. You can connect to Sunshine from any Moonlight client on a
variety of devices. A web UI is provided for configuration and client
pairing.
%package firewalld
Summary: Firewalld service for %{name}
Requires: firewalld
Requires: sunshine
Supplements: (%{name} and firewalld)
BuildArch: noarch
%description firewalld
%{summary}.
%prep
%autosetup -p1
cp %{SOURCE5} .
local-npm-registry %{_sourcedir} install --include=prod --include=dev --include=optional --include=peer
%build
export BUILD_VERSION=%{version}
%cmake \
-DBOOST_USE_STATIC=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DSUNSHINE_ASSETS_DIR=share/%{name} \
-DSUNSHINE_BUILD_FACTORY=ON \
-DSUNSHINE_ENABLE_CUDA=OFF \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_TRAY=ON \
-DSUNSHINE_ENABLE_VAAPI=ON \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_EXECUTABLE_PATH=%{_bindir}/%{name} \
-DSUNSHINE_REQUIRE_TRAY=ON \
-DSUNSHINE_SYSTEM_WAYLAND_PROTOCOLS=ON \
-DTESTS_ENABLE_PYTHON_TESTS=ON
%cmake_build
%install
%cmake_install
install -d %{buildroot}%{_libdir}
install -Dm0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}.xml
install -Dm0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}-webui.xml
install -Dm0755 %{_builddir}/%{name}-%{version}/build/third-party/inputtino/libinputtino.so.0.1 %{buildroot}%{_libdir}
%fdupes %{buildroot}
%verify_permissions -e %{_bindir}/sunshine
%post -n %{name}-firewalld
%firewalld_reload
%postun -n %{name}-firewalld
%firewalld_reload
%ldconfig_scriptlets
%files
%license LICENSE
%doc NOTICE README.md README.SUSE
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{appid}.desktop
%{_datadir}/applications/%{appid}.terminal.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/icons/hicolor/scalable/status/%{name}-{locked,pausing,playing,tray}.svg
%{_datadir}/metainfo/%{appid}.metainfo.xml
%{_libdir}/libinputtino.so.0.1
%{_modulesloaddir}/60-%{name}.conf
%{_udevrulesdir}/60-%{name}.rules
%{_userunitdir}/%{name}.service
%files firewalld
%{_prefix}/lib/firewalld/services/%{name}.xml
%{_prefix}/lib/firewalld/services/%{name}-webui.xml
%changelog