summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lang/go/Manifest1
-rw-r--r--dev-lang/go/go-1.15.7.ebuild197
2 files changed, 198 insertions, 0 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index 8ace5e4d64ad..85fdcd7caf02 100644
--- a/dev-lang/go/Manifest
+++ b/dev-lang/go/Manifest
@@ -1,3 +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
diff --git a/dev-lang/go/go-1.15.7.ebuild b/dev-lang/go/go-1.15.7.ebuild
new file mode 100644
index 000000000000..461f57dcd52f
--- /dev/null
+++ b/dev-lang/go/go-1.15.7.ebuild
@@ -0,0 +1,197 @@
+# 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"
+}