summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e429838fad58792b1056f8160ba9da158890bf93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: thelostpolaris <me [at] lostpolaris [dot] com>
# Co-maintainer: robertfoster

pkgname=navidrome-git
pkgver=v0.47.5.r7.gce0db834
pkgrel=1
pkgdesc='Music Server and Streamer compatible with Subsonic/Airsonic'
url='https://www.navidrome.org/'
license=('GPL3')
arch=(x86_64 armv6h armv7h aarch64)
provides=("${pkgname%%-git}")
conflicts=("${pkgname%%-git}")
makedepends=('go' 'git' 'npm' 'taglib' 'nodejs-lts-gallium')
depends=('ffmpeg' 'taglib')
source=("${pkgname%%-git}::git+https://github.com/deluan/navidrome.git"
  "${pkgname%%-git}.service"
  "${pkgname%%-git}.sysusers"
  "${pkgname%%-git}.toml"
)
backup=("etc/navidrome/navidrome.toml")

pkgver() {
  cd "${srcdir}/${pkgname%%-git}"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${srcdir}/${pkgname%%-git}"

  make setup
  make buildjs

  export CGO_LDFLAGS="${LDFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  go build -ldflags="-X github.com/navidrome/navidrome/consts.gitTag=v$pkgver" -tags=netgo
}

package() {
  cd "${srcdir}/${pkgname%%-git}"
  install -Dm755 "${pkgname%%-git}" \
    "${pkgdir}/usr/bin/${pkgname%%-git}"

  install -Dm0644 ../"${pkgname%%-git}.service" \
    "${pkgdir}/usr/lib/systemd/system/${pkgname%%-git}.service"
  install -Dm0644 ../"${pkgname%%-git}.toml" \
    "${pkgdir}/etc/navidrome/${pkgname%%-git}.toml"
  install -Dm0644 ../"${pkgname%%-git}.sysusers" \
    "${pkgdir}/usr/lib/sysusers.d/${pkgname%%-git}.conf"
}

sha256sums=('SKIP'
            '790cdabdffba7163a92e22572f4a0810081c9617338b8c28d3eb8d0a7edb8ae1'
            'ee74a732f807e314f97e22b907882d16d125512d6ee23a36251fde2b3b7e608c'
            '6eb784c54ab2f0c5eb617dd952b2e7a553a5c28b514a3c311300b8c9bf845c43')