diff options
author | Mike Gilbert <floppym@gentoo.org> | 2020-01-23 09:06:17 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2020-01-23 09:06:54 -0600 |
commit | a14e084227448f5a706a71aa802905d11f79a9f3 (patch) | |
tree | 1616a1d430d756eecf51554987fd1c2d9703879a /dev-lang | |
parent | dev-lang/go-bootstrap: new package (diff) | |
download | gentoo-a14e084227448f5a706a71aa802905d11f79a9f3.tar.gz gentoo-a14e084227448f5a706a71aa802905d11f79a9f3.tar.bz2 gentoo-a14e084227448f5a706a71aa802905d11f79a9f3.zip |
dev-lang/go: rework bootstrap logic to use dev-lang/go-bootstrap
This eliminates the need for the system-bootstrap USE flag. Once
dev-lang/go is installed, dev-lang/go-bootstrap can be depcleaned.
(change by williamh)
The original patch allowed go to be used to bootstrap itself once it was
installed, but that could lead to a situation where go-1.14 was being
used to bootstrap go-1.13 for example, and I'm not sure that would be a
good idea.
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/go/go-9999.ebuild | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild index 7516b365dbdb..635b905c4d91 100644 --- a/dev-lang/go/go-9999.ebuild +++ b/dev-lang/go/go-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -10,20 +10,6 @@ MY_PV=${PV/_/} inherit toolchain-funcs -BOOTSTRAP_VERSION="bootstrap-1.13.6" -BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist" -BOOTSTRAP_URI=" - ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz - ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz -" - case ${PV} in *9999*) EGIT_REPO_URI="https://github.com/golang/go.git" @@ -46,22 +32,15 @@ case ${PV} in esac esac -# If gccgo or a previously installed version of dev-lang/go is not being -# used to build Go, there is no way to know the architecture or operating system -# of the build machine, so we need to download all of our bootstrap -# archives to allow this ebuild to work under crossdev. -# -# https://bugs.gentoo.org/671394 -SRC_URI+="!gccgo? ( !system-bootstrap? ( ${BOOTSTRAP_URI} ) )" - DESCRIPTION="A concurrent garbage collected and typesafe programming language" HOMEPAGE="https://golang.org" LICENSE="BSD" SLOT="0/${PV}" -IUSE="gccgo system-bootstrap" +IUSE="gccgo" -BDEPEND="gccgo? ( >=sys-devel/gcc-5[go] )" +BDEPEND="gccgo? ( >=sys-devel/gcc-5[go(-)] ) + !gccgo? ( >=dev-lang/go-bootstrap-1.13.6 )" RDEPEND="!<dev-go/go-tools-0_pre20150902" # These test data objects have writable/executable stacks. @@ -143,13 +122,6 @@ go_cross_compile() [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] } -pkg_pretend() -{ - [[ ${MERGE_TYPE} != binary ]] && - use system-bootstrap && ! has_version -b "dev-lang/go" && - die "dev-lang/go must be installed to use the system-bootstrap use flag" -} - src_unpack() { if [[ ${PV} = 9999 ]]; then @@ -157,14 +129,12 @@ src_unpack() else unpack "go${MY_PV}.src.tar.gz" fi - use gccgo || use system-bootstrap || - unpack "go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-${BOOTSTRAP_VERSION}.tbz" } src_compile() { - export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-bootstrap if use gccgo; then + export GOROOT_BOOTSTRAP="${WORKDIR}/go-bootstrap" mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version) [[ -x ${go_binary} ]] || go_binary=$( @@ -173,9 +143,12 @@ src_compile() [[ -x ${go_binary} ]] || die "go-$(gcc-major-version): command not found" ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die - elif use system-bootstrap; then - export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go + elif has_version -b dev-lang/go-bootstrap; then + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap" + else + die "Should not be here, please report a bug" fi + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go export GOROOT="$(pwd)" export GOBIN="${GOROOT}/bin" |