From f4074341a577d19ab695d99871266d1ae1162678 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:46:59 -0400 Subject: [PATCH 1/8] Add AUR PKGBUILD --- .github/workflows/CI.yml | 85 +++++++++++++++++ CMakeLists.txt | 4 + packaging/linux/aur/sunshine-git/.SRCINFO | 35 +++++++ packaging/linux/aur/sunshine-git/PKGBUILD | 92 +++++++++++++++++++ packaging/linux/aur/sunshine/.SRCINFO | 33 +++++++ packaging/linux/aur/sunshine/PKGBUILD | 81 ++++++++++++++++ packaging/linux/aur/tmp/sunshine.install | 6 ++ .../linux/aur/tmp/systemd-user-config.patch | 14 +++ packaging/linux/aur/tmp/udev.rules | 1 + 9 files changed, 351 insertions(+) create mode 100644 packaging/linux/aur/sunshine-git/.SRCINFO create mode 100644 packaging/linux/aur/sunshine-git/PKGBUILD create mode 100644 packaging/linux/aur/sunshine/.SRCINFO create mode 100644 packaging/linux/aur/sunshine/PKGBUILD create mode 100644 packaging/linux/aur/tmp/sunshine.install create mode 100644 packaging/linux/aur/tmp/systemd-user-config.patch create mode 100644 packaging/linux/aur/tmp/udev.rules diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2562d68d..4e274b9e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -52,6 +52,91 @@ jobs: echo Within 'CMakeLists.txt' change "project(Sunshine [VERSION $cmakelists_version]" to "project(Sunshine [VERSION ${{ needs.check_changelog.outputs.next_version_bare }}]" exit 1 + build_linux_aur: + name: Linux AUR + runs-on: ubuntu-latest + needs: check_changelog + strategy: + fail-fast: false + matrix: + include: + - aur_pkg: sunshine + - aur_pkg: sunshine-git + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Dependencies Linux AUR + run: | + sudo apt-get update -y + sudo apt-get install -y \ + cmake + + - name: Configure PKGBUILD files + run: | + mkdir -p artifacts + mkdir -p build + + cd build + cmake -DSUNSHINE_CONFIGURE_AUR=ON -DSUNSHINE_CONFIGURE_ONLY=ON -DSUNSHINE_AUR_PKG=${{ matrix.aur_pkg }} .. + cd .. + + mv ./build/PKGBUILD ./artifacts/ + # mv ./build/.SRCINFO ./artifacts/ + + # mv ./packaging/linux/aur/tmp/* ./artifacts/ + + ls artifacts + + - name: Validate package + uses: hapakaien/archlinux-package-action@v2 + with: + path: artifacts + flags: '--syncdeps --noconfirm' + namcap: true + srcinfo: true + aur: true # workaround mirror problem + + - name: Test artifacts + run: | + ls artifacts + +# - name: PKGBUILD AUR +# uses: sunshinestream/pkgbuild-aur@sunshine-fix +# with: +# pkg-name: artifacts + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: sunshine-linux-aur-${{ matrix.aur_pkg }} + path: artifacts/ + + - name: Setup Publish AUR Variables + if: ${{ github.event_name == 'push' }} + run: | + if [ ${{ github.ref == 'refs/heads/master' && matrix.aur_pkg == 'sunshine' }} ] + then + echo "aur_publish=true" >> $GITHUB_ENV + elif [ ${{ github.ref == 'refs/heads/nightly' && matrix.aur_pkg == 'sunshine-git' }} ] + then + echo "aur_publish=true" >> $GITHUB_ENV + else + echo "aur_publish=false" >> $GITHUB_ENV + fi + + - name: Publish AUR package + if: ${{ env.aur_publish }} + uses: KSXGitHub/github-actions-deploy-aur@v2.2.5 + with: + pkgname: ${{ env.aur_pkgname }} + pkgbuild: ./artifacts/PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + commit_message: Autoupdate from GitHub + build_linux_flatpak: name: Linux Flatpak runs-on: ubuntu-18.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index d37fc1fd..520524ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,16 @@ project(Sunshine VERSION 0.14.0 ) option(SUNSHINE_CONFIGURE_APPIMAGE "Configure files required for AppImage." OFF) +option(SUNSHINE_CONFIGURE_AUR "Configure files required for AUR." OFF) option(SUNSHINE_CONFIGURE_FLATPAK "Configure files required for Flatpak." OFF) option(SUNSHINE_CONFIGURE_PORTFILE "Configure MacOS Portfile." OFF) option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF) if(${SUNSHINE_CONFIGURE_APPIMAGE}) configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY) +elseif(${SUNSHINE_CONFIGURE_AUR}) + configure_file(packaging/linux/aur/${SUNSHINE_AUR_PKG}/.SRCINFO .SRCINFO @ONLY) + configure_file(packaging/linux/aur/${SUNSHINE_AUR_PKG}/PKGBUILD PKGBUILD @ONLY) elseif(${SUNSHINE_CONFIGURE_FLATPAK}) configure_file(packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml com.github.sunshinestream.sunshine.yml @ONLY) elseif(${SUNSHINE_CONFIGURE_PORTFILE}) diff --git a/packaging/linux/aur/sunshine-git/.SRCINFO b/packaging/linux/aur/sunshine-git/.SRCINFO new file mode 100644 index 00000000..490be198 --- /dev/null +++ b/packaging/linux/aur/sunshine-git/.SRCINFO @@ -0,0 +1,35 @@ +pkgbase = sunshine-git + pkgdesc = Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield + pkgver = 0.13.0.957.4b658cd + pkgrel = 1 + url = https://github.com/SunshineStream/sunshine + install = sunshine.install + arch = x86_64 + arch = i686 + license = GPL3 + makedepends = git + makedepends = cmake + makedepends = boost + makedepends = make + depends = boost-libs + depends = ffmpeg4.4 + depends = openssl + depends = libpulse + depends = opus + depends = libxtst + depends = libx11 + depends = libxfixes + depends = libevdev + depends = libxcb + depends = libxrandr + depends = udev + provides = sunshine + conflicts = sunshine + source = sunshine-git::git+https://github.com/SunshineStream/sunshine.git + source = systemd-user-config.patch + source = udev.rules + sha256sums = SKIP + sha256sums = 1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9 + sha256sums = 5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0 + +pkgname = sunshine-git \ No newline at end of file diff --git a/packaging/linux/aur/sunshine-git/PKGBUILD b/packaging/linux/aur/sunshine-git/PKGBUILD new file mode 100644 index 00000000..a590177b --- /dev/null +++ b/packaging/linux/aur/sunshine-git/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: Jacek Szafarkiewicz +# Contributor: Levente Polyak + +pkgname=sunshine-git +pkgver=0.13.0.957.4b658cd +pkgrel=1 +pkgdesc="Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield" +url="https://github.com/SunshineStream/sunshine" +arch=('x86_64' 'i686') +license=('GPL3') + +depends=('boost-libs' 'ffmpeg4.4' 'openssl' 'libpulse' 'opus' 'libxtst' 'libx11' 'libxfixes' 'libevdev' 'libxcb' 'libxrandr' 'udev') +makedepends=('git' 'cmake' 'boost' 'make') + +provides=('sunshine') +conflicts=("sunshine") + +# source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git" +# "systemd-user-config.patch" +# "udev.rules") +source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git") +# sha256sums=('SKIP' +# '1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9' +# '5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0') +sha256sums=('SKIP') +# install=sunshine.install + +_assets_path=/usr/share/sunshine + +pkgver() { + cd "$pkgname" + printf "%s.%s.%s" "$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$pkgname" + git submodule update --recursive --init + + # patch -p1 < ../systemd-user-config.patch +} + +build() { + export CFLAGS="${CFLAGS/-Werror=format-security/}" + export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" + + cmake \ + -S "$pkgname" \ + -B build \ + -Wno-dev \ + -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ + -D SUNSHINE_ASSETS_DIR="$_assets_path" \ + \ + -D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \ + -D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \ + -D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \ + -D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ + -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ + -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so + + make -C build +} + +package() { + pushd "$pkgname/assets" + install -Dvm644 sunshine.conf "$pkgdir/$_assets_path/sunshine.conf" + install -Dvm644 apps_linux.json "$pkgdir/$_assets_path/apps_linux.json" + + find web shaders/opengl -type f -print0 | xargs -0 -I {} install -Dvm644 {} "$pkgdir/$_assets_path/{}" + popd + + pushd build + install -Dvm755 sunshine "$pkgdir/usr/bin/sunshine" + install -Dvm644 sunshine.service "$pkgdir/usr/lib/systemd/user/sunshine.service" + popd + + # install -Dvm644 udev.rules "$pkgdir/usr/lib/udev/rules.d/85-sunshine.rules" +} + +post_install() { + if ! getent group input > /dev/null; then + echo "Creating group input" + groupadd -r input + fi +} + +# vim: ts=2 sw=2 et: diff --git a/packaging/linux/aur/sunshine/.SRCINFO b/packaging/linux/aur/sunshine/.SRCINFO new file mode 100644 index 00000000..2a093d28 --- /dev/null +++ b/packaging/linux/aur/sunshine/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = sunshine + pkgdesc = Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield + pkgver = 0.13.0 + pkgrel = 1 + url = https://github.com/SunshineStream/sunshine + install = sunshine.install + arch = x86_64 + arch = i686 + license = GPL3 + makedepends = git + makedepends = cmake + makedepends = boost + makedepends = make + depends = boost-libs + depends = ffmpeg4.4 + depends = openssl + depends = libpulse + depends = opus + depends = libxtst + depends = libx11 + depends = libxfixes + depends = libevdev + depends = libxcb + depends = libxrandr + depends = udev + source = sunshine::git+https://github.com/SunshineStream/sunshine.git#tag=v0.13.0 + source = systemd-user-config.patch + source = udev.rules + sha256sums = SKIP + sha256sums = 1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9 + sha256sums = 5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0 + +pkgname = sunshine \ No newline at end of file diff --git a/packaging/linux/aur/sunshine/PKGBUILD b/packaging/linux/aur/sunshine/PKGBUILD new file mode 100644 index 00000000..2e857fbe --- /dev/null +++ b/packaging/linux/aur/sunshine/PKGBUILD @@ -0,0 +1,81 @@ +# Maintainer: Jacek Szafarkiewicz + +pkgname=sunshine +pkgver=0.13.0 +pkgrel=1 +pkgdesc="Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield" +url="https://github.com/SunshineStream/sunshine" +arch=('x86_64' 'i686') +license=('GPL3') + +depends=('boost-libs' 'ffmpeg4.4' 'openssl' 'libpulse' 'opus' 'libxtst' 'libx11' 'libxfixes' 'libevdev' 'libxcb' 'libxrandr' 'udev') +makedepends=('git' 'cmake' 'boost' 'make') + +# source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git#tag=v$pkgver" +# "systemd-user-config.patch" +# "udev.rules") +source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git#tag=v$pkgver") +# sha256sums=('SKIP' +# '1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9' +# '5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0') +sha256sums=('SKIP') +# install=sunshine.install + +_assets_path=/usr/share/$pkgname + +prepare() { + cd "$pkgname" + git submodule update --recursive --init + + # patch -p1 < ../systemd-user-config.patch +} + +build() { + export CFLAGS="${CFLAGS/-Werror=format-security/}" + export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" + + cmake \ + -S "$pkgname" \ + -B build \ + -Wno-dev \ + -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ + -D SUNSHINE_ASSETS_DIR="$_assets_path" \ + \ + -D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \ + -D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \ + -D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \ + -D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ + -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so + + make -C build +} + +package() { + pushd "$pkgname/assets" + install -Dvm644 sunshine.conf "$pkgdir/$_assets_path/sunshine.conf" + install -Dvm644 apps_linux.json "$pkgdir/$_assets_path/apps_linux.json" + + find web shaders/opengl -type f -print0 | xargs -0 -I {} install -Dvm644 {} "$pkgdir/$_assets_path/{}" + popd + + pushd build + install -Dvm755 sunshine "$pkgdir/usr/bin/sunshine" + install -Dvm644 sunshine.service "$pkgdir/usr/lib/systemd/user/sunshine.service" + popd + + # install -Dvm644 udev.rules "$pkgdir/usr/lib/udev/rules.d/85-sunshine.rules" +} + +post_install() { + if ! getent group input > /dev/null; then + echo "Creating group input" + groupadd -r input + fi +} + +# vim: ts=2 sw=2 et: diff --git a/packaging/linux/aur/tmp/sunshine.install b/packaging/linux/aur/tmp/sunshine.install new file mode 100644 index 00000000..d10a7a04 --- /dev/null +++ b/packaging/linux/aur/tmp/sunshine.install @@ -0,0 +1,6 @@ +post_install() { + if ! getent group input > /dev/null; then + echo "Creating group input" + groupadd -r input + fi +} diff --git a/packaging/linux/aur/tmp/systemd-user-config.patch b/packaging/linux/aur/tmp/systemd-user-config.patch new file mode 100644 index 00000000..3e872e3e --- /dev/null +++ b/packaging/linux/aur/tmp/systemd-user-config.patch @@ -0,0 +1,14 @@ +diff --git a/sunshine.service.in b/sunshine.service.in +index c0c3828..fe45460 100644 +--- a/sunshine.service.in ++++ b/sunshine.service.in +@@ -2,7 +2,8 @@ + Description=Sunshine Gamestream Server for Moonlight + + [Service] +-ExecStart=@SUNSHINE_EXECUTABLE_PATH@ ++ExecStartPre=/bin/sh -c "test -e %E/sunshine || cp -r '@SUNSHINE_ASSETS_DIR@' '%E/sunshine'" ++ExecStart=@SUNSHINE_EXECUTABLE_PATH@ %E/sunshine/sunshine.conf + + [Install] + WantedBy=graphical-session.target diff --git a/packaging/linux/aur/tmp/udev.rules b/packaging/linux/aur/tmp/udev.rules new file mode 100644 index 00000000..d626ba3f --- /dev/null +++ b/packaging/linux/aur/tmp/udev.rules @@ -0,0 +1 @@ +KERNEL=="uinput", GROUP="input", MODE="0660" From f07171315fa2483dd677d19a3bb11164536b8345 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 19 Jun 2022 16:20:25 -0400 Subject: [PATCH 2/8] Configure PKGBUILD according to github event - Release to AUR on push into `master` - Update AUR installation instructions - Use common linux directories for `PKGBUILD` --- .github/workflows/CI.yml | 95 +++++++++++-------- CMakeLists.txt | 3 +- README.rst | 4 + docs/source/about/installation.rst | 10 ++ packaging/linux/aur/PKGBUILD | 55 +++++++++++ packaging/linux/aur/sunshine-git/.SRCINFO | 35 ------- packaging/linux/aur/sunshine-git/PKGBUILD | 92 ------------------ packaging/linux/aur/sunshine/.SRCINFO | 33 ------- packaging/linux/aur/sunshine/PKGBUILD | 81 ---------------- packaging/linux/aur/tmp/sunshine.install | 6 -- .../linux/aur/tmp/systemd-user-config.patch | 14 --- packaging/linux/aur/tmp/udev.rules | 1 - 12 files changed, 126 insertions(+), 303 deletions(-) create mode 100644 packaging/linux/aur/PKGBUILD delete mode 100644 packaging/linux/aur/sunshine-git/.SRCINFO delete mode 100644 packaging/linux/aur/sunshine-git/PKGBUILD delete mode 100644 packaging/linux/aur/sunshine/.SRCINFO delete mode 100644 packaging/linux/aur/sunshine/PKGBUILD delete mode 100644 packaging/linux/aur/tmp/sunshine.install delete mode 100644 packaging/linux/aur/tmp/systemd-user-config.patch delete mode 100644 packaging/linux/aur/tmp/udev.rules diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4e274b9e..1782cffc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -56,12 +56,6 @@ jobs: name: Linux AUR runs-on: ubuntu-latest needs: check_changelog - strategy: - fail-fast: false - matrix: - include: - - aur_pkg: sunshine - - aur_pkg: sunshine-git steps: - name: Checkout @@ -75,19 +69,60 @@ jobs: - name: Configure PKGBUILD files run: | + # variables for manifest + owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) + repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) + branch=${GITHUB_HEAD_REF} + commit=${{ github.event.pull_request.head.sha }} + + echo "aur_publish=false" >> $GITHUB_ENV + aur_pkg=sunshine-dev + fragment="" + sub_version="" + conflicts="'sunshine'" + provides="'sunshine'" + + # check the branch variable + if [ -z "$branch" ] + then + echo "This is a PUSH event" + branch=branch=${{ github.ref_name }} + commit=${{ github.sha }} + + if [ ${{ github.ref == 'refs/heads/master' }} ] + then + aur_pkg=sunshine-git + # conflicts="" + # provides="" + + echo "aur_publish=true" >> $GITHUB_ENV + elif [ ${{ github.ref == 'refs/heads/nightly' }} ] + then + aur_pkg=sunshine-nightly + sub_version=".r${commit}" + fi + else + echo "This is a PR event" + sub_version=".r${commit}" + fi + + echo "aur_pkg=${aur_pkg}" >> $GITHUB_ENV + + fragment="#commit=${commit}" + + echo "Owner: ${owner}" + echo "Repo: ${repo}" + echo "Branch: ${branch}" + echo "Commit: ${commit}" + mkdir -p artifacts mkdir -p build cd build - cmake -DSUNSHINE_CONFIGURE_AUR=ON -DSUNSHINE_CONFIGURE_ONLY=ON -DSUNSHINE_AUR_PKG=${{ matrix.aur_pkg }} .. + cmake -DSUNSHINE_CONFIGURE_AUR=ON -DSUNSHINE_AUR_PKG=${aur_pkg} -DSUNSHINE_SUB_VERSION=${sub_version} -DSUNSHINE_AUR_CONFLICTS=${conflicts} -DSUNSHINE_AUR_PROVIDES=${provides} -DSUNSHINE_AUR_FRAGMENT=${fragment} -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DSUNSHINE_CONFIGURE_ONLY=ON .. cd .. mv ./build/PKGBUILD ./artifacts/ - # mv ./build/.SRCINFO ./artifacts/ - - # mv ./packaging/linux/aur/tmp/* ./artifacts/ - - ls artifacts - name: Validate package uses: hapakaien/archlinux-package-action@v2 @@ -98,44 +133,26 @@ jobs: srcinfo: true aur: true # workaround mirror problem - - name: Test artifacts - run: | - ls artifacts - -# - name: PKGBUILD AUR -# uses: sunshinestream/pkgbuild-aur@sunshine-fix -# with: -# pkg-name: artifacts - - name: Upload Artifacts + if: ${{ always() }} uses: actions/upload-artifact@v3 with: - name: sunshine-linux-aur-${{ matrix.aur_pkg }} + name: sunshine-linux-aur path: artifacts/ - - name: Setup Publish AUR Variables - if: ${{ github.event_name == 'push' }} - run: | - if [ ${{ github.ref == 'refs/heads/master' && matrix.aur_pkg == 'sunshine' }} ] - then - echo "aur_publish=true" >> $GITHUB_ENV - elif [ ${{ github.ref == 'refs/heads/nightly' && matrix.aur_pkg == 'sunshine-git' }} ] - then - echo "aur_publish=true" >> $GITHUB_ENV - else - echo "aur_publish=false" >> $GITHUB_ENV - fi - - name: Publish AUR package - if: ${{ env.aur_publish }} - uses: KSXGitHub/github-actions-deploy-aur@v2.2.5 + if: ${{ env.aur_publish == 'true' }} + uses: KSXGitHub/github-actions-deploy-aur@master # assets arg not in latest release with: - pkgname: ${{ env.aur_pkgname }} + pkgname: ${{ env.aur_pkg }} pkgbuild: ./artifacts/PKGBUILD + assets: | + ./artifacts/* commit_username: ${{ secrets.AUR_USERNAME }} commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} - commit_message: Autoupdate from GitHub + commit_message: Release ${{ needs.check_changelog.outputs.next_version }} + allow_empty_commits: false build_linux_flatpak: name: Linux Flatpak diff --git a/CMakeLists.txt b/CMakeLists.txt index 520524ba..e74c7b9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,7 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF) if(${SUNSHINE_CONFIGURE_APPIMAGE}) configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY) elseif(${SUNSHINE_CONFIGURE_AUR}) - configure_file(packaging/linux/aur/${SUNSHINE_AUR_PKG}/.SRCINFO .SRCINFO @ONLY) - configure_file(packaging/linux/aur/${SUNSHINE_AUR_PKG}/PKGBUILD PKGBUILD @ONLY) + configure_file(packaging/linux/aur/PKGBUILD PKGBUILD @ONLY) elseif(${SUNSHINE_CONFIGURE_FLATPAK}) configure_file(packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml com.github.sunshinestream.sunshine.yml @ONLY) elseif(${SUNSHINE_CONFIGURE_PORTFILE}) diff --git a/README.rst b/README.rst index 24d0c161..0e24b0cd 100644 --- a/README.rst +++ b/README.rst @@ -60,6 +60,10 @@ Downloads :alt: GitHub Releases :target: https://github.com/SunshineStream/Sunshine/releases/latest +.. image:: https://img.shields.io/aur/version/sunshine-git?style=for-the-badge&logo=archlinux + :alt: AUR version + :target: https://aur.archlinux.org/packages/sunshine-git + .. comment image:: https://img.shields.io/docker/pulls/sunshinestream/sunshine?style=for-the-badge&logo=docker :alt: Docker diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 9973b820..6609b429 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -44,6 +44,16 @@ According to AppImageLint the AppImage can run on the following distros. #. Download ``sunshine-appimage.zip`` and extract the contents to your home directory. +AUR Package +^^^^^^^^^^^ +#. Open terminal and run the following code. + + .. code-block:: bash + + git clone https://aur.archlinux.org/sunshine-git.git + cd sunshine-git + makepkg -fi + Debian Package ^^^^^^^^^^^^^^ .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/pkg:deb?logo=github&style=for-the-badge diff --git a/packaging/linux/aur/PKGBUILD b/packaging/linux/aur/PKGBUILD new file mode 100644 index 00000000..6c6e31b3 --- /dev/null +++ b/packaging/linux/aur/PKGBUILD @@ -0,0 +1,55 @@ +# Edit on github: https://github.com/SunshineStream/Sunshine/tree/nightly/packaging/linux/aur/PKGBUILD +# Reference: https://wiki.archlinux.org/title/PKGBUILD + +pkgname=@SUNSHINE_AUR_PKG@ +pkgver=@PROJECT_VERSION@@SUNSHINE_SUB_VERSION@ +pkgrel=1 +pkgdesc="@PROJECT_DESCRIPTION@" +arch=('x86_64' 'i686') +url=@PROJECT_HOMEPAGE_URL@ +license=('GPL3') + +depends=('boost-libs' 'ffmpeg4.4' 'libpulse' 'libevdev' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'openssl' 'opus' 'udev') +makedepends=('git' 'cmake' 'boost' 'make') +optdepends=('cuda' 'libdrm' 'libcap') + +provides=(@SUNSHINE_AUR_PROVIDES@) +conflicts=(@SUNSHINE_AUR_CONFLICTS@) + +source=("$pkgname::git+https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@.git@SUNSHINE_AUR_FRAGMENT@") +sha256sums=('SKIP') + +prepare() { + cd "$pkgname" + git submodule update --recursive --init +} + +build() { + export CFLAGS="${CFLAGS/-Werror=format-security/}" + export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" + + cmake \ + -S "$pkgname" \ + -B build \ + -Wno-dev \ + -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ + -D CMAKE_INSTALL_PREFIX="/usr" \ + -D SUNSHINE_ASSETS_DIR="local/sunshine/assets" \ + -D SUNSHINE_CONFIG_DIR="local/sunshine/config" \ + -D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \ + -D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \ + -D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \ + -D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ + -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ + -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so + + make -C build +} + +package() { + make -C build install DESTDIR="$pkgdir" +} diff --git a/packaging/linux/aur/sunshine-git/.SRCINFO b/packaging/linux/aur/sunshine-git/.SRCINFO deleted file mode 100644 index 490be198..00000000 --- a/packaging/linux/aur/sunshine-git/.SRCINFO +++ /dev/null @@ -1,35 +0,0 @@ -pkgbase = sunshine-git - pkgdesc = Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield - pkgver = 0.13.0.957.4b658cd - pkgrel = 1 - url = https://github.com/SunshineStream/sunshine - install = sunshine.install - arch = x86_64 - arch = i686 - license = GPL3 - makedepends = git - makedepends = cmake - makedepends = boost - makedepends = make - depends = boost-libs - depends = ffmpeg4.4 - depends = openssl - depends = libpulse - depends = opus - depends = libxtst - depends = libx11 - depends = libxfixes - depends = libevdev - depends = libxcb - depends = libxrandr - depends = udev - provides = sunshine - conflicts = sunshine - source = sunshine-git::git+https://github.com/SunshineStream/sunshine.git - source = systemd-user-config.patch - source = udev.rules - sha256sums = SKIP - sha256sums = 1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9 - sha256sums = 5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0 - -pkgname = sunshine-git \ No newline at end of file diff --git a/packaging/linux/aur/sunshine-git/PKGBUILD b/packaging/linux/aur/sunshine-git/PKGBUILD deleted file mode 100644 index a590177b..00000000 --- a/packaging/linux/aur/sunshine-git/PKGBUILD +++ /dev/null @@ -1,92 +0,0 @@ -# Maintainer: Jacek Szafarkiewicz -# Contributor: Levente Polyak - -pkgname=sunshine-git -pkgver=0.13.0.957.4b658cd -pkgrel=1 -pkgdesc="Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield" -url="https://github.com/SunshineStream/sunshine" -arch=('x86_64' 'i686') -license=('GPL3') - -depends=('boost-libs' 'ffmpeg4.4' 'openssl' 'libpulse' 'opus' 'libxtst' 'libx11' 'libxfixes' 'libevdev' 'libxcb' 'libxrandr' 'udev') -makedepends=('git' 'cmake' 'boost' 'make') - -provides=('sunshine') -conflicts=("sunshine") - -# source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git" -# "systemd-user-config.patch" -# "udev.rules") -source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git") -# sha256sums=('SKIP' -# '1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9' -# '5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0') -sha256sums=('SKIP') -# install=sunshine.install - -_assets_path=/usr/share/sunshine - -pkgver() { - cd "$pkgname" - printf "%s.%s.%s" "$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" -} - -prepare() { - cd "$pkgname" - git submodule update --recursive --init - - # patch -p1 < ../systemd-user-config.patch -} - -build() { - export CFLAGS="${CFLAGS/-Werror=format-security/}" - export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" - - cmake \ - -S "$pkgname" \ - -B build \ - -Wno-dev \ - -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -D SUNSHINE_ASSETS_DIR="$_assets_path" \ - \ - -D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \ - -D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \ - -D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \ - -D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ - -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ - -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so - - make -C build -} - -package() { - pushd "$pkgname/assets" - install -Dvm644 sunshine.conf "$pkgdir/$_assets_path/sunshine.conf" - install -Dvm644 apps_linux.json "$pkgdir/$_assets_path/apps_linux.json" - - find web shaders/opengl -type f -print0 | xargs -0 -I {} install -Dvm644 {} "$pkgdir/$_assets_path/{}" - popd - - pushd build - install -Dvm755 sunshine "$pkgdir/usr/bin/sunshine" - install -Dvm644 sunshine.service "$pkgdir/usr/lib/systemd/user/sunshine.service" - popd - - # install -Dvm644 udev.rules "$pkgdir/usr/lib/udev/rules.d/85-sunshine.rules" -} - -post_install() { - if ! getent group input > /dev/null; then - echo "Creating group input" - groupadd -r input - fi -} - -# vim: ts=2 sw=2 et: diff --git a/packaging/linux/aur/sunshine/.SRCINFO b/packaging/linux/aur/sunshine/.SRCINFO deleted file mode 100644 index 2a093d28..00000000 --- a/packaging/linux/aur/sunshine/.SRCINFO +++ /dev/null @@ -1,33 +0,0 @@ -pkgbase = sunshine - pkgdesc = Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield - pkgver = 0.13.0 - pkgrel = 1 - url = https://github.com/SunshineStream/sunshine - install = sunshine.install - arch = x86_64 - arch = i686 - license = GPL3 - makedepends = git - makedepends = cmake - makedepends = boost - makedepends = make - depends = boost-libs - depends = ffmpeg4.4 - depends = openssl - depends = libpulse - depends = opus - depends = libxtst - depends = libx11 - depends = libxfixes - depends = libevdev - depends = libxcb - depends = libxrandr - depends = udev - source = sunshine::git+https://github.com/SunshineStream/sunshine.git#tag=v0.13.0 - source = systemd-user-config.patch - source = udev.rules - sha256sums = SKIP - sha256sums = 1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9 - sha256sums = 5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0 - -pkgname = sunshine \ No newline at end of file diff --git a/packaging/linux/aur/sunshine/PKGBUILD b/packaging/linux/aur/sunshine/PKGBUILD deleted file mode 100644 index 2e857fbe..00000000 --- a/packaging/linux/aur/sunshine/PKGBUILD +++ /dev/null @@ -1,81 +0,0 @@ -# Maintainer: Jacek Szafarkiewicz - -pkgname=sunshine -pkgver=0.13.0 -pkgrel=1 -pkgdesc="Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield" -url="https://github.com/SunshineStream/sunshine" -arch=('x86_64' 'i686') -license=('GPL3') - -depends=('boost-libs' 'ffmpeg4.4' 'openssl' 'libpulse' 'opus' 'libxtst' 'libx11' 'libxfixes' 'libevdev' 'libxcb' 'libxrandr' 'udev') -makedepends=('git' 'cmake' 'boost' 'make') - -# source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git#tag=v$pkgver" -# "systemd-user-config.patch" -# "udev.rules") -source=("$pkgname::git+https://github.com/SunshineStream/sunshine.git#tag=v$pkgver") -# sha256sums=('SKIP' -# '1642eb8672b137e94aa16e4aadde37f68bf1920dfadd1325cca480d7731f38c9' -# '5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0') -sha256sums=('SKIP') -# install=sunshine.install - -_assets_path=/usr/share/$pkgname - -prepare() { - cd "$pkgname" - git submodule update --recursive --init - - # patch -p1 < ../systemd-user-config.patch -} - -build() { - export CFLAGS="${CFLAGS/-Werror=format-security/}" - export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" - - cmake \ - -S "$pkgname" \ - -B build \ - -Wno-dev \ - -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -D SUNSHINE_ASSETS_DIR="$_assets_path" \ - \ - -D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \ - -D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \ - -D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \ - -D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \ - -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ - -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so - - make -C build -} - -package() { - pushd "$pkgname/assets" - install -Dvm644 sunshine.conf "$pkgdir/$_assets_path/sunshine.conf" - install -Dvm644 apps_linux.json "$pkgdir/$_assets_path/apps_linux.json" - - find web shaders/opengl -type f -print0 | xargs -0 -I {} install -Dvm644 {} "$pkgdir/$_assets_path/{}" - popd - - pushd build - install -Dvm755 sunshine "$pkgdir/usr/bin/sunshine" - install -Dvm644 sunshine.service "$pkgdir/usr/lib/systemd/user/sunshine.service" - popd - - # install -Dvm644 udev.rules "$pkgdir/usr/lib/udev/rules.d/85-sunshine.rules" -} - -post_install() { - if ! getent group input > /dev/null; then - echo "Creating group input" - groupadd -r input - fi -} - -# vim: ts=2 sw=2 et: diff --git a/packaging/linux/aur/tmp/sunshine.install b/packaging/linux/aur/tmp/sunshine.install deleted file mode 100644 index d10a7a04..00000000 --- a/packaging/linux/aur/tmp/sunshine.install +++ /dev/null @@ -1,6 +0,0 @@ -post_install() { - if ! getent group input > /dev/null; then - echo "Creating group input" - groupadd -r input - fi -} diff --git a/packaging/linux/aur/tmp/systemd-user-config.patch b/packaging/linux/aur/tmp/systemd-user-config.patch deleted file mode 100644 index 3e872e3e..00000000 --- a/packaging/linux/aur/tmp/systemd-user-config.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/sunshine.service.in b/sunshine.service.in -index c0c3828..fe45460 100644 ---- a/sunshine.service.in -+++ b/sunshine.service.in -@@ -2,7 +2,8 @@ - Description=Sunshine Gamestream Server for Moonlight - - [Service] --ExecStart=@SUNSHINE_EXECUTABLE_PATH@ -+ExecStartPre=/bin/sh -c "test -e %E/sunshine || cp -r '@SUNSHINE_ASSETS_DIR@' '%E/sunshine'" -+ExecStart=@SUNSHINE_EXECUTABLE_PATH@ %E/sunshine/sunshine.conf - - [Install] - WantedBy=graphical-session.target diff --git a/packaging/linux/aur/tmp/udev.rules b/packaging/linux/aur/tmp/udev.rules deleted file mode 100644 index d626ba3f..00000000 --- a/packaging/linux/aur/tmp/udev.rules +++ /dev/null @@ -1 +0,0 @@ -KERNEL=="uinput", GROUP="input", MODE="0660" From 54221ae93800b21e10377da56f30741cfdeaa1ba Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 20 Jun 2022 18:55:35 -0400 Subject: [PATCH 3/8] Use cached responses for AUR badges --- README.rst | 4 ++-- docs/source/about/third_party_packages.rst | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 0e24b0cd..bc2e01e0 100644 --- a/README.rst +++ b/README.rst @@ -60,8 +60,8 @@ Downloads :alt: GitHub Releases :target: https://github.com/SunshineStream/Sunshine/releases/latest -.. image:: https://img.shields.io/aur/version/sunshine-git?style=for-the-badge&logo=archlinux - :alt: AUR version +.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=AUR&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fgithub.com%2FSunshineStream%2Fservice-repo%2Freleases%2Fdownload%2Fdaily%2Faur_sunshine-git.json&logo=archlinux + :alt: AUR votes :target: https://aur.archlinux.org/packages/sunshine-git .. comment diff --git a/docs/source/about/third_party_packages.rst b/docs/source/about/third_party_packages.rst index 7877e09c..99c7e96c 100644 --- a/docs/source/about/third_party_packages.rst +++ b/docs/source/about/third_party_packages.rst @@ -8,17 +8,14 @@ Third Party Packages AUR (Arch Linux User Repository) -------------------------------- -.. image:: https://img.shields.io/aur/version/sunshine?style=for-the-badge&logo=archlinux +.. image:: https://img.shields.io/badge/dynamic/json?color=orange&label=AUR&style=for-the-badge&prefix=v&query=$.results.0.Version&url=https%3A%2F%2Fgithub.com%2FSunshineStream%2Fservice-repo%2Freleases%2Fdownload%2Fdaily%2Faur_sunshine.json&logo=archlinux :alt: AUR version :target: https://aur.archlinux.org/packages/sunshine -.. image:: https://img.shields.io/aur/last-modified/sunshine?style=for-the-badge&logo=archlinux - :alt: AUR last modified - -.. image:: https://img.shields.io/aur/votes/sunshine?style=for-the-badge&logo=archlinux +.. image:: https://img.shields.io/badge/dynamic/json?color=yellowgreen&label=votes&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fgithub.com%2FSunshineStream%2Fservice-repo%2Freleases%2Fdownload%2Fdaily%2Faur_sunshine.json&logo=archlinux :alt: AUR votes -.. image:: https://img.shields.io/aur/maintainer/sunshine?style=for-the-badge&logo=archlinux +.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=maintainer&style=for-the-badge&query=$.results.0.Maintainer&url=https%3A%2F%2Fgithub.com%2FSunshineStream%2Fservice-repo%2Freleases%2Fdownload%2Fdaily%2Faur_sunshine.json&logo=archlinux :alt: AUR maintainer Chocolatey From 2b76111e51432308f9913649e47ff596e284045f Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 20 Jun 2022 19:44:20 -0400 Subject: [PATCH 4/8] Remove AUR from issue template config --- .github/ISSUE_TEMPLATE/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index c96ec16d..25157730 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,8 @@ blank_issues_enabled: false contact_links: - - name: AUR Package Issue - url: https://aur.archlinux.org/packages/sunshine - about: AUR Package Issues should be discussed on the AUR - name: Github Discussions url: https://github.com/SunshineStream/Sunshine/discussions about: General discussion, support, feature requests and more! - name: Discord support - url: https://discord.com/invite/CGg5JxN + url: https://sunshinestream.github.io/discord_join about: Ask question about Sunshine in Discord From 8fc8884dbcae11dfbf92e15b4948692ccdea502b Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 20 Jun 2022 20:35:19 -0400 Subject: [PATCH 5/8] Update PKGBUILD - Add `avahi` as dependency - Order dependencies in alphabetical order - Use fast compilation for `make` command --- packaging/linux/aur/PKGBUILD | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/linux/aur/PKGBUILD b/packaging/linux/aur/PKGBUILD index 6c6e31b3..ace00a5b 100644 --- a/packaging/linux/aur/PKGBUILD +++ b/packaging/linux/aur/PKGBUILD @@ -9,9 +9,9 @@ arch=('x86_64' 'i686') url=@PROJECT_HOMEPAGE_URL@ license=('GPL3') -depends=('boost-libs' 'ffmpeg4.4' 'libpulse' 'libevdev' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'openssl' 'opus' 'udev') -makedepends=('git' 'cmake' 'boost' 'make') -optdepends=('cuda' 'libdrm' 'libcap') +depends=('avahi' 'boost-libs' 'ffmpeg4.4' 'libevdev' 'libpulse' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'openssl' 'opus' 'udev') +makedepends=('boost' 'cmake' 'git' 'make') +optdepends=('cuda' 'libcap' 'libdrm') provides=(@SUNSHINE_AUR_PROVIDES@) conflicts=(@SUNSHINE_AUR_CONFLICTS@) @@ -47,7 +47,7 @@ build() { -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so - make -C build + make -C build -j ${nproc} } package() { From 270d4ddffed16bf403b00537bef1510d27ab3957 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 23 Jun 2022 23:36:06 -0400 Subject: [PATCH 6/8] Fix paths for AUR and... - Rename udev rules file - Refactor CI to properly collect clone url for PRs (AUR only) --- .github/workflows/CI.yml | 30 +++++++------------ CMakeLists.txt | 2 +- docs/source/about/usage.rst | 2 +- packaging/linux/aur/PKGBUILD | 8 ++--- ...sunshine-rules.rules => 85-sunshine.rules} | 0 5 files changed, 17 insertions(+), 25 deletions(-) rename src_assets/linux/misc/{85-sunshine-rules.rules => 85-sunshine.rules} (100%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1782cffc..18fb421b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -70,56 +70,48 @@ jobs: - name: Configure PKGBUILD files run: | # variables for manifest - owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) - repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) - branch=${GITHUB_HEAD_REF} - commit=${{ github.event.pull_request.head.sha }} - echo "aur_publish=false" >> $GITHUB_ENV aur_pkg=sunshine-dev - fragment="" sub_version="" conflicts="'sunshine'" provides="'sunshine'" + branch=${GITHUB_HEAD_REF} + # check the branch variable if [ -z "$branch" ] then echo "This is a PUSH event" - branch=branch=${{ github.ref_name }} commit=${{ github.sha }} + clone_url=${{ github.event.repository.clone_url }} - if [ ${{ github.ref == 'refs/heads/master' }} ] - then + if [[ ${{ github.ref == 'refs/heads/master' }} ]]; then aur_pkg=sunshine-git # conflicts="" # provides="" echo "aur_publish=true" >> $GITHUB_ENV - elif [ ${{ github.ref == 'refs/heads/nightly' }} ] - then + elif [[ ${{ github.ref == 'refs/heads/nightly' }} ]]; then aur_pkg=sunshine-nightly sub_version=".r${commit}" fi else echo "This is a PR event" + commit=${{ github.event.pull_request.head.sha }} + clone_url=${{ github.event.pull_request.head.repo.clone_url }} + sub_version=".r${commit}" fi + echo "Commit: ${commit}" + echo "Clone URL: ${clone_url}" echo "aur_pkg=${aur_pkg}" >> $GITHUB_ENV - fragment="#commit=${commit}" - - echo "Owner: ${owner}" - echo "Repo: ${repo}" - echo "Branch: ${branch}" - echo "Commit: ${commit}" - mkdir -p artifacts mkdir -p build cd build - cmake -DSUNSHINE_CONFIGURE_AUR=ON -DSUNSHINE_AUR_PKG=${aur_pkg} -DSUNSHINE_SUB_VERSION=${sub_version} -DSUNSHINE_AUR_CONFLICTS=${conflicts} -DSUNSHINE_AUR_PROVIDES=${provides} -DSUNSHINE_AUR_FRAGMENT=${fragment} -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DSUNSHINE_CONFIGURE_ONLY=ON .. + cmake -DSUNSHINE_CONFIGURE_AUR=ON -DSUNSHINE_AUR_PKG=${aur_pkg} -DSUNSHINE_SUB_VERSION=${sub_version} -DSUNSHINE_AUR_CONFLICTS=${conflicts} -DSUNSHINE_AUR_PROVIDES=${provides} -DGITHUB_CLONE_URL=${clone_url} -DGITHUB_COMMIT=${commit} -DSUNSHINE_CONFIGURE_ONLY=ON .. cd .. mv ./build/PKGBUILD ./artifacts/ diff --git a/CMakeLists.txt b/CMakeLists.txt index e74c7b9f..02ddfadb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -594,7 +594,7 @@ if(UNIX AND NOT APPLE) install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${CMAKE_INSTALL_LIBDIR}/udev/rules.d") install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user") diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index 8ae0287c..b29873da 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -68,7 +68,7 @@ Sunshine needs access to `uinput` to create mouse and gamepad events. #. Create `udev` rules. .. code-block:: bash - sudo nano /etc/udev/rules.d/85-sunshine-input.rules + sudo nano /etc/udev/rules.d/85-sunshine.rules Input the following contents. diff --git a/packaging/linux/aur/PKGBUILD b/packaging/linux/aur/PKGBUILD index ace00a5b..be0e38fe 100644 --- a/packaging/linux/aur/PKGBUILD +++ b/packaging/linux/aur/PKGBUILD @@ -16,7 +16,7 @@ optdepends=('cuda' 'libcap' 'libdrm') provides=(@SUNSHINE_AUR_PROVIDES@) conflicts=(@SUNSHINE_AUR_CONFLICTS@) -source=("$pkgname::git+https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@.git@SUNSHINE_AUR_FRAGMENT@") +source=("$pkgname::git+@GITHUB_CLONE_URL@#commit=@GITHUB_COMMIT@") sha256sums=('SKIP') prepare() { @@ -34,8 +34,8 @@ build() { -Wno-dev \ -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ -D CMAKE_INSTALL_PREFIX="/usr" \ - -D SUNSHINE_ASSETS_DIR="local/sunshine/assets" \ - -D SUNSHINE_CONFIG_DIR="local/sunshine/config" \ + -D SUNSHINE_ASSETS_DIR="share/sunshine/assets" \ + -D SUNSHINE_CONFIG_DIR="share/sunshine/config" \ -D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ -D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \ -D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ @@ -47,7 +47,7 @@ build() { -D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \ -D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so - make -C build -j ${nproc} + make -C build } package() { diff --git a/src_assets/linux/misc/85-sunshine-rules.rules b/src_assets/linux/misc/85-sunshine.rules similarity index 100% rename from src_assets/linux/misc/85-sunshine-rules.rules rename to src_assets/linux/misc/85-sunshine.rules From 3b2226c4ea8183748840e601d5fc9c7c17488df0 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 28 Jun 2022 20:39:33 -0400 Subject: [PATCH 7/8] Add paths for aur package --- docs/source/about/advanced_usage.rst | 18 ++++++++++-------- docs/source/about/usage.rst | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index e0903223..3aefa0ea 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -17,14 +17,16 @@ location by modifying the configuration file. .. table:: :widths: auto - ======= =========== - Value Description - ======= =========== - Docker /config/ - Linux /usr/local/sunshine/config/ - MacOS /usr/local/sunshine/config/ - Windows ./config/ - ======= =========== + ========= =========== + Value Description + ========= =========== + Docker /config/ + Linux-aur /usr/share/sunshine/config/ + Linux-deb /usr/local/sunshine/config/ + Linux-rpm /usr/local/sunshine/config/ + MacOS /usr/local/sunshine/config/ + Windows ./config/ + ========= =========== Example .. code-block:: bash diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index b29873da..a591cca5 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -102,6 +102,7 @@ Sunshine needs access to `uinput` to create mouse and gamepad events. ======== ============================================== =============== package ExecStart Auto Configured ======== ============================================== =============== + aur /usr/bin/sunshine ✔ deb /usr/bin/sunshine ✔ rpm /usr/bin/sunshine ✔ AppImage ~/sunshine.AppImage ✖ From 819501c4e7f7497bbf50908445cf8361e43666fb Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 28 Jun 2022 20:39:58 -0400 Subject: [PATCH 8/8] Use v2.3.0 of `KSXGitHub/github-actions-deploy-aur` action --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 18fb421b..f8c1c8d9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -134,7 +134,7 @@ jobs: - name: Publish AUR package if: ${{ env.aur_publish == 'true' }} - uses: KSXGitHub/github-actions-deploy-aur@master # assets arg not in latest release + uses: KSXGitHub/github-actions-deploy-aur@v2.3.0 with: pkgname: ${{ env.aur_pkg }} pkgbuild: ./artifacts/PKGBUILD