Mail archive
alpine-aports

[alpine-aports] [PATCH 2/2] main/go: upgrade to 1.5

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Mon, 24 Aug 2015 19:24:04 +0200

This might still need some further testing, especially cgo wasn't tested
to extensively by me.
---
 main/go/APKBUILD                          | 69 ++++++----------------
 main/go/default-sc-getpw-r-size-max.patch | 15 -----
 main/go/fix-arm-hackery.patch             | 98 -------------------------------
 main/go/no-longjmp-redefine.patch         | 10 ----
 main/go/no-pic.patch                      | 14 -----
 main/go/no-werror.patch                   | 10 ----
 6 files changed, 17 insertions(+), 199 deletions(-)
 delete mode 100644 main/go/default-sc-getpw-r-size-max.patch
 delete mode 100644 main/go/fix-arm-hackery.patch
 delete mode 100644 main/go/no-longjmp-redefine.patch
 delete mode 100644 main/go/no-pic.patch
 delete mode 100644 main/go/no-werror.patch
diff --git a/main/go/APKBUILD b/main/go/APKBUILD
index 62d891b..93f9e4d 100644
--- a/main/go/APKBUILD
+++ b/main/go/APKBUILD
_at_@ -1,30 +1,23 @@
 # Contributor: Sören Tempel <soeren+alpine_at_soeren-tempel.net>
 # Maintainer: Eivind Uggedal <eivind_at_uggedal.com>
 pkgname=go
-pkgver=1.4.2
+pkgver=1.5
 # This should be the latest commit on the corresponding release branch
-_toolsver="abf43428cc239218424c7a44dc9b5987cd351c3e"
-pkgrel=3
+_toolsver="d02228d1857b9f49cd0252788516ff5584266eb6"
+pkgrel=0
 pkgdesc="Go programming language compiler"
 url="http://www.golang.org/"
 arch="x86 x86_64 armhf"
 license="BSD"
+replaces="go-bootstrap"
 depends=""
 depends_dev=""
-makedepends="bash perl"
+makedepends="bash go-bootstrap"
 options="!strip"
 install=""
 subpackages="$pkgname-doc $pkgname-tools $pkgname-cross"
-source="
-	http://golang.org/dl/go${pkgver}.src.tar.gz
-	tools.tar.gz::https://github.com/golang/tools/archive/${_toolsver}.tar.gz
-
-	no-werror.patch
-	no-pic.patch
-	no-longjmp-redefine.patch
-	fix-arm-hackery.patch
-	default-sc-getpw-r-size-max.patch
-	"
+source="http://golang.org/dl/go${pkgver}.src.tar.gz
+	tools.tar.gz::https://github.com/golang/tools/archive/${_toolsver}.tar.gz"
 
 _gotools="cover vet godoc"
 _gocross="darwin freebsd openbsd windows"
_at_@ -32,23 +25,14 @@ _gocross="darwin freebsd openbsd windows"
 _builddir="$srcdir"/$pkgname
 _tooldir="$srcdir"/tools-${_toolsver}
 
-prepare() {
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) patch -p1 -i "$srcdir"/$i || return 1 ;;
-		esac
-	done
-}
-
 build() {
 	cd "$_builddir/src"
-	unset CC # ccache breaks build for some reason
 
 	export GOPATH="$srcdir"
 	export GOROOT="$_builddir"
 	export GOBIN="$GOROOT"/bin
 	export GOROOT_FINAL=/usr/lib/go
+	export GOROOT_BOOTSTRAP=/usr/lib/go
 
 	case "$CARCH" in
 	x86)	export GOARCH="386" ;;
