summaryrefslogtreecommitdiff
path: root/dev-lang/go
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/go')
-rw-r--r--dev-lang/go/Manifest14
-rw-r--r--dev-lang/go/go-1.21.10.ebuild210
-rw-r--r--dev-lang/go/go-1.21.9.ebuild210
-rw-r--r--dev-lang/go/go-1.22.6.ebuild (renamed from dev-lang/go/go-1.22.2.ebuild)65
-rw-r--r--dev-lang/go/go-1.23.0.ebuild (renamed from dev-lang/go/go-1.22.3.ebuild)71
-rw-r--r--dev-lang/go/go-9999.ebuild65
6 files changed, 33 insertions, 602 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index efd95a207fd0..8024f2219010 100644
--- a/dev-lang/go/Manifest
+++ b/dev-lang/go/Manifest
@@ -1,12 +1,8 @@
AUX go-never-download-newer-toolchains.patch 368 BLAKE2B 0c90f46492af80622f430b2d506b143f3b553b5276085f78f41b93fee8219745179038302462603b5b1677554d92911eb4865084d0488aaa4c71ae1abc307f71 SHA512 b5acf97ccf96c6a353fcb7bd97113c38562defd82338828124fcc72c71334feda9c4e839d2aae5b66b809bc8a692eac96396c54a478e17a7ffd8d2c68fea95e6
AUX go-sets.conf 256 BLAKE2B 670afd72a2fa961e2b3882ac48d10e9d047af7a68f47bc8c8985b2de7a84022410fb1acfe2c710f8b3804ec3b043bf18c948478cf7d31c982cff47714b309cdf SHA512 028fba72c2d82ef893416970c27cb277be15f7c5c67773c0a62cd8ce2c192813ba851339596f10a6f5394c479e67b62dd4e4520379cc03f764ed4a4ab834fba6
-DIST go1.21.10.src.tar.gz 26993576 BLAKE2B a310b89b6db0d6bffcc64d028b4130c7d1b456299016de3b31cb1223ad915f697dcbc15718984ab9b6199b31e192c50d1a014e38d10d32f5424133957d3aafe5 SHA512 90105f977c86a0d5ea4d31e4e699d8611a74178db1e443ddc57679b7a2a648baa328e7fa9ea4a732727487cc29afe07e9597a1e2eb0184cb270973f403349f5a
-DIST go1.21.9.src.tar.gz 26993426 BLAKE2B 08eb5a78e1d4933de63105a886e0b0d9d8582edbd18b2a40f7655628a3d5627102abf8d25b3190751109273962b731d16c25bdc58b370b6a39faa6e5c3ef3736 SHA512 e1cf7e458d41f8b343c34b7d35dc4a1696bacbad2ad64abac36dbbeaf1e0a1b71cdb32cebb1686c6e5c90bf0ad3474714d09acea010d6c074730c59d71e79f4e
-DIST go1.22.2.src.tar.gz 27551470 BLAKE2B f8994f7868f14b68d5b57a251ff4b79f26cd2dbee69e93887165a37dbdb74a0004998c2666e0bb1673a0f0efcbe58b10e2437f6ce06340fad004628e3a9cca1c SHA512 f2491d2b5d4ef2dd86ca7820503a2534cd1860822049dc01a6cb40b556a0812cfc4196fa83173765816060253ac949f4165b0fb4b2bed5d45e30d03bb69e434d
-DIST go1.22.3.src.tar.gz 27552410 BLAKE2B 8f5e5695c5bd945ad46990897c1b051abd5446dc7d9e52f7120139b084f6ec648679d4bc5c07b057a267e65dceb18dadc21234fd90b1e15444c1e3e5b5a2a1df SHA512 e6756866d3cf195f1afd3d852015f32dfb2de3648e30a78e9238a863eae192e9e7ccbcfd19fd97b1d552f35d51d62bf2104d81e35b8854a40400b0d61cf93672
-EBUILD go-1.21.10.ebuild 5205 BLAKE2B 4ea75699d4e053861f53beba1cc413e45d725f10bd3187e05f92e36f65500cc7bea369380415ecebdc5eeacde63cc97a09770ede3da0850a7382ba056c7675ff SHA512 01a5f4bd105efb636e054a8a594ca137106c8f9743c00b7a5bc94bff9a189fdb278657e657b3c3a2a2755018c971b3433cd1edc813f4cdbf5b0919729b7e25c4
-EBUILD go-1.21.9.ebuild 5204 BLAKE2B 2fe9369fbc565c10082d5d508c863739e24e85dd491cd3c27691ea3025f06bb94e976c8f109d26455a8560356fbebbaaa5e5d1e034a20b7648596c9f053807d9 SHA512 ed2806d6d1efb4d9194354468157129b9f27483f63ae166d66bb559541880d416254fa1ca39dc2022d485abda6fe771d8311c007eac78ef01a7ce38b9641ed19
-EBUILD go-1.22.2.ebuild 5269 BLAKE2B d3218c1d0e0fd4fb81b53af9a53823484737736c4d19e605f2aa805f764338487e0f35e4f44f11127ae6e1cf5420785d0b280af0f1bb9a4270e032c7d2177aa8 SHA512 0bb285a4f49ecaa9c1e6ca51a7402f3569e64be74b0ba0081850f92d07a9e482a12da1f744c163bee77a837e9951eeeb213916315a82268c9b9c63642e01a0c1
-EBUILD go-1.22.3.ebuild 5270 BLAKE2B aec6a505386a604941c430b40a503da571c31446006f6d5271eb38a886df01eb0b1a14858dc196a5a450448f0d02deba15cd6a73ad027e3a6eb524fb7b7ca264 SHA512 baaf41a1647e9b9c985cce65a01981d93e408df84ad7fc746ad037c035334eee2ef0dde5edf26ef20a085faf7abeb669d5ad5d1eb2d8b0e5f90c4b818903bfbb
-EBUILD go-9999.ebuild 5274 BLAKE2B fb71001874cd0037ff66a9b8dacc058c7276bac4095402eea81fef64eaa3f336ebe04535385fc5036aaf10267f578ef0742f2b088bd15e88747c53fc742b7a13 SHA512 139516a4593e9abcb35fa754db6c0582d3f113e68ec65fb6cf34c96673eff792c0d95cddf8786a66ffcd0725782f08b0d43b61ad10229c3c00a4a372f2f2eb96
+DIST go1.22.6.src.tar.gz 27561569 BLAKE2B 55ce88dc2039d68f14aea0792ed6a1b45c8e262aa73f76f852941aed12019318b3be7938c954fb7c03d7583f930f7a0e5164effc1ec10fc6d0fc282484390e49 SHA512 59f84ba390203271d9fe2d3f04624449d54d3bb73c2b6e54b5f7dc9e9e2dce2192bae07ef56a2afee871cff84d457b90f8a00f4433e072028b97af987f3799e1
+DIST go1.23.0.src.tar.gz 28163301 BLAKE2B 49e382dae5195e4a6544f9bd96b169a4c7a822544c7db07c69566063d3f6c21dbbac9991e7da1a0b946ee59ac8f65589b47edbb9856fed93d37e2bac18f61644 SHA512 5822124ca570662ac8dcec32a79196520ce355fe421d83372f8b8a97b3811de0739edcd7080a23f845cf700a6a26f3af6c93278f6ce485b93120afdd4f6c4f47
+EBUILD go-1.22.6.ebuild 4269 BLAKE2B 98523fc945a5383c10e91f37ec15c86a4a6cdd501ed0f4a2fb22ce8771b7d67f95c239a97bb6a4c34c5edf3050c76372afa3954bb843ef7164c89b0e61cf60a9 SHA512 c35a4c9e8eb764683cd9d53fc71e2ff7b5aec00d14f12e0d4a138d23b19974d1999e6c5cc6b5f977740ba5bb59eafb704fd4407395bbb18d276337dc6ed9efaa
+EBUILD go-1.23.0.ebuild 4174 BLAKE2B 55fa5a577403deb55f35d277ef4e7b104381982fbeece7b2c6b45f04e0bf49c4ee5e45e6372e80a351017e34d43268081cf5816ae99469d5195a9dadae549271 SHA512 bf66b5a718f227b1163053ce86b187be4e2f80289f9aeb0b8beb5a3ec4a74130fe11d64f587af4059f2a745be4d4d44c66060dd27a4359d95c358001a03b2de4
+EBUILD go-9999.ebuild 4274 BLAKE2B 7cbc81bac15c21d76bfadbc9b414ae9fbe7549a49ed2f9b9fae45bd00d6dfc304b054fef08f42f94be45d7c2defc3ebabce9d8f480db5e60c0c4a9e95cdcafd7 SHA512 9c9e3ce9713153f3316f54b96450deeb951c453b2320773771b047d12226db15d724157455fd6a218028d0a49b145c317019190083361f328b4d07001d197fd6
MISC metadata.xml 589 BLAKE2B 341e4c0e91d73ca668c1795035e1223eed60f85c724afd989ef1f8fb69649f7f6eaaf8a5228f6c8f587ffcc40a438c47d332fbe6866839f5a0829872a983f642 SHA512 fe58ddddfbd4d0d060516cb035592a80c0f48e125bb59c95d3c6fac0c182271e2a9ec9bd055b9cc8e6cb8c449e6c483bff4a23c362f532c24255febfdefc273a
diff --git a/dev-lang/go/go-1.21.10.ebuild b/dev-lang/go/go-1.21.10.ebuild
deleted file mode 100644
index 1377ec9148f2..000000000000
--- a/dev-lang/go/go-1.21.10.ebuild
+++ /dev/null
@@ -1,210 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-
-# See "Bootstrap" in release notes
-GO_BOOTSTRAP_MIN=1.17.13
-MY_PV=${PV/_/}
-
-inherit toolchain-funcs
-
-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 "
- S="${WORKDIR}"/go
- case ${PV} in
- *_beta*|*_rc*) ;;
- *)
- KEYWORDS="-* amd64 ~arm arm64 ~loong ~mips ppc64 ~riscv ~s390 x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
- ;;
- esac
-esac
-
-DESCRIPTION="A concurrent garbage collected and typesafe programming language"
-HOMEPAGE="https://go.dev"
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-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'
-
-# Do not complain about CFLAGS, etc, since Go doesn't use them.
-QA_FLAGS_IGNORED='.*'
-
-# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
-QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
-
-# This package triggers "unrecognized elf file(s)" notices on riscv.
-# https://bugs.gentoo.org/794046
-QA_PREBUILT='.*'
-
-# Do not strip this package. Stripping is unsupported upstream and may
-# fail.
-RESTRICT+=" strip"
-
-DOCS=(
- CONTRIBUTING.md
- PATENTS
- README.md
- SECURITY.md
-)
-
-go_arch() {
- # By chance most portage arch names match Go
- local tc_arch=$(tc-arch $@)
- case "${tc_arch}" in
- x86) echo 386;;
- x64-*) echo amd64;;
- loong) echo loong64;;
- mips) if use abi_mips_o32; then
- [[ $(tc-endian $@) = big ]] && echo mips || echo mipsle
- elif use abi_mips_n64; then
- [[ $(tc-endian $@) = big ]] && echo mips64 || echo mips64le
- fi ;;
- ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
- riscv) echo riscv64 ;;
- s390) echo s390x ;;
- *) echo "${tc_arch}";;
- esac
-}
-
-go_arm() {
- case "${1:-${CHOST}}" in
- armv5*) echo 5;;
- armv6*) echo 6;;
- armv7*) echo 7;;
- *)
- die "unknown GOARM for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_os() {
- case "${1:-${CHOST}}" in
- *-linux*) echo linux;;
- *-darwin*) echo darwin;;
- *-freebsd*) echo freebsd;;
- *-netbsd*) echo netbsd;;
- *-openbsd*) echo openbsd;;
- *-solaris*) echo solaris;;
- *-cygwin*|*-interix*|*-winnt*)
- echo windows
- ;;
- *)
- die "unknown GOOS for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_tuple() {
- echo "$(go_os $@)_$(go_arch $@)"
-}
-
-go_cross_compile() {
- [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
-}
-
-PATCHES=(
- "${FILESDIR}"/go-never-download-newer-toolchains.patch
-)
-
-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})
- export CC=$(tc-getBUILD_CC)
-
- export GOARCH=$(go_arch)
- export GOOS=$(go_os)
- export CC_FOR_TARGET=$(tc-getCC)
- export CXX_FOR_TARGET=$(tc-getCXX)
- use arm && export GOARM=$(go_arm)
- use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
-
- cd src
- bash -x ./make.bash || die "build failed"
-}
-
-src_test() {
- go_cross_compile && return 0
-
- cd src
-
- # https://github.com/golang/go/issues/42005
- rm cmd/link/internal/ld/fallocate_test.go || die
-
- PATH="${GOBIN}:${PATH}" \
- ./run.bash -no-rebuild -k || die "tests failed"
-}
-
-src_install() {
- dodir /usr/lib/go
- # The use of cp is deliberate in order to retain permissions
- cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
- einstalldocs
-
- insinto /usr/lib/go
- doins go.env VERSION
-
- # testdata directories are not needed on the installed system
- rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
-
- local bin_path
- if go_cross_compile; then
- bin_path="bin/$(go_tuple)"
- else
- bin_path=bin
- fi
- local f x
- for x in ${bin_path}/*; do
- f=${x##*/}
- dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
- done
-
- # install the @golang-rebuild set for Portage
- insinto /usr/share/portage/config/sets
- newins "${FILESDIR}"/go-sets.conf go.conf
-}
-
-pkg_postinst() {
- [[ -z ${REPLACING_VERSIONS} ]] && return
- elog "After ${CATEGORY}/${PN} is updated it is recommended to rebuild"
- elog "all packages compiled with previous versions of ${CATEGORY}/${PN}"
- elog "due to the static linking nature of go."
- elog "If this is not done, the packages compiled with the older"
- elog "version of the compiler will not be updated until they are"
- elog "updated individually, which could mean they will have"
- elog "vulnerabilities."
- elog "Run 'emerge @golang-rebuild' to rebuild all 'go' packages"
- elog "See https://bugs.gentoo.org/752153 for more info"
-}
diff --git a/dev-lang/go/go-1.21.9.ebuild b/dev-lang/go/go-1.21.9.ebuild
deleted file mode 100644
index 7588d8461f60..000000000000
--- a/dev-lang/go/go-1.21.9.ebuild
+++ /dev/null
@@ -1,210 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-
-# See "Bootstrap" in release notes
-GO_BOOTSTRAP_MIN=1.17.13
-MY_PV=${PV/_/}
-
-inherit toolchain-funcs
-
-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 "
- S="${WORKDIR}"/go
- case ${PV} in
- *_beta*|*_rc*) ;;
- *)
- KEYWORDS="-* amd64 arm arm64 ~loong ~mips ppc64 ~riscv ~s390 x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
- ;;
- esac
-esac
-
-DESCRIPTION="A concurrent garbage collected and typesafe programming language"
-HOMEPAGE="https://go.dev"
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-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'
-
-# Do not complain about CFLAGS, etc, since Go doesn't use them.
-QA_FLAGS_IGNORED='.*'
-
-# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
-QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
-
-# This package triggers "unrecognized elf file(s)" notices on riscv.
-# https://bugs.gentoo.org/794046
-QA_PREBUILT='.*'
-
-# Do not strip this package. Stripping is unsupported upstream and may
-# fail.
-RESTRICT+=" strip"
-
-DOCS=(
- CONTRIBUTING.md
- PATENTS
- README.md
- SECURITY.md
-)
-
-go_arch() {
- # By chance most portage arch names match Go
- local tc_arch=$(tc-arch $@)
- case "${tc_arch}" in
- x86) echo 386;;
- x64-*) echo amd64;;
- loong) echo loong64;;
- mips) if use abi_mips_o32; then
- [[ $(tc-endian $@) = big ]] && echo mips || echo mipsle
- elif use abi_mips_n64; then
- [[ $(tc-endian $@) = big ]] && echo mips64 || echo mips64le
- fi ;;
- ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
- riscv) echo riscv64 ;;
- s390) echo s390x ;;
- *) echo "${tc_arch}";;
- esac
-}
-
-go_arm() {
- case "${1:-${CHOST}}" in
- armv5*) echo 5;;
- armv6*) echo 6;;
- armv7*) echo 7;;
- *)
- die "unknown GOARM for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_os() {
- case "${1:-${CHOST}}" in
- *-linux*) echo linux;;
- *-darwin*) echo darwin;;
- *-freebsd*) echo freebsd;;
- *-netbsd*) echo netbsd;;
- *-openbsd*) echo openbsd;;
- *-solaris*) echo solaris;;
- *-cygwin*|*-interix*|*-winnt*)
- echo windows
- ;;
- *)
- die "unknown GOOS for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_tuple() {
- echo "$(go_os $@)_$(go_arch $@)"
-}
-
-go_cross_compile() {
- [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
-}
-
-PATCHES=(
- "${FILESDIR}"/go-never-download-newer-toolchains.patch
-)
-
-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})
- export CC=$(tc-getBUILD_CC)
-
- export GOARCH=$(go_arch)
- export GOOS=$(go_os)
- export CC_FOR_TARGET=$(tc-getCC)
- export CXX_FOR_TARGET=$(tc-getCXX)
- use arm && export GOARM=$(go_arm)
- use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
-
- cd src
- bash -x ./make.bash || die "build failed"
-}
-
-src_test() {
- go_cross_compile && return 0
-
- cd src
-
- # https://github.com/golang/go/issues/42005
- rm cmd/link/internal/ld/fallocate_test.go || die
-
- PATH="${GOBIN}:${PATH}" \
- ./run.bash -no-rebuild -k || die "tests failed"
-}
-
-src_install() {
- dodir /usr/lib/go
- # The use of cp is deliberate in order to retain permissions
- cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
- einstalldocs
-
- insinto /usr/lib/go
- doins go.env VERSION
-
- # testdata directories are not needed on the installed system
- rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
-
- local bin_path
- if go_cross_compile; then
- bin_path="bin/$(go_tuple)"
- else
- bin_path=bin
- fi
- local f x
- for x in ${bin_path}/*; do
- f=${x##*/}
- dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
- done
-
- # install the @golang-rebuild set for Portage
- insinto /usr/share/portage/config/sets
- newins "${FILESDIR}"/go-sets.conf go.conf
-}
-
-pkg_postinst() {
- [[ -z ${REPLACING_VERSIONS} ]] && return
- elog "After ${CATEGORY}/${PN} is updated it is recommended to rebuild"
- elog "all packages compiled with previous versions of ${CATEGORY}/${PN}"
- elog "due to the static linking nature of go."
- elog "If this is not done, the packages compiled with the older"
- elog "version of the compiler will not be updated until they are"
- elog "updated individually, which could mean they will have"
- elog "vulnerabilities."
- elog "Run 'emerge @golang-rebuild' to rebuild all 'go' packages"
- elog "See https://bugs.gentoo.org/752153 for more info"
-}
diff --git a/dev-lang/go/go-1.22.2.ebuild b/dev-lang/go/go-1.22.6.ebuild
index 38f5a0419240..a251f93835b7 100644
--- a/dev-lang/go/go-1.22.2.ebuild
+++ b/dev-lang/go/go-1.22.6.ebuild
@@ -10,7 +10,7 @@ export CTARGET=${CTARGET:-${CHOST}}
GO_BOOTSTRAP_MIN=1.20.14
MY_PV=${PV/_/}
-inherit toolchain-funcs
+inherit go-env toolchain-funcs
case ${PV} in
*9999*)
@@ -33,7 +33,7 @@ HOMEPAGE="https://go.dev"
LICENSE="BSD"
SLOT="0/${PV}"
-IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
+IUSE="cpu_flags_x86_sse2"
RDEPEND="
arm? ( sys-devel/binutils[gold] )
@@ -66,55 +66,8 @@ DOCS=(
SECURITY.md
)
-go_arch() {
- # By chance most portage arch names match Go
- local tc_arch=$(tc-arch $@)
- case "${tc_arch}" in
- x86) echo 386;;
- x64-*) echo amd64;;
- loong) echo loong64;;
- mips) if use abi_mips_o32; then
- [[ $(tc-endian $@) = big ]] && echo mips || echo mipsle
- elif use abi_mips_n64; then
- [[ $(tc-endian $@) = big ]] && echo mips64 || echo mips64le
- fi ;;
- ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
- riscv) echo riscv64 ;;
- s390) echo s390x ;;
- *) echo "${tc_arch}";;
- esac
-}
-
-go_arm() {
- case "${1:-${CHOST}}" in
- armv5*) echo 5;;
- armv6*) echo 6;;
- armv7*) echo 7;;
- *)
- die "unknown GOARM for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_os() {
- case "${1:-${CHOST}}" in
- *-linux*) echo linux;;
- *-darwin*) echo darwin;;
- *-freebsd*) echo freebsd;;
- *-netbsd*) echo netbsd;;
- *-openbsd*) echo openbsd;;
- *-solaris*) echo solaris;;
- *-cygwin*|*-interix*|*-winnt*)
- echo windows
- ;;
- *)
- die "unknown GOOS for ${1:-${CHOST}}"
- ;;
- esac
-}
-
go_tuple() {
- echo "$(go_os $@)_$(go_arch $@)"
+ echo "$(go-env_goos $@)_$(go-env_goarch $@)"
}
go_cross_compile() {
@@ -140,16 +93,16 @@ src_compile() {
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})
+ export GOHOSTARCH=$(go-env_goarch ${CBUILD})
+ export GOHOSTOS=$(go-env_goos ${CBUILD})
export CC=$(tc-getBUILD_CC)
- export GOARCH=$(go_arch)
- export GOOS=$(go_os)
+ export GOARCH=$(go-env_goarch)
+ export GOOS=$(go-env_goos)
export CC_FOR_TARGET=$(tc-getCC)
export CXX_FOR_TARGET=$(tc-getCXX)
- use arm && export GOARM=$(go_arm)
- use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
+ use arm && export GOARM=$(go-env_goarm)
+ use x86 && export GO386=$(go-env_go386)
cd src
bash -x ./make.bash || die "build failed"
diff --git a/dev-lang/go/go-1.22.3.ebuild b/dev-lang/go/go-1.23.0.ebuild
index 78e336afcd99..56fac09b0188 100644
--- a/dev-lang/go/go-1.22.3.ebuild
+++ b/dev-lang/go/go-1.23.0.ebuild
@@ -10,7 +10,7 @@ export CTARGET=${CTARGET:-${CHOST}}
GO_BOOTSTRAP_MIN=1.20.14
MY_PV=${PV/_/}
-inherit toolchain-funcs
+inherit go-env toolchain-funcs
case ${PV} in
*9999*)
@@ -23,7 +23,7 @@ case ${PV} in
case ${PV} in
*_beta*|*_rc*) ;;
*)
- KEYWORDS="-* amd64 ~arm arm64 ~loong ~mips ppc64 ~riscv ~s390 x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
;;
esac
esac
@@ -33,7 +33,7 @@ HOMEPAGE="https://go.dev"
LICENSE="BSD"
SLOT="0/${PV}"
-IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
+IUSE="cpu_flags_x86_sse2"
RDEPEND="
arm? ( sys-devel/binutils[gold] )
@@ -66,55 +66,8 @@ DOCS=(
SECURITY.md
)
-go_arch() {
- # By chance most portage arch names match Go
- local tc_arch=$(tc-arch $@)
- case "${tc_arch}" in
- x86) echo 386;;
- x64-*) echo amd64;;
- loong) echo loong64;;
- mips) if use abi_mips_o32; then
- [[ $(tc-endian $@) = big ]] && echo mips || echo mipsle
- elif use abi_mips_n64; then
- [[ $(tc-endian $@) = big ]] && echo mips64 || echo mips64le
- fi ;;
- ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
- riscv) echo riscv64 ;;
- s390) echo s390x ;;
- *) echo "${tc_arch}";;
- esac
-}
-
-go_arm() {
- case "${1:-${CHOST}}" in
- armv5*) echo 5;;
- armv6*) echo 6;;
- armv7*) echo 7;;
- *)
- die "unknown GOARM for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_os() {
- case "${1:-${CHOST}}" in
- *-linux*) echo linux;;
- *-darwin*) echo darwin;;
- *-freebsd*) echo freebsd;;
- *-netbsd*) echo netbsd;;
- *-openbsd*) echo openbsd;;
- *-solaris*) echo solaris;;
- *-cygwin*|*-interix*|*-winnt*)
- echo windows
- ;;
- *)
- die "unknown GOOS for ${1:-${CHOST}}"
- ;;
- esac
-}
-
go_tuple() {
- echo "$(go_os $@)_$(go_arch $@)"
+ echo "$(go-env_goos $@)_$(go-env_goarch $@)"
}
go_cross_compile() {
@@ -135,21 +88,17 @@ src_compile() {
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})
+ export GOHOSTARCH=$(go-env_goarch ${CBUILD})
+ export GOHOSTOS=$(go-env_goos ${CBUILD})
export CC=$(tc-getBUILD_CC)
- export GOARCH=$(go_arch)
- export GOOS=$(go_os)
+ export GOARCH=$(go-env_goarch)
+ export GOOS=$(go-env_goos)
export CC_FOR_TARGET=$(tc-getCC)
export CXX_FOR_TARGET=$(tc-getCXX)
- use arm && export GOARM=$(go_arm)
- use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
+ use arm && export GOARM=$(go-env_goarm)
+ use x86 && export GO386=$(go-env_go386)
cd src
bash -x ./make.bash || die "build failed"
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild
index fc36a2d33ae9..b16e86ae904f 100644
--- a/dev-lang/go/go-9999.ebuild
+++ b/dev-lang/go/go-9999.ebuild
@@ -10,7 +10,7 @@ export CTARGET=${CTARGET:-${CHOST}}
GO_BOOTSTRAP_MIN=1.20.14
MY_PV=${PV/_/}
-inherit toolchain-funcs
+inherit go-env toolchain-funcs
case ${PV} in
*9999*)
@@ -33,7 +33,7 @@ HOMEPAGE="https://go.dev"
LICENSE="BSD"
SLOT="0/${PV}"
-IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
+IUSE="cpu_flags_x86_sse2"
RDEPEND="
arm? ( sys-devel/binutils[gold] )
@@ -66,55 +66,8 @@ DOCS=(
SECURITY.md
)
-go_arch() {
- # By chance most portage arch names match Go
- local tc_arch=$(tc-arch $@)
- case "${tc_arch}" in
- x86) echo 386;;
- x64-*) echo amd64;;
- loong) echo loong64;;
- mips) if use abi_mips_o32; then
- [[ $(tc-endian $@) = big ]] && echo mips || echo mipsle
- elif use abi_mips_n64; then
- [[ $(tc-endian $@) = big ]] && echo mips64 || echo mips64le
- fi ;;
- ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
- riscv) echo riscv64 ;;
- s390) echo s390x ;;
- *) echo "${tc_arch}";;
- esac
-}
-
-go_arm() {
- case "${1:-${CHOST}}" in
- armv5*) echo 5;;
- armv6*) echo 6;;
- armv7*) echo 7;;
- *)
- die "unknown GOARM for ${1:-${CHOST}}"
- ;;
- esac
-}
-
-go_os() {
- case "${1:-${CHOST}}" in
- *-linux*) echo linux;;
- *-darwin*) echo darwin;;
- *-freebsd*) echo freebsd;;
- *-netbsd*) echo netbsd;;
- *-openbsd*) echo openbsd;;
- *-solaris*) echo solaris;;
- *-cygwin*|*-interix*|*-winnt*)
- echo windows
- ;;
- *)
- die "unknown GOOS for ${1:-${CHOST}}"
- ;;
- esac
-}
-
go_tuple() {
- echo "$(go_os $@)_$(go_arch $@)"
+ echo "$(go-env_goos $@)_$(go-env_goarch $@)"
}
go_cross_compile() {
@@ -140,16 +93,16 @@ src_compile() {
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})
+ export GOHOSTARCH=$(go-env_goarch ${CBUILD})
+ export GOHOSTOS=$(go-env_goos ${CBUILD})
export CC=$(tc-getBUILD_CC)
- export GOARCH=$(go_arch)
- export GOOS=$(go_os)
+ export GOARCH=$(go-env_goarch)
+ export GOOS=$(go-env_goos)
export CC_FOR_TARGET=$(tc-getCC)
export CXX_FOR_TARGET=$(tc-getCXX)
- use arm && export GOARM=$(go_arm)
- use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
+ use arm && export GOARM=$(go-env_goarm)
+ use x86 && export GO386=$(go-env_go386)
cd src
bash -x ./make.bash || die "build failed"