From 32e2621c736a217ad6234c1558cc93385d3b9bc4 Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 10 Mar 2019 21:53:45 +0100 Subject: [PATCH 1/2] New package: go1.12-bootstrap-1.12.13 --- srcpkgs/go1.12-bootstrap/INSTALL.msg | 4 ++ srcpkgs/go1.12-bootstrap/template | 63 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 srcpkgs/go1.12-bootstrap/INSTALL.msg create mode 100644 srcpkgs/go1.12-bootstrap/template diff --git a/srcpkgs/go1.12-bootstrap/INSTALL.msg b/srcpkgs/go1.12-bootstrap/INSTALL.msg new file mode 100644 index 00000000000..142aeabbc1b --- /dev/null +++ b/srcpkgs/go1.12-bootstrap/INSTALL.msg @@ -0,0 +1,4 @@ +This is a copy of the official Go language toolchain binaries as provided by +the project on its download page. Please do keep in mind that it is almost +definitely not what you want to use and exists purely for the purpose of +bootstrapping the official compiler package (called simply 'go'). diff --git a/srcpkgs/go1.12-bootstrap/template b/srcpkgs/go1.12-bootstrap/template new file mode 100644 index 00000000000..24e5df3aa6b --- /dev/null +++ b/srcpkgs/go1.12-bootstrap/template @@ -0,0 +1,63 @@ +# Template file for 'go1.12-bootstrap' +pkgname=go1.12-bootstrap +version=1.12.13 +revision=1 +archs="x86_64* i686* armv[67]l* aarch64* ppc64le*" +wrksrc="go" +short_desc="Go 1.12 (bootstrap compiler)" +maintainer="q66 " +license="BSD-3-Clause" +homepage="https://golang.org" +nostrip=yes +noverifyrdeps=yes +nocross=yes + +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + depends+=" gcompat" + hostmakedepends+=" patchelf" +fi + +case "$XBPS_TARGET_MACHINE" in + x86_64*) + _dist_arch="amd64" + checksum="da036454cb3353f9f507f0ceed4048feac611065e4e1818b434365eb32ac9bdc" + ;; + i686*) + _dist_arch="386" + checksum="fafcb585591557b7b16d9b22dec4654193d205cf444b1810ab2988f658585e23" + ;; + arm*) + _dist_arch="armv6l" + checksum="bf061cc3d4951e07904496b5c3d6c82419309d24634835522d786673a3f5438f" + ;; + aarch64*) + _dist_arch="arm64" + checksum="dcfcb3785292c98f7a75c2276169dfe2d445c19f8ffe1d40b3f7b8f59712d361" + ;; + ppc64le*) + _dist_arch="ppc64le" + checksum="77056264abcf5444ed0d9ab7552552ae2145ca8fb6c39d33db3c735eaf3f42d2" + ;; +esac + +distfiles="https://dl.google.com/go/go${version}.linux-${_dist_arch}.tar.gz" + +post_build() { + [ "$XBPS_TARGET_LIBC" != "musl" ] && return 0 + + # we don't have lib64 compatibility path on musl 64-bit systems + # use patchelf to replace /lib64/ with /lib/ + + local _interp=$(patchelf --print-interpreter ${wrksrc}/bin/go) + + patchelf --set-interpreter ${_interp/lib64\//lib\/} ${wrksrc}/bin/go + patchelf --set-interpreter ${_interp/lib64\//lib\/} ${wrksrc}/bin/godoc +} + +do_install() { + vmkdir usr/lib/go1.12 + vcopy bin usr/lib/go1.12 + vcopy src usr/lib/go1.12 + vcopy pkg usr/lib/go1.12 + vlicense LICENSE +} From 6bf94162c938565b29b415d4722338ec62f6ab6c Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 15 Dec 2018 04:11:57 +0100 Subject: [PATCH 2/2] go: use go1.12-bootstrap, disable ppc* BE, disable cross-libc [ci skip] --- srcpkgs/go/template | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/srcpkgs/go/template b/srcpkgs/go/template index c263afc1d38..0349e5e3da2 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -4,14 +4,13 @@ version=1.13.4 revision=1 create_wrksrc=yes build_wrksrc=go -hostmakedepends="go1.4-bootstrap" +hostmakedepends="go1.12-bootstrap" short_desc="Go Programming Language" maintainer="Michael Aldridge " license="BSD-3-Clause" homepage="http://golang.org/" distfiles="https://golang.org/dl/go${version}.src.tar.gz" checksum=95dbeab442ee2746b9acf0934c8e2fc26414a0565c008631b04addb8c02e7624 - nostrip=yes noverifyrdeps=yes @@ -21,20 +20,27 @@ case "${XBPS_TARGET_MACHINE}" in mips*) _goarch=mips ;; i686*) _goarch=386 ;; x86_64*) _goarch=amd64 ;; + ppc64le*) _goarch=ppc64le ;; + ppc64*) broken="Upstream does not support ELFv2 for big endian ppc64";; + ppc*) broken="Upstream does not support 32-bit ppc";; *) _goarch=${XBPS_TARGET_MACHINE} ;; esac +if [ "$CROSS_BUILD" ]; then + if [ "${XBPS_MACHINE%%-musl}" = "${XBPS_TARGET_MACHINE%%-musl}" ]; then + broken="Cross-compiling to different libc is not supported" + fi +fi + do_build() { unset GCC CC CXX LD CFLAGS # FIXME: work around leaking go build-style vars when built as a # dependency unset CGO_CXXFLAGS CGO_CFLAGS CGO_ENABLED - - export GOCACHE=off + export GOROOT_BOOTSTRAP="/usr/lib/go1.12" export GOROOT=$PWD export GOROOT_FINAL="/usr/lib/go" - export GOROOT_BOOTSTRAP="/usr/lib/go1.4" export GOARCH=${_goarch} cd "src"