go: add support for /usr/local host installations

fix build when compiling on arm/aarch64
This commit is contained in:
Arthur Liberman 2023-04-26 21:02:35 +03:00
parent a68c4c7114
commit 684a2b2d64
No known key found for this signature in database
GPG Key ID: 8894632E36AF1866

View File

@ -13,14 +13,14 @@ PKG_LONGDESC="An programming language that makes it easy to build simple, reliab
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
configure_host() { configure_host() {
export GOOS=linux
export GOROOT_FINAL=${TOOLCHAIN}/lib/golang export GOROOT_FINAL=${TOOLCHAIN}/lib/golang
if [ -x /usr/lib/go/bin/go ]; then if [ -x /usr/local/go/bin/go ]; then
export GOROOT_BOOTSTRAP=/usr/local/go
elif [ -x /usr/lib/go/bin/go ]; then
export GOROOT_BOOTSTRAP=/usr/lib/go export GOROOT_BOOTSTRAP=/usr/lib/go
else else
export GOROOT_BOOTSTRAP=/usr/lib/golang export GOROOT_BOOTSTRAP=/usr/lib/golang
fi fi
export GOARCH=amd64
if [ ! -d ${GOROOT_BOOTSTRAP} ]; then if [ ! -d ${GOROOT_BOOTSTRAP} ]; then
cat <<EOF cat <<EOF