aboutsummaryrefslogtreecommitdiff
path: root/extra/go
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2021-12-02 13:41:02 +0100
committerCem Keylan <cem@ckyln.com>2021-12-02 13:41:02 +0100
commit05ffbfadd0bbf17a5d0e29e2d13a4ce5b4ffc64a (patch)
treecf2dbb364896e26063e5c663e38309a2d3f79ecb /extra/go
parent547a14ae9bf93068625ba8e309f166ccb3236f40 (diff)
downloadrepository-05ffbfadd0bbf17a5d0e29e2d13a4ce5b4ffc64a.tar.gz
go: arch fix
Diffstat (limited to 'extra/go')
-rwxr-xr-xextra/go/build8
1 files changed, 7 insertions, 1 deletions
diff --git a/extra/go/build b/extra/go/build
index 6c394266..db14aea2 100755
--- a/extra/go/build
+++ b/extra/go/build
@@ -7,8 +7,14 @@ patch -p1 < no-bash.patch
# This breaks Go.
:> nostrip
+case $3 in
+ x86_64) export GOARCH=amd64 ;;
+ i?86) export GOARCH=386 ;;
+ *) printf 'unsupported architecture: %s\n' "$3"
+ exit 1
+esac
+
export CC="${CC:-cc}"
-export GOARCH=amd64
export GO_LDFLAGS="-w -s"
[ -f "$CPT_ROOT/var/db/cpt/installed/go/manifest" ] || {