summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 494af340639c63db2274a08bd082b499561f1d13 (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
# Maintainer: hashworks <mail@hashworks.net>
pkgname=xrel-terminal-client
pkgver=2.1.2
pkgrel=2
pkgdesc="A terminal client to access the xREL.to API"
arch=("x86_64")
url="https://github.com/hashworks/xREL-Terminal-Client"
license=("GPL3")
changelog=CHANGELOG
makedepends=('go')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=("5fc87553a139ea25fc2c616045d0c99ce884bc62eaed53091a30bbcef3a3661f")

prepare(){
	cd "xREL-Terminal-Client-${pkgver}"
	mkdir -p build/
}

build() {
	cd "xREL-Terminal-Client-${pkgver}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
	go build -ldflags '-X main.VERSION='"${pkgver}"' -X main.BUILD_DATE='"$(date +"%Y-%m-%d_%H:%M:%S")" -o build/xrel ./src
}

check() {
	cd "xREL-Terminal-Client-${pkgver}"
	go test ./src
}

package() {
	cd "xREL-Terminal-Client-${pkgver}"
	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	install -Dm755 build/xrel "${pkgdir}/usr/bin/xrel"
}