Mail archive
alpine-aports

[alpine-aports] [PATCH 9/9] community/go: add s390x support

From: Tuan M. Hoang <tmhoang_at_flatglobe.org>
Date: Wed, 22 Feb 2017 17:07:18 -0500

go/s390x is not supported by go1.4 thus cannot use community/go-bootstrap. On
x86_64, cross-build a go/s390x bootstrap, then use that bootstrap toolchains to
natively build the go-linux-s390x-bootstrap.on.s390x.tbz toolchains.

---
 community/go/APKBUILD | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/community/go/APKBUILD b/community/go/APKBUILD
index 8ff2ae4..654edb1 100644
--- a/community/go/APKBUILD
+++ b/community/go/APKBUILD
_at_@ -19,6 +19,7 @@ source="http://golang.org/dl/go${pkgver/_/}.src.tar.gz
 	$pkgname-tools-${pkgver/_/}.tar.gz::https://github.com/golang/tools/archive/${_toolsver}.tar.gz
 	default-buildmode-pie.patch
 	http://dev.alpinelinux.org/bootstrap/go/go-linux-musl-arm64-bootstrap.tar.bz2
+	https://raw.githubusercontent.com/tmh1999/alpine-s390x-repo/master/go-linux-s390x-bootstrap.on.s390x.tbz
 	"
 
 # NOTE: building go for x86 with grsec kernel requires:
_at_@ -29,6 +30,9 @@ case "$CARCH" in
 aarch64)
 	_goroot_bootstrap="$srcdir"/go-linux-arm64-bootstrap
 	;;
+s390x)
+	_goroot_bootstrap="$srcdir"/go-linux-s390x-bootstrap
+	;;
 *)
 	makedepends="$makedepends go-bootstrap"
 	_goroot_bootstrap=/usr/lib/go-bootstrap
_at_@ -45,6 +49,7 @@ done
 
 builddir="$srcdir"/$pkgname
 build() {
+	[ "$CARCH" = "s390x" ] && tar xf "$srcdir"/go-linux-s390x-bootstrap.on.s390x.tbz -C "$srcdir"
 	cd "$builddir/src"
 
 	export GOPATH="$srcdir"
_at_@ -59,6 +64,7 @@ build() {
 	armv7)	export GOARCH="arm" GOARM=7 ;;
 	x86)	export GOARCH="386" GO386=387 ;;
 	x86_64)	export GOARCH="amd64" ;;
+	s390x)	export GOARCH="s390x" ;;
 	*)	return 1 ;;
 	esac
 
_at_@ -156,4 +162,5 @@ a1d870570317f5e87c606d6bad0d435a594fed802c99475ab306768dc853a029  go-linux-musl-
 sha512sums="dc9950c3ea7100e536ad58fd93505d584276b7c50d4b8fe2ba7f20fd043dcf0d315b735c48945302055e91517594cc2b0061ccec9478a8ab48f1f2836c20afb3  go1.7.4.src.tar.gz
 553be713d03f1a53605c41f67822c75d86dacf9ccba9f2329e111b4178287aee1ddccd3ccc4ab76b9dbcff34f11aeddebce5deac47e715ea75d032bc9ab0355c  go-tools-1.7.4.tar.gz
 13cd386c38875b951da4057586007f3c67503dc79ddf57befbf763af85ec2cd2a2e6b00614450c179c93f1f8747ee7456ee412adccd08a5f115b33812598a148  default-buildmode-pie.patch
+5d6bb93de8d36c906a870b998bc8e058d780b8ac9f00df27b51735f32b0aa71867bbb97e8d6780213c38ac9e78c091c593a7a0d5aec69a60a6d9eb3553de58fe  go-linux-s390x-bootstrap.on.s390x.tbz
 da2a33c7bafe11bdad12e755bfe19c9f8ab34ae14899712a0e10da202d5457af419a920be5ffa19cc03d2351194b5c02f1edb595201f81dfb8a51f34b42a8162  go-linux-musl-arm64-bootstrap.tar.bz2"
-- 
2.1.4
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed Feb 22 2017 - 17:07:18 GMT