summaryrefslogtreecommitdiff
path: root/dev-lang/go/go-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/go/go-9999.ebuild')
-rw-r--r--dev-lang/go/go-9999.ebuild66
1 files changed, 21 insertions, 45 deletions
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild
index b8dc68bce065..fc36a2d33ae9 100644
--- a/dev-lang/go/go-9999.ebuild
+++ b/dev-lang/go/go-9999.ebuild
@@ -1,54 +1,24 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
export CBUILD=${CBUILD:-${CHOST}}
export CTARGET=${CTARGET:-${CHOST}}
+# See "Bootstrap" in release notes
+GO_BOOTSTRAP_MIN=1.20.14
MY_PV=${PV/_/}
inherit toolchain-funcs
-# See "Bootstrap" in release notes
-# GO_BV is set to the minimum version of go required to bootstrap the
-# current version.
-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 )
- )
- )
- 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 )
- "
-
case ${PV} in
*9999*)
EGIT_REPO_URI="https://github.com/golang/go.git"
inherit git-r3
;;
*)
- SRC_URI+=" https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
+ SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
S="${WORKDIR}"/go
case ${PV} in
*_beta*|*_rc*) ;;
@@ -63,11 +33,14 @@ HOMEPAGE="https://go.dev"
LICENSE="BSD"
SLOT="0/${PV}"
-IUSE="abi_mips_o32 abi_mips_n64 big-endian"
+IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
RDEPEND="
arm? ( sys-devel/binutils[gold] )
arm64? ( sys-devel/binutils[gold] )"
+BDEPEND="|| (
+ >=dev-lang/go-${GO_BOOTSTRAP_MIN}
+ >=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN} )"
# the *.syso files have writable/executable stacks
QA_EXECSTACK='*.syso'
@@ -152,12 +125,20 @@ PATCHES=(
"${FILESDIR}"/go-never-download-newer-toolchains.patch
)
-src_unpack() {
- default
- [[ ${PV} == *9999* ]] && git-r3_src_unpack
-}
-
src_compile() {
+ if has_version -b ">=dev-lang/go-${GO_BOOTSTRAP_MIN}"; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
+ elif has_version -b ">=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN}"; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
+ else
+ eerror "Go cannot be built without go or go-bootstrap installed"
+ die "Should not be here, please report a bug"
+ fi
+
+ export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
+ export GOROOT="${PWD}"
+ export GOBIN="${GOROOT}/bin"
+
# Go's build script does not use BUILD/HOST/TARGET consistently. :(
export GOHOSTARCH=$(go_arch ${CBUILD})
export GOHOSTOS=$(go_os ${CBUILD})
@@ -170,11 +151,6 @@ src_compile() {
use arm && export GOARM=$(go_arm)
use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
- export GOROOT="${PWD}"
- export GOROOT_BOOTSTRAP="${WORKDIR}/go-${GOOS}-${GOARCH}-bootstrap"
- export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
- export GOBIN="${GOROOT}/bin"
-
cd src
bash -x ./make.bash || die "build failed"
}