summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMario Finelli2021-06-08 19:28:38 -0400
committerMario Finelli2021-06-08 19:28:38 -0400
commit994dae525387dd4a203de61247d8d05f03af2637 (patch)
treecbd9550eefc717a747e876e15c6bb1411cf9592e /PKGBUILD
downloadaur-time_warrior.tar.gz
Initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD42
1 files changed, 42 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..393fc6b3b8d7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Mario Finelli <mario at finel dot li>
+
+pkgname=time_warrior
+pkgver=1.3.2
+pkgrel=1
+pkgdesc="A CLI-based time tracking tool"
+arch=(x86_64)
+url=https://github.com/mrcook/time_warrior
+license=(MIT)
+depends=(glibc)
+makedepends=(go)
+source=(https://github.com/mrcook/time_warrior/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
+sha256sums=('a8b80082d62f464edc21f00faa98fa4a917f85e0b0878898a2f87ccddc2e971c')
+
+prepare() {
+ cd $pkgname-$pkgver
+ export GOPATH="${srcdir}/gopath"
+ go mod vendor
+}
+
+build() {
+ cd $pkgname-$pkgver
+
+ export CGO_LDFLAGS="$LDFLAGS"
+ export CGO_CFLAGS="$CFLAGS"
+ export CGO_CPPFLAGS="$CPPFLAGS"
+ export CGO_CXXFLAGS="$CXXFLAGS"
+
+ export GOPATH="${srcdir}/gopath"
+
+ go build -o tw/tw -trimpath -buildmode=pie -mod=readonly \
+ -ldflags "-s -w -linkmode external -extldflags \"${LDFLAGS}\"" tw/main.go
+}
+
+package() {
+ cd $pkgname-$pkgver
+ install -Dm0755 tw/tw "$pkgdir/usr/bin/tw"
+ install -Dm0644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
+ install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim: set ts=2 sw=2 et: