1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 export CTARGET=${CTARGET:-${CHOST}}
9 inherit eutils toolchain-funcs
11 if [[ ${PV} = 9999 ]]; then
12 EGIT_REPO_URI="git://github.com/golang/go.git"
15 SRC_URI="https://storage.googleapis.com/golang/go${PV}.src.tar.gz"
16 # Upstream only supports go on amd64, arm and x86 architectures.
17 KEYWORDS="-* amd64 arm x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x86-macos ~x64-solaris"
20 DESCRIPTION="A concurrent garbage collected and typesafe programming language"
21 HOMEPAGE="http://www.golang.org"
30 # These test data objects have writable/executable stacks.
32 usr/lib/go/src/debug/elf/testdata/go-relocation-test-gcc482-aarch64.obj
33 usr/lib/go/src/debug/elf/testdata/gcc-amd64-openbsd-debug-with-rela.obj"
35 REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*"
37 # The tools in /usr/lib/go should not cause the multilib-strict check to fail.
38 QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
40 # The go language uses *.a files which are _NOT_ libraries and should not be
42 STRIP_MASK="/usr/lib/go/pkg/linux*/*.a /usr/lib/go/pkg/freebsd*/*.a /usr/lib/go/pkg/darwin*/*.a"
44 if [[ ${PV} != 9999 ]]; then
50 if [[ ${PV} != 9999 ]]; then
51 sed -i -e 's#"-Werror",##g' src/cmd/dist/build.c ||
59 export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
60 export GOROOT="$(pwd)"
61 export GOBIN="${GOROOT}/bin"
62 if [[ $CTARGET = armv5* ]]
69 ./make.bash || die "build failed"
75 PATH="${GOBIN}:${PATH}" \
76 ./run.bash --no-rebuild --banner || die "tests failed"
82 dodoc AUTHORS CONTRIBUTORS PATENTS README
87 # There is a known issue which requires the source tree to be installed [1].
88 # Once this is fixed, we can consider using the doc use flag to control
89 # installing the doc and src directories.
90 # [1] https://golang.org/issue/2775
91 doins -r doc include lib pkg src
92 fperms -R +x /usr/lib/go/pkg/tool
97 has_version '<dev-lang/go-1.4' &&
98 export had_support_files=true ||
99 export had_support_files=false
104 # If the go tool sees a package file timestamped older than a dependancy it
105 # will rebuild that file. So, in order to stop go from rebuilding lots of
106 # packages for every build we need to fix the timestamps. The compiler and
107 # linker are also checked - so we need to fix them too.
108 ebegin "fixing timestamps to avoid unnecessary rebuilds"
109 tref="usr/lib/go/pkg/*/runtime.a"
110 find "${EROOT}"usr/lib/go -type f \
111 -exec touch -r "${EROOT}"${tref} {} \;
114 if [[ ${PV} != 9999 && -n ${REPLACING_VERSIONS} &&
115 ${REPLACING_VERSIONS} != ${PV} ]]; then
116 elog "Release notes are located at http://golang.org/doc/go1.4"
119 if $had_support_files; then
121 ewarn "All editor support, IDE support, shell completion"
122 ewarn "support, etc has been removed from the go package"
124 ewarn "For more information on which support is available, see"
125 ewarn "the following URL:"
126 ewarn "https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins"