Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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
94 changes: 94 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,100 @@ 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

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: |
# variables for manifest
echo "aur_publish=false" >> $GITHUB_ENV
aur_pkg=sunshine-dev
sub_version=""
conflicts="'sunshine'"
provides="'sunshine'"

branch=${GITHUB_HEAD_REF}

# check the branch variable
if [ -z "$branch" ]
then
echo "This is a PUSH event"
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}

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"
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

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} -DGITHUB_CLONE_URL=${clone_url} -DGITHUB_COMMIT=${commit} -DSUNSHINE_CONFIGURE_ONLY=ON ..
cd ..

mv ./build/PKGBUILD ./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: Upload Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: sunshine-linux-aur
path: artifacts/

- name: Publish AUR package
if: ${{ env.aur_publish == 'true' }}
uses: KSXGitHub/github-actions-deploy-aur@v2.3.0
with:
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: Release ${{ needs.check_changelog.outputs.next_version }}
allow_empty_commits: false

build_linux_flatpak:
name: Linux Flatpak
runs-on: ubuntu-18.04
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ 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/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})
Expand Down Expand Up @@ -591,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")
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ Downloads
:alt: GitHub Releases
:target: https://github.com/SunshineStream/Sunshine/releases/latest

.. 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
image:: https://img.shields.io/docker/pulls/sunshinestream/sunshine?style=for-the-badge&logo=docker
:alt: Docker
Expand Down
18 changes: 10 additions & 8 deletions docs/source/about/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions docs/source/about/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions docs/source/about/third_party_packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/source/about/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 ✖
Expand Down
55 changes: 55 additions & 0 deletions packaging/linux/aur/PKGBUILD
Original file line number Diff line number Diff line change
@@ -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=('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@)

source=("$pkgname::git+@GITHUB_CLONE_URL@#commit=@GITHUB_COMMIT@")
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="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 \
-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"
}