summaryrefslogtreecommitdiff
path: root/butler-git/PKGBUILD
blob: be4c026f52d7a73446c3d8a264572b369afa0000 (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
# Maintainer: Aki <please at ignore pl>

pkgname=butler-git
_pkgname=butler
pkgver=15.21.0.r9.g50d55e90
pkgrel=1
license=('MIT')
pkgdesc='Your happy little itch.io helper'
makedepends=('git' 'go>=1.6' 'nodejs' 'npm')
arch=('i686' 'x86_64')
source=(
	"${_pkgname}::git+https://github.com/itchio/butler.git"
	"butler.sh"
)
sha256sums=(
	'SKIP'
	'cdafc6745e4d4fa012dbe04fcb803336f70b7a53a1ab6bdf100e0e3510ca9512'
)
provides=("${_pkgname}")
conflicts=("${_pkgname}")


_goarch() {
	case "$1" in
		i686) echo 386;;
		x86_64) echo "amd64";;
		*) return 1;;
	esac
}

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


build() {
	export GOPATH="${srcdir}/go"
	cd "${srcdir}/${_pkgname}"
	npm install --production=false
	node release/build.js --os linux --arch ${CARCH}
}


package() {
	cd "${srcdir}"
	install -Dm644 -t "${pkgdir}/etc/profile.d" butler.sh
	cd "${_pkgname}"
	install -Dm755 -t "${pkgdir}/usr/lib/${_pkgname}" "artifacts/linux-$(_goarch ${CARCH})/butler"
	install -Dm755 -t "${pkgdir}/usr/lib/${_pkgname}" "artifacts/linux-$(_goarch ${CARCH})/7z.so"
	install -Dm755 -t "${pkgdir}/usr/lib/${_pkgname}" "artifacts/linux-$(_goarch ${CARCH})/libc7zip.so"
	install -Dm644 -t "${pkgdir}/usr/share/licenses/${_pkgname}" LICENSE
}