# Contributor: Tom Lebreux # Maintainer: Tom Lebreux pkgname=navidrome pkgver=0.49.3 pkgrel=5 pkgdesc="Modern Music Server and Streamer compatible with Subsonic/Airsonic" url="https://navidrome.org/" arch="all" license="GPL-3.0-or-later" # check: TypeError: Cannot redefine property: localStorage # For downloading go and nodejs dependencies options="net !check" depends="ffmpeg" makedepends="go nodejs npm sqlite-dev taglib-dev zlib-dev" install="$pkgname.pre-install" subpackages="$pkgname-openrc" pkgusers="navidrome" pkggroups="navidrome" source=" $pkgname-$pkgver.tar.gz::https://github.com/navidrome/navidrome/archive/refs/tags/v$pkgver.tar.gz navidrome.initd navidrome.confd navidrome.toml " export GOFLAGS="$GOFLAGS -tags=embed,netgo,libsqlite3" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" # secfixes: # 0.47.5-r0: # - CVE-2022-23857 prepare() { default_prepare go mod download go mod tidy cd ui # Prevents crash due to allocation failure echo 'node-options=--max_old_space_size=3072' > .npmrc npm install cd .. } build() { cd ./ui/ npm run build cd .. # Display pkgrel instead of keeping the git sha in sync with pkgver CGO_ENABLED=1 go build \ -ldflags=" -X github.com/navidrome/navidrome/consts.gitSha=$pkgver-r$pkgrel -X github.com/navidrome/navidrome/consts.gitTag=v$pkgver" } check() { make testall } package() { install -Dm755 navidrome "$pkgdir"/usr/bin/navidrome install -Dm644 "$srcdir"/navidrome.toml \ "$pkgdir"/etc/navidrome/navidrome.toml install -Dm755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname install -Dm644 "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname install -dm755 -o navidrome -g navidrome \ "$pkgdir"/var/lib/navidrome \ "$pkgdir"/var/lib/navidrome/music } sha512sums=" 3155c91a302fcb42a9c6ff440f39d58b9444e8e509debd40b6101143bdf670e701f50fcd4162666f3dd533001bc7aeefd491c959bf7b732f53d4811cb2a0376b navidrome-0.49.3.tar.gz d632f769ed4dd0cc1ddf937ed6b3115df538399f176cc5afb576f3129c305e7a0b2762b5d62968e2819ee4cd9c88552e5c821601f5fd5b32ce5925f3e92ce281 navidrome.initd e69ff79d0be237979c7faa28cc7d6467070c48fb8870a228d122622b8fb4d4cd3cdd58bd22090bec37478b8c4cec8d30db5928c2094ee60a32c40bc7c96d10a3 navidrome.confd 5eaf194d9a0dd3b31a9710bc37eaaeef8c08597928591e68b07a8acf64ca72b8cb9663b604b502b8666a7d069c8308a177b0f21fb42564c4acd82c8d7f0a4780 navidrome.toml "