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.
This commit is contained in:
1 parent
6f0f9488ec
commit
b17ec7b0b0
6 files changed
+116
-1
No files matched your search
@@ -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
|
||||
@@ -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}"
|
||||
}
|
||||
@@ -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 <version> <pkgbuild-path>
|
||||
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"
|
||||
}
|
||||
Reference in new issue
Block a user