summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2ed5f4d481e6d9d50459b4b85bfa548fcd657923 (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
# Maintainer: Hoream <2175223953@qq.com>
_pkgname="go-musicfox"
pkgname="${_pkgname}-git"
pkgver=4.0.1.r9.gff81a02
pkgrel=1
pkgdesc='Command-line Netease Cloud Music written in Go (git version).'
url='https://github.com/anhoder/go-musicfox'
license=('MIT')
arch=('x86_64')
provides=('musicfox')
conflicts=('go-musicfox-bin' 'musicfox' 'go-musicfox')
depends=('flac' 'alsa-lib')
makedepends=('gcc-objc' 'go' 'git')
source=(${_pkgname}::git+https://github.com/go-musicfox/go-musicfox)
sha256sums=('SKIP')

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

build(){
    make 
}

build(){
 	cd "${srcdir}/${_pkgname}"
	export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external"
	export CGO_LDFLAGS="${LDFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export GOPATH=${srcdir}
	go build -o bin/musicfox -ldflags "-s -w -X go-musicfox/pkg/constants.AppVersion=v${pkgver}" cmd/musicfox.go
}


package() {
	install -d "${pkgdir}/usr/bin"
	install -d "${pkgdir}/usr/share/licenses/${_pkgname}"
	install -Dm755 "${srcdir}/${_pkgname}/bin/musicfox" "${pkgdir}/usr/bin/musicfox"
	install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}"
}