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