summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 703b831ee63c992f70c87518db8778da9ce8627e (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
58
59
# Maintainer: Pierre Neidhardt <ambrevar@gmail.com>

pkgname=demlo
pkgver=3.7.1
pkgrel=1
pkgdesc="A dynamic and extensible music library organizer"
arch=("i686" "x86_64")
url="http://ambrevar.bitbucket.io/demlo/"
license=("MIT")
depends=("ffmpeg" "lua" "taglib")
makedepends=("go" "git")
optdepends=("chromaprint: Internet tagging")
source=("$pkgname-$pkgver.tar.gz::https://github.com/ambrevar/$pkgname/archive/v$pkgver.tar.gz")
md5sums=('2fbda9956ffd42cd5a0826c971792d70')
_gourl="github.com/ambrevar/$pkgname"

prepare() {
	## Move source extracted folder to its proper location in the GOPATH.
	cd "$srcdir"
	rm -rfv "src/$_gourl"
	mkdir -p "src/github.com/ambrevar"
	mv "$pkgname-$pkgver" "src/$_gourl"
}

build() {
	case "$CARCH" in
	x86_64) GOARCH=amd64 ;;
	i686) GOARCH=386 ;;
	esac

	export GOPATH="$srcdir"
	go get -v -x -d github.com/aarzilli/golua/lua
	cd "$srcdir"/src/github.com/aarzilli/golua/lua
	git checkout lua5.3
	go install -v -x -tags llua
	go get -v -x -ldflags "-X main.version=$pkgver" "$_gourl"
}

check() {
	GOPATH="$srcdir" go test -v -x "$_gourl"
}

package() {
	cd "$srcdir"
	install -Dm755 "bin/$pkgname" "$pkgdir/usr/bin/$pkgname"
	install -Dm644 "src/$_gourl/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

	install -Dm644 "src/$_gourl/${pkgname}rc" "$pkgdir/usr/share/$pkgname/${pkgname}rc"

	cd "src/$_gourl"
	for i in scripts/*; do
		install -Dm644 "$i" "$pkgdir/usr/share/$pkgname/$i"
	done
	for i in actions/*; do
		install -Dm644 "$i" "$pkgdir/usr/share/$pkgname/$i"
	done

	install -Dm644 completion/demlo.fish "$pkgdir/usr/share/fish/vendor_completions.d/demlo.fish"
}