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