diff options
author | Atte Lautanala | 2024-02-12 20:41:54 +0200 |
---|---|---|
committer | Atte Lautanala | 2024-02-12 20:41:54 +0200 |
commit | 27d50f25b7362354cdae05edf8f592b01b5f976d (patch) | |
tree | 14bf835318d8c7c8ea971f478361720e64369f5a | |
parent | 4bfe2d95cc2d3a8a25249e9194c1dafc5d20c2e6 (diff) | |
download | aur-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-- | PKGBUILD | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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() { |