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, 02 Sep 2020 15:20:21
Message-Id: 1599059846.85c7704875bce7491b8fd6a8c88b325dd7b1975d.williamh@gentoo
1 commit: 85c7704875bce7491b8fd6a8c88b325dd7b1975d
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 2 15:17:26 2020 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 2 15:17:26 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85c77048
7
8 dev-lang/go 1.14.8 and 1.15.1 bump
9
10 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
11
12 dev-lang/go/Manifest | 2 +
13 dev-lang/go/go-1.14.8.ebuild | 188 +++++++++++++++++++++++++++++++++++++++++++
14 dev-lang/go/go-1.15.1.ebuild | 188 +++++++++++++++++++++++++++++++++++++++++++
15 3 files changed, 378 insertions(+)
16
17 diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
18 index bc758af4bce..0fae56dbece 100644
19 --- a/dev-lang/go/Manifest
20 +++ b/dev-lang/go/Manifest
21 @@ -1,3 +1,5 @@
22 DIST go1.13.15.src.tar.gz 21705183 BLAKE2B eac8c6113dd6cef164cc5368732c2dce26f200e309c728ca71b4c312ace465382b8cc1dd8fb216bdf927211d6cb26c21090a9ac9c9ef2d7ac1b16c85feac0e0c SHA512 35d3e7aaef1b0fc6ab684bb7352da3a23194115331ba7d1543225c35939cafcd437f454519aac38182cb8f222723ed9a297f9da566075b5e4079be26952a21e3
23 DIST go1.14.7.src.tar.gz 22534747 BLAKE2B ab43abeec9d636dd88eaa10dc210f5d11d487df35238a00548e1f56a86bdf2375e7c180ee6e1cea53591528714fa70333e3336db61eacfdeb5f51b2d5ea86a45 SHA512 3f1133c66d7795ceb6c5793db90616613244d7561abaef6b059602992c0b7a53b6b6ebbcf69add4769a58542e9dc55871bcfe3d64d4cd9f3569bd435ade86dee
24 +DIST go1.14.8.src.tar.gz 22535549 BLAKE2B b7630dd95b8252150937f49a164af4c8a1b9f186db9f8ec9f5e2589762a96c5c22aa8fc3a9f697cb2b884844962cea41ea789283e07f3b7b3be3343af1056573 SHA512 c7f2826d9f674591b183f209e8854875273a6ac846f93ae1da841a0c80943d9b8fa04cdad389a339bbdf583913ab71646dff15afa9b4ad8be47e12041fe71c45
25 +DIST go1.15.1.src.tar.gz 23009031 BLAKE2B bf944570b77eb7a04f751daaf653a43260d03b1b0d413529beef9ec0879064be67130f65d1a38947b605f6b7deba51f8d832818ac44fb738482203f7c618ebb1 SHA512 08728dd7c64467482b1b17d1bd852ae6ca329062da95e10e91535e096b6ddd32d0e34a5e1f7b736175863c5543b6623406fc89b057273afc3f434ea97b343cfe
26 DIST go1.15.src.tar.gz 23002901 BLAKE2B a04bfb5d8bb6377e92d5d8c96f11d39b9bb878f4f9a3221baa5f42bcc822b562a209fd5d2d2a643f3b72df2db494899b2f7a446f1a9a8e25bf0df56ef87f3b7f SHA512 7d85382bcc6a0625dfa3d07196ab364860846367ed67697a7b1516b0af551a72bc4873882141fc3c7a60d39f2e27b33f6693e8b18b608de76fc9a55b5eac55ea
27
28 diff --git a/dev-lang/go/go-1.14.8.ebuild b/dev-lang/go/go-1.14.8.ebuild
29 new file mode 100644
30 index 00000000000..fa07749bdeb
31 --- /dev/null
32 +++ b/dev-lang/go/go-1.14.8.ebuild
33 @@ -0,0 +1,188 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +export CBUILD=${CBUILD:-${CHOST}}
40 +export CTARGET=${CTARGET:-${CHOST}}
41 +
42 +MY_PV=${PV/_/}
43 +
44 +inherit toolchain-funcs
45 +
46 +case ${PV} in
47 +*9999*)
48 + EGIT_REPO_URI="https://github.com/golang/go.git"
49 + inherit git-r3
50 + ;;
51 +*)
52 + SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
53 + S="${WORKDIR}"/go
54 + case ${PV} in
55 + *_beta*|*_rc*) ;;
56 + *)
57 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
58 + ;;
59 + esac
60 +esac
61 +
62 +DESCRIPTION="A concurrent garbage collected and typesafe programming language"
63 +HOMEPAGE="https://golang.org"
64 +
65 +LICENSE="BSD"
66 +SLOT="0/${PV}"
67 +
68 +BDEPEND="|| (
69 + dev-lang/go
70 + dev-lang/go-bootstrap )"
71 +RDEPEND="!<dev-go/go-tools-0_pre20150902"
72 +
73 +# Do not complain about CFLAGS, etc, since Go doesn't use them.
74 +QA_FLAGS_IGNORED='.*'
75 +
76 +# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
77 +QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
78 +
79 +# Do not strip this package. Stripping is unsupported upstream and may
80 +# fail.
81 +RESTRICT+=" strip"
82 +
83 +DOCS=(
84 +AUTHORS
85 +CONTRIBUTING.md
86 +CONTRIBUTORS
87 +PATENTS
88 +README.md
89 +)
90 +
91 +go_arch()
92 +{
93 + # By chance most portage arch names match Go
94 + local portage_arch=$(tc-arch $@)
95 + case "${portage_arch}" in
96 + x86) echo 386;;
97 + x64-*) echo amd64;;
98 + ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
99 + s390) echo s390x ;;
100 + *) echo "${portage_arch}";;
101 + esac
102 +}
103 +
104 +go_arm()
105 +{
106 + case "${1:-${CHOST}}" in
107 + armv5*) echo 5;;
108 + armv6*) echo 6;;
109 + armv7*) echo 7;;
110 + *)
111 + die "unknown GOARM for ${1:-${CHOST}}"
112 + ;;
113 + esac
114 +}
115 +
116 +go_os()
117 +{
118 + case "${1:-${CHOST}}" in
119 + *-linux*) echo linux;;
120 + *-darwin*) echo darwin;;
121 + *-freebsd*) echo freebsd;;
122 + *-netbsd*) echo netbsd;;
123 + *-openbsd*) echo openbsd;;
124 + *-solaris*) echo solaris;;
125 + *-cygwin*|*-interix*|*-winnt*)
126 + echo windows
127 + ;;
128 + *)
129 + die "unknown GOOS for ${1:-${CHOST}}"
130 + ;;
131 + esac
132 +}
133 +
134 +go_tuple()
135 +{
136 + echo "$(go_os $@)_$(go_arch $@)"
137 +}
138 +
139 +go_cross_compile()
140 +{
141 + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
142 +}
143 +
144 +src_compile()
145 +{
146 + if has_version -b dev-lang/go; then
147 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
148 + elif has_version -b dev-lang/go-bootstrap; then
149 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
150 + else
151 + eerror "Go cannot be built without go or go-bootstrap installed"
152 + die "Should not be here, please report a bug"
153 + fi
154 +
155 + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
156 + export GOROOT="$(pwd)"
157 + export GOBIN="${GOROOT}/bin"
158 +
159 + # Go's build script does not use BUILD/HOST/TARGET consistently. :(
160 + export GOHOSTARCH=$(go_arch ${CBUILD})
161 + export GOHOSTOS=$(go_os ${CBUILD})
162 + export CC=$(tc-getBUILD_CC)
163 +
164 + export GOARCH=$(go_arch)
165 + export GOOS=$(go_os)
166 + export CC_FOR_TARGET=$(tc-getCC)
167 + export CXX_FOR_TARGET=$(tc-getCXX)
168 + if [[ ${ARCH} == arm ]]; then
169 + export GOARM=$(go_arm)
170 + fi
171 +
172 + cd src
173 + bash -x ./make.bash || die "build failed"
174 +}
175 +
176 +src_test()
177 +{
178 + go_cross_compile && return 0
179 +
180 + cd src
181 + PATH="${GOBIN}:${PATH}" \
182 + ./run.bash -no-rebuild || die "tests failed"
183 + cd ..
184 + rm -fr pkg/*_race || die
185 + rm -fr pkg/obj/go-build || die
186 +}
187 +
188 +src_install()
189 +{
190 + local bin_path f x
191 +
192 + dodir /usr/lib/go
193 +
194 + # There is a known issue which requires the source tree to be installed [1].
195 + # Once this is fixed, we can consider using the doc use flag to control
196 + # installing the doc and src directories.
197 + # [1] https://golang.org/issue/2775
198 + #
199 + # deliberately use cp to retain permissions
200 + cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
201 + # testdata directories are not needed on the installed system
202 + rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
203 + if go_cross_compile; then
204 + bin_path="bin/$(go_tuple)"
205 + else
206 + bin_path=bin
207 + fi
208 + for x in ${bin_path}/*; do
209 + f=${x##*/}
210 + dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
211 + done
212 + einstalldocs
213 +
214 + if [[ ${CHOST} == *-darwin* ]] ; then
215 + # fix install_name for test object (binutils_test) on Darwin, it
216 + # is never used in real circumstances
217 + local libmac64="${EPREFIX}"/usr/lib/go/src/cmd/vendor/github.com/
218 + libmac64+=google/pprof/internal/binutils/testdata/lib_mac_64
219 + install_name_tool -id "${libmac64}" "${D}${libmac64}"
220 + fi
221 +}
222
223 diff --git a/dev-lang/go/go-1.15.1.ebuild b/dev-lang/go/go-1.15.1.ebuild
224 new file mode 100644
225 index 00000000000..fa07749bdeb
226 --- /dev/null
227 +++ b/dev-lang/go/go-1.15.1.ebuild
228 @@ -0,0 +1,188 @@
229 +# Copyright 1999-2020 Gentoo Authors
230 +# Distributed under the terms of the GNU General Public License v2
231 +
232 +EAPI=7
233 +
234 +export CBUILD=${CBUILD:-${CHOST}}
235 +export CTARGET=${CTARGET:-${CHOST}}
236 +
237 +MY_PV=${PV/_/}
238 +
239 +inherit toolchain-funcs
240 +
241 +case ${PV} in
242 +*9999*)
243 + EGIT_REPO_URI="https://github.com/golang/go.git"
244 + inherit git-r3
245 + ;;
246 +*)
247 + SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
248 + S="${WORKDIR}"/go
249 + case ${PV} in
250 + *_beta*|*_rc*) ;;
251 + *)
252 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
253 + ;;
254 + esac
255 +esac
256 +
257 +DESCRIPTION="A concurrent garbage collected and typesafe programming language"
258 +HOMEPAGE="https://golang.org"
259 +
260 +LICENSE="BSD"
261 +SLOT="0/${PV}"
262 +
263 +BDEPEND="|| (
264 + dev-lang/go
265 + dev-lang/go-bootstrap )"
266 +RDEPEND="!<dev-go/go-tools-0_pre20150902"
267 +
268 +# Do not complain about CFLAGS, etc, since Go doesn't use them.
269 +QA_FLAGS_IGNORED='.*'
270 +
271 +# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
272 +QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
273 +
274 +# Do not strip this package. Stripping is unsupported upstream and may
275 +# fail.
276 +RESTRICT+=" strip"
277 +
278 +DOCS=(
279 +AUTHORS
280 +CONTRIBUTING.md
281 +CONTRIBUTORS
282 +PATENTS
283 +README.md
284 +)
285 +
286 +go_arch()
287 +{
288 + # By chance most portage arch names match Go
289 + local portage_arch=$(tc-arch $@)
290 + case "${portage_arch}" in
291 + x86) echo 386;;
292 + x64-*) echo amd64;;
293 + ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
294 + s390) echo s390x ;;
295 + *) echo "${portage_arch}";;
296 + esac
297 +}
298 +
299 +go_arm()
300 +{
301 + case "${1:-${CHOST}}" in
302 + armv5*) echo 5;;
303 + armv6*) echo 6;;
304 + armv7*) echo 7;;
305 + *)
306 + die "unknown GOARM for ${1:-${CHOST}}"
307 + ;;
308 + esac
309 +}
310 +
311 +go_os()
312 +{
313 + case "${1:-${CHOST}}" in
314 + *-linux*) echo linux;;
315 + *-darwin*) echo darwin;;
316 + *-freebsd*) echo freebsd;;
317 + *-netbsd*) echo netbsd;;
318 + *-openbsd*) echo openbsd;;
319 + *-solaris*) echo solaris;;
320 + *-cygwin*|*-interix*|*-winnt*)
321 + echo windows
322 + ;;
323 + *)
324 + die "unknown GOOS for ${1:-${CHOST}}"
325 + ;;
326 + esac
327 +}
328 +
329 +go_tuple()
330 +{
331 + echo "$(go_os $@)_$(go_arch $@)"
332 +}
333 +
334 +go_cross_compile()
335 +{
336 + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
337 +}
338 +
339 +src_compile()
340 +{
341 + if has_version -b dev-lang/go; then
342 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
343 + elif has_version -b dev-lang/go-bootstrap; then
344 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
345 + else
346 + eerror "Go cannot be built without go or go-bootstrap installed"
347 + die "Should not be here, please report a bug"
348 + fi
349 +
350 + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
351 + export GOROOT="$(pwd)"
352 + export GOBIN="${GOROOT}/bin"
353 +
354 + # Go's build script does not use BUILD/HOST/TARGET consistently. :(
355 + export GOHOSTARCH=$(go_arch ${CBUILD})
356 + export GOHOSTOS=$(go_os ${CBUILD})
357 + export CC=$(tc-getBUILD_CC)
358 +
359 + export GOARCH=$(go_arch)
360 + export GOOS=$(go_os)
361 + export CC_FOR_TARGET=$(tc-getCC)
362 + export CXX_FOR_TARGET=$(tc-getCXX)
363 + if [[ ${ARCH} == arm ]]; then
364 + export GOARM=$(go_arm)
365 + fi
366 +
367 + cd src
368 + bash -x ./make.bash || die "build failed"
369 +}
370 +
371 +src_test()
372 +{
373 + go_cross_compile && return 0
374 +
375 + cd src
376 + PATH="${GOBIN}:${PATH}" \
377 + ./run.bash -no-rebuild || die "tests failed"
378 + cd ..
379 + rm -fr pkg/*_race || die
380 + rm -fr pkg/obj/go-build || die
381 +}
382 +
383 +src_install()
384 +{
385 + local bin_path f x
386 +
387 + dodir /usr/lib/go
388 +
389 + # There is a known issue which requires the source tree to be installed [1].
390 + # Once this is fixed, we can consider using the doc use flag to control
391 + # installing the doc and src directories.
392 + # [1] https://golang.org/issue/2775
393 + #
394 + # deliberately use cp to retain permissions
395 + cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
396 + # testdata directories are not needed on the installed system
397 + rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
398 + if go_cross_compile; then
399 + bin_path="bin/$(go_tuple)"
400 + else
401 + bin_path=bin
402 + fi
403 + for x in ${bin_path}/*; do
404 + f=${x##*/}
405 + dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
406 + done
407 + einstalldocs
408 +
409 + if [[ ${CHOST} == *-darwin* ]] ; then
410 + # fix install_name for test object (binutils_test) on Darwin, it
411 + # is never used in real circumstances
412 + local libmac64="${EPREFIX}"/usr/lib/go/src/cmd/vendor/github.com/
413 + libmac64+=google/pprof/internal/binutils/testdata/lib_mac_64
414 + install_name_tool -id "${libmac64}" "${D}${libmac64}"
415 + fi
416 +}