diff options
Diffstat (limited to 'dev-lang/go')
-rw-r--r-- | dev-lang/go/Manifest | 8 | ||||
-rw-r--r-- | dev-lang/go/files/go-never-download-newer-toolchains.patch | 13 | ||||
-rw-r--r-- | dev-lang/go/files/go-sets.conf | 6 | ||||
-rw-r--r-- | dev-lang/go/go-1.21.10.ebuild (renamed from dev-lang/go/go-1.15.7.ebuild) | 121 | ||||
-rw-r--r-- | dev-lang/go/go-1.21.9.ebuild (renamed from dev-lang/go/go-1.15.6-r1.ebuild) | 121 | ||||
-rw-r--r-- | dev-lang/go/go-1.22.2.ebuild (renamed from dev-lang/go/go-1.14.13-r1.ebuild) | 122 | ||||
-rw-r--r-- | dev-lang/go/go-1.22.3.ebuild (renamed from dev-lang/go/go-1.14.14.ebuild) | 122 | ||||
-rw-r--r-- | dev-lang/go/go-9999.ebuild | 122 | ||||
-rw-r--r-- | dev-lang/go/metadata.xml | 8 |
9 files changed, 367 insertions, 276 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest index 85fdcd7caf02..5197175b5767 100644 --- a/dev-lang/go/Manifest +++ b/dev-lang/go/Manifest @@ -1,4 +1,4 @@ -DIST go1.14.13.src.tar.gz 22553900 BLAKE2B 35aed1c43a59e06c1d5feaa91a6c4120c586958257cb3e4f83ab4e767159e20ae953d70bc0debabd80722bca0965d1b129531a2bd89f558df0a8700cadc09edc SHA512 b54a0bc3b85809a78d4704fe2e97ad7417a2027608ec0f90c2784e2ddb28b505df3cda862dc6f1b99af2d136363cbb9b120e2fd6ed985cb300c43f8e539a5e28 -DIST go1.14.14.src.tar.gz 22557733 BLAKE2B aa3638c7a20f89e90bf17e9da1b12323cc8c0f52fb0a92ca6a850f7b2c94e406ea50a57fc28cc34b951bf7ecee0a9bb1ce884ad86dfc23241d7b62cd9435f881 SHA512 76213b19eeec66ca6c6b5bdef875bea0b64c3877c70eec64dd65f7869ceb8db016ff19193f01771f8944fd5f0ae3b54c68185e158f2622d1db5552fec1f37976 -DIST go1.15.6.src.tar.gz 23019337 BLAKE2B d328401af9843f4a099dee7d82433ad2a0b349add0f2ecb609635814cca610e17a6fc50215e9928b8cb0d8ea8dd6ae9d84ffca125e1362dfb18ba08783bb4264 SHA512 f20e495204f32170d6554e8f4b64763dae8302a7859005020f650d1d53a5b15de3afbaff28e0b6418287396166c67bdc4c6bee7a0fd7ba8a87bb79b6c1d38326 -DIST go1.15.7.src.tar.gz 23017978 BLAKE2B 15b0827fb56b8e9208c65e8f7f11c7f67820efce1627b4123e937301bb437c597e87adfff9a2eee9aaf53ba0f22eb2f10746bafb7247b4250566f20181b7a2a0 SHA512 7b3e8bcd2fc95baad41f8b5f0456c009e01896d160e65c2670d51c23d8cfcf7a6801e831e6f9a8877fe58c8f54ac8f75bf6e7935b38ba7aaa51dc8e46cf76ddb +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 diff --git a/dev-lang/go/files/go-never-download-newer-toolchains.patch b/dev-lang/go/files/go-never-download-newer-toolchains.patch new file mode 100644 index 000000000000..74e85f80b63a --- /dev/null +++ b/dev-lang/go/files/go-never-download-newer-toolchains.patch @@ -0,0 +1,13 @@ +diff --git a/go.env b/go.env +index 6ff2b921d4..1112a19c9b 100644 +--- a/go.env ++++ b/go.env +@@ -7,6 +7,6 @@ + GOPROXY=https://proxy.golang.org,direct + GOSUMDB=sum.golang.org + +-# Automatically download newer toolchains as directed by go.mod files. ++# Never download newer toolchains. + # See https://go.dev/doc/toolchain for details. +-GOTOOLCHAIN=auto ++GOTOOLCHAIN=local diff --git a/dev-lang/go/files/go-sets.conf b/dev-lang/go/files/go-sets.conf index 01ad4a8b3d4f..f38edb71a6fc 100644 --- a/dev-lang/go/files/go-sets.conf +++ b/dev-lang/go/files/go-sets.conf @@ -1,7 +1,7 @@ -# Installed packages that inherit from known Go related eclasses. +# Installed packages for which vdb *DEPEND includes dev-lang/go. # This is useful after a dev-lang/go version change to rebuild all # software written in Go. [golang-rebuild] class = portage.sets.dbapi.VariableSet -variable = INHERITED -includes = golang-base golang-build golang-vcs golang-vcs-snapshot go-module +variable = BDEPEND +includes = dev-lang/go diff --git a/dev-lang/go/go-1.15.7.ebuild b/dev-lang/go/go-1.21.10.ebuild index 07cd0d903d5f..1377ec9148f2 100644 --- a/dev-lang/go/go-1.15.7.ebuild +++ b/dev-lang/go/go-1.21.10.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -6,6 +6,8 @@ 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 @@ -21,21 +23,27 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* amd64 ~arm ~arm64 ~ppc64 ~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 DESCRIPTION="A concurrent garbage collected and typesafe programming language" -HOMEPAGE="https://golang.org" +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 - dev-lang/go-bootstrap )" -RDEPEND="!<dev-go/go-tools-0_pre20150902" + >=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='.*' @@ -43,33 +51,41 @@ 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=( -AUTHORS -CONTRIBUTING.md -CONTRIBUTORS -PATENTS -README.md + CONTRIBUTING.md + PATENTS + README.md + SECURITY.md ) -go_arch() -{ +go_arch() { # By chance most portage arch names match Go - local portage_arch=$(tc-arch $@) - case "${portage_arch}" in + 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 "${portage_arch}";; + *) echo "${tc_arch}";; esac } -go_arm() -{ +go_arm() { case "${1:-${CHOST}}" in armv5*) echo 5;; armv6*) echo 6;; @@ -80,8 +96,7 @@ go_arm() esac } -go_os() -{ +go_os() { case "${1:-${CHOST}}" in *-linux*) echo linux;; *-darwin*) echo darwin;; @@ -98,21 +113,22 @@ go_os() esac } -go_tuple() -{ +go_tuple() { echo "$(go_os $@)_$(go_arch $@)" } -go_cross_compile() -{ +go_cross_compile() { [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] } -src_compile() -{ - if has_version -b dev-lang/go; then +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; then + 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" @@ -120,7 +136,7 @@ src_compile() fi export GOROOT_FINAL="${EPREFIX}"/usr/lib/go - export GOROOT="$(pwd)" + export GOROOT="${PWD}" export GOBIN="${GOROOT}/bin" # Go's build script does not use BUILD/HOST/TARGET consistently. :( @@ -132,37 +148,34 @@ src_compile() export GOOS=$(go_os) export CC_FOR_TARGET=$(tc-getCC) export CXX_FOR_TARGET=$(tc-getCXX) - if [[ ${ARCH} == arm ]]; then - export GOARM=$(go_arm) - fi + 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() -{ +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 || die "tests failed" - cd .. - rm -fr pkg/*_race || die - rm -fr pkg/obj/go-build || die + ./run.bash -no-rebuild -k || die "tests failed" } -src_install() -{ - # There is a known issue which requires the source tree to be installed [1]. - # Once this is fixed, we can consider using the doc use flag to control - # installing the doc and src directories. - # The use of cp is deliberate in order to retain permissions - # [1] https://golang.org/issue/2775 +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) @@ -185,13 +198,13 @@ src_install() pkg_postinst() { [[ -z ${REPLACING_VERSIONS} ]] && return - einfo "After ${CATEGORY}/${PN} is updated it is recommended to rebuild" - einfo "all packages compiled with previous versions of ${CATEGORY}/${PN}" - einfo "due to the static linking nature of go." - einfo "If this is not done, the packages compiled with the older" - einfo "version of the compiler will not be updated until they are" - einfo "updated individually, which could mean they will have" - einfo "vulnerabilities." - einfo "Run 'emerge @golang-rebuild' to rebuild all 'go' packages" - einfo "See https://bugs.gentoo.org/752153 for more info" + 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.15.6-r1.ebuild b/dev-lang/go/go-1.21.9.ebuild index 55fd0c4f6bf1..7588d8461f60 100644 --- a/dev-lang/go/go-1.15.6-r1.ebuild +++ b/dev-lang/go/go-1.21.9.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -6,6 +6,8 @@ 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 @@ -21,21 +23,27 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* amd64 arm arm64 ppc64 ~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 DESCRIPTION="A concurrent garbage collected and typesafe programming language" -HOMEPAGE="https://golang.org" +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 - dev-lang/go-bootstrap )" -RDEPEND="!<dev-go/go-tools-0_pre20150902" + >=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='.*' @@ -43,33 +51,41 @@ 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=( -AUTHORS -CONTRIBUTING.md -CONTRIBUTORS -PATENTS -README.md + CONTRIBUTING.md + PATENTS + README.md + SECURITY.md ) -go_arch() -{ +go_arch() { # By chance most portage arch names match Go - local portage_arch=$(tc-arch $@) - case "${portage_arch}" in + 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 "${portage_arch}";; + *) echo "${tc_arch}";; esac } -go_arm() -{ +go_arm() { case "${1:-${CHOST}}" in armv5*) echo 5;; armv6*) echo 6;; @@ -80,8 +96,7 @@ go_arm() esac } -go_os() -{ +go_os() { case "${1:-${CHOST}}" in *-linux*) echo linux;; *-darwin*) echo darwin;; @@ -98,21 +113,22 @@ go_os() esac } -go_tuple() -{ +go_tuple() { echo "$(go_os $@)_$(go_arch $@)" } -go_cross_compile() -{ +go_cross_compile() { [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] } -src_compile() -{ - if has_version -b dev-lang/go; then +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; then + 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" @@ -120,7 +136,7 @@ src_compile() fi export GOROOT_FINAL="${EPREFIX}"/usr/lib/go - export GOROOT="$(pwd)" + export GOROOT="${PWD}" export GOBIN="${GOROOT}/bin" # Go's build script does not use BUILD/HOST/TARGET consistently. :( @@ -132,37 +148,34 @@ src_compile() export GOOS=$(go_os) export CC_FOR_TARGET=$(tc-getCC) export CXX_FOR_TARGET=$(tc-getCXX) - if [[ ${ARCH} == arm ]]; then - export GOARM=$(go_arm) - fi + 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() -{ +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 || die "tests failed" - cd .. - rm -fr pkg/*_race || die - rm -fr pkg/obj/go-build || die + ./run.bash -no-rebuild -k || die "tests failed" } -src_install() -{ - # There is a known issue which requires the source tree to be installed [1]. - # Once this is fixed, we can consider using the doc use flag to control - # installing the doc and src directories. - # The use of cp is deliberate in order to retain permissions - # [1] https://golang.org/issue/2775 +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) @@ -185,13 +198,13 @@ src_install() pkg_postinst() { [[ -z ${REPLACING_VERSIONS} ]] && return - einfo "After ${CATEGORY}/${PN} is updated it is recommended to rebuild" - einfo "all packages compiled with previous versions of ${CATEGORY}/${PN}" - einfo "due to the static linking nature of go." - einfo "If this is not done, the packages compiled with the older" - einfo "version of the compiler will not be updated until they are" - einfo "updated individually, which could mean they will have" - einfo "vulnerabilities." - einfo "Run 'emerge @golang-rebuild' to rebuild all 'go' packages" - einfo "See https://bugs.gentoo.org/752153 for more info" + 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.14.13-r1.ebuild b/dev-lang/go/go-1.22.2.ebuild index 55fd0c4f6bf1..38f5a0419240 100644 --- a/dev-lang/go/go-1.14.13-r1.ebuild +++ b/dev-lang/go/go-1.22.2.ebuild @@ -1,11 +1,13 @@ -# Copyright 1999-2021 Gentoo Authors +# 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 @@ -21,21 +23,27 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* amd64 arm arm64 ppc64 ~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 DESCRIPTION="A concurrent garbage collected and typesafe programming language" -HOMEPAGE="https://golang.org" +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 - dev-lang/go-bootstrap )" -RDEPEND="!<dev-go/go-tools-0_pre20150902" + >=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='.*' @@ -43,33 +51,41 @@ 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" +RESTRICT=" strip" DOCS=( -AUTHORS -CONTRIBUTING.md -CONTRIBUTORS -PATENTS -README.md + CONTRIBUTING.md + PATENTS + README.md + SECURITY.md ) -go_arch() -{ +go_arch() { # By chance most portage arch names match Go - local portage_arch=$(tc-arch $@) - case "${portage_arch}" in + 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 "${portage_arch}";; + *) echo "${tc_arch}";; esac } -go_arm() -{ +go_arm() { case "${1:-${CHOST}}" in armv5*) echo 5;; armv6*) echo 6;; @@ -80,8 +96,7 @@ go_arm() esac } -go_os() -{ +go_os() { case "${1:-${CHOST}}" in *-linux*) echo linux;; *-darwin*) echo darwin;; @@ -98,21 +113,22 @@ go_os() esac } -go_tuple() -{ +go_tuple() { echo "$(go_os $@)_$(go_arch $@)" } -go_cross_compile() -{ +go_cross_compile() { [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] } -src_compile() -{ - if has_version -b dev-lang/go; then +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; then + 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" @@ -120,7 +136,7 @@ src_compile() fi export GOROOT_FINAL="${EPREFIX}"/usr/lib/go - export GOROOT="$(pwd)" + export GOROOT="${PWD}" export GOBIN="${GOROOT}/bin" # Go's build script does not use BUILD/HOST/TARGET consistently. :( @@ -132,37 +148,37 @@ src_compile() export GOOS=$(go_os) export CC_FOR_TARGET=$(tc-getCC) export CXX_FOR_TARGET=$(tc-getCXX) - if [[ ${ARCH} == arm ]]; then - export GOARM=$(go_arm) - fi + 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() -{ +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 || die "tests failed" + ./run.bash -no-rebuild -k || die "tests failed" cd .. rm -fr pkg/*_race || die rm -fr pkg/obj/go-build || die } -src_install() -{ - # There is a known issue which requires the source tree to be installed [1]. - # Once this is fixed, we can consider using the doc use flag to control - # installing the doc and src directories. - # The use of cp is deliberate in order to retain permissions - # [1] https://golang.org/issue/2775 +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) @@ -185,13 +201,13 @@ src_install() pkg_postinst() { [[ -z ${REPLACING_VERSIONS} ]] && return - einfo "After ${CATEGORY}/${PN} is updated it is recommended to rebuild" - einfo "all packages compiled with previous versions of ${CATEGORY}/${PN}" - einfo "due to the static linking nature of go." - einfo "If this is not done, the packages compiled with the older" - einfo "version of the compiler will not be updated until they are" - einfo "updated individually, which could mean they will have" - einfo "vulnerabilities." - einfo "Run 'emerge @golang-rebuild' to rebuild all 'go' packages" - einfo "See https://bugs.gentoo.org/752153 for more info" + 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.14.14.ebuild b/dev-lang/go/go-1.22.3.ebuild index 07cd0d903d5f..78e336afcd99 100644 --- a/dev-lang/go/go-1.14.14.ebuild +++ b/dev-lang/go/go-1.22.3.ebuild @@ -1,11 +1,13 @@ -# Copyright 1999-2021 Gentoo Authors +# 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 @@ -21,21 +23,27 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* amd64 ~arm ~arm64 ~ppc64 ~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 DESCRIPTION="A concurrent garbage collected and typesafe programming language" -HOMEPAGE="https://golang.org" +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 - dev-lang/go-bootstrap )" -RDEPEND="!<dev-go/go-tools-0_pre20150902" + >=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='.*' @@ -43,33 +51,41 @@ 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" +RESTRICT=" strip" DOCS=( -AUTHORS -CONTRIBUTING.md -CONTRIBUTORS -PATENTS -README.md + CONTRIBUTING.md + PATENTS + README.md + SECURITY.md ) -go_arch() -{ +go_arch() { # By chance most portage arch names match Go - local portage_arch=$(tc-arch $@) - case "${portage_arch}" in + 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 "${portage_arch}";; + *) echo "${tc_arch}";; esac } -go_arm() -{ +go_arm() { case "${1:-${CHOST}}" in armv5*) echo 5;; armv6*) echo 6;; @@ -80,8 +96,7 @@ go_arm() esac } -go_os() -{ +go_os() { case "${1:-${CHOST}}" in *-linux*) echo linux;; *-darwin*) echo darwin;; @@ -98,21 +113,22 @@ go_os() esac } -go_tuple() -{ +go_tuple() { echo "$(go_os $@)_$(go_arch $@)" } -go_cross_compile() -{ +go_cross_compile() { [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] } -src_compile() -{ - if has_version -b dev-lang/go; then +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; then + 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" @@ -120,7 +136,7 @@ src_compile() fi export GOROOT_FINAL="${EPREFIX}"/usr/lib/go - export GOROOT="$(pwd)" + export GOROOT="${PWD}" export GOBIN="${GOROOT}/bin" # Go's build script does not use BUILD/HOST/TARGET consistently. :( @@ -132,37 +148,37 @@ src_compile() export GOOS=$(go_os) export CC_FOR_TARGET=$(tc-getCC) export CXX_FOR_TARGET=$(tc-getCXX) - if [[ ${ARCH} == arm ]]; then - export GOARM=$(go_arm) - fi + 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() -{ +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 || die "tests failed" + ./run.bash -no-rebuild -k || die "tests failed" cd .. rm -fr pkg/*_race || die rm -fr pkg/obj/go-build || die } -src_install() -{ - # There is a known issue which requires the source tree to be installed [1]. - # Once this is fixed, we can consider using the doc use flag to control - # installing the doc and src directories. - # The use of cp is deliberate in order to retain permissions - # [1] https://golang.org/issue/2775 +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) @@ -185,13 +201,13 @@ src_install() pkg_postinst() { [[ -z ${REPLACING_VERSIONS} ]] && return - einfo "After ${CATEGORY}/${PN} is updated it is recommended to rebuild" - einfo "all packages compiled with previous versions of ${CATEGORY}/${PN}" - einfo "due to the static linking nature of go." - einfo "If this is not done, the packages compiled with the older" - einfo "version of the compiler will not be updated until they are" - einfo "updated individually, which could mean they will have" - einfo "vulnerabilities." - einfo "Run 'emerge @golang-rebuild' to rebuild all 'go' packages" - einfo "See https://bugs.gentoo.org/752153 for more info" + 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-9999.ebuild b/dev-lang/go/go-9999.ebuild index 39d69abc7b52..fc36a2d33ae9 100644 --- a/dev-lang/go/go-9999.ebuild +++ b/dev-lang/go/go-9999.ebuild @@ -1,11 +1,13 @@ -# Copyright 1999-2020 Gentoo Authors +# 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 @@ -21,21 +23,27 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~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 DESCRIPTION="A concurrent garbage collected and typesafe programming language" -HOMEPAGE="https://golang.org" +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 - dev-lang/go-bootstrap )" -RDEPEND="!<dev-go/go-tools-0_pre20150902" + >=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='.*' @@ -43,33 +51,41 @@ 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" +RESTRICT=" strip" DOCS=( -AUTHORS -CONTRIBUTING.md -CONTRIBUTORS -PATENTS -README.md + CONTRIBUTING.md + PATENTS + README.md + SECURITY.md ) -go_arch() -{ +go_arch() { # By chance most portage arch names match Go - local portage_arch=$(tc-arch $@) - case "${portage_arch}" in + 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 "${portage_arch}";; + *) echo "${tc_arch}";; esac } -go_arm() -{ +go_arm() { case "${1:-${CHOST}}" in armv5*) echo 5;; armv6*) echo 6;; @@ -80,8 +96,7 @@ go_arm() esac } -go_os() -{ +go_os() { case "${1:-${CHOST}}" in *-linux*) echo linux;; *-darwin*) echo darwin;; @@ -98,21 +113,22 @@ go_os() esac } -go_tuple() -{ +go_tuple() { echo "$(go_os $@)_$(go_arch $@)" } -go_cross_compile() -{ +go_cross_compile() { [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] } -src_compile() -{ - if has_version -b dev-lang/go; then +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; then + 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" @@ -120,7 +136,7 @@ src_compile() fi export GOROOT_FINAL="${EPREFIX}"/usr/lib/go - export GOROOT="$(pwd)" + export GOROOT="${PWD}" export GOBIN="${GOROOT}/bin" # Go's build script does not use BUILD/HOST/TARGET consistently. :( @@ -132,37 +148,37 @@ src_compile() export GOOS=$(go_os) export CC_FOR_TARGET=$(tc-getCC) export CXX_FOR_TARGET=$(tc-getCXX) - if [[ ${ARCH} == arm ]]; then - export GOARM=$(go_arm) - fi + 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() -{ +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 || die "tests failed" + ./run.bash -no-rebuild -k || die "tests failed" cd .. rm -fr pkg/*_race || die rm -fr pkg/obj/go-build || die } -src_install() -{ - # There is a known issue which requires the source tree to be installed [1]. - # Once this is fixed, we can consider using the doc use flag to control - # installing the doc and src directories. - # The use of cp is deliberate in order to retain permissions - # [1] https://golang.org/issue/2775 +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) @@ -185,13 +201,13 @@ src_install() pkg_postinst() { [[ -z ${REPLACING_VERSIONS} ]] && return - einfo "After ${CATEGORY}/${PN} is updated it is recommended to rebuild" - einfo "all packages compiled with previous versions of ${CATEGORY}/${PN}" - einfo "due to the static linking nature of go." - einfo "If this is not done, the packages compiled with the older" - einfo "version of the compiler will not be updated until they are" - einfo "updated individually, which could mean they will have" - einfo "vulnerabilities." - einfo "Run 'emerge @golang-rebuild' to rebuild all 'go' packages" - einfo "See https://bugs.gentoo.org/752153 for more info" + 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/metadata.xml b/dev-lang/go/metadata.xml index 1050d935da86..5e00214a73f6 100644 --- a/dev-lang/go/metadata.xml +++ b/dev-lang/go/metadata.xml @@ -1,13 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> <email>williamh@gentoo.org</email> <name>William Hubbs</name> </maintainer> <longdescription lang="en"> - Go is a new systems programming language developped at google by + Go is a new systems programming language developed at google by Rob Pike. It has garbage collection, coroutines, communication channels and a clean syntax. </longdescription> + <upstream> + <remote-id type="cpe">cpe:/a:golang:go</remote-id> + <remote-id type="github">golang/go</remote-id> + </upstream> </pkgmetadata> |