summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD7
1 files changed, 6 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 3af4bd6f6c3a..a69a3b1255e8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -32,6 +32,12 @@ prepare() {
# Change into directory
cd ${pkgname}-${pkgver}
+ # Prepare environment
+ export GOPATH=${srcdir}/go
+ export GOENV=${srcdir}/go/.config
+ export GOCACHE=${srcdir}/go/.cache
+ go clean -cache -modcache
+
# Correct the Debian executable path to work with Arch Linux and related distros
sed -i 's/^Exec.*$/Exec=wireguird/g' deb/usr/share/applications/${pkgname}.desktop
mv deb/usr/local/bin deb/usr
@@ -58,7 +64,6 @@ build() {
export GOCACHE=${srcdir}/go/.cache
# Compile binary with gcc-go compiler
- go clean -cache -modcache
go generate
go build -modcacherw -ldflags "-s -w" -trimpath -o bin/${pkgname}
go clean -cache -modcache