Fix paths for AUR and...

- Rename udev rules file
- Refactor CI to properly collect clone url for PRs (AUR only)
This commit is contained in:
ReenigneArcher 2022-06-23 23:36:06 -04:00
parent 8fc8884dbc
commit 270d4ddffe
5 changed files with 17 additions and 25 deletions

View File

@ -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/

View File

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

View File

@ -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.

View File

@ -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() {