From b17ec7b0b089756e7707c7f78758bcfed638867b Mon Sep 17 00:00:00 2001 From: Felitendo <95575686+Felitendo@users.noreply.github.com> Date: Fri, 24 Jul 2026 11:33:08 +0200 Subject: [PATCH] lunar-client-bin: add package (3.7.12-1) Upstream moved to an "ow" electron-updater channel with a filename suffix; latest_version checks both channels (vercmp picks the winner) and refresh_checksums keeps the _appimage filename in sync. Also clean up downloaded .AppImage files like the other source leftovers. --- .gitignore | 1 + README.md | 1 + lunar-client-bin/.SRCINFO | 19 ++++++++++++++++ lunar-client-bin/PKGBUILD | 48 +++++++++++++++++++++++++++++++++++++++ lunar-client-bin/pkg.sh | 46 +++++++++++++++++++++++++++++++++++++ scripts/update-package.sh | 2 +- 6 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 lunar-client-bin/.SRCINFO create mode 100644 lunar-client-bin/PKGBUILD create mode 100644 lunar-client-bin/pkg.sh diff --git a/.gitignore b/.gitignore index 15235fc..71a6872 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ */src/ */pkg/ *.deb +*.AppImage diff --git a/README.md b/README.md index 5e4f440..3e230a1 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ users don't need any build dependencies. | `chiaki-ng-bin` | [streetpea/chiaki-ng](https://github.com/streetpea/chiaki-ng) — PlayStation Remote Play client (Qt6) | [chiaki-ng-bin](https://aur.archlinux.org/packages/chiaki-ng-bin) | | `gnome-network-displays-bin` | [GNOME/gnome-network-displays](https://gitlab.gnome.org/GNOME/gnome-network-displays) — GNOME screencasting (Miracast/Chromecast) | [gnome-network-displays-bin](https://aur.archlinux.org/packages/gnome-network-displays-bin) | | `waydroid-helper-bin` | [ayasa520/waydroid-helper](https://github.com/ayasa520/waydroid-helper) — GTK4 GUI for Waydroid configuration and extensions | [waydroid-helper-bin](https://aur.archlinux.org/packages/waydroid-helper-bin) | +| `lunar-client-bin` | [lunarclient.com](https://lunarclient.com) — Minecraft PvP modpack launcher (upstream AppImage) | [lunar-client-bin](https://aur.archlinux.org/packages/lunar-client-bin) | ## Setup (one-time) diff --git a/lunar-client-bin/.SRCINFO b/lunar-client-bin/.SRCINFO new file mode 100644 index 0000000..e049bc6 --- /dev/null +++ b/lunar-client-bin/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = lunar-client-bin + pkgdesc = PvP modpack for all modern versions of Minecraft (upstream AppImage) + pkgver = 3.7.12 + pkgrel = 1 + url = https://lunarclient.com + arch = x86_64 + license = LicenseRef-proprietary + depends = fuse2 + depends = xorg-xrandr + provides = lunar-client + provides = lunarclient + conflicts = lunar-client + conflicts = lunarclient + options = !strip + options = !debug + source = lunarclient-3.7.12.AppImage::https://launcherupdates.lunarclientcdn.com/Lunar%20Client-3.7.12-ow.AppImage + sha256sums = 7364e876a59291d8b0b7d6c0efdacb988617e35e054e9c21a5814d071710bf98 + +pkgname = lunar-client-bin diff --git a/lunar-client-bin/PKGBUILD b/lunar-client-bin/PKGBUILD new file mode 100644 index 0000000..93f1640 --- /dev/null +++ b/lunar-client-bin/PKGBUILD @@ -0,0 +1,48 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=lunar-client-bin +_pkgname=lunarclient +pkgver=3.7.12 +pkgrel=1 +pkgdesc="PvP modpack for all modern versions of Minecraft (upstream AppImage)" +arch=('x86_64') +url="https://lunarclient.com" +license=('LicenseRef-proprietary') +depends=('fuse2' 'xorg-xrandr') +provides=('lunar-client' 'lunarclient') +conflicts=('lunar-client' 'lunarclient') +options=('!strip' '!debug') +# maintained by CI together with pkgver (upstream varies the filename suffix) +_appimage="Lunar%20Client-3.7.12-ow.AppImage" +source=("${_pkgname}-${pkgver}.AppImage::https://launcherupdates.lunarclientcdn.com/${_appimage}") +sha256sums=('7364e876a59291d8b0b7d6c0efdacb988617e35e054e9c21a5814d071710bf98') + +prepare() { + chmod +x "${_pkgname}-${pkgver}.AppImage" + "./${_pkgname}-${pkgver}.AppImage" --appimage-extract +} + +build() { + # make the .desktop file work outside of the AppImage container + sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false /usr/bin/${_pkgname}|" \ + "squashfs-root/${_pkgname}.desktop" + # AppImage directory permissions are 700 + chmod -R a-x+rX squashfs-root/usr +} + +package() { + install -Dm755 "${srcdir}/${_pkgname}-${pkgver}.AppImage" \ + "${pkgdir}/opt/${_pkgname}/${_pkgname}.AppImage" + + install -Dm644 "${srcdir}/squashfs-root/${_pkgname}.desktop" \ + "${pkgdir}/usr/share/applications/${_pkgname}.desktop" + + install -Dm644 \ + "${srcdir}/squashfs-root/usr/share/icons/hicolor/1024x1024/apps/${_pkgname}.png" \ + "${pkgdir}/usr/share/icons/hicolor/512x512/apps/${_pkgname}.png" + + install -dm755 "${pkgdir}/usr/bin" + ln -s "/opt/${_pkgname}/${_pkgname}.AppImage" "${pkgdir}/usr/bin/${_pkgname}" +} diff --git a/lunar-client-bin/pkg.sh b/lunar-client-bin/pkg.sh new file mode 100644 index 0000000..44fc638 --- /dev/null +++ b/lunar-client-bin/pkg.sh @@ -0,0 +1,46 @@ +# lunar-client-bin - Lunar Client (https://lunarclient.com), Minecraft PvP +# modpack launcher, proprietary Electron AppImage. +# +# Upstream hosts versioned AppImages itself, so there is no build_artifact(): +# on a new version pkgver, the artifact filename (_appimage) and the checksum +# are refreshed. Upstream currently publishes on the "ow" electron-updater +# channel (latest-ow-linux.yml) with an -ow filename suffix; the old plain +# channel (latest-linux.yml) went stale but is still checked in case they +# switch back - whichever carries the higher version wins. + +DL_BASE="https://launcherupdates.lunarclientcdn.com" + +_channel_version() { + curl -sf "$DL_BASE/$1" | grep -Po '^version: \K\S+' +} + +latest_version() { + local a b + a="$(_channel_version latest-ow-linux.yml | sed 's/-.*//')" + b="$(_channel_version latest-linux.yml | sed 's/-.*//')" + [[ -n "$a" || -n "$b" ]] || return 1 + if [[ -n "$a" && -n "$b" ]]; then + if [[ "$(vercmp "$a" "$b")" -ge 0 ]]; then echo "$a"; else echo "$b"; fi + else + echo "${a:-$b}" + fi +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local yml file sha + for yml in latest-ow-linux.yml latest-linux.yml; do + file="$(curl -sf "$DL_BASE/$yml" | grep -Po '^path: \K.*\.AppImage')" + [[ "$file" == *"$ver"* ]] && break + file="" + done + [[ -n "$file" ]] || { echo "no updater channel carries version $ver" >&2; return 1; } + file="${file// /%20}" + + sha="$(curl -sfL "$DL_BASE/$file" | sha256sum | cut -d' ' -f1)" + sed -i \ + -e "s|^_appimage=.*|_appimage=\"$file\"|" \ + -e "s|^sha256sums=.*|sha256sums=('$sha')|" \ + "$pkgbuild" +} diff --git a/scripts/update-package.sh b/scripts/update-package.sh index 3fe6fc9..21ca800 100644 --- a/scripts/update-package.sh +++ b/scripts/update-package.sh @@ -112,7 +112,7 @@ mv "$pkg/.SRCINFO.new" "$pkg/.SRCINFO" # drop downloaded sources and build leftovers (all gitignored, never tracked) rm -rf "$pkg/src" "$pkg/pkg" -rm -f "$pkg"/*.pkg.tar.* "$pkg"/*.tar.zst "$pkg"/*.tar.gz "$pkg"/*.deb +rm -f "$pkg"/*.pkg.tar.* "$pkg"/*.tar.zst "$pkg"/*.tar.gz "$pkg"/*.deb "$pkg"/*.AppImage ### 4: commit back to this repository ########################################