summaryrefslogtreecommitdiff
path: root/dev-lang/go
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/go')
-rw-r--r--dev-lang/go/Manifest4
-rw-r--r--dev-lang/go/go-1.15.15.ebuild189
-rw-r--r--dev-lang/go/go-1.16.7.ebuild194
3 files changed, 387 insertions, 0 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index b034fa39aa67..cff8e913f84f 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.14.src.tar.gz 23041432 BLAKE2B bcc79756b77cb7c435360a91da853b723ba33287a803250ff6bc36d523eddc293265797dc63df2ca6c504050d56c34336dbed205025f2efdda9247fc9a07f7e3 SHA512 2bf18efcb3a5f9e54de0a0e7ee27a689c2dc895d9403bc6f66e500358e70d1d664d7f17102126c98bd26fa2a3346ead358684e45b1a354cde8764c715064dd92
+DIST go1.15.15.src.tar.gz 23042945 BLAKE2B 4787b9b1c22d5e0bf35350dc075cbdb51d838aff7972cd4c8d821ad495e712527499e28fcfb1f04738b8d749d01f432ec5d254d9d69762234a7f12ff94933e7c SHA512 bf8a6f669d024ce77271fbc8dc1d7a727c4da85c70cad00d0baaef157e7c5d7879ea9ae71cdb04e55f9c07f5ae76655264ca8a159c971eab1cf8a8861b74e69b
DIST go1.16.6.src.tar.gz 20923044 BLAKE2B 7a46d33f947c1d7f2c6f5e0085cba89520fdb8859fc804c8318b85d0b0e888b74ca074affcf3119c2d80157485e8f679e37390cbd58c644b38948f7d15428b7b SHA512 82634763dce636c9e9cba1bbf74a669e8b88e6df095e80672f295edb82cc1fc4b8ffde91a1f56c3470f2c4d9ee0404f65146d7478b645890623f6c463513a61f
+DIST go1.16.7.src.tar.gz 20922206 BLAKE2B 65e53684f66975313caf4661a7c52b178dde8b32ac40f98fe8164fe035c835e1407ef442d41c7cbf907d5093703e440d0e62c398f8ed541bad074b537f6dd6ff SHA512 1aab6f3dcbae71ebfa29a1d9a46613a3aa48de01cee82b48842d92abbb4ee57db019a4d47a3f12af9553c8e2a982e90114a06ee187f908f7c29245d9786b9186
EBUILD go-1.15.14.ebuild 4574 BLAKE2B 12cc502e407d5ccfc0a4ff3c63c724602e29b3806f8add96e1113f2a76f8444d971e7d1394d4a97b01f9755d743dee2cda4053a89d20d348c454a311277836d5 SHA512 6e4c888f2da630120c644fbc3f330af1c92c0847fb0f5bfb0fd42c888af8b7834c8508263801b34c946ed54e6414e7461411e2713f92f802c293af3624f0ad47
+EBUILD go-1.15.15.ebuild 4577 BLAKE2B dd2d4efe5fdfc7e74f62d0cac56b6e4623b928a11a70505cd1b64dbb32a46eadb455eb15427d51cf00969c895e69b543283531132c236b967f014cb0b7aac194 SHA512 917ee36e39e67d719cee4a14082b217d942521275e8fee1bf1804e8223e25858b112af6def2f3f66cdf8575948658ce9dcf50f3df1e69e587f9081d5487f9403
EBUILD go-1.16.6.ebuild 4794 BLAKE2B 54a75927b9d5e7fd50a83de625087f34ec4f0abbdaed135ab709b9581e141f0e96b52cc9fd64b797a3092e8e057fd84c9d9db3ad74de9945a72253c23a7d328f SHA512 02ff8dd6f4e225e3c414ef6e3d7792fb6a8e95914e8ef75caf8606c3f931bce72e7e2c77d54d6f350b743bc5de7f441ba405a5b8ff758b5a3be64a7922b2e41c
+EBUILD go-1.16.7.ebuild 4797 BLAKE2B b6a4fda102174ed5798fea6dcde0816532120cea5709711ad517c374ff7c15b10867885f195f306aaf64193af1dc11f9f2eed2f178844cf6db02246bebe92602 SHA512 4eb0e4509f0b09ae7c21e3ccbdc0cb60407bd0c830ab4271d831e6e53f581b03bce613607c404a750597176998d4b81efd45ca0f4e74308e0924eaa572012f7f
EBUILD go-9999.ebuild 4799 BLAKE2B e4ab02babd5f6d6020b5a67c5640c7c5b0661c6ecb9832ce0fc702f2f91da7ac5f430fc76e2feb94ef8f460cda6262765adba361c796232a28a15d2728de310b SHA512 5a54c5120a8c08cd58ab6a7497c1cf5ed07c637c69994bbf437c7d4c50b01b3ec6744f04e2644bfa316ace7237fdd84ee304affa18a0d2d5dd3e4380a58d1dd9
MISC metadata.xml 462 BLAKE2B d9d4280e921286791a55619a7e5557c7041b0de157aa0f8bf6f17cf5041f802df4037270eeb3e8d37263f9fc17939c619a0dd3bce449c5f247279884da10bf67 SHA512 26fa7bfe26f00e8e1766cc0a1052fb8b5352799a33c9eb8f0c4f4523601d3eb5d1da8adc4b731f0d778039788734a9ad483f22e58e4bf1551ec8e9dccbcb87ba
diff --git a/dev-lang/go/go-1.15.15.ebuild b/dev-lang/go/go-1.15.15.ebuild
new file mode 100644
index 000000000000..e98303b97bf0
--- /dev/null
+++ b/dev-lang/go/go-1.15.15.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.7.ebuild b/dev-lang/go/go-1.16.7.ebuild
new file mode 100644
index 000000000000..3e9855f5a351
--- /dev/null
+++ b/dev-lang/go/go-1.16.7.ebuild
@@ -0,0 +1,194 @@
+# 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 ~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"
+
+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/.*/.*"
+
+# 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 portage_arch=$(tc-arch $@)
+ case "${portage_arch}" in
+ x86) echo 386;;
+ x64-*) echo amd64;;
+ ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
+ riscv) echo riscv64 ;;
+ 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"
+}