diff --git a/README.md b/README.md index 950a6d7..5084b41 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ source in the `PKGBUILD` (and drop the `-bin` suffix), or don't package it. | `modrinth-enhanced-bin` | [Felitendo/Modrinth-Enhanced](https://github.com/Felitendo/Modrinth-Enhanced) — prebuilt release of `modrinth-enhanced` | `.deb` | [modrinth-enhanced-bin](https://aur.archlinux.org/packages/modrinth-enhanced-bin) | | `moondeckbuddy` | [FrogTheFrog/moondeck-buddy](https://github.com/FrogTheFrog/moondeck-buddy) — host companion of the MoonDeck Steam Deck plugin (C++/Qt6) | *built from source* | [moondeckbuddy](https://aur.archlinux.org/packages/moondeckbuddy) | | `moondeckbuddy-bin` | [FrogTheFrog/moondeck-buddy](https://github.com/FrogTheFrog/moondeck-buddy) — prebuilt release of `moondeckbuddy` | AppImage | *not published yet* | +| `moonlight-vrr` | [Nonary/moonlight-qt](https://github.com/Nonary/moonlight-qt): fork of the Moonlight game streaming client with smooth VRR pacing and the PyroWave codec (C++/Qt6) | *built from source* | [moonlight-vrr](https://aur.archlinux.org/packages/moonlight-vrr) | +| `moonlight-vrr-bin` | [Nonary/moonlight-qt](https://github.com/Nonary/moonlight-qt): prebuilt release of `moonlight-vrr`, built by upstream without Wayland support (runs through XWayland) | AppImage | [moonlight-vrr-bin](https://aur.archlinux.org/packages/moonlight-vrr-bin) | | `nextcloud-native` | [Obiente/native](https://github.com/Obiente/native) — adaptive native Nextcloud client for files, media and installed server apps (Compose Multiplatform, unofficial) | *built from source* | [nextcloud-native](https://aur.archlinux.org/packages/nextcloud-native) | | `nextcloud-native-bin` | [Obiente/native](https://github.com/Obiente/native) — prebuilt release of `nextcloud-native` | `.deb` | [nextcloud-native-bin](https://aur.archlinux.org/packages/nextcloud-native-bin) | | `nextcloud-native-git` | [Obiente/native](https://github.com/Obiente/native) — `main` branch of `nextcloud-native` | *built from source* | [nextcloud-native-git](https://aur.archlinux.org/packages/nextcloud-native-git) | diff --git a/moonlight-vrr-bin/.SRCINFO b/moonlight-vrr-bin/.SRCINFO new file mode 100644 index 0000000..32afbd5 --- /dev/null +++ b/moonlight-vrr-bin/.SRCINFO @@ -0,0 +1,36 @@ +pkgbase = moonlight-vrr-bin + pkgdesc = GameStream client for PCs, fork of moonlight-qt with smooth VRR pacing (upstream AppImage) + pkgver = 6.1.0_vrr18 + pkgrel = 1 + url = https://github.com/Nonary/moonlight-qt + arch = x86_64 + license = GPL-3.0-or-later + depends = e2fsprogs + depends = fontconfig + depends = freetype2 + depends = glibc + depends = harfbuzz + depends = hicolor-icon-theme + depends = libdrm + depends = libgcc + depends = libglvnd + depends = libgpg-error + depends = libice + depends = libsm + depends = libstdc++ + depends = libx11 + depends = libxcb + depends = zlib + optdepends = libva-intel-driver: hardware acceleration for Intel GPUs up to Coffee Lake + optdepends = intel-media-driver: hardware acceleration for Intel GPUs from Broadwell on + provides = moonlight-vrr + provides = moonlight-qt + conflicts = moonlight-vrr + conflicts = moonlight-qt + noextract = moonlight-vrr-bin-6.1.0_vrr18.AppImage + options = !strip + options = !debug + source = moonlight-vrr-bin-6.1.0_vrr18.AppImage::https://github.com/Nonary/moonlight-qt/releases/download/v6.1.0-vrr18/Moonlight-6.1.0-vrr18-x86_64.AppImage + sha256sums = 5b5992eb0d9d6528ca6db83c33da3bf6cbecea0f5a8f7b9b34dcd5d22d13f40c + +pkgname = moonlight-vrr-bin diff --git a/moonlight-vrr-bin/PKGBUILD b/moonlight-vrr-bin/PKGBUILD new file mode 100644 index 0000000..94957f7 --- /dev/null +++ b/moonlight-vrr-bin/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=moonlight-vrr-bin +pkgver=6.1.0_vrr18 +pkgrel=1 +pkgdesc="GameStream client for PCs, fork of moonlight-qt with smooth VRR pacing (upstream AppImage)" +arch=('x86_64') +url="https://github.com/Nonary/moonlight-qt" +license=('GPL-3.0-or-later') +# the AppImage bundles Qt6, FFmpeg, SDL, libplacebo and the rest of the stack; +# these are what is left over +depends=('e2fsprogs' 'fontconfig' 'freetype2' 'glibc' 'harfbuzz' + 'hicolor-icon-theme' 'libdrm' 'libgcc' 'libglvnd' 'libgpg-error' 'libice' + 'libsm' 'libstdc++' 'libx11' 'libxcb' 'zlib') +optdepends=('libva-intel-driver: hardware acceleration for Intel GPUs up to Coffee Lake' + 'intel-media-driver: hardware acceleration for Intel GPUs from Broadwell on') +provides=('moonlight-vrr' 'moonlight-qt') +conflicts=('moonlight-vrr' 'moonlight-qt') +options=('!strip' '!debug') +# upstream tags use hyphens (v6.1.0-vrr18), which pkgver must not contain +_upver="${pkgver//_/-}" +source=("${pkgname}-${pkgver}.AppImage::${url}/releases/download/v${_upver}/Moonlight-${_upver}-x86_64.AppImage") +noextract=("${pkgname}-${pkgver}.AppImage") +sha256sums=('5b5992eb0d9d6528ca6db83c33da3bf6cbecea0f5a8f7b9b34dcd5d22d13f40c') + +prepare() { + chmod +x "$srcdir/${pkgname}-${pkgver}.AppImage" + "$srcdir/${pkgname}-${pkgver}.AppImage" --appimage-extract > /dev/null +} + +package() { + local _root="$srcdir/squashfs-root" + + # upstream's AppImage payload, installed unchanged + install -d "$pkgdir/opt/$pkgname" + cp -a "$_root/usr/." "$pkgdir/opt/$pkgname/" + # the squashfs has private directories and world writable files + chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname" + + # the binary has a RUNPATH into the bundle and reads the qt.conf next to it, + # so it has to be exec'd where it is + install -d "$pkgdir/usr/bin" + cat > "$pkgdir/usr/bin/moonlight" << EOF +#!/bin/sh +exec /opt/$pkgname/bin/moonlight "\$@" +EOF + chmod 755 "$pkgdir/usr/bin/moonlight" + + install -Dm644 "$_root/com.moonlight_stream.Moonlight.desktop" \ + "$pkgdir/usr/share/applications/com.moonlight_stream.Moonlight.desktop" + sed -i '/^X-AppImage-/d' "$pkgdir/usr/share/applications/com.moonlight_stream.Moonlight.desktop" + install -Dm644 "$_root/usr/share/metainfo/com.moonlight_stream.Moonlight.appdata.xml" \ + "$pkgdir/usr/share/metainfo/com.moonlight_stream.Moonlight.appdata.xml" + install -Dm644 "$_root/usr/share/icons/hicolor/scalable/apps/moonlight.svg" \ + "$pkgdir/usr/share/icons/hicolor/scalable/apps/moonlight.svg" +} diff --git a/moonlight-vrr-bin/pkg.sh b/moonlight-vrr-bin/pkg.sh new file mode 100644 index 0000000..8eaf5e3 --- /dev/null +++ b/moonlight-vrr-bin/pkg.sh @@ -0,0 +1,34 @@ +# moonlight-vrr-bin - Nonary's fork of Moonlight (https://github.com/Nonary/moonlight-qt), +# the GameStream client for PCs, with smooth VRR frame pacing (C++ + Qt6). +# +# Upstream publishes an AppImage per release, which the PKGBUILD unpacks and +# installs into /opt, so there is no build step here. GitHub lists each +# asset's sha256, so a new version needs no download. Upstream builds the +# AppImage without Wayland support, it runs through XWayland. +# +# Version handling is the same as in moonlight-vrr: tags look like +# v6.1.0-vrr18, pkgver has an underscore for the hyphen, and /releases/latest +# skips the betas. + +UPSTREAM_REPO="Nonary/moonlight-qt" + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' \ + | sed -e 's/^v//' -e 's/-/_/g' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local upver="${ver//_/-}" sha + + sha="$(gh api "repos/$UPSTREAM_REPO/releases/tags/v$upver" \ + --jq ".assets[] | select(.name == \"Moonlight-$upver-x86_64.AppImage\") | .digest" \ + | sed 's/^sha256://')" + if [[ ! "$sha" =~ ^[0-9a-f]{64}$ ]]; then + echo "v$upver has no Moonlight-$upver-x86_64.AppImage with a sha256" >&2 + return 1 + fi + + sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild" +} diff --git a/moonlight-vrr/.SRCINFO b/moonlight-vrr/.SRCINFO new file mode 100644 index 0000000..df29834 --- /dev/null +++ b/moonlight-vrr/.SRCINFO @@ -0,0 +1,46 @@ +pkgbase = moonlight-vrr + pkgdesc = GameStream client for PCs, fork of moonlight-qt with smooth VRR pacing + pkgver = 6.1.0_vrr18 + pkgrel = 1 + url = https://github.com/Nonary/moonlight-qt + arch = x86_64 + license = GPL-3.0-or-later + makedepends = vulkan-headers + depends = ffmpeg + depends = glibc + depends = hicolor-icon-theme + depends = libdrm + depends = libgcc + depends = libglvnd + depends = libplacebo + depends = libstdc++ + depends = libva + depends = libx11 + depends = openssl + depends = opus + depends = qt6-base + depends = qt6-declarative + depends = qt6-svg + depends = sdl2-compat + depends = sdl2_ttf + depends = wayland + optdepends = libva-intel-driver: hardware acceleration for Intel GPUs up to Coffee Lake + optdepends = intel-media-driver: hardware acceleration for Intel GPUs from Broadwell on + provides = moonlight-qt + conflicts = moonlight-qt + source = moonlight-vrr-6.1.0_vrr18.tar.gz::https://github.com/Nonary/moonlight-qt/archive/refs/tags/v6.1.0-vrr18.tar.gz + source = moonlight-common-c-d6a11bc685b41037b352a96f29d08276fe5359ba.tar.gz::https://github.com/Nonary/moonlight-common-c/archive/d6a11bc685b41037b352a96f29d08276fe5359ba.tar.gz + source = enet-aca87840b57f045a1f7f9299e4b1b9b8e2a5e2f1.tar.gz::https://github.com/cgutman/enet/archive/aca87840b57f045a1f7f9299e4b1b9b8e2a5e2f1.tar.gz + source = nanors-b1e3c22ca0cdc0bb83e3cd6ed1a2fc77869ed99a.tar.gz::https://github.com/sleepybishop/nanors/archive/b1e3c22ca0cdc0bb83e3cd6ed1a2fc77869ed99a.tar.gz + source = qmdnsengine-920c097ffa742e2968290f15d4dde6693aec02e5.tar.gz::https://github.com/cgutman/qmdnsengine/archive/920c097ffa742e2968290f15d4dde6693aec02e5.tar.gz + source = SDL_GameControllerDB-8d9fefd7b810f2541f78cc7a8ccbd185bc84c7a5.tar.gz::https://github.com/gabomdq/SDL_GameControllerDB/archive/8d9fefd7b810f2541f78cc7a8ccbd185bc84c7a5.tar.gz + source = h264bitstream-34f3c58afa3c47b6cf0a49308a68cbf89c5e0bff.tar.gz::https://github.com/aizvorski/h264bitstream/archive/34f3c58afa3c47b6cf0a49308a68cbf89c5e0bff.tar.gz + sha256sums = c5daa59fe3ec058500f57fbae61a3c6697d020a2c3649f36cd2232ea7e999bff + sha256sums = 55e62d1735f6e676193d792077c732edb4b467fcff1f4d3bf36ea75be030aca2 + sha256sums = 6bb1a151e6d21e1756baeff5a95eaf85a5b6731aeda6d0bc255651192ba4a32d + sha256sums = 41edc0309b255b0eeb5e8eb1ad79f7c7e9e6c31db1bd79a16d73271c62867003 + sha256sums = f12236ff3ebce99adb083434756ca17aaf845f11248d2eeb9e68c530304e0299 + sha256sums = e260456d9c7bdff5f2f8a0db0f772316b44d3e4f7833f72ff8328e95b30eb0ec + sha256sums = 04fdcd690de01fa29221f65431f93dc156db146dbaf9e0c27346f3e0cee1a193 + +pkgname = moonlight-vrr diff --git a/moonlight-vrr/PKGBUILD b/moonlight-vrr/PKGBUILD new file mode 100644 index 0000000..4dd8c9f --- /dev/null +++ b/moonlight-vrr/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=moonlight-vrr +pkgver=6.1.0_vrr18 +pkgrel=1 +pkgdesc="GameStream client for PCs, fork of moonlight-qt with smooth VRR pacing" +arch=('x86_64') +url="https://github.com/Nonary/moonlight-qt" +license=('GPL-3.0-or-later') +depends=('ffmpeg' 'glibc' 'hicolor-icon-theme' 'libdrm' 'libgcc' 'libglvnd' 'libplacebo' + 'libstdc++' 'libva' 'libx11' 'openssl' 'opus' 'qt6-base' 'qt6-declarative' + 'qt6-svg' 'sdl2-compat' 'sdl2_ttf' 'wayland') +makedepends=('vulkan-headers') +optdepends=('libva-intel-driver: hardware acceleration for Intel GPUs up to Coffee Lake' + 'intel-media-driver: hardware acceleration for Intel GPUs from Broadwell on') +provides=('moonlight-qt') +conflicts=('moonlight-qt') +# upstream tags use hyphens (v6.1.0-vrr18), which pkgver must not contain +_upver="${pkgver//_/-}" +# The tag tarball has none of the git submodules. Each is pinned to the commit +# the tag references, synced by pkg.sh. enet and nanors are submodules of +# moonlight-common-c. +_common_c="d6a11bc685b41037b352a96f29d08276fe5359ba" +_enet="aca87840b57f045a1f7f9299e4b1b9b8e2a5e2f1" +_nanors="b1e3c22ca0cdc0bb83e3cd6ed1a2fc77869ed99a" +_qmdnsengine="920c097ffa742e2968290f15d4dde6693aec02e5" +_gamecontrollerdb="8d9fefd7b810f2541f78cc7a8ccbd185bc84c7a5" +_h264bitstream="34f3c58afa3c47b6cf0a49308a68cbf89c5e0bff" +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${_upver}.tar.gz" + "moonlight-common-c-${_common_c}.tar.gz::https://github.com/Nonary/moonlight-common-c/archive/${_common_c}.tar.gz" + "enet-${_enet}.tar.gz::https://github.com/cgutman/enet/archive/${_enet}.tar.gz" + "nanors-${_nanors}.tar.gz::https://github.com/sleepybishop/nanors/archive/${_nanors}.tar.gz" + "qmdnsengine-${_qmdnsengine}.tar.gz::https://github.com/cgutman/qmdnsengine/archive/${_qmdnsengine}.tar.gz" + "SDL_GameControllerDB-${_gamecontrollerdb}.tar.gz::https://github.com/gabomdq/SDL_GameControllerDB/archive/${_gamecontrollerdb}.tar.gz" + "h264bitstream-${_h264bitstream}.tar.gz::https://github.com/aizvorski/h264bitstream/archive/${_h264bitstream}.tar.gz") +sha256sums=('c5daa59fe3ec058500f57fbae61a3c6697d020a2c3649f36cd2232ea7e999bff' '55e62d1735f6e676193d792077c732edb4b467fcff1f4d3bf36ea75be030aca2' '6bb1a151e6d21e1756baeff5a95eaf85a5b6731aeda6d0bc255651192ba4a32d' '41edc0309b255b0eeb5e8eb1ad79f7c7e9e6c31db1bd79a16d73271c62867003' 'f12236ff3ebce99adb083434756ca17aaf845f11248d2eeb9e68c530304e0299' 'e260456d9c7bdff5f2f8a0db0f772316b44d3e4f7833f72ff8328e95b30eb0ec' '04fdcd690de01fa29221f65431f93dc156db146dbaf9e0c27346f3e0cee1a193') + +# _link +_link() { + rm -rf "$1" + ln -s "$srcdir/$2" "$1" +} + +prepare() { + cd "$srcdir/moonlight-common-c-${_common_c}" + _link enet "enet-${_enet}" + _link nanors "nanors-${_nanors}" + + cd "$srcdir/moonlight-qt-${_upver}" + _link moonlight-common-c/moonlight-common-c "moonlight-common-c-${_common_c}" + _link qmdnsengine/qmdnsengine "qmdnsengine-${_qmdnsengine}" + _link app/SDL_GameControllerDB "SDL_GameControllerDB-${_gamecontrollerdb}" + _link h264bitstream/h264bitstream "h264bitstream-${_h264bitstream}" +} + +build() { + cd "moonlight-qt-${_upver}" + + # the version the app shows; app/version.txt only has the base version + export CI_VERSION="$_upver" + qmake6 PREFIX=/usr moonlight-qt.pro + make release +} + +package() { + cd "moonlight-qt-${_upver}" + make INSTALL_ROOT="$pkgdir" install +} diff --git a/moonlight-vrr/pkg.sh b/moonlight-vrr/pkg.sh new file mode 100644 index 0000000..d41769b --- /dev/null +++ b/moonlight-vrr/pkg.sh @@ -0,0 +1,67 @@ +# moonlight-vrr - Nonary's fork of Moonlight (https://github.com/Nonary/moonlight-qt), +# the GameStream client for PCs, with smooth VRR frame pacing (C++ + Qt6). +# +# Source package: the PKGBUILD builds the release tag against Arch's Qt6 and +# FFmpeg, as extra/moonlight-qt does for the original. moonlight-vrr-bin +# repackages the AppImage upstream builds from the same tag. +# +# The tag tarball lacks the git submodules. refresh_checksums() reads the +# commit of each from the tag's tree (enet and nanors from moonlight-common-c) +# and syncs it into the PKGBUILD. It fails when a submodule moves to another +# repository. +# +# Tags look like v6.1.0-vrr18, pkgver has an underscore for the hyphen. +# /releases/latest skips the betas, which upstream marks as prereleases. + +UPSTREAM_REPO="Nonary/moonlight-qt" + +# Installed in CI (pacman) before the makepkg test build: the makedepends plus +# the libraries the build links against. qmake turns off what it cannot find. +BUILD_DEPS=(vulkan-headers ffmpeg libdrm libglvnd libplacebo libva libx11 openssl opus + qt6-base qt6-declarative qt6-svg sdl2-compat sdl2_ttf wayland) + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' \ + | sed -e 's/^v//' -e 's/-/_/g' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local tag="v${ver//_/-}" var parent path repo sha url + local -A commit=() + local -a sed_args=() sums=() + + sums+=("$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$tag.tar.gz" \ + | sha256sum | cut -d' ' -f1)") + + # , + # in the order of source=() + while read -r var parent path repo; do + read -r sha url < <(gh api "repos/$parent/contents/$path?ref=${commit[$parent]:-$tag}" \ + --jq 'select(.type == "submodule") | "\(.sha) \(.submodule_git_url)"') || true + if [[ ! "$sha" =~ ^[0-9a-f]{40}$ || "${url%.git}" != "https://github.com/$repo" ]]; then + echo "$tag: submodule $path is no longer $repo (${url:-not found}), update the PKGBUILD" >&2 + return 1 + fi + commit[$repo]="$sha" + sed_args+=(-e "s|^$var=.*|$var=\"$sha\"|") + sums+=("$(curl -sfL "https://github.com/$repo/archive/$sha.tar.gz" | sha256sum | cut -d' ' -f1)") + done <<'EOF' +_common_c Nonary/moonlight-qt moonlight-common-c/moonlight-common-c Nonary/moonlight-common-c +_enet Nonary/moonlight-common-c enet cgutman/enet +_nanors Nonary/moonlight-common-c nanors sleepybishop/nanors +_qmdnsengine Nonary/moonlight-qt qmdnsengine/qmdnsengine cgutman/qmdnsengine +_gamecontrollerdb Nonary/moonlight-qt app/SDL_GameControllerDB gabomdq/SDL_GameControllerDB +_h264bitstream Nonary/moonlight-qt h264bitstream/h264bitstream aizvorski/h264bitstream +EOF + + if [[ " ${sums[*]} " == *" $(printf '' | sha256sum | cut -d' ' -f1) "* ]]; then + echo "$tag: could not download every source tarball" >&2 + return 1 + fi + + sed -i "${sed_args[@]}" \ + -e "s|^sha256sums=.*|sha256sums=($(printf "'%s' " "${sums[@]}" | sed 's/ $//'))|" \ + "$pkgbuild" +}