summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO1
-rwxr-xr-xPKGBUILD16
2 files changed, 15 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3c3520de34e2..c1a71f510a37 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -13,4 +13,3 @@ pkgbase = discordlogin-git
sha1sums = SKIP
pkgname = discordlogin-git
-
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() {