From 5c729884ca9f544374c9464f7d93dc0332cd0a75 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 29 Jan 2026 22:28:24 -0500 Subject: [PATCH 1/3] build(fedora): use nodejs-npm instead of npm --- packaging/linux/copr/Sunshine.spec | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/packaging/linux/copr/Sunshine.spec b/packaging/linux/copr/Sunshine.spec index 3d515fecc8d..ba1cac585d0 100644 --- a/packaging/linux/copr/Sunshine.spec +++ b/packaging/linux/copr/Sunshine.spec @@ -40,7 +40,6 @@ BuildRequires: libXi-devel BuildRequires: libXinerama-devel BuildRequires: libXrandr-devel BuildRequires: libXtst-devel -BuildRequires: npm BuildRequires: openssl-devel BuildRequires: rpm-build BuildRequires: systemd-rpm-macros @@ -57,6 +56,9 @@ BuildRequires: libgudev BuildRequires: mesa-libGL-devel BuildRequires: mesa-libgbm-devel BuildRequires: miniupnpc-devel +%if 0%{?fedora} < 44 +BuildRequires: nodejs-npm +%endif BuildRequires: numactl-devel BuildRequires: opus-devel BuildRequires: pulseaudio-libs-devel @@ -78,6 +80,7 @@ BuildRequires: libminiupnpc-devel BuildRequires: libnuma-devel BuildRequires: libopus-devel BuildRequires: libpulse-devel +BuildRequires: npm BuildRequires: udev # for unit tests BuildRequires: xvfb-run @@ -254,6 +257,30 @@ else cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF") fi +# Install and setup NVM for Fedora 44+ +%if 0%{?fedora} > 43 +echo "Installing NVM for Fedora 44+..." +export HOME=${HOME:-/builddir} +export NVM_DIR="$HOME/.nvm" + +# Install NVM +if [ ! -d "$NVM_DIR" ]; then + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +fi + +# Load NVM +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + +# Install and use Node.js +nvm install node +nvm use node + +echo "Node.js version: $(node --version)" +echo "npm version: $(npm --version)" +echo "npm location: $(which npm)" +%endif + # setup the version export BRANCH=%{branch} export BUILD_VERSION=v%{build_version} From 5eb0e4723ee84513595223413e4b6c701af7159e Mon Sep 17 00:00:00 2001 From: David Lane <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 30 Jan 2026 08:49:33 -0500 Subject: [PATCH 2/3] Add conditional BuildRequires for Fedora 44 and above --- packaging/linux/copr/Sunshine.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packaging/linux/copr/Sunshine.spec b/packaging/linux/copr/Sunshine.spec index ba1cac585d0..03ade97ce3e 100644 --- a/packaging/linux/copr/Sunshine.spec +++ b/packaging/linux/copr/Sunshine.spec @@ -51,6 +51,10 @@ BuildRequires: which BuildRequires: appstream # BuildRequires: boost-devel >= 1.86.0 BuildRequires: libappstream-glib +%if 0%{fedora} > 43 +# needed for npm from nvm +BuildRequires: libatomic +%endif BuildRequires: libayatana-appindicator3-devel BuildRequires: libgudev BuildRequires: mesa-libGL-devel From fe5e23f255eeb3779f78556113d60e245fce9920 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:51:52 -0500 Subject: [PATCH 3/3] Add Node/NPM paths to cmake and load NVM Print node location, capture NPM and NODE paths, and pass NPM to cmake via -DNPM. Prepend node's bin dir to PATH so make can find node during build. During %install, load NVM and run `nvm use node` for Fedora >43 so npm is available during make install. These changes ensure node/npm are discoverable in the build and install phases, particularly on newer Fedora environments where NVM isn't auto-loaded. --- packaging/linux/copr/Sunshine.spec | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packaging/linux/copr/Sunshine.spec b/packaging/linux/copr/Sunshine.spec index 03ade97ce3e..84f1ee248c4 100644 --- a/packaging/linux/copr/Sunshine.spec +++ b/packaging/linux/copr/Sunshine.spec @@ -283,6 +283,15 @@ nvm use node echo "Node.js version: $(node --version)" echo "npm version: $(npm --version)" echo "npm location: $(which npm)" +echo "node location: $(which node)" + +# Add npm and node path to cmake args +NPM_PATH=$(which npm) +NODE_PATH=$(which node) +cmake_args+=("-DNPM=${NPM_PATH}") + +# Add node bin directory to PATH for make +export PATH="$(dirname ${NODE_PATH}):${PATH}" %endif # setup the version @@ -308,6 +317,21 @@ cd %{_builddir}/Sunshine/build xvfb-run ./tests/test_sunshine %install +# Load NVM for Fedora 44+ so npm is available during make install +%if 0%{?fedora} > 43 +export HOME=${HOME:-/builddir} +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +nvm use node + +# Add node bin directory to PATH for make install +NODE_PATH=$(which node) +export PATH="$(dirname ${NODE_PATH}):${PATH}" + +echo "Node.js version: $(node --version)" +echo "npm version: $(npm --version)" +%endif + cd %{_builddir}/Sunshine/build %make_install