tdev-lang/go: Add 1.10_beta1 - parlay - yet another gentoo overlay HTML git clone https://git.parazyd.org/parlay DIR Log DIR Files DIR Refs DIR README --- DIR commit 8eaac4eb3a9130ff664815573f2cb220611c7cb4 DIR parent 38e70422ac9fb22c1492537a5844cdcdd0438f48 HTML Author: parazyd <parazyd@dyne.org> Date: Sun, 10 Dec 2017 14:36:23 +0100 dev-lang/go: Add 1.10_beta1 Diffstat: M dev-lang/go/Manifest | 1 + A dev-lang/go/go-1.10_beta1.ebuild | 228 +++++++++++++++++++++++++++++++ 2 files changed, 229 insertions(+), 0 deletions(-) --- DIR diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest t@@ -1,2 +1,3 @@ DIST go-linux-amd64-bootstrap-1.4.3.tbz 31469891 SHA256 393e0ba67490f639f44817817d3fd935cd29233dd55dae8d07a68a9772587f0b SHA512 fafc66ce2a261fce9204b2e15d2ee2d09fb693d20a9df74691bb5a569d791dcf4aefc6c116d3af75367443af3cd5ff302c7836ac4fea1ef0d7de3089d2b6bdce WHIRLPOOL cadb40c936f954d187641b9e795a7ba094a8821c76a45534d09c2db2808a12084d2f068a6994f3db09577cc27c98822efcbe4f50249fe8668ff0137c76806053 +DIST go1.10beta1.src.tar.gz 18312654 SHA256 841df62b20fd915d83a2e43b7d043c2a3781c299de78abc45480eec575186b6b SHA512 ad479336f2ad90ca3dfb782e96c954d3c876fac69664666310817e31b471b6591f983aa8ab8eb321be8354fb0de7f5a901c10a192a06333535ccaebc14184d9b WHIRLPOOL 196f6ae0e31df8f87ea2f1674921d2b33154d3d5eb8378f70be476faf5122fa9a92bc984a7bff0d7da389380fd673dd722ea04eae560f703db6e96601e2f4ceb DIST go1.9.2.src.tar.gz 16383591 SHA256 665f184bf8ac89986cfd5a4460736976f60b57df6b320ad71ad4cef53bb143dc SHA512 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5 WHIRLPOOL f9a009e1befa29ff93a2a1f942276b932f7d96a95f027b99c04f8d56317cfeebcfb779f36ddb46801a8e7646fdd0be57a39b2a3c04886c09f1799bc4e6752af0 DIR diff --git a/dev-lang/go/go-1.10_beta1.ebuild b/dev-lang/go/go-1.10_beta1.ebuild t@@ -0,0 +1,228 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} + +MY_PV=${PV/_/} + +inherit toolchain-funcs + +#BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist" +BOOTSTRAP_DIST="https://pub.parazyd.cf/mirror/gentoo/distfiles" +BOOTSTRAP_VERSION="bootstrap-1.4.3" +BOOTSTRAP_URI=" +amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz )" +#arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz ) +#arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz ) +#ppc64? ( +# ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz +# ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz +#) +#s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz ) +#x86? ( ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz ) +#amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-${BOOTSTRAP_VERSION}.tbz ) +#x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-${BOOTSTRAP_VERSION}.tbz ) +#x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz ) +#x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz ) +#" + +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 x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x64-solaris" + # The upstream tests fail under portage but pass if the build is + # run according to their documentation [1]. + # I am restricting the tests on released versions until this is + # solved. + # [1] https://golang.org/issues/18442 + RESTRICT="test" + ;; + esac +esac +SRC_URI+="!gccgo? ( ${BOOTSTRAP_URI} )" + +DESCRIPTION="A concurrent garbage collected and typesafe programming language" +HOMEPAGE="https://golang.org" + +LICENSE="BSD" +SLOT="0/${PV}" +IUSE="gccgo" + +DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )" +RDEPEND="!<dev-go/go-tools-0_pre20150902" + +# These test data objects have writable/executable stacks. +QA_EXECSTACK=" + usr/lib/go/src/debug/elf/testdata/*.obj + usr/lib/go/src/go/internal/gccgoimporter/testdata/unicode.gox + usr/lib/go/src/go/internal/gccgoimporter/testdata/time.gox + " + +# Do not complain about CFLAGS, etc, since Go doesn't use them. +QA_FLAGS_IGNORED='.*' + +REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*" + +# 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) ]] +} + +pkg_pretend() +{ + # make.bash does not understand cross-compiling a cross-compiler + if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then + die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}" + fi +} + +src_unpack() +{ + if [[ ${PV} = 9999 ]]; then + git-r3_src_unpack + fi + default +} + +src_compile() +{ + export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap + if use gccgo; then + mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die + local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version) + [[ -x ${go_binary} ]] || go_binary=$( + find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-$(gcc-major-version) | + sort -V | tail -n1) + [[ -x ${go_binary} ]] || + die "go-$(gcc-major-version): command not found" + ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die + 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 + einfo "GOROOT_BOOTSTRAP is ${GOROOT_BOOTSTRAP}" + + cd src + CGO_ENABLED=0 ./make.bash || die "build failed" +} + +src_test() +{ + go_cross_compile && return 0 + + cd src + PATH="${GOBIN}:${PATH}" \ + ./run.bash -no-rebuild || die "tests failed" +} + +src_install() +{ + local bin_path f x + + dodir /usr/lib/go + + # 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. + # [1] https://golang.org/issue/2775 + # + # deliberately use cp to retain permissions + cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go + if go_cross_compile; then + bin_path="bin/$(go_tuple)" + else + bin_path=bin + fi + for x in ${bin_path}/*; do + f=${x##*/} + dosym ../lib/go/${bin_path}/${f} /usr/bin/${f} + done + einstalldocs +}