From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1443883-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 08149158094
	for <garchives@archives.gentoo.org>; Thu,  6 Oct 2022 01:36:41 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 118F6E086C;
	Thu,  6 Oct 2022 01:36:40 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id E723AE086C
	for <gentoo-commits@lists.gentoo.org>; Thu,  6 Oct 2022 01:36:39 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id BFC2A340831
	for <gentoo-commits@lists.gentoo.org>; Thu,  6 Oct 2022 01:36:38 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 269925DD
	for <gentoo-commits@lists.gentoo.org>; Thu,  6 Oct 2022 01:36:37 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org>
Message-ID: <1665020153.840cbb4676771234cdbaa4c55f88cc34ff64b399.williamh@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/go/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-lang/go/Manifest dev-lang/go/go-1.18.7.ebuild dev-lang/go/go-1.19.2.ebuild
X-VCS-Directories: dev-lang/go/
X-VCS-Committer: williamh
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: 840cbb4676771234cdbaa4c55f88cc34ff64b399
X-VCS-Branch: master
Date: Thu,  6 Oct 2022 01:36:37 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: ecc025fa-da0d-4e5f-81ac-6d5fe1cc1f2b
X-Archives-Hash: 3a8df4fe2807cc119e8afe8a8489b47d

commit:     840cbb4676771234cdbaa4c55f88cc34ff64b399
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  6 01:35:32 2022 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Oct  6 01:35:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=840cbb46

dev-lang/go: add 1.18.7, 1.19.2

Bug: https://bugs.gentoo.org/873637
Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-lang/go/Manifest         |   2 +
 dev-lang/go/go-1.18.7.ebuild | 196 +++++++++++++++++++++++++++++++++++++++++
 dev-lang/go/go-1.19.2.ebuild | 201 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 399 insertions(+)

diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index e7980ce8a9a4..0b9f515b9367 100644
--- a/dev-lang/go/Manifest
+++ b/dev-lang/go/Manifest
@@ -1,3 +1,5 @@
 DIST go1.18.5.src.tar.gz 22847094 BLAKE2B 8edf133aa5b1fa4076db72bd7c63240db6cbd6b9b4725c2a71384ff302bee77e193bcfad6b55bfd31ee58f08fc59d9bbee5750d9227598fe402d6293863595ff SHA512 4ba69ad49b5c17963fdc39ae7f5360fa38950db39ec1fb9b52744d6a209abf177dab6bd587e7457c83a4fd265589907ec241d8b09d0eac76cf984243a14500ef
 DIST go1.18.6.src.tar.gz 22865753 BLAKE2B fc86e509006e61434bcf6968aca345474560457be1573c836f24cd1d173d7cd515bbe70376d4231cd4318c77bd8e7c3af1101ded8403b3ca8f0afd08563a38ba SHA512 2af66b09bfe033b413eb7603a73a490319bf49fec0a2e20c40350e60b9ef35250a6dc8544c5fc67bd1ede55e242d056e7749f69ef500a38b1efe4b8f93078de3
+DIST go1.18.7.src.tar.gz 22872579 BLAKE2B 194ef3440c0e23c4409e433fa9c62419d9aa7c3445bacd45c905cb78b480882e220ca5cb0a45ebe071d8c6592db470832f9358b36b18af557a4684ef6872c456 SHA512 cf1ff024e94b900b87cc52d3ec04b0f7f853880a99c416791ad4b9af5f8e50ec82fbe00788bc8dcc184ef5ce1a9df17f5f5e95cf01c0c8138f28f53d691ca5d4
 DIST go1.19.1.src.tar.gz 26527375 BLAKE2B 80e80189e7e94f0a6bcb5dfdccc56fa3fee82d461816606b5600f6238f8929bb230c74c527ca01a087024002f9e9eb807997bd43639a7af81774d731361ce3a2 SHA512 7e8cf557f05d5a537f9305bb9c19cf8ab9ce640376e5ea97ff0d490b016364936e8dfc129462760c4e817af01fdf09e3f815b88412f9985bb254dfa3167752c0
+DIST go1.19.2.src.tar.gz 26534465 BLAKE2B 9b1eb84a8d840facf69dde8f6263d08239b67b583b3b4fdf0aa5c03cb15c41c0dd6b10df61bfe7d1b02eeb0d1eb97fc5adeaa71e9745318c2648057be3f37259 SHA512 72901e5eaf1857b22bf62a82690579aa4bd8b8130f16416313d249600c99e1ae3c1451ac5c53138ce41dd39dd72dcf8d0f3592b98f4239754efcf4f8b0103cb4

diff --git a/dev-lang/go/go-1.18.7.ebuild b/dev-lang/go/go-1.18.7.ebuild
new file mode 100644
index 000000000000..c340b5873264
--- /dev/null
+++ b/dev-lang/go/go-1.18.7.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+
+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 ~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="cpu_flags_x86_sse2"
+
+BDEPEND="|| (
+		dev-lang/go
+		dev-lang/go-bootstrap )"
+
+# 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=(
+AUTHORS
+CONTRIBUTING.md
+CONTRIBUTORS
+PATENTS
+README.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;;
+		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) ]]
+}
+
+src_compile() {
+	if has_version -b dev-lang/go; then
+		export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
+	elif has_version -b dev-lang/go-bootstrap; 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
+	PATH="${GOBIN}:${PATH}" \
+	./run.bash -no-rebuild || 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
+	dodir /usr/lib/go
+	cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
+	einstalldocs
+
+	# 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.19.2.ebuild b/dev-lang/go/go-1.19.2.ebuild
new file mode 100644
index 000000000000..5e8e4e56890a
--- /dev/null
+++ b/dev-lang/go/go-1.19.2.ebuild
@@ -0,0 +1,201 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+
+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"
+
+BDEPEND="|| (
+		dev-lang/go
+		dev-lang/go-bootstrap )"
+
+# 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) ]]
+}
+
+src_compile() {
+	if has_version -b dev-lang/go; then
+		export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
+	elif has_version -b dev-lang/go-bootstrap; 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
+	PATH="${GOBIN}:${PATH}" \
+	./run.bash -no-rebuild || 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
+	dodir /usr/lib/go
+	cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
+	einstalldocs
+
+	# 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"
+}