2020-04-17 02:58:25 +00:00
|
|
|
if [ -z "$hostmakedepends" -o "${hostmakedepends##*gcc-go-tools*}" ]; then
|
2019-11-11 02:03:14 +00:00
|
|
|
# gc compiler
|
|
|
|
if [ -z "$archs" ]; then
|
|
|
|
archs="aarch64* armv[567]* i686* x86_64* ppc64le*"
|
|
|
|
fi
|
|
|
|
hostmakedepends+=" go"
|
|
|
|
nopie=yes
|
|
|
|
else
|
|
|
|
# gccgo compiler
|
2020-12-16 23:12:37 +00:00
|
|
|
if [ -z "$archs" ]; then
|
|
|
|
# we have support for these in our gcc
|
2021-01-17 14:46:26 +00:00
|
|
|
archs="aarch64* armv[567]* i686* x86_64* ppc64*"
|
2020-12-16 23:12:37 +00:00
|
|
|
fi
|
2019-11-11 02:03:14 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
|
|
# target compiler to use; otherwise it'll just call gccgo
|
|
|
|
export GCCGO="${XBPS_CROSS_TRIPLET}-gccgo"
|
|
|
|
fi
|
2019-11-11 02:03:14 +00:00
|
|
|
fi
|
2015-02-21 12:38:37 +00:00
|
|
|
nostrip=yes
|
2015-02-21 13:34:03 +00:00
|
|
|
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
2016-09-16 20:26:56 +00:00
|
|
|
aarch64*) export GOARCH=arm64;;
|
2019-11-11 02:03:14 +00:00
|
|
|
armv5*) export GOARCH=arm; export GOARM=5;;
|
2015-02-21 13:34:03 +00:00
|
|
|
armv6*) export GOARCH=arm; export GOARM=6;;
|
|
|
|
armv7*) export GOARCH=arm; export GOARM=7;;
|
|
|
|
i686*) export GOARCH=386;;
|
|
|
|
x86_64*) export GOARCH=amd64;;
|
2018-12-31 23:24:00 +00:00
|
|
|
ppc64le*) export GOARCH=ppc64le;;
|
|
|
|
ppc64*) export GOARCH=ppc64;;
|
2019-11-11 02:03:14 +00:00
|
|
|
ppc*) export GOARCH=ppc;;
|
|
|
|
mipsel*) export GOARCH=mipsle;;
|
|
|
|
mips*) export GOARCH=mips;;
|
2015-02-21 13:34:03 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
export GOPATH="${wrksrc}/_build-${pkgname}-xbps"
|
2017-11-24 22:05:29 +00:00
|
|
|
GOSRCPATH="${GOPATH}/src/${go_import_path}"
|
2015-09-04 00:18:57 +00:00
|
|
|
export CGO_CFLAGS="$CFLAGS"
|
|
|
|
export CGO_CPPFLAGS="$CPPFLAGS"
|
|
|
|
export CGO_CXXFLAGS="$CXXFLAGS"
|
|
|
|
export CGO_LDFLAGS="$LDFLAGS"
|
|
|
|
export CGO_ENABLED=1
|
2021-03-12 13:11:11 +00:00
|
|
|
export GO111MODULE=auto
|
2018-09-11 10:38:46 +00:00
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
|
|
|
|
*) export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;;
|
|
|
|
esac
|