Putting this here if anyone is interested:
I changed my pkgbuild to download zip archive directly from "latest branch" (link on their website). It's similar to how git- releases are meant to work, but without having to wait for it to compile. Zip gets extracted automatically by pacman with bsdtar and a pkgver() function finds version of this release and updates it. From there on everything works the same.
Advantage of this approach is that when you want to update, you just come back into grayjay directory and run makepkg -si without editing PKGBUILD manually.
# Maintainer: Nathan Chere <git@nathanchere.com.au>
pkgname=grayjay-bin
pkgver=12
pkgrel=1
pkgdesc="Grayjay Desktop - follow creators, not platforms (privacy- and freedom-respecting client for YouTube, Rumble, Twitch, Spotify etc)"
arch=('x86_64')
url="https://grayjay.app/desktop/"
license=('Source First License 1.1')
depends=('gtk3' 'unzip' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'libsecret' 'libappindicator-gtk3' 'jq')
provides=('grayjay')
conflicts=('grayjay-git' 'grayjay')
options=(!strip)
_dl_filename="Grayjay.Desktop-linux-x64"
_filename="Grayjay.Desktop-linux-x64-v${pkgver}"
source=("${_dl_filename}.zip::https://updater.grayjay.app/Apps/Grayjay.Desktop/${_dl_filename}.zip")
sha256sums=('ba008a153255fff7adba5612c3d27b42509f7910043f4daf7f3c88c7f1c01a54')
pkgver() {
VERSION="$(
find -type f -name AppVersion.json \
-exec jq -r '.Version' {} + |
grep -v null |
sort -n |
tail -1
)"
printf "%s" $VERSION
}
package() {
cd "${_filename}"
# Create necessary directories
install -dm755 "${pkgdir}/usr/share/grayjay"
install -dm755 "${pkgdir}/usr/bin"
install -dm755 "${pkgdir}/usr/share/applications"
install -dm755 "${pkgdir}/usr/share/icons/hicolor/512x512/apps"
# Create launcher script that copies app to user directory on first run
cat >"${pkgdir}/usr/bin/grayjay" <<'EOF'
#!/bin/sh
APP_DIR="$HOME/.local/share/grayjay"
USER_VERSION="$(jq '.Version' $APP_DIR/AppVersion.json)"
SYSTEM_VERSION="$(pacman -Qi grayjay-bin | grep Version | awk '{print $3}' | cut -d'-' -f1)"
install_grayjay(){
mkdir -p "$APP_DIR"
cp -r /usr/share/grayjay/* "$APP_DIR/"
chmod u+w -R "$APP_DIR"
}
# Check if app is already installed in user directory
if [ ! -d "$APP_DIR" ] && echo "First run - installing Grayjay to $APP_DIR" || \
[ "$USER_VERSION" -ne "$SYSTEM_VERSION" ] && echo "Version mismatch - installing system Grayjay to $APP_DIR"
then
install_grayjay
fi
exec sh -c "cd '$APP_DIR' && exec ./Grayjay \"\$@\"" -- "$@"
EOF
chmod 755 "${pkgdir}/usr/bin/grayjay"
# Copy application files to system directory (will be copied to user dir on first run)
cp -r ./* "${pkgdir}/usr/share/grayjay/"
# Create desktop entry
cat >"${pkgdir}/usr/share/applications/grayjay.desktop" <<EOF
[Desktop Entry]
Name=Grayjay
Comment=Privacy-respecting client for YouTube, Rumble, Twitch, Spotify etc
Exec=/usr/bin/grayjay
Icon=grayjay
Terminal=false
Type=Application
Categories=Network;Video;AudioVideo;
EOF
# Install icon
install -Dm644 "grayjay.png" \
"${pkgdir}/usr/share/icons/hicolor/512x512/apps/grayjay.png"
}
Pinned Comments
nathanchere commented on 2025-01-30 06:30 (UTC)
Sorry for the unreliable builds recently. I've spoken with Futo about the generic latestversion.zip downloads and have been advised about versioned links which they don't officially publish. Hopefully that should finally resolve the issue of this package breaking when a new release is published to the same download URL breaking checksums.