summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8d90169d348f84e4948e0cd66f9933e58e43de61 (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
# Maintainer: hashworks <mail@hashworks.net>
pkgname=xrel-terminal-client
pkgver=2.1.2
pkgrel=3
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')
options=('!lto')
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"
}