From fd6e5c33ba4e0e7b5cff749bb464fd29d0897fa3 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 5 Dec 2020 13:25:41 +1100 Subject: [PATCH 1/2] New package: go1.4-bootstrap-20171003. --- srcpkgs/go1.4-bootstrap/INSTALL.msg | 4 +++ srcpkgs/go1.4-bootstrap/template | 39 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 srcpkgs/go1.4-bootstrap/INSTALL.msg create mode 100644 srcpkgs/go1.4-bootstrap/template diff --git a/srcpkgs/go1.4-bootstrap/INSTALL.msg b/srcpkgs/go1.4-bootstrap/INSTALL.msg new file mode 100644 index 00000000000..142aeabbc1b --- /dev/null +++ b/srcpkgs/go1.4-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.4-bootstrap/template b/srcpkgs/go1.4-bootstrap/template new file mode 100644 index 00000000000..fd12cd3825b --- /dev/null +++ b/srcpkgs/go1.4-bootstrap/template @@ -0,0 +1,39 @@ +# Template file for 'go1.4-bootstrap' +pkgname=go1.4-bootstrap +version=20171003 +revision=1 +archs="x86_64* i686* aarch64* armv[67]l*" +wrksrc="go" +short_desc="Go Programming Language 1.4 bootstrap package" +maintainer="fosslinux " +license="BSD-3-Clause" +homepage="https://golang.org/doc/install/source" +distfiles="https://dl.google.com/go/go1.4-bootstrap-${version}.tar.gz" +checksum=f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52 +nostrip=yes +noverifyrdeps=yes + +case "${XBPS_TARGET_MACHINE}" in + aarch64*) GOARCH=arm64 ;; + arm*) GOARCH=arm ;; + i686*) GOARCH=386 ;; + x86_64*) GOARCH=amd64 ;; + *) broken="Unsupported architecture ${XBPS_TARGET_MACHINE}" ;; +esac +export GOARCH + +do_build() { + unset GCC CC CXX LD LDFLAGS + unset CGO_CXXFLAGS CGO_CFLAGS CGO_ENABLED + + cd src + CGO_ENABLED=0 GOROOT="${PWD}" GOROOT_FINAL="/usr/lib/go1.4" ./make.bash +} + +do_install() { + vmkdir usr/lib/go1.4 + vcopy bin usr/lib/go1.4 + vcopy src usr/lib/go1.4 + vcopy pkg usr/lib/go1.4 + vlicense LICENSE +} From fd811f2af1a907fa20eeda1390fb24ba351fbb33 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 5 Dec 2020 13:26:05 +1100 Subject: [PATCH 2/2] go: use go1.4-bootstrap where possible. --- srcpkgs/go/template | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/srcpkgs/go/template b/srcpkgs/go/template index 977c87da8d0..54f6e7a46b7 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -4,7 +4,6 @@ version=1.15.5 revision=1 create_wrksrc=yes build_wrksrc=go -hostmakedepends="go1.12-bootstrap" short_desc="Go Programming Language" maintainer="Michael Aldridge " license="BSD-3-Clause" @@ -24,6 +23,19 @@ case "${XBPS_TARGET_MACHINE}" in *) broken="Unsupported architecture ${XBPS_TARGET_MACHINE}" ;; esac +_src_bootstrap=0 +case "${XBPS_MACHINE}" in + aarch64*) _src_bootstrap=1 ;; + arm*) _src_bootstrap=1 ;; + i686*) _src_bootstrap=1 ;; + x86_64*) _src_bootstrap=1 ;; +esac +if [ "${_src_bootstrap}" = "1" ]; then + hostmakedepends="go1.4-bootstrap" +else + hostmakedepends="go1.12-bootstrap" +fi + if [ "$CROSS_BUILD" ]; then if [ "${XBPS_MACHINE%%-musl}" = "${XBPS_TARGET_MACHINE%%-musl}" ]; then broken="Cross-compiling to different libc is not supported" @@ -36,7 +48,11 @@ do_build() { # dependency unset CGO_CXXFLAGS CGO_CFLAGS CGO_ENABLED - export GOROOT_BOOTSTRAP="/usr/lib/go1.12" + if [ "${_src_bootstrap}" = "1" ]; then + export GOROOT_BOOTSTRAP="/usr/lib/go1.4" + else + export GOROOT_BOOTSTRAP="/usr/lib/go1.12" + fi export GOROOT=$PWD export GOROOT_FINAL="/usr/lib/go" export GOARCH=${_goarch}