summaryrefslogtreecommitdiff
path: root/dev-lang/go
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /dev-lang/go
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'dev-lang/go')
-rw-r--r--dev-lang/go/Manifest4
-rw-r--r--dev-lang/go/go-1.15.13.ebuild189
-rw-r--r--dev-lang/go/go-1.16.5.ebuild189
3 files changed, 382 insertions, 0 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index 2a21618f9699..32ff37a07acb 100644
--- a/dev-lang/go/Manifest
+++ b/dev-lang/go/Manifest
@@ -1,7 +1,11 @@
AUX go-sets.conf 313 BLAKE2B 03e94776e317d34b72bfb8385b8b0dfa6a599a6086e4d0c9214e7b49293768947c21d9afb323ffcc7fd85ba0af72d9cb243dbb571eee9eb81de9400fd5f5e79c SHA512 7d01b98bc8d1b609183682dd942bd4c9fa757a98243c7de3cf6c497c7bc20b8cdbe59dd669ce4bb11f914a0e9b6d100e65cea2dffd99f38be50b18e0ecf66315
DIST go1.15.12.src.tar.gz 23035406 BLAKE2B b5c79bb243b0052e7a3d58538ae734bbb38839654ffc0e1cf266d360c4f35ac1a8b02c999306a0c1bc598d6ec0c9b3326fea278163b49cd7becc820c7a129bd4 SHA512 9fdb0e74c0b4e8e5d8d45cbdb6f1d4be4d40549ef10629350856c3e045a82567a0418e949dfc229df7eea091ababec6b3e4e12b1bd424e14d7b10ef989e5c232
+DIST go1.15.13.src.tar.gz 23039791 BLAKE2B 45a6cd985a27afa8b063dff1e4e4903abf76f03621bb6e4b64b03ef5ba2a9acd3d8b19e131464e6ef57d69bcb513ae81516e4b2a8b020b50503ca162385ed222 SHA512 3f77716c9721afacb27daa175e236bb25cfc93602f1531df18938fad94bf4f59e81b81f53fa977c2ebc9a912942275a1106043133fec166965e72766b1638ba1
DIST go1.16.4.src.tar.gz 20917203 BLAKE2B 4602a20ced74dba86938283a736d5235fe5dfb34ae742c44cdcd7ae2453d4654ea5757d0be76b6687d1d34c1b8c32681c41398d1a04ae72d491ee1d8b296d16d SHA512 e1b64610e22e657d9c65094e679cec50f59ff338c0ef102e54debcced1bc032390122456451fffb2d26d45c6db2f55bb9ef7f56ce479f6f1c2c2e6cc49442d86
+DIST go1.16.5.src.tar.gz 20921372 BLAKE2B a6565deb34b6cb167c41fc3af2e3bbdc8e22333adc9109de67c9e1f4bffb3d2c6e7d289e310f777d69092b3ee7a4dd706e13b0fe9ae5b0a16f270569953039df SHA512 ba90ce1f3faa39519eb5437009c4b710b493e42764a14b0821292a8a17b714fe5985ef20e6e3c340f71cb521ff63d45a23570d38fd752526a1262448c641d544
EBUILD go-1.15.12.ebuild 4574 BLAKE2B 12cc502e407d5ccfc0a4ff3c63c724602e29b3806f8add96e1113f2a76f8444d971e7d1394d4a97b01f9755d743dee2cda4053a89d20d348c454a311277836d5 SHA512 6e4c888f2da630120c644fbc3f330af1c92c0847fb0f5bfb0fd42c888af8b7834c8508263801b34c946ed54e6414e7461411e2713f92f802c293af3624f0ad47
+EBUILD go-1.15.13.ebuild 4574 BLAKE2B 12cc502e407d5ccfc0a4ff3c63c724602e29b3806f8add96e1113f2a76f8444d971e7d1394d4a97b01f9755d743dee2cda4053a89d20d348c454a311277836d5 SHA512 6e4c888f2da630120c644fbc3f330af1c92c0847fb0f5bfb0fd42c888af8b7834c8508263801b34c946ed54e6414e7461411e2713f92f802c293af3624f0ad47
EBUILD go-1.16.4.ebuild 4574 BLAKE2B 12cc502e407d5ccfc0a4ff3c63c724602e29b3806f8add96e1113f2a76f8444d971e7d1394d4a97b01f9755d743dee2cda4053a89d20d348c454a311277836d5 SHA512 6e4c888f2da630120c644fbc3f330af1c92c0847fb0f5bfb0fd42c888af8b7834c8508263801b34c946ed54e6414e7461411e2713f92f802c293af3624f0ad47
+EBUILD go-1.16.5.ebuild 4642 BLAKE2B 2a3ebc1f8b2797ef0ca78e81fd9201ddeb25d3d422170b6f383b853579a633bbd2c5040ec4e3d0bd904ec75aa9be0a43d0d4f243514ae58ff3d9f17f7ee53a57 SHA512 6cc0b8e18db98fbe1faef5185d87e369298b8019d4c7119c6ffb2225b89a2c51c9dd550f77b5e17ef2111dea89091b64ddd78b12e20c49c2c7bcb92fd9a1a36d
EBUILD go-9999.ebuild 4579 BLAKE2B c74b2bdd8db85b106cc7fced8388d1d50a67ccd1cc003ccf984c04a3213191e662a7285cacca758edbaa56149007ca84ae5d869b06a5a3f9cb72239e7ad621e8 SHA512 8cb0132fa8cdbc8a45346013f15c66b0075f3df678c3d623a1d16ed03d6b0a04b6372c14d8fdddde00dfa2eee39661ea17104fd787b6609bb5e8407ee773fcbc
MISC metadata.xml 462 BLAKE2B d9d4280e921286791a55619a7e5557c7041b0de157aa0f8bf6f17cf5041f802df4037270eeb3e8d37263f9fc17939c619a0dd3bce449c5f247279884da10bf67 SHA512 26fa7bfe26f00e8e1766cc0a1052fb8b5352799a33c9eb8f0c4f4523601d3eb5d1da8adc4b731f0d778039788734a9ad483f22e58e4bf1551ec8e9dccbcb87ba
diff --git a/dev-lang/go/go-1.15.13.ebuild b/dev-lang/go/go-1.15.13.ebuild
new file mode 100644
index 000000000000..0d4ac09e8905
--- /dev/null
+++ b/dev-lang/go/go-1.15.13.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2021 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 ~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"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+
+BDEPEND="|| (
+ dev-lang/go
+ dev-lang/go-bootstrap )"
+RDEPEND="!<dev-go/go-tools-0_pre20150902"
+
+# 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/.*/.*"
+
+# 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 portage_arch=$(tc-arch $@)
+ case "${portage_arch}" in
+ x86) echo 386;;
+ x64-*) echo amd64;;
+ ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
+ s390) echo s390x ;;
+ *) echo "${portage_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)
+ if [[ ${ARCH} == arm ]]; then
+ export GOARM=$(go_arm)
+ fi
+
+ 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
+ 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"
+}
diff --git a/dev-lang/go/go-1.16.5.ebuild b/dev-lang/go/go-1.16.5.ebuild
new file mode 100644
index 000000000000..ec9ee79ef9d4
--- /dev/null
+++ b/dev-lang/go/go-1.16.5.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2021 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 ~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"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cpu_flags_x86_sse2"
+
+BDEPEND="|| (
+ dev-lang/go
+ dev-lang/go-bootstrap )"
+RDEPEND="!<dev-go/go-tools-0_pre20150902"
+
+# 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/.*/.*"
+
+# 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 portage_arch=$(tc-arch $@)
+ case "${portage_arch}" in
+ x86) echo 386;;
+ x64-*) echo amd64;;
+ ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
+ s390) echo s390x ;;
+ *) echo "${portage_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
+ 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"
+}