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:
+11
-19
@@ -70,56 +70,48 @@ jobs:
|
|||||||
- name: Configure PKGBUILD files
|
- name: Configure PKGBUILD files
|
||||||
run: |
|
run: |
|
||||||
# variables for manifest
|
# 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
|
echo "aur_publish=false" >> $GITHUB_ENV
|
||||||
aur_pkg=sunshine-dev
|
aur_pkg=sunshine-dev
|
||||||
fragment=""
|
|
||||||
sub_version=""
|
sub_version=""
|
||||||
conflicts="'sunshine'"
|
conflicts="'sunshine'"
|
||||||
provides="'sunshine'"
|
provides="'sunshine'"
|
||||||
|
|
||||||
|
branch=${GITHUB_HEAD_REF}
|
||||||
|
|
||||||
# check the branch variable
|
# check the branch variable
|
||||||
if [ -z "$branch" ]
|
if [ -z "$branch" ]
|
||||||
then
|
then
|
||||||
echo "This is a PUSH event"
|
echo "This is a PUSH event"
|
||||||
branch=branch=${{ github.ref_name }}
|
|
||||||
commit=${{ github.sha }}
|
commit=${{ github.sha }}
|
||||||
|
clone_url=${{ github.event.repository.clone_url }}
|
||||||
|
|
||||||
if [ ${{ github.ref == 'refs/heads/master' }} ]
|
if [[ ${{ github.ref == 'refs/heads/master' }} ]]; then
|
||||||
then
|
|
||||||
aur_pkg=sunshine-git
|
aur_pkg=sunshine-git
|
||||||
# conflicts=""
|
# conflicts=""
|
||||||
# provides=""
|
# provides=""
|
||||||
|
|
||||||
echo "aur_publish=true" >> $GITHUB_ENV
|
echo "aur_publish=true" >> $GITHUB_ENV
|
||||||
elif [ ${{ github.ref == 'refs/heads/nightly' }} ]
|
elif [[ ${{ github.ref == 'refs/heads/nightly' }} ]]; then
|
||||||
then
|
|
||||||
aur_pkg=sunshine-nightly
|
aur_pkg=sunshine-nightly
|
||||||
sub_version=".r${commit}"
|
sub_version=".r${commit}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "This is a PR event"
|
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}"
|
sub_version=".r${commit}"
|
||||||
fi
|
fi
|
||||||
|
echo "Commit: ${commit}"
|
||||||
|
echo "Clone URL: ${clone_url}"
|
||||||
|
|
||||||
echo "aur_pkg=${aur_pkg}" >> $GITHUB_ENV
|
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 artifacts
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
|
|
||||||
cd 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 ..
|
cd ..
|
||||||
|
|
||||||
mv ./build/PKGBUILD ./artifacts/
|
mv ./build/PKGBUILD ./artifacts/
|
||||||
|
|||||||
+1
-1
@@ -594,7 +594,7 @@ if(UNIX AND NOT APPLE)
|
|||||||
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
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(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Sunshine needs access to `uinput` to create mouse and gamepad events.
|
|||||||
#. Create `udev` rules.
|
#. Create `udev` rules.
|
||||||
.. code-block:: bash
|
.. 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.
|
Input the following contents.
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ optdepends=('cuda' 'libcap' 'libdrm')
|
|||||||
provides=(@SUNSHINE_AUR_PROVIDES@)
|
provides=(@SUNSHINE_AUR_PROVIDES@)
|
||||||
conflicts=(@SUNSHINE_AUR_CONFLICTS@)
|
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')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
@@ -34,8 +34,8 @@ build() {
|
|||||||
-Wno-dev \
|
-Wno-dev \
|
||||||
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
||||||
-D CMAKE_INSTALL_PREFIX="/usr" \
|
-D CMAKE_INSTALL_PREFIX="/usr" \
|
||||||
-D SUNSHINE_ASSETS_DIR="local/sunshine/assets" \
|
-D SUNSHINE_ASSETS_DIR="share/sunshine/assets" \
|
||||||
-D SUNSHINE_CONFIG_DIR="local/sunshine/config" \
|
-D SUNSHINE_CONFIG_DIR="share/sunshine/config" \
|
||||||
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||||
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
|
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
|
||||||
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||||
@@ -47,7 +47,7 @@ build() {
|
|||||||
-D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
-D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||||
-D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so
|
-D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so
|
||||||
|
|
||||||
make -C build -j ${nproc}
|
make -C build
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
|||||||
Reference in New Issue
Block a user