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: Wed, 27 Apr 2016 20:50:29
Message-Id: 1461789788.65f3c9844c018a3ba1a7b35e9e2817c5754fc8bb.williamh@gentoo
1 commit: 65f3c9844c018a3ba1a7b35e9e2817c5754fc8bb
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 27 20:42:35 2016 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 27 20:43:08 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65f3c984
7
8 dev-lang/go: version bump to 1.6.2
9
10 Package-Manager: portage-2.2.26
11
12 dev-lang/go/Manifest | 2 +
13 dev-lang/go/go-1.6.2.ebuild | 253 ++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 255 insertions(+)
15
16 diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
17 index 70faab2..426210b 100644
18 --- a/dev-lang/go/Manifest
19 +++ b/dev-lang/go/Manifest
20 @@ -6,6 +6,8 @@ DIST go-linux-amd64-bootstrap.tbz 48722911 SHA256 0ab0842fb1f6cc6f10a85f225ff1a2
21 DIST go-linux-arm-bootstrap.tbz 46055976 SHA256 a44e33b95046e01fd7125c3cc3c34b13f83bbf692cddfd3e86e267da11de2a44 SHA512 a8cf3225dafd2f08b944e60d0fb6320b5e394646f5df2ca2464c76a2e6e6b72f4840ddcc65dc5f59c94907715780f1e25c73b480a79909d9455faad59ffd38d5 WHIRLPOOL 304bb37f94b8f5d0bd77c0d5faebed1cb627cc3b453c686d7297f6542ee3e0ddabc7139e13a21ee2f5a20caca273c63bcfbcbd4daf670b1dbfe77b599f8111ac
22 DIST go-linux-arm64-bootstrap.tbz 45369354 SHA256 810c998e6701580fe0f26d46c5796eefce648e252ff9d6d761304e60556b7fc0 SHA512 3f64869430c03efa77796ed74d07a337e2a205802485605cbdd67778a08e5ce041ce3925b7a5cca0a6b4ad24ab70e07ee54091b010f67ec7370a985022f5a21e WHIRLPOOL f6f470081d5f23c190310280aaf7454a4f58fe4e7545bbd219046711f8d27ce97cc5f5f1c207e777067d1f6332e4b3f2c819b178e899d21c2d5d1d466a42cc37
23 DIST go-linux-ppc64-bootstrap.tbz 45266082 SHA256 89902cebaf93b95dea225b7304eedcae101d6fb83bba0fcdfee001361b4868c0 SHA512 d013a1a5953207505a9f7e0c5cfdc7f463d4669fd18b36cf1df10126e9d4c012252bc4d207dd4503c34301e76197d8e89a9ed9d9d0b8a3b54b62e782b4c39d7b WHIRLPOOL 3ec868d94e8452a3cdb49a1292f9f32ebeb813ea297e419849cdee28c8d952887feb70e1095ce109ff6b8bb81dee47b7eb6f275b15bb6f46422095c3b260f968
24 +DIST go-linux-ppc64le-bootstrap.tbz 50134685 SHA256 ca816a3e3cbd7721200522fa39843de0bf546d0ac18e0d550e64b7cc33bea4f2 SHA512 da718166febe77b57f2f2edb18c921501a0eb7184a7e6f18411b5cba95fe0de185ef9d5e85be3632c5829e66008912d12b5259ca7fc330ad28026e53bb658e7f WHIRLPOOL 0d7875146f1bdc8f6af089f7f4b003d952419c51be7d519ca3474b39f67dbc88c6caa515f707ad9e6fac345e8a78f42d13eb794485ce18b6d90f7331ee16686c
25 DIST go-solaris-amd64-bootstrap.tbz 48367195 SHA256 92ebdbf001f243a78a6c2d8ee30e929ba2cecbedf8e0fc07e129b04b107453ad SHA512 cf8725db0d001d61badee71624799a3c9e75f61f77ab090c1f6c490d694c4be367019b28d88306045d877ab5a324a1f9b0674293caf3acb19c193fc3746a48f2 WHIRLPOOL 672c6642e340b6d4f38b633f67fdc3202e3725022a8a61e2129276fccd6c42ddc24ed06c1d57eb31a25ea8056b79686619cbb36431b9c23b6d4be5bcb715bd89
26 DIST go1.6.1.src.tar.gz 12615799 SHA256 1d4b53cdee51b2298afcf50926a7fa44b286f0bf24ff8323ce690a66daa7193f SHA512 31ea2504f8ab0fd709005275d0c2129b6cdb4e5d34d6e2b435b23480674b135d1bff8de863b1e01201e757523f4dc28b6ebefeb87d7e855f2509a6837e436fab WHIRLPOOL 6589f311fc3893775352a3c5d6409933397215389f2b25d3b61370acde35ead374403dfdd1dd58962b5066acd61c4acd85cf9c556d05b099e7fec6d23d6daca0
27 +DIST go1.6.2.src.tar.gz 12617724 SHA256 787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc SHA512 e148022f9e18b5d5b05744f1aa9fa3ef82e255752179545711ade077e271216aa5b450859a764fdfb028ae4faa26adad8d0a0a5268b31396ab9d14de3cb2f20a WHIRLPOOL bbd04cc0b18768b9dcf3b1d3614d2a263d2314ca811e03b390bafeafc7ea4d2aa650a34901da75e55ca58bf9c00601d9924152228ed0d57bbc4b5dbdc081e8a9
28 DIST go1.6.src.tar.gz 12613308 SHA256 a96cce8ce43a9bf9b2a4c7d470bc7ee0cb00410da815980681c8353218dcf146 SHA512 59e9d72a80558fd5e3f176e068897a45333b36e35f6c00393647941a70e741168e65941b6059397378020c3b78ec3471a48809682f7efd97cf33eec6325fc3e8 WHIRLPOOL c6debe1a5039f0ca34c29b4a53f958503a724cae13715ea14f0237b5faacd26e09eb6405462e22abd6806540dd8fb9eb2fa08ff6e8676b0f6dffa267210f5eac
29
30 diff --git a/dev-lang/go/go-1.6.2.ebuild b/dev-lang/go/go-1.6.2.ebuild
31 new file mode 100644
32 index 0000000..57ca2c7
33 --- /dev/null
34 +++ b/dev-lang/go/go-1.6.2.ebuild
35 @@ -0,0 +1,253 @@
36 +# Copyright 1999-2016 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +# $Id$
39 +
40 +EAPI=6
41 +
42 +export CBUILD=${CBUILD:-${CHOST}}
43 +export CTARGET=${CTARGET:-${CHOST}}
44 +
45 +MY_PV=${PV/_/}
46 +
47 +inherit toolchain-funcs
48 +
49 +BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
50 +SRC_URI="!gccgo? (
51 +kernel_Darwin? (
52 + x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-bootstrap.tbz )
53 +)
54 +kernel_FreeBSD? (
55 +amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-bootstrap.tbz )
56 +x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-bootstrap-1.tbz )
57 +)
58 +kernel_linux? (
59 + amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-bootstrap.tbz )
60 + arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-bootstrap.tbz )
61 + arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-bootstrap.tbz )
62 + ppc64? (
63 + ${BOOTSTRAP_DIST}/go-linux-ppc64-bootstrap.tbz
64 + ${BOOTSTRAP_DIST}/go-linux-ppc64le-bootstrap.tbz
65 + )
66 + x86? ( ${BOOTSTRAP_DIST}/go-linux-386-bootstrap-1.tbz )
67 +)
68 +kernel_SunOS? (
69 + x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-bootstrap.tbz )
70 +)
71 +)
72 +"
73 +
74 +if [[ ${PV} = 9999 ]]; then
75 + EGIT_REPO_URI="git://github.com/golang/go.git"
76 + inherit git-r3
77 +else
78 + SRC_URI+="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz"
79 + case ${PV} in
80 + *9999*|*_rc*) ;;
81 + *)
82 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x64-solaris"
83 + ;;
84 + esac
85 +fi
86 +
87 +DESCRIPTION="A concurrent garbage collected and typesafe programming language"
88 +HOMEPAGE="http://www.golang.org"
89 +
90 +LICENSE="BSD"
91 +SLOT="0/${PV}"
92 +IUSE="gccgo"
93 +
94 +DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
95 +RDEPEND="!<dev-go/go-tools-0_pre20150902"
96 +
97 +# These test data objects have writable/executable stacks.
98 +QA_EXECSTACK="usr/lib/go/src/debug/elf/testdata/*.obj"
99 +
100 +# Do not complain about CFLAGS, etc, since Go doesn't use them.
101 +QA_FLAGS_IGNORED='.*'
102 +
103 +REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*"
104 +
105 +# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
106 +QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
107 +
108 +# The go language uses *.a files which are _NOT_ libraries and should not be
109 +# stripped. The test data objects should also be left alone and unstripped.
110 +STRIP_MASK="/usr/lib/go/pkg/*.a
111 + /usr/lib/go/src/debug/elf/testdata/*
112 + /usr/lib/go/src/debug/dwarf/testdata/*
113 + /usr/lib/go/src/runtime/race/*.syso"
114 +
115 +if [[ ${PV} != 9999 ]]; then
116 + S="${WORKDIR}"/go
117 +fi
118 +
119 +go_arch()
120 +{
121 + # By chance most portage arch names match Go
122 + local portage_arch=$(tc-arch $@)
123 + case "${portage_arch}" in
124 + x86) echo 386;;
125 + x64-*) echo amd64;;
126 + *) echo "${portage_arch}";;
127 + esac
128 +}
129 +
130 +go_arm()
131 +{
132 + case "${1:-${CHOST}}" in
133 + armv5*) echo 5;;
134 + armv6*) echo 6;;
135 + armv7*) echo 7;;
136 + *)
137 + die "unknown GOARM for ${1:-${CHOST}}"
138 + ;;
139 + esac
140 +}
141 +
142 +go_os()
143 +{
144 + case "${1:-${CHOST}}" in
145 + *-linux*) echo linux;;
146 + *-darwin*) echo darwin;;
147 + *-freebsd*) echo freebsd;;
148 + *-netbsd*) echo netbsd;;
149 + *-openbsd*) echo openbsd;;
150 + *-solaris*) echo solaris;;
151 + *-cygwin*|*-interix*|*-winnt*)
152 + echo windows
153 + ;;
154 + *)
155 + die "unknown GOOS for ${1:-${CHOST}}"
156 + ;;
157 + esac
158 +}
159 +
160 +go_tuple()
161 +{
162 + echo "$(go_os $@)_$(go_arch $@)"
163 +}
164 +
165 +go_cross_compile()
166 +{
167 + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
168 +}
169 +
170 +pkg_pretend()
171 +{
172 + # make.bash does not understand cross-compiling a cross-compiler
173 + if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then
174 + die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}"
175 + fi
176 +}
177 +
178 +src_unpack()
179 +{
180 + if [[ ${PV} = 9999 ]]; then
181 + git-r3_src_unpack
182 + fi
183 + default
184 +}
185 +
186 +src_compile()
187 +{
188 + export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap
189 + if use gccgo; then
190 + mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
191 + local go_binary=$(type -P go-5 2>/dev/null)
192 + [[ -x ${go_binary} ]] || go_binary=$(
193 + find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-5 | sort -V | tail -n1)
194 + [[ -x ${go_binary} ]] || die "go-5: command not found"
195 + ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
196 + fi
197 + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
198 + export GOROOT="$(pwd)"
199 + export GOBIN="${GOROOT}/bin"
200 +
201 + # Go's build script does not use BUILD/HOST/TARGET consistently. :(
202 + export GOHOSTARCH=$(go_arch ${CBUILD})
203 + export GOHOSTOS=$(go_os ${CBUILD})
204 + export CC=$(tc-getBUILD_CC)
205 +
206 + export GOARCH=$(go_arch)
207 + export GOOS=$(go_os)
208 + export CC_FOR_TARGET=$(tc-getCC)
209 + export CXX_FOR_TARGET=$(tc-getCXX)
210 + if [[ ${ARCH} == arm ]]; then
211 + export GOARM=$(go_arm)
212 + fi
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 +}
254 +
255 +pkg_preinst()
256 +{
257 + has_version '<dev-lang/go-1.4' &&
258 + export had_support_files=true ||
259 + export had_support_files=false
260 +}
261 +
262 +pkg_postinst()
263 +{
264 + # If the go tool sees a package file timestamped older than a dependancy it
265 + # will rebuild that file. So, in order to stop go from rebuilding lots of
266 + # packages for every build we need to fix the timestamps. The compiler and
267 + # linker are also checked - so we need to fix them too.
268 + ebegin "fixing timestamps to avoid unnecessary rebuilds"
269 + tref="usr/lib/go/pkg/*/runtime.a"
270 + find "${EROOT}"usr/lib/go -type f \
271 + -exec touch -r "${EROOT}"${tref} {} \;
272 + eend $?
273 +
274 + if [[ ${PV} != 9999 && -n ${REPLACING_VERSIONS} &&
275 + ${REPLACING_VERSIONS} != ${PV} ]]; then
276 + elog "Release notes are located at http://golang.org/doc/go${PV}"
277 + fi
278 +
279 + if $had_support_files; then
280 + ewarn
281 + ewarn "All editor support, IDE support, shell completion"
282 + ewarn "support, etc has been removed from the go package"
283 + ewarn "upstream."
284 + ewarn "For more information on which support is available, see"
285 + ewarn "the following URL:"
286 + ewarn "https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins"
287 + fi
288 +}