build(fedora): use nvm to install npm for rawhide (#4646)
This commit is contained in:
parent
2a31583c7f
commit
bd857c2d83
1 changed files with 56 additions and 1 deletions
|
|
@ -40,7 +40,6 @@ BuildRequires: libXi-devel
|
||||||
BuildRequires: libXinerama-devel
|
BuildRequires: libXinerama-devel
|
||||||
BuildRequires: libXrandr-devel
|
BuildRequires: libXrandr-devel
|
||||||
BuildRequires: libXtst-devel
|
BuildRequires: libXtst-devel
|
||||||
BuildRequires: npm
|
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
BuildRequires: rpm-build
|
BuildRequires: rpm-build
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
|
|
@ -52,11 +51,18 @@ BuildRequires: which
|
||||||
BuildRequires: appstream
|
BuildRequires: appstream
|
||||||
# BuildRequires: boost-devel >= 1.86.0
|
# BuildRequires: boost-devel >= 1.86.0
|
||||||
BuildRequires: libappstream-glib
|
BuildRequires: libappstream-glib
|
||||||
|
%if 0%{fedora} > 43
|
||||||
|
# needed for npm from nvm
|
||||||
|
BuildRequires: libatomic
|
||||||
|
%endif
|
||||||
BuildRequires: libayatana-appindicator3-devel
|
BuildRequires: libayatana-appindicator3-devel
|
||||||
BuildRequires: libgudev
|
BuildRequires: libgudev
|
||||||
BuildRequires: mesa-libGL-devel
|
BuildRequires: mesa-libGL-devel
|
||||||
BuildRequires: mesa-libgbm-devel
|
BuildRequires: mesa-libgbm-devel
|
||||||
BuildRequires: miniupnpc-devel
|
BuildRequires: miniupnpc-devel
|
||||||
|
%if 0%{?fedora} < 44
|
||||||
|
BuildRequires: nodejs-npm
|
||||||
|
%endif
|
||||||
BuildRequires: numactl-devel
|
BuildRequires: numactl-devel
|
||||||
BuildRequires: opus-devel
|
BuildRequires: opus-devel
|
||||||
BuildRequires: pulseaudio-libs-devel
|
BuildRequires: pulseaudio-libs-devel
|
||||||
|
|
@ -78,6 +84,7 @@ BuildRequires: libminiupnpc-devel
|
||||||
BuildRequires: libnuma-devel
|
BuildRequires: libnuma-devel
|
||||||
BuildRequires: libopus-devel
|
BuildRequires: libopus-devel
|
||||||
BuildRequires: libpulse-devel
|
BuildRequires: libpulse-devel
|
||||||
|
BuildRequires: npm
|
||||||
BuildRequires: udev
|
BuildRequires: udev
|
||||||
# for unit tests
|
# for unit tests
|
||||||
BuildRequires: xvfb-run
|
BuildRequires: xvfb-run
|
||||||
|
|
@ -254,6 +261,39 @@ else
|
||||||
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF")
|
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF")
|
||||||
fi
|
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)"
|
||||||
|
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
|
# setup the version
|
||||||
export BRANCH=%{branch}
|
export BRANCH=%{branch}
|
||||||
export BUILD_VERSION=v%{build_version}
|
export BUILD_VERSION=v%{build_version}
|
||||||
|
|
@ -277,6 +317,21 @@ cd %{_builddir}/Sunshine/build
|
||||||
xvfb-run ./tests/test_sunshine
|
xvfb-run ./tests/test_sunshine
|
||||||
|
|
||||||
%install
|
%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
|
cd %{_builddir}/Sunshine/build
|
||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue