From 15b91a1ad4439a5288d78bf239a25800eddf61a1 Mon Sep 17 00:00:00 2001
From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
Date: Sun, 6 Oct 2024 14:41:21 -0400
Subject: [PATCH 1/8] build(fedora)!: add copr build (#3239)
---
.github/workflows/ci-copr.yml | 56 +++++
.github/workflows/update-flathub-repo.yml | 2 +-
.github/workflows/update-pacman-repo.yml | 4 +-
DOCKER_README.md | 4 -
docker/fedora-39.dockerfile | 104 ----------
docker/fedora-40.dockerfile | 104 ----------
docs/getting_started.md | 40 ++--
packaging/linux/fedora/copr-build.sh | 62 ++++++
packaging/linux/fedora/sunshine.spec | 240 ++++++++++++++++++++++
9 files changed, 378 insertions(+), 238 deletions(-)
create mode 100644 .github/workflows/ci-copr.yml
delete mode 100644 docker/fedora-39.dockerfile
delete mode 100644 docker/fedora-40.dockerfile
create mode 100644 packaging/linux/fedora/copr-build.sh
create mode 100644 packaging/linux/fedora/sunshine.spec
diff --git a/.github/workflows/ci-copr.yml b/.github/workflows/ci-copr.yml
new file mode 100644
index 00000000..ba3d14ff
--- /dev/null
+++ b/.github/workflows/ci-copr.yml
@@ -0,0 +1,56 @@
+---
+name: CI Copr
+
+on:
+ pull_request:
+ branches:
+ - master
+ types:
+ - opened
+ - synchronize
+ - reopened
+ release:
+ types:
+ - prereleased
+ - released
+ workflow_dispatch:
+
+concurrency:
+ group: "${{ github.workflow }}-${{ github.ref }}"
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: Copr build
+ if: github.repository_owner == 'LizardByte'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Get properties
+ run: |
+ # package name = repository name
+ package=${{ github.event.repository.name }}
+ copr_base="https://copr.fedorainfracloud.org/webhooks/custom-dir/lizardbyte"
+
+ # release and released type
+ if [ "${{ github.event_name }}" = "release" ]; then
+ if [ "${{ github.event.action }}" = "prereleased" ]; then
+ COPR_PUSH_WEBHOOK="${copr_base}/beta/${{ secrets.COPR_BETA_WEBHOOK_TOKEN }}/${package}/"
+ elif [ "${{ github.event.action }}" = "released" ]; then
+ COPR_PUSH_WEBHOOK="${copr_base}/stable/${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }}/${package}/"
+ fi
+ elif [ "${{ github.event_name }}" = "pull_request" ]; then
+ COPR_PR_WEBHOOK="${copr_base}/pulls:pr:${{github.event.number}}/${{vars.COPR_PR_WEBHOOK_TOKEN}}/${package}/"
+ fi
+
+ echo "COPR_PUSH_WEBHOOK=${COPR_PUSH_WEBHOOK}" >> $GITHUB_ENV
+ echo "COPR_PR_WEBHOOK=${COPR_PR_WEBHOOK}" >> $GITHUB_ENV
+
+ - name: Build
+ run: |
+ curl https://raw.githubusercontent.com/praiskup/copr-ci-tooling/main/copr-gh-actions-submit > submit
+
+ # if a PR number is added the script will use the PR webhook, otherwise it will use the push webhook
+ bash submit ${{ github.event.pull_request.number }}
diff --git a/.github/workflows/update-flathub-repo.yml b/.github/workflows/update-flathub-repo.yml
index 15580f23..b3e326c9 100644
--- a/.github/workflows/update-flathub-repo.yml
+++ b/.github/workflows/update-flathub-repo.yml
@@ -180,7 +180,7 @@ jobs:
with:
path: "flathub/${{ env.FLATHUB_PKG }}"
token: ${{ secrets.GH_BOT_TOKEN }}
- commit-message: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}
+ commit-message: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}"
branch: bot/bump-${{ env.FLATHUB_PKG }}-${{ github.event.release.tag_name }}
delete-branch: true
title: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}"
diff --git a/.github/workflows/update-pacman-repo.yml b/.github/workflows/update-pacman-repo.yml
index c95f7cda..92e14dc7 100644
--- a/.github/workflows/update-pacman-repo.yml
+++ b/.github/workflows/update-pacman-repo.yml
@@ -70,7 +70,7 @@ jobs:
steps.check-label.outputs.hasTopic == 'true' &&
steps.check-release.outputs.isLatestRelease == 'true'
run: |
- echo "pkg_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
+ echo "pkg_name=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Download release asset
id: download
@@ -97,7 +97,7 @@ jobs:
add-paths: |
pkgbuilds/*
token: ${{ secrets.GH_BOT_TOKEN }}
- commit-message: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}
+ commit-message: "chore: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}"
branch: bot/bump-${{ github.repository }}-${{ github.event.release.tag_name }}
delete-branch: true
title: "chore: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}"
diff --git a/DOCKER_README.md b/DOCKER_README.md
index 0d9d1f4c..cbe977a3 100644
--- a/DOCKER_README.md
+++ b/DOCKER_README.md
@@ -26,8 +26,6 @@ Sunshine images are available with the following tag suffixes, based on their re
- `archlinux`
- `debian-bookworm`
-- `fedora-39`
-- `fedora-40`
- `ubuntu-22.04`
- `ubuntu-24.04`
@@ -157,8 +155,6 @@ The architectures supported by these images are shown in the table below.
|-----------------|--------------|---------------|
| archlinux | ✅ | ❌ |
| debian-bookworm | ✅ | ✅ |
-| fedora-39 | ✅ | ❌ |
-| fedora-40 | ✅ | ❌ |
| ubuntu-22.04 | ✅ | ✅ |
| ubuntu-24.04 | ✅ | ✅ |
diff --git a/docker/fedora-39.dockerfile b/docker/fedora-39.dockerfile
deleted file mode 100644
index 579eec9e..00000000
--- a/docker/fedora-39.dockerfile
+++ /dev/null
@@ -1,104 +0,0 @@
-# syntax=docker/dockerfile:1
-# artifacts: true
-# platforms: linux/amd64
-# platforms_pr: linux/amd64
-# no-cache-filters: sunshine-base,artifacts,sunshine
-ARG BASE=fedora
-ARG TAG=39
-FROM ${BASE}:${TAG} AS sunshine-base
-
-FROM sunshine-base AS sunshine-build
-
-ARG BRANCH
-ARG BUILD_VERSION
-ARG COMMIT
-# note: BUILD_VERSION may be blank
-
-ENV BRANCH=${BRANCH}
-ENV BUILD_VERSION=${BUILD_VERSION}
-ENV COMMIT=${COMMIT}
-
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
-
-# copy repository
-WORKDIR /build/sunshine/
-COPY --link .. .
-
-# cmake and cpack
-RUN <<_BUILD
-#!/bin/bash
-set -e
-chmod +x ./scripts/linux_build.sh
-./scripts/linux_build.sh \
- --publisher-name='LizardByte' \
- --publisher-website='https://app.lizardbyte.dev' \
- --publisher-issue-url='https://app.lizardbyte.dev/support' \
- --sudo-off
-dnf clean all
-rm -rf /var/cache/yum
-_BUILD
-
-# run tests
-WORKDIR /build/sunshine/build/tests
-# hadolint ignore=SC1091
-RUN <<_TEST
-#!/bin/bash
-set -e
-export DISPLAY=:1
-Xvfb ${DISPLAY} -screen 0 1024x768x24 &
-./test_sunshine --gtest_color=yes
-_TEST
-
-FROM scratch AS artifacts
-ARG BASE
-ARG TAG
-ARG TARGETARCH
-COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.rpm /sunshine-${BASE}-${TAG}-${TARGETARCH}.rpm
-
-FROM sunshine-base AS sunshine
-
-# copy deb from builder
-COPY --link --from=artifacts /sunshine*.rpm /sunshine.rpm
-
-# install sunshine
-RUN <<_INSTALL_SUNSHINE
-#!/bin/bash
-set -e
-dnf -y update
-dnf -y install /sunshine.rpm
-dnf clean all
-rm -rf /var/cache/yum
-_INSTALL_SUNSHINE
-
-# network setup
-EXPOSE 47984-47990/tcp
-EXPOSE 48010
-EXPOSE 47998-48000/udp
-
-# setup user
-ARG PGID=1000
-ENV PGID=${PGID}
-ARG PUID=1000
-ENV PUID=${PUID}
-ENV TZ="UTC"
-ARG UNAME=lizard
-ENV UNAME=${UNAME}
-
-ENV HOME=/home/$UNAME
-
-# setup user
-RUN <<_SETUP_USER
-#!/bin/bash
-set -e
-groupadd -f -g "${PGID}" "${UNAME}"
-useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}"
-mkdir -p ${HOME}/.config/sunshine
-ln -s ${HOME}/.config/sunshine /config
-chown -R ${UNAME} ${HOME}
-_SETUP_USER
-
-USER ${UNAME}
-WORKDIR ${HOME}
-
-# entrypoint
-ENTRYPOINT ["/usr/bin/sunshine"]
diff --git a/docker/fedora-40.dockerfile b/docker/fedora-40.dockerfile
deleted file mode 100644
index fc6362d4..00000000
--- a/docker/fedora-40.dockerfile
+++ /dev/null
@@ -1,104 +0,0 @@
-# syntax=docker/dockerfile:1
-# artifacts: true
-# platforms: linux/amd64
-# platforms_pr: linux/amd64
-# no-cache-filters: sunshine-base,artifacts,sunshine
-ARG BASE=fedora
-ARG TAG=40
-FROM ${BASE}:${TAG} AS sunshine-base
-
-FROM sunshine-base AS sunshine-build
-
-ARG BRANCH
-ARG BUILD_VERSION
-ARG COMMIT
-# note: BUILD_VERSION may be blank
-
-ENV BRANCH=${BRANCH}
-ENV BUILD_VERSION=${BUILD_VERSION}
-ENV COMMIT=${COMMIT}
-
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
-
-# copy repository
-WORKDIR /build/sunshine/
-COPY --link .. .
-
-# cmake and cpack
-RUN <<_BUILD
-#!/bin/bash
-set -e
-chmod +x ./scripts/linux_build.sh
-./scripts/linux_build.sh \
- --publisher-name='LizardByte' \
- --publisher-website='https://app.lizardbyte.dev' \
- --publisher-issue-url='https://app.lizardbyte.dev/support' \
- --sudo-off
-dnf clean all
-rm -rf /var/cache/yum
-_BUILD
-
-# run tests
-WORKDIR /build/sunshine/build/tests
-# hadolint ignore=SC1091
-RUN <<_TEST
-#!/bin/bash
-set -e
-export DISPLAY=:1
-Xvfb ${DISPLAY} -screen 0 1024x768x24 &
-./test_sunshine --gtest_color=yes
-_TEST
-
-FROM scratch AS artifacts
-ARG BASE
-ARG TAG
-ARG TARGETARCH
-COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.rpm /sunshine-${BASE}-${TAG}-${TARGETARCH}.rpm
-
-FROM sunshine-base AS sunshine
-
-# copy deb from builder
-COPY --link --from=artifacts /sunshine*.rpm /sunshine.rpm
-
-# install sunshine
-RUN <<_INSTALL_SUNSHINE
-#!/bin/bash
-set -e
-dnf -y update
-dnf -y install /sunshine.rpm
-dnf clean all
-rm -rf /var/cache/yum
-_INSTALL_SUNSHINE
-
-# network setup
-EXPOSE 47984-47990/tcp
-EXPOSE 48010
-EXPOSE 47998-48000/udp
-
-# setup user
-ARG PGID=1000
-ENV PGID=${PGID}
-ARG PUID=1000
-ENV PUID=${PUID}
-ENV TZ="UTC"
-ARG UNAME=lizard
-ENV UNAME=${UNAME}
-
-ENV HOME=/home/$UNAME
-
-# setup user
-RUN <<_SETUP_USER
-#!/bin/bash
-set -e
-groupadd -f -g "${PGID}" "${UNAME}"
-useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}"
-mkdir -p ${HOME}/.config/sunshine
-ln -s ${HOME}/.config/sunshine /config
-chown -R ${UNAME} ${HOME}
-_SETUP_USER
-
-USER ${UNAME}
-WORKDIR ${HOME}
-
-# entrypoint
-ENTRYPOINT ["/usr/bin/sunshine"]
diff --git a/docs/getting_started.md b/docs/getting_started.md
index 534aa5f2..02de66e3 100644
--- a/docs/getting_started.md
+++ b/docs/getting_started.md
@@ -54,28 +54,21 @@ CUDA is used for NVFBC capture.
| 12.0.0 |
- 525.60.13 |
+ 525.60.13 |
50;52;60;61;62;70;72;75;80;86;87;89;90 |
sunshine-debian-bookworm-{arch}.deb |
-
- | 12.4.0 |
- sunshine-fedora-39-{arch}.rpm |
-
| 12.5.1 |
sunshine.pkg.tar.zst |
- | 12.6.2 |
- 560.35.03 |
+ 12.6.2 |
+ 560.35.03 |
sunshine_{arch}.flatpak |
- | n/a |
- n/a |
- n/a |
- sunshine-fedora-40-{arch}.rpm |
+ Sunshine (copr) |
@@ -165,26 +158,27 @@ sudo apt remove sunshine
```
#### Fedora
+@tip{The package name is case-sensitive.}
+
##### Install
-1. Add `rpmfusion` repositories.
+1. Enable copr repository.
```bash
- sudo dnf install \
- https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
- https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- ```
-2. Download `sunshine-{distro}-{distro-version}-{arch}.rpm` and run the following command.
- ```bash
- sudo dnf install ./sunshine-{distro}-{distro-version}-{arch}.rpm
+ sudo dnf copr enable lizardbyte/stable
```
-@note{The `{distro-version}` is the version of the distro we built the package on. The `{arch}` is the
-architecture of your operating system.}
+ or
+ ```bash
+ sudo dnf copr enable lizardbyte/beta
+ ```
-@tip{You can double-click the rpm file to see details about the package and begin installation.}
+2. Install the package.
+ ```bash
+ sudo dnf install Sunshine
+ ```
##### Uninstall
```bash
-sudo dnf remove sunshine
+sudo dnf remove Sunshine
```
#### Flatpak
diff --git a/packaging/linux/fedora/copr-build.sh b/packaging/linux/fedora/copr-build.sh
new file mode 100644
index 00000000..3aa8bb83
--- /dev/null
+++ b/packaging/linux/fedora/copr-build.sh
@@ -0,0 +1,62 @@
+#! /bin/sh -x
+
+# This file is not used directly in this repository. It should be uploaded to Copr whenever the file changes.
+# Replicate to each package in "pulls", "beta", and "stable" Copr repositories
+
+set -e
+resultdir="${COPR_RESULTDIR}"
+git clone "https://github.com/${COPR_OWNER}/${COPR_PACKAGE}.git" --depth 1
+cd "${COPR_PACKAGE}"
+
+# optional part; drop if building against 'master' is enough
+if test -z "$REVISION"; then
+ # the hook_payload file contains webhook JSON payload (copr creates it for
+ # us); it is created only if the build is triggered by Custom webhook.
+ if test -f "$resultdir"/hook_payload; then
+ git clone https://github.com/praiskup/copr-ci-tooling \
+ "$resultdir/cct" --depth 1
+ export PATH="$resultdir/cct:$PATH"
+
+ echo "---"
+ cat "$resultdir"/hook_payload
+ echo "---"
+
+ # use jq to get the pr_id from the hook_payload
+ PR=$(jq -r '.pr_id' "$resultdir"/hook_payload)
+ if [ -z "$PR" ]; then
+ BRANCH="master"
+ else
+ BRANCH="pr/${PR}"
+ fi
+
+ copr-travis-checkout "$resultdir"/hook_payload
+ fi
+else
+ git checkout "$REVISION"
+fi
+
+# initialize the submodules
+git submodule update --init --recursive
+
+# get the tag of this commit IF it has one
+TAG=$(git tag --points-at HEAD | head -n1)
+if [ -z "$TAG" ]; then
+ TAG="0.0.$PR"
+fi
+TAG=$(echo "$TAG" | sed 's/^v//') # remove v prefix from the tag
+echo "TAG=$TAG"
+
+# get the commit
+COMMIT=$(git rev-parse HEAD)
+echo "COMMIT=$COMMIT"
+
+# move spec file to the correct location
+mv packaging/linux/fedora/*.spec "${resultdir}"
+
+# use sed to replace these values in the spec file
+sed -i "s|%global build_version 0|%global build_version ${TAG}|" "${resultdir}"/*.spec
+sed -i "s|%global branch 0|%global branch ${BRANCH}|" "${resultdir}"/*.spec
+sed -i "s|%global commit 0|%global commit ${COMMIT}|" "${resultdir}"/*.spec
+
+# create a tarball of the source code
+tar -czf "${resultdir}/tarball.tar.gz" .
diff --git a/packaging/linux/fedora/sunshine.spec b/packaging/linux/fedora/sunshine.spec
new file mode 100644
index 00000000..a56287e4
--- /dev/null
+++ b/packaging/linux/fedora/sunshine.spec
@@ -0,0 +1,240 @@
+%global build_timestamp %(date +"%Y%m%d")
+
+# use sed to replace these values
+%global build_version 0
+%global branch 0
+%global commit 0
+
+%undefine _hardened_build
+
+Name: Sunshine
+Version: %{build_version}
+Summary: Self-hosted game stream host for Moonlight.
+Release: 1%{?dist}
+License: GPLv3-only
+URL: https://github.com/LizardByte/Sunshine
+Source0: tarball.tar.gz
+
+# BuildRequires: boost-devel >= 1.86.0
+BuildRequires: cmake >= 3.25.0
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: libayatana-appindicator3-devel
+BuildRequires: libcap-devel
+BuildRequires: libcurl-devel
+BuildRequires: libdrm-devel
+BuildRequires: libevdev-devel
+BuildRequires: libgudev
+BuildRequires: libnotify-devel
+BuildRequires: libva-devel
+BuildRequires: libvdpau-devel
+BuildRequires: libX11-devel
+BuildRequires: libxcb-devel
+BuildRequires: libXcursor-devel
+BuildRequires: libXfixes-devel
+BuildRequires: libXi-devel
+BuildRequires: libXinerama-devel
+BuildRequires: libXrandr-devel
+BuildRequires: libXtst-devel
+BuildRequires: git
+BuildRequires: mesa-libGL-devel
+BuildRequires: miniupnpc-devel
+BuildRequires: npm
+BuildRequires: numactl-devel
+BuildRequires: openssl-devel
+BuildRequires: opus-devel
+BuildRequires: pulseaudio-libs-devel
+BuildRequires: rpm-build
+BuildRequires: systemd-udev
+BuildRequires: systemd-rpm-macros
+%{?sysusers_requires_compat}
+BuildRequires: wget
+BuildRequires: which
+
+# for unit tests
+BuildRequires: xorg-x11-server-Xvfb
+
+# Conditional BuildRequires for cuda-gcc based on Fedora version
+%if 0%{?fedora} >= 40
+# this package conflicts with gcc on f39
+BuildRequires: cuda-gcc-c++
+%endif
+
+Requires: libcap >= 2.22
+Requires: libcurl >= 7.0
+Requires: libdrm > 2.4.97
+Requires: libevdev >= 1.5.6
+Requires: libopusenc >= 0.2.1
+Requires: libva >= 2.14.0
+Requires: libvdpau >= 1.5
+Requires: libwayland-client >= 1.20.0
+Requires: libX11 >= 1.7.3.1
+Requires: miniupnpc >= 2.2.4
+Requires: numactl-libs >= 2.0.14
+Requires: openssl >= 3.0.2
+Requires: pulseaudio-libs >= 10.0
+Requires: libayatana-appindicator3 >= 0.5.3
+
+%description
+Self-hosted game stream host for Moonlight.
+
+%prep
+# extract tarball to current directory
+mkdir -p %{_builddir}/Sunshine
+tar -xzf %{SOURCE0} -C %{_builddir}/Sunshine
+
+# list directory
+ls -a %{_builddir}/Sunshine
+
+# patches
+%autopatch -p1
+
+%build
+# Detect the architecture and Fedora version
+architecture=$(uname -m)
+fedora_version=%{fedora}
+
+cuda_supported_architectures=("x86_64" "aarch64")
+
+# set cuda_version based on Fedora version
+# these are the same right now, but leave this structure to make it easier to set different versions
+if [ "$fedora_version" == 39 ]; then
+ cuda_version="12.6.2"
+ cuda_build="560.35.03"
+else
+ cuda_version="12.6.2"
+ cuda_build="560.35.03"
+fi
+
+# prepare CMAKE args
+cmake_args=(
+ "-B=%{_builddir}/Sunshine/build"
+ "-G=Unix Makefiles"
+ "-S=."
+ "-DBUILD_DOCS=OFF"
+ "-DBUILD_WERROR=ON"
+ "-DCMAKE_BUILD_TYPE=Release"
+ "-DCMAKE_INSTALL_PREFIX=%{_prefix}"
+ "-DSUNSHINE_ASSETS_DIR=%{_datadir}/sunshine"
+ "-DSUNSHINE_EXECUTABLE_PATH=%{_bindir}/sunshine"
+ "-DSUNSHINE_ENABLE_WAYLAND=ON"
+ "-DSUNSHINE_ENABLE_X11=ON"
+ "-DSUNSHINE_ENABLE_DRM=ON"
+ "-DSUNSHINE_PUBLISHER_NAME=LizardByte"
+ "-DSUNSHINE_PUBLISHER_WEBSITE=https://app.lizardbyte.dev"
+ "-DSUNSHINE_PUBLISHER_ISSUE_URL=https://app.lizardbyte.dev/support"
+)
+
+function install_cuda() {
+ # check if we need to install cuda
+ if [ -f "%{_builddir}/cuda/bin/nvcc" ]; then
+ echo "cuda already installed"
+ return
+ fi
+
+ if [ "$fedora_version" -ge 40 ]; then
+ # update environment variables for CUDA, necessary when using cuda-gcc-c++
+ export NVCC_PREPEND_FLAGS='-ccbin /usr/bin/cuda'
+ export PATH=/usr/bin/cuda:"%{_builddir}/cuda/bin:${PATH}"
+ export LD_LIBRARY_PATH="%{_builddir}/cuda/lib64:${LD_LIBRARY_PATH}"
+ fi
+
+ local cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
+ local cuda_suffix=""
+ if [ "$architecture" == "aarch64" ]; then
+ local cuda_suffix="_sbsa"
+ fi
+
+ local url="${cuda_prefix}${cuda_version}/local_installers/cuda_${cuda_version}_${cuda_build}_linux${cuda_suffix}.run"
+ echo "cuda url: ${url}"
+ wget "$url" --progress=bar:force:noscroll -q -O "%{_builddir}/cuda.run"
+ chmod a+x "%{_builddir}/cuda.run"
+ "%{_builddir}/cuda.run" \
+ --no-drm \
+ --no-man-page \
+ --no-opengl-libs \
+ --override \
+ --silent \
+ --toolkit \
+ --toolkitpath="%{_builddir}/cuda"
+ rm "%{_builddir}/cuda.run"
+}
+
+# we need to clear these flags to avoid linkage errors with cuda-gcc-c++
+export CFLAGS=""
+export CXXFLAGS=""
+export FFLAGS=""
+export FCFLAGS=""
+export LDFLAGS=""
+
+if [ -n "$cuda_version" ] && [[ " ${cuda_supported_architectures[@]} " =~ " ${architecture} " ]]; then
+ install_cuda
+ cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON")
+ cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=%{_builddir}/cuda/bin/nvcc")
+fi
+
+# cmake
+cd %{_builddir}/Sunshine
+echo "cmake args:"
+echo "${cmake_args[@]}"
+cmake "${cmake_args[@]}"
+make -j$(nproc) -C "%{_builddir}/Sunshine/build"
+
+%check
+# run tests
+cd %{_builddir}/Sunshine/build
+xvfb-run ./tests/test_sunshine
+
+%install
+cd %{_builddir}/Sunshine/build
+%make_install
+
+# Add modules-load configuration
+# load the uhid module in initramfs even if it doesn't detect the module as being used during dracut
+# which must be run every time a new kernel is installed
+install -D -m 0644 /dev/stdin %{buildroot}/usr/lib/modules-load.d/uhid.conf <
Date: Sun, 6 Oct 2024 19:09:20 -0400
Subject: [PATCH 2/8] build(fedora): fix version variables and skip post on
rpm-ostree (#3265)
---
.github/workflows/ci-copr.yml | 7 ++++-
packaging/linux/fedora/sunshine.spec | 35 +++++++++++++++++++-----
src_assets/linux/misc/postinst | 41 +++++++++++++++++++---------
3 files changed, 62 insertions(+), 21 deletions(-)
diff --git a/.github/workflows/ci-copr.yml b/.github/workflows/ci-copr.yml
index ba3d14ff..782246f6 100644
--- a/.github/workflows/ci-copr.yml
+++ b/.github/workflows/ci-copr.yml
@@ -29,6 +29,8 @@ jobs:
uses: actions/checkout@v4
- name: Get properties
+ env:
+ COPR_PR_WH_KEY: "05fc9b07-a19b-4f83-89b2-ae1e7e0b5282"
run: |
# package name = repository name
package=${{ github.event.repository.name }}
@@ -42,12 +44,15 @@ jobs:
COPR_PUSH_WEBHOOK="${copr_base}/stable/${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }}/${package}/"
fi
elif [ "${{ github.event_name }}" = "pull_request" ]; then
- COPR_PR_WEBHOOK="${copr_base}/pulls:pr:${{github.event.number}}/${{vars.COPR_PR_WEBHOOK_TOKEN}}/${package}/"
+ COPR_PR_WEBHOOK="${copr_base}/pulls:pr:${{github.event.number}}/${{env.COPR_PR_WH_KEY}}/${package}/"
fi
echo "COPR_PUSH_WEBHOOK=${COPR_PUSH_WEBHOOK}" >> $GITHUB_ENV
echo "COPR_PR_WEBHOOK=${COPR_PR_WEBHOOK}" >> $GITHUB_ENV
+ echo "COPR_PUSH_WEBHOOK=${COPR_PUSH_WEBHOOK}"
+ echo "COPR_PR_WEBHOOK=${COPR_PR_WEBHOOK}"
+
- name: Build
run: |
curl https://raw.githubusercontent.com/praiskup/copr-ci-tooling/main/copr-gh-actions-submit > submit
diff --git a/packaging/linux/fedora/sunshine.spec b/packaging/linux/fedora/sunshine.spec
index a56287e4..e17e213b 100644
--- a/packaging/linux/fedora/sunshine.spec
+++ b/packaging/linux/fedora/sunshine.spec
@@ -147,7 +147,12 @@ function install_cuda() {
local url="${cuda_prefix}${cuda_version}/local_installers/cuda_${cuda_version}_${cuda_build}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
- wget "$url" --progress=bar:force:noscroll -q -O "%{_builddir}/cuda.run"
+ wget \
+ "$url" \
+ --progress=bar:force:noscroll \
+ --retry-connrefused \
+ --tries=3 \
+ -q -O "%{_builddir}/cuda.run"
chmod a+x "%{_builddir}/cuda.run"
"%{_builddir}/cuda.run" \
--no-drm \
@@ -173,6 +178,11 @@ if [ -n "$cuda_version" ] && [[ " ${cuda_supported_architectures[@]} " =~ " ${ar
cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=%{_builddir}/cuda/bin/nvcc")
fi
+# setup the version
+export BRANCH=%{branch}
+export BUILD_VERSION=v%{build_version}
+export COMMIT=%{commit}
+
# cmake
cd %{_builddir}/Sunshine
echo "cmake args:"
@@ -198,12 +208,23 @@ EOF
%post
# Note: this is copied from the postinst script
-# Trigger udev rule reload for /dev/uinput and /dev/uhid
-path_to_udevadm=$(which udevadm)
-if [ -x "$path_to_udevadm" ] ; then
- $path_to_udevadm control --reload-rules
- $path_to_udevadm trigger --property-match=DEVNAME=/dev/uinput
- $path_to_udevadm trigger --property-match=DEVNAME=/dev/uhid
+# Check if we're in an rpm-ostree environment
+if [ ! -x "$(command -v rpm-ostree)" ]; then
+ echo "Not in an rpm-ostree environment, proceeding with post install steps."
+
+ # Trigger udev rule reload for /dev/uinput and /dev/uhid
+ path_to_udevadm=$(which udevadm)
+ if [ -x "$path_to_udevadm" ]; then
+ echo "Reloading udev rules."
+ $path_to_udevadm control --reload-rules
+ $path_to_udevadm trigger --property-match=DEVNAME=/dev/uinput
+ $path_to_udevadm trigger --property-match=DEVNAME=/dev/uhid
+ echo "Udev rules reloaded successfully."
+ else
+ echo "error: udevadm not found or not executable."
+ fi
+else
+ echo "rpm-ostree environment detected, skipping post install steps. Restart to apply the changes."
fi
%preun
diff --git a/src_assets/linux/misc/postinst b/src_assets/linux/misc/postinst
index 47deb784..262dd8bc 100644
--- a/src_assets/linux/misc/postinst
+++ b/src_assets/linux/misc/postinst
@@ -1,17 +1,32 @@
#!/bin/sh
-# Ensure Sunshine can grab images from KMS
-path_to_setcap=$(which setcap)
-path_to_sunshine=$(readlink -f $(which sunshine))
-if [ -x "$path_to_setcap" ] ; then
- echo "$path_to_setcap cap_sys_admin+p $path_to_sunshine"
- $path_to_setcap cap_sys_admin+p $path_to_sunshine
-fi
+# Check if we're in an rpm-ostree environment
+if [ ! -x "$(command -v rpm-ostree)" ]; then
+ echo "Not in an rpm-ostree environment, proceeding with post install steps."
-# Trigger udev rule reload for /dev/uinput and /dev/uhid
-path_to_udevadm=$(which udevadm)
-if [ -x "$path_to_udevadm" ] ; then
- $path_to_udevadm control --reload-rules
- $path_to_udevadm trigger --property-match=DEVNAME=/dev/uinput
- $path_to_udevadm trigger --property-match=DEVNAME=/dev/uhid
+ # Ensure Sunshine can grab images from KMS
+ path_to_setcap=$(which setcap)
+ path_to_sunshine=$(readlink -f "$(which sunshine)")
+ if [ -x "$path_to_setcap" ] ; then
+ echo "Setting CAP_SYS_ADMIN capability on Sunshine binary."
+ echo "$path_to_setcap cap_sys_admin+p $path_to_sunshine"
+ $path_to_setcap cap_sys_admin+p $path_to_sunshine
+ echo "CAP_SYS_ADMIN capability set on Sunshine binary."
+ else
+ echo "error: setcap not found or not executable."
+ fi
+
+ # Trigger udev rule reload for /dev/uinput and /dev/uhid
+ path_to_udevadm=$(which udevadm)
+ if [ -x "$path_to_udevadm" ] ; then
+ echo "Reloading udev rules."
+ $path_to_udevadm control --reload-rules
+ $path_to_udevadm trigger --property-match=DEVNAME=/dev/uinput
+ $path_to_udevadm trigger --property-match=DEVNAME=/dev/uhid
+ echo "Udev rules reloaded successfully."
+ else
+ echo "error: udevadm not found or not executable."
+ fi
+else
+ echo "rpm-ostree environment detected, skipping post install steps. Restart to apply the changes."
fi
From 011a872c889999dc2ce8e552488d3d3011426c94 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 6 Oct 2024 19:15:53 -0500
Subject: [PATCH 3/8] build(deps): update to FFmpeg 7.1 (#3263)
---
src/video.cpp | 19 +++++++++++++++----
third-party/build-deps | 2 +-
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/video.cpp b/src/video.cpp
index 8c5829a2..5f810860 100644
--- a/src/video.cpp
+++ b/src/video.cpp
@@ -512,6 +512,7 @@ namespace video {
{ "delay"s, 0 },
{ "forced-idr"s, 1 },
{ "zerolatency"s, 1 },
+ { "surfaces"s, 1 },
{ "preset"s, &config::video.nv_legacy.preset },
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
@@ -532,6 +533,7 @@ namespace video {
{ "delay"s, 0 },
{ "forced-idr"s, 1 },
{ "zerolatency"s, 1 },
+ { "surfaces"s, 1 },
{ "preset"s, &config::video.nv_legacy.preset },
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
@@ -557,6 +559,7 @@ namespace video {
{ "delay"s, 0 },
{ "forced-idr"s, 1 },
{ "zerolatency"s, 1 },
+ { "surfaces"s, 1 },
{ "preset"s, &config::video.nv_legacy.preset },
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
@@ -697,6 +700,9 @@ namespace video {
// Common options
{
{ "filler_data"s, false },
+ { "forced_idr"s, 1 },
+ { "latency"s, "lowest_latency"s },
+ { "skip_frame"s, 0 },
{ "log_to_dbg"s, []() { return config::sunshine.min_log_level < 2 ? 1 : 0; } },
{ "preencode"s, &config::video.amd.amd_preanalysis },
{ "quality"s, &config::video.amd.amd_quality_av1 },
@@ -716,12 +722,13 @@ namespace video {
// Common options
{
{ "filler_data"s, false },
+ { "forced_idr"s, 1 },
+ { "latency"s, 1 },
+ { "skip_frame"s, 0 },
{ "log_to_dbg"s, []() { return config::sunshine.min_log_level < 2 ? 1 : 0; } },
{ "gops_per_idr"s, 1 },
{ "header_insertion_mode"s, "idr"s },
{ "preencode"s, &config::video.amd.amd_preanalysis },
- { "qmax"s, 51 },
- { "qmin"s, 0 },
{ "quality"s, &config::video.amd.amd_quality_hevc },
{ "rc"s, &config::video.amd.amd_rc_hevc },
{ "usage"s, &config::video.amd.amd_usage_hevc },
@@ -740,10 +747,11 @@ namespace video {
// Common options
{
{ "filler_data"s, false },
+ { "forced_idr"s, 1 },
+ { "latency"s, 1 },
+ { "frame_skipping"s, 0 },
{ "log_to_dbg"s, []() { return config::sunshine.min_log_level < 2 ? 1 : 0; } },
{ "preencode"s, &config::video.amd.amd_preanalysis },
- { "qmax"s, 51 },
- { "qmin"s, 0 },
{ "quality"s, &config::video.amd.amd_quality_h264 },
{ "rc"s, &config::video.amd.amd_rc_h264 },
{ "usage"s, &config::video.amd.amd_usage_h264 },
@@ -922,6 +930,7 @@ namespace video {
{ "require_sw"s, &config::video.vt.vt_require_sw },
{ "realtime"s, &config::video.vt.vt_realtime },
{ "prio_speed"s, 1 },
+ { "max_ref_frames"s, 1 },
},
{}, // SDR-specific options
{}, // HDR-specific options
@@ -938,6 +947,7 @@ namespace video {
{ "require_sw"s, &config::video.vt.vt_require_sw },
{ "realtime"s, &config::video.vt.vt_realtime },
{ "prio_speed"s, 1 },
+ { "max_ref_frames"s, 1 },
},
{}, // SDR-specific options
{}, // HDR-specific options
@@ -954,6 +964,7 @@ namespace video {
{ "require_sw"s, &config::video.vt.vt_require_sw },
{ "realtime"s, &config::video.vt.vt_realtime },
{ "prio_speed"s, 1 },
+ { "max_ref_frames"s, 1 },
},
{}, // SDR-specific options
{}, // HDR-specific options
diff --git a/third-party/build-deps b/third-party/build-deps
index a4fb39f2..1977d9c5 160000
--- a/third-party/build-deps
+++ b/third-party/build-deps
@@ -1 +1 @@
-Subproject commit a4fb39f22e63649d2ef30508644937e3d7a18aed
+Subproject commit 1977d9c560717b9b5f7621d13f6771c05c89f36f
From 11975274a31c6f2f72ca72d39d25c098b449deda Mon Sep 17 00:00:00 2001
From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
Date: Sun, 6 Oct 2024 21:29:53 -0400
Subject: [PATCH 4/8] chore(github): update issue template (#3260)
---
.github/ISSUE_TEMPLATE/bug-report.yml | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index 422a0a64..6e0a87ff 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -70,9 +70,8 @@ body:
attributes:
label: Architecture
options:
- - 32 bit
- - 64 bit
- - arm
+ - amd64/x86_64
+ - arm64/aarch64
- other, n/a
validations:
required: true
@@ -95,18 +94,18 @@ body:
- Linux - AUR (Third Party)
- Linux - deb
- Linux - Docker
- - Linux - flathub (Third Party)
- - Linux - flatpak
+ - Linux - flathub/flatpak
- Linux - Homebrew
+ - Linux - LizardByte/pacman-repo
- Linux - nixpkgs (Third Party)
- Linux - pkg.tar.zst
- - Linux - rpm
+ - Linux - Fedora Copr
- Linux - solus (Third Party)
- macOS - Homebrew
- macOS - Portfile
- Windows - Chocolatey (Third Party)
- - Windows - installer
- - Windows - portable
+ - Windows - installer (recommended)
+ - Windows - portable (not recommended)
- Windows - Scoop (Third Party)
- Windows - Winget
- other (not listed)
@@ -166,7 +165,7 @@ body:
Please copy and paste your config (`sunshine.conf`) file.
render: Shell
validations:
- required: true
+ required: false
- type: textarea
id: apps
attributes:
From 319a92a582add91f3c902b38c23c7a7e888feacc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 02:35:27 +0000
Subject: [PATCH 5/8] build(deps): bump
packaging/linux/flatpak/deps/shared-modules from `a4a03d7` to `9ad0965`
(#3258)
build(deps): bump packaging/linux/flatpak/deps/shared-modules
Bumps [packaging/linux/flatpak/deps/shared-modules](https://github.com/flathub/shared-modules) from `a4a03d7` to `9ad0965`.
- [Commits](https://github.com/flathub/shared-modules/compare/a4a03d755258d0d242bfec259b559c673abbafb3...9ad0965214b9433e7e462417323a54154d37beeb)
---
updated-dependencies:
- dependency-name: packaging/linux/flatpak/deps/shared-modules
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
packaging/linux/flatpak/deps/shared-modules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packaging/linux/flatpak/deps/shared-modules b/packaging/linux/flatpak/deps/shared-modules
index a4a03d75..9ad09652 160000
--- a/packaging/linux/flatpak/deps/shared-modules
+++ b/packaging/linux/flatpak/deps/shared-modules
@@ -1 +1 @@
-Subproject commit a4a03d755258d0d242bfec259b559c673abbafb3
+Subproject commit 9ad0965214b9433e7e462417323a54154d37beeb
From 4c20355f041113523984ee4b3ef3de0230e8ef8e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 03:38:44 +0000
Subject: [PATCH 6/8] build(deps): bump @lizardbyte/shared-web from
2024.901.195233 to 2024.921.191855 (#3217)
build(deps): bump @lizardbyte/shared-web
Bumps [@lizardbyte/shared-web](https://github.com/LizardByte/shared-web) from 2024.901.195233 to 2024.921.191855.
- [Commits](https://github.com/LizardByte/shared-web/commits)
---
updated-dependencies:
- dependency-name: "@lizardbyte/shared-web"
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d93d9629..a5dd9c10 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"serve": "serve ./tests/fixtures/http --no-port-switching"
},
"dependencies": {
- "@lizardbyte/shared-web": "2024.901.195233",
+ "@lizardbyte/shared-web": "2024.921.191855",
"vue": "3.5.3",
"vue-i18n": "9.14.0"
},
From b553f68d0f1f0b543ce4dcf6dfe61f208e87f237 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 05:07:56 +0000
Subject: [PATCH 7/8] build(deps): bump vue from 3.5.3 to 3.5.11 (#3257)
Bumps [vue](https://github.com/vuejs/core) from 3.5.3 to 3.5.11.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/core/compare/v3.5.3...v3.5.11)
---
updated-dependencies:
- dependency-name: vue
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index a5dd9c10..a2ac9e73 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
},
"dependencies": {
"@lizardbyte/shared-web": "2024.921.191855",
- "vue": "3.5.3",
+ "vue": "3.5.11",
"vue-i18n": "9.14.0"
},
"devDependencies": {
From dff1cd48d4f692b7033c633a694e1ea4a2293ae4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 17:41:14 -0400
Subject: [PATCH 8/8] build(deps): bump third-party/doxyconfig from `5fcfd9a`
to `4c05198` (#3269)
Bumps [third-party/doxyconfig](https://github.com/LizardByte/doxyconfig) from `5fcfd9a` to `4c05198`.
- [Commits](https://github.com/LizardByte/doxyconfig/compare/5fcfd9a3d2ed90f3197268d9668f5c6c408ddc72...4c051982c1523f88fbbdb69d44af2ea384dc7052)
---
updated-dependencies:
- dependency-name: third-party/doxyconfig
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
third-party/doxyconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third-party/doxyconfig b/third-party/doxyconfig
index 5fcfd9a3..4c051982 160000
--- a/third-party/doxyconfig
+++ b/third-party/doxyconfig
@@ -1 +1 @@
-Subproject commit 5fcfd9a3d2ed90f3197268d9668f5c6c408ddc72
+Subproject commit 4c051982c1523f88fbbdb69d44af2ea384dc7052