[arch-commits] Commit in (zk zk/repos zk/trunk zk/trunk/PKGBUILD)

George Rawlinson grawlinson at gemini.archlinux.org
Mon Jan 3 08:13:11 UTC 2022


    Date: Monday, January 3, 2022 @ 08:13:11
  Author: grawlinson
Revision: 1092402

addpkg: zk 0.9.0-1

Added:
  zk/
  zk/repos/
  zk/trunk/
  zk/trunk/PKGBUILD

----------+
 PKGBUILD |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

Added: zk/trunk/PKGBUILD
===================================================================
--- zk/trunk/PKGBUILD	                        (rev 0)
+++ zk/trunk/PKGBUILD	2022-01-03 08:13:11 UTC (rev 1092402)
@@ -0,0 +1,63 @@
+# Maintainer: George Rawlinson <grawlinson at archlinux.org>
+# Contributor: Nogweii <me at nogweii.net>
+
+pkgname=zk
+pkgver=0.9.0
+pkgrel=1
+pkgdesc='A command-line tool helping you to maintain a Zettelkasten or personal wiki'
+arch=('x86_64')
+url="https://github.com/mickael-menu/zk"
+license=('GPL3')
+depends=('icu')
+makedepends=('go' 'git')
+options=('!lto')
+_commit='f8ef8cc09358434e3615e4babe9bdf75066904fb'
+source=("$pkgname::git+$url.git#commit=$_commit")
+md5sums=('SKIP')
+
+prepare() {
+  cd "$pkgname"
+
+  # create directory for build output
+  mkdir build
+
+  # download dependencies
+  go mod download
+}
+
+build() {
+  cd "$pkgname"
+
+  # set Go flags
+  export CGO_CPPFLAGS="${CPPFLAGS}"
+  export CGO_CFLAGS="${CFLAGS}"
+  export CGO_CXXFLAGS="${CXXFLAGS}"
+
+  go build -v \
+    -trimpath \
+    -buildmode=pie \
+    -mod=readonly \
+    -modcacherw \
+    -ldflags "-linkmode external -extldflags $LDFLAGS \
+    -X main.Version=$(git describe --tags HEAD) \
+    -X main.Build=$(git rev-parse --short HEAD)" \
+    -tags "fts5 icu" \
+    -o build \
+    .
+}
+
+check() {
+  cd "$pkgname"
+  go test -v -race -tags "fts5 icu" ./...
+}
+
+package() {
+  cd "$pkgname"
+
+  # binary
+  install -vDm755 -t "$pkgdir/usr/bin" build/zk
+
+  # documentation
+  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
+  cp -vr docs "$pkgdir/usr/share/doc/$pkgname"
+}



More information about the arch-commits mailing list