summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f2efd34ce15a07e3f6560817d1e8e94f43ae5c8c (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
# Maintainer: pancho horrillo <pancho at pancho dot name>
# Contributor: Valentin-Costel H─âloiu <vially.ichb@gmail.com>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>

pkgname=the_platinum_searcher
pkgver=2.2.0
pkgrel=1
pkgdesc='A code search tool similar to ack, the_silver_searcher (ag) and ripgrep (rg).'
arch=('x86_64')
makedepends=('git' 'go' 'godep')
url='https://github.com/monochromegane/the_platinum_searcher'
license=('MIT')
provides=('the_platinum_searcher')
conflicts=('the_platinum_searcher-bin')
source=('git+https://github.com/monochromegane/the_platinum_searcher.git')
sha512sums=('SKIP')

build() {
	export _repodir="$srcdir/src/github.com/monochromegane"
	mkdir -p "$_repodir"
	mv "$srcdir/$pkgname" "$_repodir"
	cd "$_repodir/$pkgname"
	git checkout -q v"$pkgver"
	unset GOBIN  # prevent bin to end up elsewhere
	GOPATH="$srcdir" godep restore
	GOPATH="$srcdir" godep go install -v ./...
}

check() {
	cd "$_repodir/$pkgname"
	GOPATH="$srcdir" godep go test -v -x .
}

package() {
	msg 'Installing pt binary...'
	install -Dm755 "$srcdir/bin/pt"			"$pkgdir/usr/bin/pt"

	msg 'Installing README...'
	install -Dm644 "$_repodir/$pkgname/README.md"	"$pkgdir/usr/share/doc/$pkgname/README.md"

	msg 'Installing LICENSE...'
	install -Dm644 "$_repodir/$pkgname/LICENSE"	"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}