summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorNikola Pavlica2022-05-14 21:35:35 +0200
committerNikola Pavlica2022-05-14 21:35:35 +0200
commit49558d38fdd79200501382703d074ef18eb064f4 (patch)
tree1ab31f8c397919ba292a2d508f8d663dcc068247 /PKGBUILD
parent6068b340409ea18c00f46a0748c803e0d936c0fb (diff)
downloadaur-discordlogin-git.tar.gz
[fix] add goflags as per @micwoj92's comment
Diffstat (limited to 'PKGBUILD')
-rwxr-xr-xPKGBUILD16
1 files changed, 15 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index c765adffd8a6..ba4a39647c81 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -22,7 +22,21 @@ build() {
GOPATH="${srcdir}/go"
fi
cd $_pkgname
- go build -trimpath
+
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+
+ # or alternatively you can define some of these flags from the CLI options
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
+ .
}
package() {