blob: dd30d252cf95d881b0a61235d01e056f9452860d (
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=klog-time-tracker
_pkgname=klog
pkgver=6.4
pkgrel=1
pkgdesc='A plain-text file format and a command line tool for time tracking'
arch=(x86_64)
url="https://github.com/jotaen/$_pkgname"
license=(MIT)
depends=(glibc)
makedepends=(go
git)
conflicts=(klog)
_archive="$_pkgname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('890a6368ce7273f6c8152e3d8c5f37f07d7d994eff1ae10330e089a33cc3b9bb')
prepare() {
cd "$_archive"
go get -t ./...
go mod tidy
mkdir -p dist
}
build() {
local _commit=$(zcat ${source[0]##*/} | git get-tar-commit-id)
cd "$_archive"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
go build -o dist -v \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags '$LDFLAGS' \
-X main.BinaryVersion=v$pkgver -X main.BinaryBuildHash=${_commit::7}" \
./...
}
package() {
cd "$_archive"
install -Dm0755 -t "$pkgdir/usr/bin/" "dist/$_pkgname"
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.txt
}
|