_at_@ -64,8 +48,8 @@ build() {
 		done
 	done
 
-	# FIXME: race and bench tests fail:
-	#PATH="$GOROOT/bin:$PATH" ./run.bash --no-rebuild --banner || return 1
+	# FIXME some tests fail:
+	# PATH="$GOROOT/bin:$PATH" ./run.bash -no-rebuild || return 1
 
 	mkdir -p "$GOPATH"/src/golang.org/x/tools
 	cp -r "$_tooldir"/* "$GOPATH"/src/golang.org/x/tools
_at_@ -114,37 +98,18 @@ cross() {
 	pkgdesk="Go cross compilers"
 	depends="$pkgname"
 
-	mkdir -p "$subpkgdir"/usr/lib/go/pkg/tool \
-		"$subpkgdir"/usr/lib/go/src/runtime
-
+	mkdir -p "$subpkgdir"/usr/lib/go/pkg/tool
 	for os in $_gocross; do
 		mv "$pkgdir"/usr/lib/go/pkg/tool/${os}_* \
 			"$subpkgdir"/usr/lib/go/pkg/tool || return 1
 		mv "$pkgdir"/usr/lib/go/pkg/${os}_* \
 			"$subpkgdir"/usr/lib/go/pkg || return 1
-		mv "$pkgdir"/usr/lib/go/src/runtime/zasm_${os}*.h \
-			"$subpkgdir"/usr/lib/go/src/runtime || return 1
 	done
 }
 
-md5sums="907f85c8fa765d31f7f955836fec4049  go1.4.2.src.tar.gz
-a8bc7ad3d0deff01bd45e4938cc3adb6  tools.tar.gz
-65330c61f6d6c881033b0a95ca228edb  no-werror.patch
-4391be88ce8bacdd7fee433b39635583  no-pic.patch
-93ad940db4a6d51e086f80755eaa8f53  no-longjmp-redefine.patch
-81ac9f3188df7a0c16c52cc4d8cc1ffa  fix-arm-hackery.patch
-fd4d1a7ccb5d37da4ff9c3a2d97aa976  default-sc-getpw-r-size-max.patch"
-sha256sums="299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b  go1.4.2.src.tar.gz
-e754f0e28092f19d70e2c229023ef9b2d935e81ba886ece40e02803a83825f3d  tools.tar.gz
-65d38b9485da2ff9417a2c44a81b6e52cc9bd2727b27e7add10d48a63805d4a3  no-werror.patch
-86fc68a50bc4a9336a003239adf1dcc6d7cabfb9c1bcf09b0d53d09100ceff12  no-pic.patch
-084020e0eb6cb0aceee047bd5962872ed51dbb45465174018d108eb195c26605  no-longjmp-redefine.patch
-fced8436d9c32a43a5cc87f2243529e7a8209ba73a9afd4fd7733245bc55e4e3  fix-arm-hackery.patch
-3757d5f7c4e6d3b2fed4b01c7da6e3e8c0b7789333219ab10ec0b151fb163980  default-sc-getpw-r-size-max.patch"
-sha512sums="cda1a29d4418875dffaf3324004ddae8e1bbb573f7668e6e0c03d8b61284f4db7fca244c181f2859f8ccdd3db6391fb21e0d98a1a9fc15096c15883249d48a9c  go1.4.2.src.tar.gz
-1b4a6fb526029fe7f07a676cf2ee0b9e228e3b3b600e8607b04f129074892a85f39685257ffe25939478044ce1096ce053a283ef2b05465b4e6d8deb10da8e03  tools.tar.gz
-3cf139723e6ff0cbf7aaf76295fe4208f2062f2d4086e36d05cad83919217b5355e0e79b0b515a06a578389301bd07b062cb58b98fc0f9e4badf190cd1c34826  no-werror.patch
-a8e95c3c536a30e15b9bad5e623a085c521739639a58ac638679d99413a1bee8823729783123cbe4495ac42822df31f4776f0380a63786b9f4fc73190e012ae5  no-pic.patch
-3a9b665f8fda89729c4c269ea82f82ee515f0026d26f1d51e2cf84054456e394afc14875e7ed29280a12488907d50c70af313e2e4a5b62c328bbade098db9d4d  no-longjmp-redefine.patch
-573146b72c980af5e41540fd7912b5579b050e41ac9d808e8d14268cf0a0fa1a70e6fade85011c0f18f1a428bc95b225d8b8345be1c50656dc69046ef1eb0b40  fix-arm-hackery.patch
-5de9747fe60bbc60aa8ac9870f397fa8750723f919fea25a6afc22066be45a8ad193f7935d3deacbe85c032be89b8ace0a7e82b6c9981ddaf3b7f6e8d140c61f  default-sc-getpw-r-size-max.patch"
+md5sums="3f072baece07fa42d18376419afad323  go1.5.src.tar.gz
+c64b28ba5df8499bcc19adc995da991a  tools.tar.gz"
+sha256sums="be81abec996d5126c05f2d36facc8e58a94d9183a56f026fc9441401d80062db  go1.5.src.tar.gz
+80db6fc563df50eb924dbf4f96cef287fc6b89cc8b98595c1dac3c80a118f290  tools.tar.gz"
+sha512sums="dac657d3ce8226e247449ce8b0bf34bcacd2479764e29f04562bd07af0bd054a4b3b8d309898dc0775450005c9d077fd4cebb3d1831c9a09d3f093579e32d54f  go1.5.src.tar.gz
+80813c2da74c7b25fa2cfd15b2505757e7f466469ac701cb22d190dc83a607f091c4dea207a2e371e53d7a1f5459e7b53e5eea53c95565e958a6eb7fcb212359  tools.tar.gz"
diff --git a/main/go/default-sc-getpw-r-size-max.patch b/main/go/default-sc-getpw-r-size-max.patch
deleted file mode 100644
index f242b5a..0000000
--- a/main/go/default-sc-getpw-r-size-max.patch
+++ /dev/null
_at_@ -1,15 +0,0 @@
---- a/src/os/user/lookup_unix.go
-+++ b/src/os/user/lookup_unix.go
-_at_@ -57,6 +57,12 @@
- 		bufSize = 1024
- 	} else {
- 		bufSize = C.sysconf(C._SC_GETPW_R_SIZE_MAX)
-+		// The musl alternative standard library on Linux
-+		// return -1 as specified by POSIX if there are no
-+		// hard limit on _SC_GETPW_R_SIZE_MAX.
-+		if bufSize == -1 {
-+			bufSize = 1024
-+		}
- 		if bufSize <= 0 || bufSize > 1<<20 {
- 			return nil, fmt.Errorf("user: unreasonable _SC_GETPW_R_SIZE_MAX of %d", bufSize)
- 		}
diff --git a/main/go/fix-arm-hackery.patch b/main/go/fix-arm-hackery.patch
deleted file mode 100644
index f5a4472..0000000
--- a/main/go/fix-arm-hackery.patch
+++ /dev/null
_at_@ -1,98 +0,0 @@
---- go/src/cmd/dist/arm.c
-+++ go.fixed/src/cmd/dist/arm.c
-_at_@ -11,8 +11,8 @@
- 	return "6";
- }
- #else
--static void useVFPv3(void);
--static void useVFPv1(void);
-+void useVFPv3(void);
-+void useVFPv1(void);
- 
- char *
- xgetgoarm(void)
-_at_@ -26,46 +26,6 @@
- 	else if(xtryexecfunc(useVFPv1))
- 		return "6";
- 	return "5";
--}
--
--static void
--useVFPv3(void)
--{
--	// try to run VFPv3-only "vmov.f64 d0, #112" instruction
--	// we can't use that instruction directly, because we
--	// might be compiling with a soft-float only toolchain.
--	//
--	// some newer toolchains are configured to use thumb
--	// by default, so we need to do some mode changing magic
--	// here.
--	// We can use "bx pc; nop" here, but GNU as(1) insists
--	// on warning us
--	// "use of r15 in bx in ARM mode is not really useful"
--	// so we workaround that by using "bx r0"
--	__asm__ __volatile__ ("mov r0, pc");
--	__asm__ __volatile__ ("bx r0");
--	__asm__ __volatile__ (".word 0xeeb70b00"); // vmov.f64 d0, #112
--	__asm__ __volatile__ (".word 0xe12fff1e"); // bx lr
--}
--
--static void
--useVFPv1(void)
--{
--	// try to run "vmov.f64 d0, d0" instruction
--	// we can't use that instruction directly, because we
--	// might be compiling with a soft-float only toolchain
--	//
--	// some newer toolchains are configured to use thumb
--	// by default, so we need to do some mode changing magic
--	// here.
--	// We can use "bx pc; nop" here, but GNU as(1) insists
--	// on warning us
--	// "use of r15 in bx in ARM mode is not really useful"
--	// so we workaround that by using "bx r0"
--	__asm__ __volatile__ ("mov r0, pc");
--	__asm__ __volatile__ ("bx r0");
--	__asm__ __volatile__ (".word 0xeeb00b40"); // vomv.f64 d0, d0
--	__asm__ __volatile__ (".word 0xe12fff1e"); // bx lr
- }
- 
- #endif
---- go/src/make.bash
-+++ go.fixed/src/make.bash
-_at_@ -129,7 +132,7 @@
- if [ -z "$CC" -a -z "$(type -t gcc)" -a -n "$(type -t clang)" ]; then
- 	export CC=clang CXX=clang++
- fi
--${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
-+${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c cmd/dist/*.S
- 
- # -e doesn't propagate out of eval, so check success by hand.
- eval $(./cmd/dist/dist env -p || echo FAIL=true)
---- /dev/null	2014-12-09 07:52:31.203329541 -0200
-+++ go.fixed/src/cmd/dist/arm.S	2014-12-09 10:29:34.149969243 -0200
-_at_@ -0,0 +1,24 @@
-+#ifdef __ARMEL__
-+
-+.text
-+
-+.global useVFPv3
-+.hidden useVFPv3
-+.type useVFPv3,%function
-+useVFPv3:
-+	mov r0, pc
-+	bx r0
-+	.word 0xeeb70b00 // vmov.f64 d0, #112
-+	.word 0xe12fff1e // bx lr
-+
-+
-+.global useVFPv1
-+.hidden useVFPv1
-+.type useVFPv1,%function
-+useVFPv1:
-+	mov r0, pc
-+	bx r0
-+	.word 0xeeb00b40 // vomv.f64 d0, d0
-+	.word 0xe12fff1e // bx lr
-+
-+#endif
diff --git a/main/go/no-longjmp-redefine.patch b/main/go/no-longjmp-redefine.patch
deleted file mode 100644
index 36566d7..0000000
--- a/main/go/no-longjmp-redefine.patch
+++ /dev/null
_at_@ -1,10 +0,0 @@
---- a/include/libc.h
-+++ b/include/libc.h
-_at_@ -102,7 +102,6 @@ extern	void	sysfatal(char*, ...);
- #define atoll		p9atoll
- #define getenv		p9getenv
- #define	getwd		p9getwd
--#define	longjmp		p9longjmp
- #undef  setjmp
- #define setjmp		p9setjmp
- #define putenv		p9putenv
diff --git a/main/go/no-pic.patch b/main/go/no-pic.patch
deleted file mode 100644
index 633dd9a..0000000
--- a/main/go/no-pic.patch
+++ /dev/null
_at_@ -1,14 +0,0 @@
---- a/src/cmd/ld/lib.c
-+++ b/src/cmd/ld/lib.c
-_at_@ -786,6 +786,11 @@ hostlink(void)
- 		p = strchr(p + 1, ' ');
- 	}
- 
-+	// The Go linker does not currently support building objects that
-+	// may be linked into a PIE. See:
-+	// https://code.google.com/p/go/issues/detail?id=6940
-+	argv[argc++] = "-fno-PIC";
-+
- 	argv[argc] = nil;
- 
- 	quotefmtinstall();
diff --git a/main/go/no-werror.patch b/main/go/no-werror.patch
deleted file mode 100644
index 01f183e..0000000
--- a/main/go/no-werror.patch
+++ /dev/null
_at_@ -1,10 +0,0 @@
---- a/src/cmd/dist/build.c
-+++ b/src/cmd/dist/build.c
-_at_@ -384,7 +384,6 @@ static char *proto_gccargs[] = {
- 	"-Wno-switch",
- 	"-Wno-comment",
-	"-Wno-missing-field-initializers",
--	"-Werror",
- 	"-fno-common",
- 	"-ggdb",
- 	"-pipe",
-- 
2.5.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Aug 24 2015 - 19:24:04 GMT