Date: Sunday, July 5, 2020 @ 15:46:52
  Author: foxboron
Revision: 657877

upgpkg: easyjson 0.7.1-2

Use the new go package guidelines

Remove `-i` from "go build" because it will try write shared files to a 
root-owned directory.

Modified:
  easyjson/trunk/PKGBUILD

----------+
 PKGBUILD |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2020-07-05 15:46:09 UTC (rev 657876)
+++ PKGBUILD    2020-07-05 15:46:52 UTC (rev 657877)
@@ -2,7 +2,7 @@
 
 pkgname=easyjson
 pkgver=0.7.1
-pkgrel=1
+pkgrel=2
 pkgdesc='Fast JSON serializer for golang'
 arch=(x86_64)
 url='https://github.com/mailru/easyjson'
@@ -15,15 +15,27 @@
 prepare() {
   cd $srcdir/easyjson-$pkgver
   sed -i 's/golint /#golint /g' Makefile
+  sed -i 's/-i//g' Makefile
 }
 
 build() {
   cd $srcdir/easyjson-$pkgver
+  export CGO_CPPFLAGS="${CPPFLAGS}"
+  export CGO_CFLAGS="${CFLAGS}"
+  export CGO_CXXFLAGS="${CXXFLAGS}"
+  export CGO_LDFLAGS="${LDFLAGS}"
+  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
   make build
 }
 
 check() {
   cd $srcdir/easyjson-$pkgver
+  # The tests rebuild the binary, this time without flags
+  export CGO_CPPFLAGS="${CPPFLAGS}"
+  export CGO_CFLAGS="${CFLAGS}"
+  export CGO_CXXFLAGS="${CXXFLAGS}"
+  export CGO_LDFLAGS="${LDFLAGS}"
+  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
   make test
 }
 

Reply via email to