summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtte Lautanala2024-02-12 20:41:54 +0200
committerAtte Lautanala2024-02-12 20:41:54 +0200
commit27d50f25b7362354cdae05edf8f592b01b5f976d (patch)
tree14bf835318d8c7c8ea971f478361720e64369f5a
parent4bfe2d95cc2d3a8a25249e9194c1dafc5d20c2e6 (diff)
downloadaur-27d50f25b7362354cdae05edf8f592b01b5f976d.tar.gz
Build package with cgo enabled
This seems to be a commonly used way of building go applications in official Arch repositories. It also seems to have a more reasonable way of passing LDFLAGS.
-rw-r--r--PKGBUILD8
1 files changed, 5 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d4011cbae225..c66b5de1ea8b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,10 +13,12 @@ b2sums=('faa57be60b8e863265fc98b169364b49eb88db78b1de116d69a7d809228fff0285ea7e2
build() {
cd "${pkgname}-${pkgver}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
export GOFLAGS="-buildmode=pie"
- export CGO_ENABLED=0
- _LDFLAGS="-X github.com/phrase/phrase-cli/cmd.PHRASE_CLIENT_VERSION=${pkgver} -extldflags ${LDFLAGS}"
- go build -o phrase -ldflags "${_LDFLAGS}"
+ go build -o phrase -ldflags "-X github.com/phrase/phrase-cli/cmd.PHRASE_CLIENT_VERSION=${pkgver}"
}
package() {