From 583eb4f8b4d58cacb84f2a16bcd48e88aabb3f90 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 | 107 +++++++++++++++++++++++++++ 2 files changed, 111 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..2324c6529bf --- /dev/null +++ b/srcpkgs/go1.12-bootstrap/template @@ -0,0 +1,107 @@ +# 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 + +case "$XBPS_TARGET_MACHINE" in + x86_64*) + _dist_arch="amd64" + _deb_arch="amd64" + checksum=" + da036454cb3353f9f507f0ceed4048feac611065e4e1818b434365eb32ac9bdc + 48bc07f034d4681cd3a758809e5a192b9ad2b65a6455e83363ce891fb47a6b73" + ;; + i686*) + _dist_arch="386" + _deb_arch="i386" + checksum=" + fafcb585591557b7b16d9b22dec4654193d205cf444b1810ab2988f658585e23 + 87064f73f9f4e24efca95ebc95531caad3d016f646dd07c42808e5ece55f0ec7" + ;; + arm*) + _dist_arch="armv6l" + # we're hardfloat on armv6l but debian armhf is armv7l + _deb_arch="armel" + checksum=" + bf061cc3d4951e07904496b5c3d6c82419309d24634835522d786673a3f5438f + 2c9633e5030216be7d3d0bb83e3dbb8882541c57afa098a54fdc0162823e112b" + ;; + aarch64*) + _dist_arch="arm64" + _deb_arch="arm64" + checksum=" + dcfcb3785292c98f7a75c2276169dfe2d445c19f8ffe1d40b3f7b8f59712d361 + b3dd4d3c2523f9a07d3bde9d35ef7c6c30bcd32af31abbc6ce085888e1f8dd57" + ;; + ppc64le*) + _dist_arch="ppc64le" + _deb_arch="ppc64el" + checksum=" + 77056264abcf5444ed0d9ab7552552ae2145ca8fb6c39d33db3c735eaf3f42d2 + 05d63c62e413ae638732242cba5d57c92c40d66d5c7ffe23e8adf8ec168fac34" + ;; +esac + +# the official binaries of go use the dynamic linker and libc from glibc, +# so on musl hosts, fetch a binary distribution of glibc from a trustable +# source (Debian) and use patchelf to alter the dynamic linker path as +# well as add rpath to make the go compiler use the bundled libs +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + _libc_ver=2.29 + _libc_rev=3 + _libc_deb="libc6_${_libc_ver}-${_libc_rev}_${_deb_arch}.deb" + hostmakedepends+=" patchelf" +fi + +distfiles="https://dl.google.com/go/go${version}.linux-${_dist_arch}.tar.gz" +if [ -n "$_libc_ver" ]; then + distfiles+=" http://ftp.debian.org/debian/pool/main/g/glibc/${_libc_deb}" + skip_extraction+=" ${_libc_deb}" +fi + +post_extract() { + [ -z "$_libc_ver" ] && return 0 + + mkdir ${wrksrc}/libc6 + pushd ${wrksrc}/libc6 + ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_libc_deb} + tar xf data.tar.xz + mv lib/*-linux-*/ld-${_libc_ver}.so ${wrksrc}/bin + mv lib/*-linux-*/libc-${_libc_ver}.so ${wrksrc}/bin + mv lib/*-linux-*/libpthread-${_libc_ver}.so ${wrksrc}/bin + popd +} + +post_build() { + [ -z "$_libc_ver" ] && return 0 + + local _pelf_path="/usr/lib/go1.12/bin" _pelf_args= + _pelf_args+=" --set-interpreter ${_pelf_path}/ld-${_libc_ver}.so" + _pelf_args+=" --set-rpath ${_pelf_path}" + + pushd ${wrksrc}/bin + patchelf ${_pelf_args} libc-${_libc_ver}.so + patchelf ${_pelf_args} libpthread-${_libc_ver}.so + patchelf ${_pelf_args} go + patchelf ${_pelf_args} godoc + ln -sf libc-${_libc_ver}.so libc.so.6 + ln -sf libpthread-${_libc_ver}.so libpthread.so.0 + popd +} + +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 0e5c17b5703d34d45a52f5937e14a1e22c5f3716 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 --- 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"