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