[arch-commits] Commit in gron/repos (community-x86_64 community-x86_64/PKGBUILD)

George Rawlinson grawlinson at gemini.archlinux.org
Wed Apr 13 08:05:11 UTC 2022


    Date: Wednesday, April 13, 2022 @ 08:05:10
  Author: grawlinson
Revision: 1186025

archrelease: copy trunk to community-x86_64

Added:
  gron/repos/community-x86_64/
  gron/repos/community-x86_64/PKGBUILD
    (from rev 1186024, gron/trunk/PKGBUILD)

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

Copied: gron/repos/community-x86_64/PKGBUILD (from rev 1186024, gron/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD	                        (rev 0)
+++ community-x86_64/PKGBUILD	2022-04-13 08:05:10 UTC (rev 1186025)
@@ -0,0 +1,72 @@
+# Maintainer: George Rawlinson <grawlinson at archlinux.org>
+# Contributor: Stefan Tatschner <stefan at rumpelsepp.org>
+
+pkgname=gron
+pkgver=0.6.1
+pkgrel=2
+pkgdesc='Makes JSON greppable'
+arch=('x86_64')
+url='https://github.com/tomnomnom/gron'
+license=('MIT')
+depends=('glibc')
+makedepends=('git' 'go')
+options=('!lto')
+_commit='6d4fe183671a3583f61c1340bdb7f0a9374f7a1d'
+source=("$pkgname::git+https://github.com/tomnomnom/gron.git#commit=$_commit")
+b2sums=('SKIP')
+
+pkgver() {
+  cd "$pkgname"
+
+  git describe --tags | sed 's/^v//'
+}
+
+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" \
+    -o build \
+    .
+}
+
+check() {
+  cd "$pkgname"
+
+  go test -v ./...
+}
+
+package() {
+  cd "$pkgname"
+
+  # binary
+  install -vDm755 -t "$pkgdir/usr/bin" build/gron
+
+  # shell completion
+  install -vDm644 -t "$pkgdir/usr/share/fish/vendor_completions.d" completions/gron.fish
+
+  # documentation
+  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" {README,ADVANCED}.mkd
+
+  # license
+  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+}



More information about the arch-commits mailing list