diff options
author | William Hubbs <williamh@gentoo.org> | 2024-02-21 12:52:34 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2024-02-21 12:53:45 -0600 |
commit | 8b57b79cbeb7c24133a423620b27b60fab34d0f0 (patch) | |
tree | 74064512dacb28d1d3b83986eafda495f17afbdf /dev-lang/go | |
parent | games-util/cartridges: bump to 2.7.3 (diff) | |
download | gentoo-8b57b79cbeb7c24133a423620b27b60fab34d0f0.tar.gz gentoo-8b57b79cbeb7c24133a423620b27b60fab34d0f0.tar.bz2 gentoo-8b57b79cbeb7c24133a423620b27b60fab34d0f0.zip |
dev-lang/go: add system-bootstrap use flag
The system-bootstrap use flag allows you to bootstrap with the installed
version of go.
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'dev-lang/go')
-rw-r--r-- | dev-lang/go/go-9999.ebuild | 56 | ||||
-rw-r--r-- | dev-lang/go/metadata.xml | 3 |
2 files changed, 36 insertions, 23 deletions
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild index 401b23dc4e83..6b21274bfbf5 100644 --- a/dev-lang/go/go-9999.ebuild +++ b/dev-lang/go/go-9999.ebuild @@ -16,30 +16,32 @@ inherit toolchain-funcs GO_BV=1.20.14 BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist" SRC_URI=" - amd64? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-amd64-bootstrap.tbz ) - arm? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-arm-bootstrap.tbz ) - arm64? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-arm64-bootstrap.tbz ) - loong? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-loong64-bootstrap.tbz ) - mips? ( - abi_mips_o32? ( - big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mips-bootstrap.tbz ) - !big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mipsle-bootstrap.tbz ) - ) - abi_mips_n64? ( - big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mips64-bootstrap.tbz ) - !big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mips64le-bootstrap.tbz ) + !system-bootstrap? ( + amd64? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-amd64-bootstrap.tbz ) + arm? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-arm-bootstrap.tbz ) + arm64? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-arm64-bootstrap.tbz ) + loong? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-loong64-bootstrap.tbz ) + mips? ( + abi_mips_o32? ( + big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mips-bootstrap.tbz ) + !big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mipsle-bootstrap.tbz ) + ) + abi_mips_n64? ( + big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mips64-bootstrap.tbz ) + !big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-mips64le-bootstrap.tbz ) + ) ) + ppc64? ( + big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-ppc64-bootstrap.tbz ) + !big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-ppc64le-bootstrap.tbz ) ) - ppc64? ( - big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-ppc64-bootstrap.tbz ) - !big-endian? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-ppc64le-bootstrap.tbz ) + riscv? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-riscv64-bootstrap.tbz ) + s390? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-s390x-bootstrap.tbz ) + x86? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-386-bootstrap.tbz ) + x64-macos? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-darwin-amd64-bootstrap.tbz ) + arm64-macos? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-darwin-arm64-bootstrap.tbz ) + x64-solaris? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-solaris-amd64-bootstrap.tbz ) ) - riscv? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-riscv64-bootstrap.tbz ) - s390? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-s390x-bootstrap.tbz ) - x86? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-linux-386-bootstrap.tbz ) - x64-macos? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-darwin-amd64-bootstrap.tbz ) - arm64-macos? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-darwin-arm64-bootstrap.tbz ) - x64-solaris? ( ${BOOTSTRAP_DIST}/go-${GO_BV}-solaris-amd64-bootstrap.tbz ) " case ${PV} in @@ -63,7 +65,7 @@ HOMEPAGE="https://go.dev" LICENSE="BSD" SLOT="0/${PV}" -IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2 big-endian" +IUSE="abi_mips_o32 abi_mips_n64 big-endian system-bootstrap" RDEPEND=" arm? ( sys-devel/binutils[gold] ) @@ -171,7 +173,15 @@ src_compile() { use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat') export GOROOT="${PWD}" - export GOROOT_BOOTSTRAP="${WORKDIR}/go-${GOOS}-${GOARCH}-bootstrap" + if use system-bootstrap; then + if has_version <dev-lang/go-${GO_BV}; then + eerror "You need at least dev-lang/go-${GO_BV} installed to bootstrap this version of go" + die "version of go is too old" + fi + export GOROOT_BOOTSTRAP="${EPREFIX}/usr/lib/go" + else + export GOROOT_BOOTSTRAP="${WORKDIR}/go-${GOOS}-${GOARCH}-bootstrap" + fi export GOROOT_FINAL="${EPREFIX}"/usr/lib/go export GOBIN="${GOROOT}/bin" diff --git a/dev-lang/go/metadata.xml b/dev-lang/go/metadata.xml index 5e00214a73f6..51455ddf8e9f 100644 --- a/dev-lang/go/metadata.xml +++ b/dev-lang/go/metadata.xml @@ -14,4 +14,7 @@ <remote-id type="cpe">cpe:/a:golang:go</remote-id> <remote-id type="github">golang/go</remote-id> </upstream> + <use> + <flag name="system-bootstrap">Bootstrap using installed go compiler</flag> + </use> </pkgmetadata> |