go.sh (1336B)
1if [ -z "$hostmakedepends" -o "${hostmakedepends##*gcc-go-tools*}" ]; then 2 # gc compiler 3 if [ -z "$archs" ]; then 4 archs="aarch64* armv[567]* i686* x86_64* ppc64le*" 5 fi 6 hostmakedepends+=" go" 7 nopie=yes 8else 9 # gccgo compiler 10 if [ -z "$archs" ]; then 11 # we have support for these in our gcc 12 archs="aarch64* armv[567]* i686* x86_64* ppc64*" 13 fi 14 if [ "$CROSS_BUILD" ]; then 15 # target compiler to use; otherwise it'll just call gccgo 16 export GCCGO="${XBPS_CROSS_TRIPLET}-gccgo" 17 fi 18fi 19nostrip=yes 20 21case "$XBPS_TARGET_MACHINE" in 22 aarch64*) export GOARCH=arm64;; 23 armv5*) export GOARCH=arm; export GOARM=5;; 24 armv6*) export GOARCH=arm; export GOARM=6;; 25 armv7*) export GOARCH=arm; export GOARM=7;; 26 i686*) export GOARCH=386;; 27 x86_64*) export GOARCH=amd64;; 28 ppc64le*) export GOARCH=ppc64le;; 29 ppc64*) export GOARCH=ppc64;; 30 ppc*) export GOARCH=ppc;; 31 mipsel*) export GOARCH=mipsle;; 32 mips*) export GOARCH=mips;; 33esac 34 35export GOPATH="${wrksrc}/_build-${pkgname}-xbps" 36GOSRCPATH="${GOPATH}/src/${go_import_path}" 37export CGO_CFLAGS="$CFLAGS" 38export CGO_CPPFLAGS="$CPPFLAGS" 39export CGO_CXXFLAGS="$CXXFLAGS" 40export CGO_LDFLAGS="$LDFLAGS" 41export CGO_ENABLED=1 42export GO111MODULE=auto 43case "$XBPS_TARGET_MACHINE" in 44 *-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;; 45 *) export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;; 46esac