Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/go/
Date: Thu, 02 Feb 2017 00:35:56
Message-Id: 1485995739.240052d72782c8b18d524b951e5d314703412e63.williamh@gentoo
1 commit: 240052d72782c8b18d524b951e5d314703412e63
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 2 00:33:02 2017 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 2 00:35:39 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=240052d7
7
8 dev-lang/go: 1.7.5 version bump for #607402
9
10 Package-Manager: portage-2.3.3
11
12 dev-lang/go/Manifest | 1 +
13 dev-lang/go/go-1.7.5.ebuild | 222 ++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 223 insertions(+)
15
16 diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
17 index 3ba43f4..9474bd5 100644
18 --- a/dev-lang/go/Manifest
19 +++ b/dev-lang/go/Manifest
20 @@ -10,3 +10,4 @@ DIST go-linux-ppc64le-bootstrap.tbz 50134685 SHA256 ca816a3e3cbd7721200522fa3984
21 DIST go-linux-s390x-bootstrap.tbz 49809007 SHA256 80a87bc5ac2239c99f8d7425fbc6f4fefba63f549b0835505c25378c08114656 SHA512 1b7500e6c42508b6cb07214620070065262349d2cd3698deeac0638d0bf0bfeb89c59c2d72a284af34f3071b4cfb9ce543c5fdec7add4a46adc9580295909439 WHIRLPOOL d3782cb515ab67720105224e02d96ab1ca86518db661719b2d0f7c48aa1f4f896a7cc5fed5b6ddc032c8206e8a10c6262646be0e59def61723936044d6ceb143
22 DIST go-solaris-amd64-bootstrap.tbz 48367195 SHA256 92ebdbf001f243a78a6c2d8ee30e929ba2cecbedf8e0fc07e129b04b107453ad SHA512 cf8725db0d001d61badee71624799a3c9e75f61f77ab090c1f6c490d694c4be367019b28d88306045d877ab5a324a1f9b0674293caf3acb19c193fc3746a48f2 WHIRLPOOL 672c6642e340b6d4f38b633f67fdc3202e3725022a8a61e2129276fccd6c42ddc24ed06c1d57eb31a25ea8056b79686619cbb36431b9c23b6d4be5bcb715bd89
23 DIST go1.7.4.src.tar.gz 14198817 SHA256 4c189111e9ba651a2bb3ee868aa881fab36b2f2da3409e80885ca758a6b614cc SHA512 dc9950c3ea7100e536ad58fd93505d584276b7c50d4b8fe2ba7f20fd043dcf0d315b735c48945302055e91517594cc2b0061ccec9478a8ab48f1f2836c20afb3 WHIRLPOOL 054f496555dd30e0ba6a3c449b915ea048d5f85f1cf6d2ef6e8aa84939b6e9674b30cfccee99d050c5d75d028cf43d83bf0267703ffb02dfc5bc780fd0a1706f
24 +DIST go1.7.5.src.tar.gz 14204325 SHA256 4e834513a2079f8cbbd357502cccaac9507fd00a1efe672375798858ff291815 SHA512 2dda0780a8b24d71fec4ddeb6858c58a42845f51d9afc171d924a7b763101878cc7f29ae1dd35f129b4ee45b84d45211093a1d20639745fed36b49fb7fe1ba07 WHIRLPOOL b28ab10558d9f8fba87d5db2c839a84eab0b61244d75f4b3d42b443365ca8a1ae1c60c2e1073ef2b4a854d957c26111fcc286b7caae4be892e6cba0e4b24e21d
25
26 diff --git a/dev-lang/go/go-1.7.5.ebuild b/dev-lang/go/go-1.7.5.ebuild
27 new file mode 100644
28 index 00000000..4432f8a
29 --- /dev/null
30 +++ b/dev-lang/go/go-1.7.5.ebuild
31 @@ -0,0 +1,222 @@
32 +# Copyright 1999-2017 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +# $Id$
35 +
36 +EAPI=6
37 +
38 +export CBUILD=${CBUILD:-${CHOST}}
39 +export CTARGET=${CTARGET:-${CHOST}}
40 +
41 +MY_PV=${PV/_/}
42 +
43 +inherit toolchain-funcs
44 +
45 +BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
46 +SRC_URI="!gccgo? (
47 +kernel_Darwin? (
48 + x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-bootstrap.tbz )
49 +)
50 +kernel_FreeBSD? (
51 +amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-bootstrap.tbz )
52 +x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-bootstrap-1.tbz )
53 +)
54 +kernel_linux? (
55 + amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-bootstrap.tbz )
56 + arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-bootstrap.tbz )
57 + arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-bootstrap.tbz )
58 + ppc64? (
59 + ${BOOTSTRAP_DIST}/go-linux-ppc64-bootstrap.tbz
60 + ${BOOTSTRAP_DIST}/go-linux-ppc64le-bootstrap.tbz
61 + )
62 + s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-bootstrap.tbz )
63 + x86? ( ${BOOTSTRAP_DIST}/go-linux-386-bootstrap-1.tbz )
64 +)
65 +kernel_SunOS? (
66 + x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-bootstrap.tbz )
67 +)
68 +)
69 +"
70 +
71 +if [[ ${PV} = 9999 ]]; then
72 + EGIT_REPO_URI="git://github.com/golang/go.git"
73 + inherit git-r3
74 +else
75 + SRC_URI+="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz"
76 + case ${PV} in
77 + *9999*|*_rc*) ;;
78 + *)
79 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x64-solaris"
80 + ;;
81 + esac
82 +fi
83 +
84 +DESCRIPTION="A concurrent garbage collected and typesafe programming language"
85 +HOMEPAGE="http://www.golang.org"
86 +
87 +LICENSE="BSD"
88 +SLOT="0/${PV}"
89 +IUSE="gccgo"
90 +
91 +DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
92 +RDEPEND="!<dev-go/go-tools-0_pre20150902"
93 +
94 +# These test data objects have writable/executable stacks.
95 +QA_EXECSTACK="usr/lib/go/src/debug/elf/testdata/*.obj"
96 +
97 +# Do not complain about CFLAGS, etc, since Go doesn't use them.
98 +QA_FLAGS_IGNORED='.*'
99 +
100 +REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*"
101 +
102 +# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
103 +QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
104 +
105 +# The go language uses *.a files which are _NOT_ libraries and should not be
106 +# stripped. The test data objects should also be left alone and unstripped.
107 +STRIP_MASK="/usr/lib/go/pkg/*.a
108 + /usr/lib/go/src/debug/elf/testdata/*
109 + /usr/lib/go/src/debug/dwarf/testdata/*
110 + /usr/lib/go/src/runtime/race/*.syso"
111 +
112 +if [[ ${PV} != 9999 ]]; then
113 + S="${WORKDIR}"/go
114 +fi
115 +
116 +go_arch()
117 +{
118 + # By chance most portage arch names match Go
119 + local portage_arch=$(tc-arch $@)
120 + case "${portage_arch}" in
121 + x86) echo 386;;
122 + x64-*) echo amd64;;
123 + ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
124 + s390) echo s390x ;;
125 + *) echo "${portage_arch}";;
126 + esac
127 +}
128 +
129 +go_arm()
130 +{
131 + case "${1:-${CHOST}}" in
132 + armv5*) echo 5;;
133 + armv6*) echo 6;;
134 + armv7*) echo 7;;
135 + *)
136 + die "unknown GOARM for ${1:-${CHOST}}"
137 + ;;
138 + esac
139 +}
140 +
141 +go_os()
142 +{
143 + case "${1:-${CHOST}}" in
144 + *-linux*) echo linux;;
145 + *-darwin*) echo darwin;;
146 + *-freebsd*) echo freebsd;;
147 + *-netbsd*) echo netbsd;;
148 + *-openbsd*) echo openbsd;;
149 + *-solaris*) echo solaris;;
150 + *-cygwin*|*-interix*|*-winnt*)
151 + echo windows
152 + ;;
153 + *)
154 + die "unknown GOOS for ${1:-${CHOST}}"
155 + ;;
156 + esac
157 +}
158 +
159 +go_tuple()
160 +{
161 + echo "$(go_os $@)_$(go_arch $@)"
162 +}
163 +
164 +go_cross_compile()
165 +{
166 + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
167 +}
168 +
169 +pkg_pretend()
170 +{
171 + # make.bash does not understand cross-compiling a cross-compiler
172 + if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then
173 + die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}"
174 + fi
175 +}
176 +
177 +src_unpack()
178 +{
179 + if [[ ${PV} = 9999 ]]; then
180 + git-r3_src_unpack
181 + fi
182 + default
183 +}
184 +
185 +src_compile()
186 +{
187 + export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap
188 + if use gccgo; then
189 + mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
190 + local go_binary=$(gcc-config --get-bin-path)/go-5
191 + [[ -x ${go_binary} ]] || go_binary=$(
192 + find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-5 | sort -V | tail -n1)
193 + [[ -x ${go_binary} ]] || die "go-5: command not found"
194 + ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
195 + fi
196 + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
197 + export GOROOT="$(pwd)"
198 + export GOBIN="${GOROOT}/bin"
199 +
200 + # Go's build script does not use BUILD/HOST/TARGET consistently. :(
201 + export GOHOSTARCH=$(go_arch ${CBUILD})
202 + export GOHOSTOS=$(go_os ${CBUILD})
203 + export CC=$(tc-getBUILD_CC)
204 +
205 + export GOARCH=$(go_arch)
206 + export GOOS=$(go_os)
207 + export CC_FOR_TARGET=$(tc-getCC)
208 + export CXX_FOR_TARGET=$(tc-getCXX)
209 + if [[ ${ARCH} == arm ]]; then
210 + export GOARM=$(go_arm)
211 + fi
212 + elog "GOROOT_BOOTSTRAP is ${GOROOT_BOOTSTRAP}"
213 +
214 + cd src
215 + ./make.bash || die "build failed"
216 +}
217 +
218 +src_test()
219 +{
220 + go_cross_compile && return 0
221 +
222 + cd src
223 + PATH="${GOBIN}:${PATH}" \
224 + ./run.bash -no-rebuild || die "tests failed"
225 +}
226 +
227 +src_install()
228 +{
229 + local bin_path f x
230 +
231 + dodir /usr/lib/go
232 + insinto /usr/lib/go
233 +
234 + # There is a known issue which requires the source tree to be installed [1].
235 + # Once this is fixed, we can consider using the doc use flag to control
236 + # installing the doc and src directories.
237 + # [1] https://golang.org/issue/2775
238 + doins -r bin doc lib pkg src
239 + fperms -R +x /usr/lib/go/bin /usr/lib/go/pkg/tool
240 +
241 + cp -a misc "${D}"/usr/lib/go/misc
242 +
243 + if go_cross_compile; then
244 + bin_path="bin/$(go_tuple)"
245 + else
246 + bin_path=bin
247 + fi
248 + for x in ${bin_path}/*; do
249 + f=${x##*/}
250 + dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
251 + done
252 + dodoc AUTHORS CONTRIBUTORS PATENTS README.md
253 +}