mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-12-06 23:36:10 +09:00
fix(packaging): enforce Arch PKGBUILD lint (#6229)
This commit is contained in:
1 parent
139dbd7ccb
commit
fece579169
2 files changed
+11
-16
No files matched your search
@@ -134,8 +134,12 @@ jobs:
|
||||
# Run Xvfb for headless testing
|
||||
Xvfb "${DISPLAY}" -screen 0 1024x768x24 &
|
||||
|
||||
# Check PKGBUILD
|
||||
sudo -u builder namcap -i PKGBUILD
|
||||
# Fail the build on PKGBUILD warnings and errors.
|
||||
report=$(sudo -u builder namcap -i PKGBUILD)
|
||||
printf '%s\n' "$report"
|
||||
if grep -qE '^PKGBUILD( \([^)]*\))? [EW]:' <<< "$report"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Export PKGBUILD options so they're available to makepkg
|
||||
export _use_cuda="${_use_cuda}"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Maintainer: SunshineStream
|
||||
# Sunshine issues: https://github.com/SunshineStream/Sunshine/issues
|
||||
# Pacman repository issues: https://github.com/LizardByte/pacman-repo/issues
|
||||
# Edit on github: https://github.com/SunshineStream/Sunshine/blob/master/packaging/linux/Arch/PKGBUILD
|
||||
# Reference: https://wiki.archlinux.org/title/PKGBUILD
|
||||
|
||||
@@ -95,8 +98,9 @@ if [[ "${_use_cuda::1}" == "d" ]] && pacman -Qi cuda &> /dev/null; then
|
||||
fi
|
||||
|
||||
if [[ "${_use_cuda::1}" == "t" ]]; then
|
||||
optdepends+=(
|
||||
optdepends=(
|
||||
'cuda: Nvidia GPU encoding support'
|
||||
"${optdepends[@]}"
|
||||
)
|
||||
fi
|
||||
|
||||
@@ -106,19 +110,6 @@ if [[ "${_support_headless_testing::1}" == "t" ]]; then
|
||||
)
|
||||
fi
|
||||
|
||||
# Ensure makedepends, checkdepends, optdepends are sorted
|
||||
if [ -n "${makedepends+x}" ]; then
|
||||
mapfile -t tmp_array < <(printf '%s\n' "${makedepends[@]}" | sort)
|
||||
makedepends=("${tmp_array[@]}")
|
||||
unset tmp_array
|
||||
fi
|
||||
|
||||
if [ -n "${optdepends+x}" ]; then
|
||||
mapfile -t tmp_array < <(printf '%s\n' "${optdepends[@]}" | sort)
|
||||
optdepends=("${tmp_array[@]}")
|
||||
unset tmp_array
|
||||
fi
|
||||
|
||||
prepare() {
|
||||
cd "$pkgname"
|
||||
git submodule update --recursive --init --depth 1
|
||||
|
||||
Reference in new issue
Block a user