Add shell completions and clean up some syntax

This commit is contained in:
Mike Wilson
2026-01-28 13:28:05 -05:00
parent e9e3df0695
commit 01f47e6475

View File

@@ -6,23 +6,21 @@ arch=('x86_64')
url="https://github.com/autobrr/qui" url="https://github.com/autobrr/qui"
license=('GPL') license=('GPL')
makedepends=('git' 'go>=1.25' 'nodejs' 'pnpm') makedepends=('git' 'go>=1.25' 'nodejs' 'pnpm')
source=( source=("$url/archive/refs/tags/v$pkgver.tar.gz"
"$url/archive/refs/tags/v$pkgver.tar.gz" "$pkgname.service"
"${pkgname}.service" "$pkgname.sysusers"
"${pkgname}.sysusers" "$pkgname.tmpfiles")
"${pkgname}.tmpfiles"
)
sha256sums=('a9e49979b0e0610d39b165be5a7fcdc7f72698a986777428407129faf6eacd68' sha256sums=('a9e49979b0e0610d39b165be5a7fcdc7f72698a986777428407129faf6eacd68'
'd52299510cf4845f0514eefd492b01c33bc2cd2819c2be9dc157f50f67462bd2' 'd52299510cf4845f0514eefd492b01c33bc2cd2819c2be9dc157f50f67462bd2'
'ac49b4d6ae748334f7fa360d8dd58c7cd09ba5e062249666ab380d451b7925dd' 'ac49b4d6ae748334f7fa360d8dd58c7cd09ba5e062249666ab380d451b7925dd'
'3bacde8867fbb7b6d566666b635589579c1cc079cd23418284f43a7b37f0c41b') '3bacde8867fbb7b6d566666b635589579c1cc079cd23418284f43a7b37f0c41b')
prepare() { prepare() {
cd "${pkgname}-${pkgver}" cd "$pkgname-$pkgver"
mkdir -p build/ mkdir -p build/
# Retrieve Go dependencies # Retrieve Go dependencies
export GOPATH="${srcdir}" export GOPATH="$srcdir"
# Don't proxy connection through Google # Don't proxy connection through Google
export GOPROXY=direct export GOPROXY=direct
go mod download -modcacherw go mod download -modcacherw
@@ -33,7 +31,7 @@ prepare() {
} }
build() { build() {
cd "${pkgname}-${pkgver}" cd "$pkgname-$pkgver"
# Build frontend # Build frontend
pnpm --dir web run build pnpm --dir web run build
@@ -47,6 +45,12 @@ build() {
# Build backend # Build backend
go build -o build ./cmd/... go build -o build ./cmd/...
# Generate shell completions
cd ..
"$pkgname-$pkgver/build/$pkgname" completion bash > bash_completion
"$pkgname-$pkgver/build/$pkgname" completion zsh > zsh_completion
"$pkgname-$pkgver/build/$pkgname" completion fish > fish_completion
} }
check() { check() {
@@ -56,12 +60,15 @@ check() {
package() { package() {
# systemd files # systemd files
install -Dm755 $pkgname.service "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" install -Dm755 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
install -Dm755 $pkgname.sysusers "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" install -Dm755 $pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
install -Dm755 $pkgname.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" install -Dm755 $pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
cd "$pkgname-$pkgver"
# Binary # Binary
install -Dm755 build/$pkgname "$pkgdir/usr/bin/$pkgname" install -Dm755 "$pkgname-$pkgver/build/$pkgname" "$pkgdir/usr/bin/$pkgname"
# Shell Completions
install -Dm644 bash_completion "$pkgdir/usr/share/bash-completion/completions/$pkgname"
install -Dm644 zsh_completion "$pkgdir/usr/share/zsh/site-functions/$pkgname"
install -Dm644 fish_completion "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
} }