blob: bfe9d7699c913292f565d7a102f75506f537fdf4 (
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
|
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
pkgname=kt
pkgver=13.1.0
_commit=5ecef5c
pkgrel=1
pkgdesc="Kafka JSON tool"
arch=('x86_64')
url="https://github.com/fgeller/kt"
license=('MIT')
depends=('glibc')
makedepends=('git' 'go')
source=("$pkgname::git+$url#commit=$_commit?signed")
sha256sums=('SKIP')
validpgpkeys=('76DCDDA475507AA5186DC9E571E54A69B0C4269F') ## Felix Geller
prepare() {
cd "$pkgname"
mkdir -p build
go mod tidy
}
build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
cd "$pkgname"
go build -o build \
-ldflags "-X main.buildTime=`date --iso-8601=s`
-X main.buildVersion=$pkgver
-linkmode external
-extldflags \"${LDFLAGS}\""
}
# check() {
# cd "$pkgname"
# go test -v -short -vet=all -failfast -ldflags "-linkmode external -extldflags \"${LDFLAGS}\""
# }
package() {
cd "$pkgname"
install -D build/kt -t "$pkgdir/usr/bin/"
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
|