summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6cbccb6dbca44965ec10bee11b1a16bc63b49d67 (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=ijq
pkgver=0.2.4
pkgrel=1
pkgdesc='Interactive jq tool, like jqplay for the commandline'
arch=(x86_64)
url="https://git.sr.ht/~gpanders/$pkgname"
license=(GPL3)
depends=(jq)
makedepends=(go scdoc)
source=("$pkgname-v$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('1060f48ceb0b8770531253cfe3b98b29b35e54655b794008ed78fc3079a01140')

prepare(){
	cd "$pkgname-v$pkgver"
	export GOPATH="$srcdir"
	go mod download
	# release has broken go.sum file
	go mod tidy
}

build() {
	cd "$pkgname-v$pkgver"
	export GOPATH="$srcdir"
	go build \
		-trimpath \
		-buildmode=pie \
		-mod=readonly \
		-modcacherw \
		-ldflags "-linkmode external -extldflags \"$LDFLAGS\" -X main.Version=$pkgver" \
		. ./...
	make docs
}

check() {
	cd "$pkgname-v$pkgver"
	export GOPATH="$srcdir"
	go test ./...
}

package() {
	cd "$pkgname-v$pkgver"
	install -Dm755 -t "$pkgdir/usr/bin/" "$pkgname"
	install -Dm644 -t "$pkgdir/usr/share/man/man1/" "$pkgname.1"
}