68 lines
1.7 KiB
Bash
68 lines
1.7 KiB
Bash
pkgname=qui
|
|
pkgver=1.13.0
|
|
pkgrel=1
|
|
pkgdesc="A fast, modern web interface for qBittorrent"
|
|
arch=('x86_64')
|
|
url="https://github.com/autobrr/qui"
|
|
license=('GPL')
|
|
makedepends=('git' 'go>=1.25' 'nodejs' 'pnpm')
|
|
source=(
|
|
"$url/archive/refs/tags/v$pkgver.tar.gz"
|
|
"${pkgname}.service"
|
|
"${pkgname}.sysusers"
|
|
"${pkgname}.tmpfiles"
|
|
)
|
|
sha256sums=('a9e49979b0e0610d39b165be5a7fcdc7f72698a986777428407129faf6eacd68'
|
|
'd52299510cf4845f0514eefd492b01c33bc2cd2819c2be9dc157f50f67462bd2'
|
|
'ac49b4d6ae748334f7fa360d8dd58c7cd09ba5e062249666ab380d451b7925dd'
|
|
'3bacde8867fbb7b6d566666b635589579c1cc079cd23418284f43a7b37f0c41b')
|
|
|
|
prepare() {
|
|
cd "${pkgname}-${pkgver}"
|
|
mkdir -p build/
|
|
|
|
# Retrieve Go dependencies
|
|
export GOPATH="${srcdir}"
|
|
# Don't proxy connection through Google
|
|
export GOPROXY=direct
|
|
go mod download -modcacherw
|
|
|
|
# Retrieve NodeJS dependencies
|
|
cd web
|
|
pnpm install
|
|
}
|
|
|
|
build() {
|
|
cd "${pkgname}-${pkgver}"
|
|
|
|
# Build frontend
|
|
pnpm --dir web run build
|
|
|
|
# Set Go flags
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
export CGO_LDFLAGS="${LDFLAGS}"
|
|
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
|
|
|
|
# Build backend
|
|
go build -o build ./cmd/...
|
|
}
|
|
|
|
check() {
|
|
cd "$pkgname-$pkgver"
|
|
go test ./...
|
|
}
|
|
|
|
package() {
|
|
# systemd files
|
|
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.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
|
|
|
|
cd "$pkgname-$pkgver"
|
|
|
|
# Binary
|
|
install -Dm755 build/$pkgname "$pkgdir/usr/bin/$pkgname"
|
|
}
|