blob: 2f5d6dbdab97d7c554b7f52bebc73024ab46ffb7 (
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.5
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=('1b74a89a778c2f526db7ea2784db61c558b153ed3b45d1c8b45fc194d9bb5df9')
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
}
|