From e39eb6fa6f04b548dc4b61dde5a48359e966b7f8 Mon Sep 17 00:00:00 2001 From: vicrodh Date: Wed, 4 Mar 2026 12:45:10 -0600 Subject: [PATCH] feat(aur): add qbz and qbz-git source-build packages Add PKGBUILDs and GitHub Actions workflows for: - qbz: compiles from release source tarball - qbz-git: compiles from main branch (updates on push) Fix --bundles none -> --no-bundle for Tauri 2.0 CLI --- .github/workflows/release-aur-git.yml | 98 +++++++++++++++ .github/workflows/release-aur-source.yml | 148 +++++++++++++++++++++++ packaging/arch/PKGBUILD | 2 +- packaging/aur-git/PKGBUILD | 51 ++++++++ packaging/aur-source/PKGBUILD | 46 +++++++ 5 files changed, 344 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-aur-git.yml create mode 100644 .github/workflows/release-aur-source.yml create mode 100644 packaging/aur-git/PKGBUILD create mode 100644 packaging/aur-source/PKGBUILD diff --git a/.github/workflows/release-aur-git.yml b/.github/workflows/release-aur-git.yml new file mode 100644 index 000000000..f1e728039 --- /dev/null +++ b/.github/workflows/release-aur-git.yml @@ -0,0 +1,98 @@ +name: release-aur-git + +on: + push: + branches: [main] + paths-ignore: + - '*.md' + - 'docs/**' + - '.github/workflows/release-aur.yml' + - '.github/workflows/release-aur-source.yml' + workflow_dispatch: + +concurrency: + group: aur-git-publish + cancel-in-progress: true + +permissions: + contents: read + +jobs: + update-aur: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history needed for pkgver() + + - name: Compute pkgver + id: pkgver + run: | + REVCOUNT=$(git rev-list --count HEAD) + SHORTHASH=$(git rev-parse --short HEAD) + PKGVER="r${REVCOUNT}.${SHORTHASH}" + echo "pkgver=$PKGVER" >> "$GITHUB_OUTPUT" + echo "Computed pkgver: $PKGVER" + + - name: Setup SSH for AUR + env: + AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur + chmod 600 ~/.ssh/aur + echo "Host aur.archlinux.org" >> ~/.ssh/config + echo " IdentityFile ~/.ssh/aur" >> ~/.ssh/config + echo " User aur" >> ~/.ssh/config + ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts + + - name: Clone AUR repo + run: | + git clone ssh://aur@aur.archlinux.org/qbz-git.git /tmp/aur-qbz-git + cd /tmp/aur-qbz-git + git checkout master 2>/dev/null || git checkout -b master + + - name: Update PKGBUILD + env: + PKGVER: ${{ steps.pkgver.outputs.pkgver }} + run: | + cd /tmp/aur-qbz-git + + # Copy PKGBUILD from main repo (source of truth) + cp ${{ github.workspace }}/packaging/aur-git/PKGBUILD . + + # Update pkgver to current value (so .SRCINFO reflects it) + sed -i "s/^pkgver=.*/pkgver=${PKGVER}/" PKGBUILD + + echo "=== Updated PKGBUILD ===" + cat PKGBUILD + + - name: Generate .SRCINFO + run: | + cd /tmp/aur-qbz-git + docker run --rm -v "$PWD":/pkg -w /pkg -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) archlinux:latest bash -c " + pacman -Sy --noconfirm pacman-contrib sudo git + useradd -m builder + chown -R builder:builder /pkg + sudo -u builder makepkg --printsrcinfo > .SRCINFO + chown -R \$HOST_UID:\$HOST_GID /pkg + " + cat .SRCINFO + + - name: Commit and push to AUR + env: + PKGVER: ${{ steps.pkgver.outputs.pkgver }} + run: | + cd /tmp/aur-qbz-git + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add PKGBUILD .SRCINFO + + # Only commit if there are changes + if git diff --cached --quiet; then + echo "No changes to commit" + else + git commit -m "Update to ${PKGVER}" + git push + fi diff --git a/.github/workflows/release-aur-source.yml b/.github/workflows/release-aur-source.yml new file mode 100644 index 000000000..d7319d031 --- /dev/null +++ b/.github/workflows/release-aur-source.yml @@ -0,0 +1,148 @@ +name: release-aur-source + +on: + # Trigger after release-linux completes (same as qbz-bin) + workflow_run: + workflows: ["release-linux"] + types: [completed] + workflow_dispatch: + inputs: + version: + description: "Version to publish (e.g. 1.1.18)" + required: true + type: string + pkgrel: + description: "Package release number (bump for same-version rebuilds)" + required: false + default: "1" + type: string + +concurrency: + group: aur-source-publish + cancel-in-progress: false + +permissions: + contents: read + +jobs: + update-aur: + runs-on: ubuntu-latest + # Only run on manual dispatch, or successful stable tag releases (no -rc) + if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v') && !contains(github.event.workflow_run.head_branch, '-rc')) }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Determine version + id: version + env: + EVENT_NAME: ${{ github.event_name }} + WORKFLOW_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} + DISPATCH_VERSION: ${{ inputs.version }} + run: | + if [[ "$EVENT_NAME" == "workflow_run" ]]; then + REF="$WORKFLOW_HEAD_BRANCH" + if [[ ! "$REF" =~ ^v[0-9]+(\.[0-9]+){1,3}([.-][0-9A-Za-z.-]+)?$ ]]; then + echo "Invalid workflow_run head branch for release: $REF" + exit 1 + fi + VERSION="${REF#v}" + else + VERSION="$DISPATCH_VERSION" + fi + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "Detected version: $VERSION" + + - name: Wait for source tarball + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + echo "Verifying GitHub source archive is available..." + SOURCE_URL="https://github.com/vicrodh/qbz/archive/refs/tags/v${VERSION}.tar.gz" + HTTP_CODE=$(curl -sL -o /dev/null -w "%{http_code}" "$SOURCE_URL") + if [[ "$HTTP_CODE" != "200" ]]; then + echo "Source archive not found at $SOURCE_URL (HTTP $HTTP_CODE)" + exit 1 + fi + echo "Source archive available" + + - name: Get source tarball checksum + id: checksums + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + SOURCE_URL="https://github.com/vicrodh/qbz/archive/refs/tags/v${VERSION}.tar.gz" + echo "Downloading: $SOURCE_URL" + curl -fsSL -o /tmp/qbz-source.tar.gz "$SOURCE_URL" + SHA256=$(sha256sum /tmp/qbz-source.tar.gz | cut -d' ' -f1) + echo "sha256=$SHA256" >> "$GITHUB_OUTPUT" + echo "Source checksum: $SHA256" + + - name: Setup SSH for AUR + env: + AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur + chmod 600 ~/.ssh/aur + echo "Host aur.archlinux.org" >> ~/.ssh/config + echo " IdentityFile ~/.ssh/aur" >> ~/.ssh/config + echo " User aur" >> ~/.ssh/config + ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts + + - name: Clone AUR repo + run: | + git clone ssh://aur@aur.archlinux.org/qbz.git /tmp/aur-qbz + cd /tmp/aur-qbz + git checkout master 2>/dev/null || git checkout -b master + + - name: Determine pkgrel + id: pkgrel + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "pkgrel=${{ inputs.pkgrel || '1' }}" >> "$GITHUB_OUTPUT" + else + echo "pkgrel=1" >> "$GITHUB_OUTPUT" + fi + + - name: Update PKGBUILD + env: + VERSION: ${{ steps.version.outputs.version }} + PKGREL: ${{ steps.pkgrel.outputs.pkgrel }} + SHA256: ${{ steps.checksums.outputs.sha256 }} + run: | + cd /tmp/aur-qbz + + # Copy PKGBUILD from main repo (source of truth) + cp ${{ github.workspace }}/packaging/aur-source/PKGBUILD . + + # Update version, pkgrel, and checksum + sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD + sed -i "s/^pkgrel=.*/pkgrel=${PKGREL}/" PKGBUILD + sed -i "s/^sha256sums=.*/sha256sums=('${SHA256}')/" PKGBUILD + + echo "=== Updated PKGBUILD ===" + cat PKGBUILD + + - name: Generate .SRCINFO + run: | + cd /tmp/aur-qbz + docker run --rm -v "$PWD":/pkg -w /pkg -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) archlinux:latest bash -c " + pacman -Sy --noconfirm pacman-contrib sudo + useradd -m builder + chown -R builder:builder /pkg + sudo -u builder makepkg --printsrcinfo > .SRCINFO + chown -R \$HOST_UID:\$HOST_GID /pkg + " + cat .SRCINFO + + - name: Commit and push to AUR + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + cd /tmp/aur-qbz + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add PKGBUILD .SRCINFO + git commit -m "Update to v${VERSION}" + git push diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index 766be64d8..4a378e790 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -35,7 +35,7 @@ build() { cd "${srcdir}/qbz-${pkgver}" npm ci npm run build - npm run tauri build -- --bundles none + npx tauri build --no-bundle } package() { diff --git a/packaging/aur-git/PKGBUILD b/packaging/aur-git/PKGBUILD new file mode 100644 index 000000000..a18b197a3 --- /dev/null +++ b/packaging/aur-git/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: blitzkriegfc +pkgname=qbz-git +pkgver=r0.0000000 +pkgrel=1 +pkgdesc="Native Qobuz client for Linux with bit-perfect hi-res audio, DAC passthrough, Last.fm scrobbling, and Chromecast/DLNA casting (development version)" +arch=('x86_64' 'aarch64') +url="https://github.com/vicrodh/qbz" +license=('MIT') +depends=('webkit2gtk-4.1' 'gtk3' 'alsa-lib' 'libappindicator-gtk3' 'libxkbcommon' 'openssl') +makedepends=('nodejs' 'npm' 'rust' 'cargo' 'pkgconf' 'clang' 'git') +optdepends=( + 'alsa-utils: Required for bit-perfect device detection and better ALSA device names' + 'pipewire-alsa: PipeWire audio support' + 'pipewire-pulse: PulseAudio compatibility' +) +provides=('qbz') +conflicts=('qbz' 'qbz-bin') +source=("${pkgname}::git+https://github.com/vicrodh/qbz.git#branch=main") +sha256sums=('SKIP') + +pkgver() { + cd "${srcdir}/${pkgname}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "${srcdir}/${pkgname}" + npm ci + npm run build + npx tauri build --no-bundle +} + +package() { + cd "${srcdir}/${pkgname}" + + # Install binary + install -Dm755 "src-tauri/target/release/qbz-nix" "${pkgdir}/usr/bin/qbz" + + # Install desktop file + install -Dm644 "packaging/arch/qbz.desktop" "${pkgdir}/usr/share/applications/qbz.desktop" + + # Install icons (freedesktop hicolor structure) + install -Dm644 "src-tauri/icons/32x32.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/qbz.png" + install -Dm644 "src-tauri/icons/48x48.png" "${pkgdir}/usr/share/icons/hicolor/48x48/apps/qbz.png" + install -Dm644 "src-tauri/icons/64x64.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/qbz.png" + install -Dm644 "src-tauri/icons/128x128.png" "${pkgdir}/usr/share/icons/hicolor/128x128/apps/qbz.png" + install -Dm644 "src-tauri/icons/256x256.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/qbz.png" + + # Install license + install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/packaging/aur-source/PKGBUILD b/packaging/aur-source/PKGBUILD new file mode 100644 index 000000000..125ece772 --- /dev/null +++ b/packaging/aur-source/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: blitzkriegfc +pkgname=qbz +pkgver=1.1.18 +pkgrel=1 +pkgdesc="Native Qobuz client for Linux with bit-perfect hi-res audio, DAC passthrough, Last.fm scrobbling, and Chromecast/DLNA casting" +arch=('x86_64' 'aarch64') +url="https://github.com/vicrodh/qbz" +license=('MIT') +depends=('webkit2gtk-4.1' 'gtk3' 'alsa-lib' 'libappindicator-gtk3' 'libxkbcommon' 'openssl') +makedepends=('nodejs' 'npm' 'rust' 'cargo' 'pkgconf' 'clang') +optdepends=( + 'alsa-utils: Required for bit-perfect device detection and better ALSA device names' + 'pipewire-alsa: PipeWire audio support' + 'pipewire-pulse: PulseAudio compatibility' +) +provides=('qbz') +conflicts=('qbz-bin' 'qbz-git') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/vicrodh/qbz/archive/refs/tags/v${pkgver}.tar.gz") +sha256sums=('SKIP') + +build() { + cd "${srcdir}/qbz-${pkgver}" + npm ci + npm run build + npx tauri build --no-bundle +} + +package() { + cd "${srcdir}/qbz-${pkgver}" + + # Install binary + install -Dm755 "src-tauri/target/release/qbz-nix" "${pkgdir}/usr/bin/qbz" + + # Install desktop file + install -Dm644 "packaging/arch/qbz.desktop" "${pkgdir}/usr/share/applications/qbz.desktop" + + # Install icons (freedesktop hicolor structure) + install -Dm644 "src-tauri/icons/32x32.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/qbz.png" + install -Dm644 "src-tauri/icons/48x48.png" "${pkgdir}/usr/share/icons/hicolor/48x48/apps/qbz.png" + install -Dm644 "src-tauri/icons/64x64.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/qbz.png" + install -Dm644 "src-tauri/icons/128x128.png" "${pkgdir}/usr/share/icons/hicolor/128x128/apps/qbz.png" + install -Dm644 "src-tauri/icons/256x256.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/qbz.png" + + # Install license + install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +}