summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD20
1 files changed, 13 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d4280f5a4bb4..8205bc96a6bb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,21 +9,27 @@ url='https://go-city.github.io'
license=('MIT')
provides=('gocity')
depends=('glibc')
-makedepends=('go-pie')
+makedepends=('go')
source=("gocity-${pkgver}.tar.gz::https://github.com/rodrigo-brito/gocity/archive/v${pkgver}.tar.gz")
sha256sums=('dfe6cc9b7845f47d4850b1d30fe5246a40e2635d71824a29dbb13bffce2d40a2')
+prepare() {
+ cd "${srcdir}/gocity-${pkgver}"
+ mkdir -p build/
+}
+
build() {
cd "${srcdir}/gocity-${pkgver}"
- mkdir -p $srcdir/go
- export GOPATH="${srcdir}"/go
- export PATH=$PATH:$GOPATH/bin
- go build -v -o "../gocity-bin"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+ go build -o build ./...
}
package() {
cd "${srcdir}/gocity-${pkgver}"
- install -Dm755 ../gocity-bin "${pkgdir}/usr/bin/gocity"
+ install -Dm755 build/gocity "${pkgdir}/usr/bin/gocity"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/gocity/LICENSE"
- go clean -modcache #Remove go libraries
} \ No newline at end of file