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: Fri, 01 Feb 2019 15:05:29
Message-Id: 1549033479.aec12ac686f0feb2fccf8daff88ac0f28ad88aa2.williamh@gentoo
1 commit: aec12ac686f0feb2fccf8daff88ac0f28ad88aa2
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 1 15:04:06 2019 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 1 15:04:39 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aec12ac6
7
8 dev-lang/go: remove vulnerable versions
9
10 bug: https://bugs.gentoo.org/676368
11 Package-Manager: Portage-2.3.59, Repoman-2.3.12
12 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
13
14 dev-lang/go/Manifest | 2 -
15 dev-lang/go/go-1.10.7.ebuild | 228 -----------------------------------------
16 dev-lang/go/go-1.11.4.ebuild | 236 -------------------------------------------
17 3 files changed, 466 deletions(-)
18
19 diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
20 index 2edca5a6180..0f5ffb89972 100644
21 --- a/dev-lang/go/Manifest
22 +++ b/dev-lang/go/Manifest
23 @@ -9,7 +9,5 @@ DIST go-linux-ppc64-bootstrap-1.8.tbz 52315782 BLAKE2B 6be0a48e8bc4e5fed4d34f8aa
24 DIST go-linux-ppc64le-bootstrap-1.8.tbz 52211575 BLAKE2B 7a28ec5a381369c4e9415c8360e904c2545380513afd328077c584e8af0bf6bd818aa03e5a58c350cbb98facc1c9dccb02b06adcb27233875497cf5d33265912 SHA512 6931d999dd0ee1ff44c4cec48acb27af061f57f87aa74802dcebab78553b46bc8ac732f07fe91e5074dbdd32c55b707994875934bfb12bb4276d71eb1d06c4ba
25 DIST go-linux-s390x-bootstrap-1.8.tbz 57124869 BLAKE2B 920a176b8f4fc3a816e724324bbb30a383d599e31a0d2093d24797dbcd0e799a662a3589dbb87d2f5dd16df07c4cf8f1e444e87b540ec732746bb025dc9271f8 SHA512 d429cae870d66217ab2e07c74209d3031d97baa4f899b4d70ae6283a1a5b1434b037904c4cfca0b2bc798d5ba0b358c3739e000eccbc74809baf564c5686df5a
26 DIST go-solaris-amd64-bootstrap-1.8.tbz 54926326 BLAKE2B 0a45312f090d81ebf46fe5950cb65c059e2801394231e715e94145d1f918eb59b10472b2385e57ebd5cfb9eca0ad7290fb118436486b665520bb540970f971ab SHA512 52b849e5b9a940e10de7ba3df0ebdf6e1c5d631de9581d936c9edf8f38e6bb3314acbc2b2d5202b0528fde2a359d52bc0c6f39acf9b1b614725e4b4a947ed10d
27 -DIST go1.10.7.src.tar.gz 18333472 BLAKE2B 8e1d85ced41541f1c7a02208da6ff518d7af76e078c47b2b269b31868fad8578b70494aad0ab35a33b1273d2f55523ee5e97e688991a62bf2289821c1c669c1f SHA512 798e0ea053b38f4b4f5a6fbdefb30ad09d95b7e8af424bd5f1aa7856bf7ca4e9c9bbd32926e2936f2b332f88a1980e92e6b61862fd9e779edf64f965fd8d1ffe
28 DIST go1.10.8.src.tar.gz 18333813 BLAKE2B 69fd0e7c3e265162e48b2ed90c8f560071322a093e09ca926d3cb94f4f9b44548652066d0c2f44696f0da5e7342f3afa894b71116f9451a0b2438eb0e0df42df SHA512 c274b99e39b78dfdf6b6b1c4fd6a5a54bff1b3eba55a879413692586ac7f0d30772416dcb5f715213c650946ade649bd424981f77508d92510c717d1845e3ede
29 -DIST go1.11.4.src.tar.gz 21108067 BLAKE2B 3e9e433d9f85cadcf4c62bbc7a27d80944d4dbe4f4e43bdeddc407a7957a51b28082d5b90d4e27f06cc554792bb9eb7ccbf221003f012c91cd1f329af998ae4e SHA512 9aa2e1800807841ec0432289b672c1607bdcb295f29c02d38adfaf1e3bf043040c9f916e4cb170875d92fe168c5ba6baef2b3d1f824a56ff9138ca2cdcc646e0
30 DIST go1.11.5.src.tar.gz 21108339 BLAKE2B 3a33a89e267e57fee688e4d67257810ca1f37cfb904b6806c3a566b021aa80153f59f64d3a61ed68f526f093e0d5b6b3c95565cd06622cf9a65eef81bc7e9733 SHA512 63500238e8d73e4b29279ee3eb9242960de93ccd3b52bacc4009f45cf123cb8edfe5f519d38c5b07bdf2a810925758511ff3255310a056113d0169f78be1d2f6
31
32 diff --git a/dev-lang/go/go-1.10.7.ebuild b/dev-lang/go/go-1.10.7.ebuild
33 deleted file mode 100644
34 index 44ca41c8b29..00000000000
35 --- a/dev-lang/go/go-1.10.7.ebuild
36 +++ /dev/null
37 @@ -1,228 +0,0 @@
38 -# Copyright 1999-2019 Gentoo Authors
39 -# Distributed under the terms of the GNU General Public License v2
40 -
41 -EAPI=6
42 -
43 -export CBUILD=${CBUILD:-${CHOST}}
44 -export CTARGET=${CTARGET:-${CHOST}}
45 -
46 -MY_PV=${PV/_/}
47 -
48 -inherit toolchain-funcs
49 -
50 -BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
51 -BOOTSTRAP_VERSION="bootstrap-1.8"
52 -BOOTSTRAP_URI="
53 -amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz )
54 -arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz )
55 -arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz )
56 -ppc64? (
57 - ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz
58 - ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz
59 -)
60 -s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz )
61 -x86? ( ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz )
62 -amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-${BOOTSTRAP_VERSION}.tbz )
63 -x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-${BOOTSTRAP_VERSION}.tbz )
64 -x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz )
65 -x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz )
66 -"
67 -
68 -case ${PV} in
69 -*9999*)
70 - EGIT_REPO_URI="https://github.com/golang/go.git"
71 - inherit git-r3
72 - ;;
73 -*)
74 - SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
75 - S="${WORKDIR}"/go
76 - case ${PV} in
77 - *_beta*|*_rc*) ;;
78 - *)
79 - KEYWORDS="-* amd64 arm ~arm64 ~ppc64 ~s390 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x64-macos ~x64-solaris"
80 - # The upstream tests fail under portage but pass if the build is
81 - # run according to their documentation [1].
82 - # I am restricting the tests on released versions until this is
83 - # solved.
84 - # [1] https://golang.org/issues/18442
85 - RESTRICT="test"
86 - ;;
87 - esac
88 -esac
89 -SRC_URI+="!gccgo? ( ${BOOTSTRAP_URI} )"
90 -
91 -DESCRIPTION="A concurrent garbage collected and typesafe programming language"
92 -HOMEPAGE="https://golang.org"
93 -
94 -LICENSE="BSD"
95 -SLOT="0/${PV}"
96 -IUSE="gccgo"
97 -
98 -DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
99 -RDEPEND="!<dev-go/go-tools-0_pre20150902"
100 -
101 -# These test data objects have writable/executable stacks.
102 -QA_EXECSTACK="
103 - usr/lib/go/src/debug/elf/testdata/*.obj
104 - usr/lib/go/src/go/internal/gccgoimporter/testdata/escapeinfo.gox
105 - usr/lib/go/src/go/internal/gccgoimporter/testdata/unicode.gox
106 - usr/lib/go/src/go/internal/gccgoimporter/testdata/time.gox
107 - "
108 -
109 -# Do not complain about CFLAGS, etc, since Go doesn't use them.
110 -QA_FLAGS_IGNORED='.*'
111 -
112 -REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*"
113 -
114 -# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
115 -QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
116 -
117 -# Do not strip this package. Stripping is unsupported upstream and may
118 -# fail.
119 -RESTRICT+=" strip"
120 -
121 -DOCS=(
122 -AUTHORS
123 -CONTRIBUTING.md
124 -CONTRIBUTORS
125 -PATENTS
126 -README.md
127 -)
128 -
129 -go_arch()
130 -{
131 - # By chance most portage arch names match Go
132 - local portage_arch=$(tc-arch $@)
133 - case "${portage_arch}" in
134 - x86) echo 386;;
135 - x64-*) echo amd64;;
136 - ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
137 - s390) echo s390x ;;
138 - *) echo "${portage_arch}";;
139 - esac
140 -}
141 -
142 -go_arm()
143 -{
144 - case "${1:-${CHOST}}" in
145 - armv5*) echo 5;;
146 - armv6*) echo 6;;
147 - armv7*) echo 7;;
148 - *)
149 - die "unknown GOARM for ${1:-${CHOST}}"
150 - ;;
151 - esac
152 -}
153 -
154 -go_os()
155 -{
156 - case "${1:-${CHOST}}" in
157 - *-linux*) echo linux;;
158 - *-darwin*) echo darwin;;
159 - *-freebsd*) echo freebsd;;
160 - *-netbsd*) echo netbsd;;
161 - *-openbsd*) echo openbsd;;
162 - *-solaris*) echo solaris;;
163 - *-cygwin*|*-interix*|*-winnt*)
164 - echo windows
165 - ;;
166 - *)
167 - die "unknown GOOS for ${1:-${CHOST}}"
168 - ;;
169 - esac
170 -}
171 -
172 -go_tuple()
173 -{
174 - echo "$(go_os $@)_$(go_arch $@)"
175 -}
176 -
177 -go_cross_compile()
178 -{
179 - [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
180 -}
181 -
182 -pkg_pretend()
183 -{
184 - # make.bash does not understand cross-compiling a cross-compiler
185 - if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then
186 - die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}"
187 - fi
188 -}
189 -
190 -src_unpack()
191 -{
192 - if [[ ${PV} = 9999 ]]; then
193 - git-r3_src_unpack
194 - fi
195 - default
196 -}
197 -
198 -src_compile()
199 -{
200 - export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap
201 - if use gccgo; then
202 - mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
203 - local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version)
204 - [[ -x ${go_binary} ]] || go_binary=$(
205 - find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-$(gcc-major-version) |
206 - sort -V | tail -n1)
207 - [[ -x ${go_binary} ]] ||
208 - die "go-$(gcc-major-version): command not found"
209 - ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
210 - fi
211 - export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
212 - export GOROOT="$(pwd)"
213 - export GOBIN="${GOROOT}/bin"
214 -
215 - # Go's build script does not use BUILD/HOST/TARGET consistently. :(
216 - export GOHOSTARCH=$(go_arch ${CBUILD})
217 - export GOHOSTOS=$(go_os ${CBUILD})
218 - export CC=$(tc-getBUILD_CC)
219 -
220 - export GOARCH=$(go_arch)
221 - export GOOS=$(go_os)
222 - export CC_FOR_TARGET=$(tc-getCC)
223 - export CXX_FOR_TARGET=$(tc-getCXX)
224 - if [[ ${ARCH} == arm ]]; then
225 - export GOARM=$(go_arm)
226 - fi
227 - einfo "GOROOT_BOOTSTRAP is ${GOROOT_BOOTSTRAP}"
228 -
229 - cd src
230 - ./make.bash || die "build failed"
231 -}
232 -
233 -src_test()
234 -{
235 - go_cross_compile && return 0
236 -
237 - cd src
238 - PATH="${GOBIN}:${PATH}" \
239 - ./run.bash -no-rebuild || die "tests failed"
240 -}
241 -
242 -src_install()
243 -{
244 - local bin_path f x
245 -
246 - dodir /usr/lib/go
247 -
248 - # There is a known issue which requires the source tree to be installed [1].
249 - # Once this is fixed, we can consider using the doc use flag to control
250 - # installing the doc and src directories.
251 - # [1] https://golang.org/issue/2775
252 - #
253 - # deliberately use cp to retain permissions
254 - cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
255 - if go_cross_compile; then
256 - bin_path="bin/$(go_tuple)"
257 - else
258 - bin_path=bin
259 - fi
260 - for x in ${bin_path}/*; do
261 - f=${x##*/}
262 - dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
263 - done
264 - einstalldocs
265 -}
266
267 diff --git a/dev-lang/go/go-1.11.4.ebuild b/dev-lang/go/go-1.11.4.ebuild
268 deleted file mode 100644
269 index 414547edcf6..00000000000
270 --- a/dev-lang/go/go-1.11.4.ebuild
271 +++ /dev/null
272 @@ -1,236 +0,0 @@
273 -# Copyright 1999-2019 Gentoo Authors
274 -# Distributed under the terms of the GNU General Public License v2
275 -
276 -EAPI=6
277 -
278 -export CBUILD=${CBUILD:-${CHOST}}
279 -export CTARGET=${CTARGET:-${CHOST}}
280 -
281 -MY_PV=${PV/_/}
282 -
283 -inherit toolchain-funcs
284 -
285 -BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
286 -BOOTSTRAP_VERSION="bootstrap-1.8"
287 -BOOTSTRAP_URI="
288 -amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz )
289 -arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz )
290 -arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz )
291 -ppc64? (
292 - ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz
293 - ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz
294 -)
295 -s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz )
296 -x86? ( ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz )
297 -amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-${BOOTSTRAP_VERSION}.tbz )
298 -x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-${BOOTSTRAP_VERSION}.tbz )
299 -x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz )
300 -x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz )
301 -"
302 -
303 -case ${PV} in
304 -*9999*)
305 - EGIT_REPO_URI="https://github.com/golang/go.git"
306 - inherit git-r3
307 - ;;
308 -*)
309 - SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
310 - S="${WORKDIR}"/go
311 - case ${PV} in
312 - *_beta*|*_rc*) ;;
313 - *)
314 - KEYWORDS="-* amd64 arm ~arm64 ~ppc64 ~s390 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x64-macos ~x64-solaris"
315 - # The upstream tests fail under portage but pass if the build is
316 - # run according to their documentation [1].
317 - # I am restricting the tests on released versions until this is
318 - # solved.
319 - # [1] https://golang.org/issues/18442
320 - RESTRICT="test"
321 - ;;
322 - esac
323 -esac
324 -SRC_URI+="!gccgo? ( ${BOOTSTRAP_URI} )"
325 -
326 -DESCRIPTION="A concurrent garbage collected and typesafe programming language"
327 -HOMEPAGE="https://golang.org"
328 -
329 -LICENSE="BSD"
330 -SLOT="0/${PV}"
331 -IUSE="gccgo"
332 -
333 -DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
334 -RDEPEND="!<dev-go/go-tools-0_pre20150902"
335 -
336 -# These test data objects have writable/executable stacks.
337 -QA_EXECSTACK="
338 - usr/lib/go/src/debug/elf/testdata/*.obj
339 - usr/lib/go/src/go/internal/gccgoimporter/testdata/escapeinfo.gox
340 - usr/lib/go/src/go/internal/gccgoimporter/testdata/unicode.gox
341 - usr/lib/go/src/go/internal/gccgoimporter/testdata/time.gox
342 - "
343 -
344 -# Do not complain about CFLAGS, etc, since Go doesn't use them.
345 -QA_FLAGS_IGNORED='.*'
346 -
347 -REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*"
348 -
349 -# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
350 -QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
351 -
352 -# Do not strip this package. Stripping is unsupported upstream and may
353 -# fail.
354 -RESTRICT+=" strip"
355 -
356 -DOCS=(
357 -AUTHORS
358 -CONTRIBUTING.md
359 -CONTRIBUTORS
360 -PATENTS
361 -README.md
362 -)
363 -
364 -go_arch()
365 -{
366 - # By chance most portage arch names match Go
367 - local portage_arch=$(tc-arch $@)
368 - case "${portage_arch}" in
369 - x86) echo 386;;
370 - x64-*) echo amd64;;
371 - ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
372 - s390) echo s390x ;;
373 - *) echo "${portage_arch}";;
374 - esac
375 -}
376 -
377 -go_arm()
378 -{
379 - case "${1:-${CHOST}}" in
380 - armv5*) echo 5;;
381 - armv6*) echo 6;;
382 - armv7*) echo 7;;
383 - *)
384 - die "unknown GOARM for ${1:-${CHOST}}"
385 - ;;
386 - esac
387 -}
388 -
389 -go_os()
390 -{
391 - case "${1:-${CHOST}}" in
392 - *-linux*) echo linux;;
393 - *-darwin*) echo darwin;;
394 - *-freebsd*) echo freebsd;;
395 - *-netbsd*) echo netbsd;;
396 - *-openbsd*) echo openbsd;;
397 - *-solaris*) echo solaris;;
398 - *-cygwin*|*-interix*|*-winnt*)
399 - echo windows
400 - ;;
401 - *)
402 - die "unknown GOOS for ${1:-${CHOST}}"
403 - ;;
404 - esac
405 -}
406 -
407 -go_tuple()
408 -{
409 - echo "$(go_os $@)_$(go_arch $@)"
410 -}
411 -
412 -go_cross_compile()
413 -{
414 - [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
415 -}
416 -
417 -pkg_pretend()
418 -{
419 - # make.bash does not understand cross-compiling a cross-compiler
420 - if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then
421 - die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}"
422 - fi
423 -}
424 -
425 -src_unpack()
426 -{
427 - if [[ ${PV} = 9999 ]]; then
428 - git-r3_src_unpack
429 - fi
430 - default
431 -}
432 -
433 -src_compile()
434 -{
435 - export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap
436 - if use gccgo; then
437 - mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
438 - local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version)
439 - [[ -x ${go_binary} ]] || go_binary=$(
440 - find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-$(gcc-major-version) |
441 - sort -V | tail -n1)
442 - [[ -x ${go_binary} ]] ||
443 - die "go-$(gcc-major-version): command not found"
444 - ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
445 - fi
446 - export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
447 - export GOROOT="$(pwd)"
448 - export GOBIN="${GOROOT}/bin"
449 -
450 - # Go's build script does not use BUILD/HOST/TARGET consistently. :(
451 - export GOHOSTARCH=$(go_arch ${CBUILD})
452 - export GOHOSTOS=$(go_os ${CBUILD})
453 - export CC=$(tc-getBUILD_CC)
454 -
455 - export GOARCH=$(go_arch)
456 - export GOOS=$(go_os)
457 - export CC_FOR_TARGET=$(tc-getCC)
458 - export CXX_FOR_TARGET=$(tc-getCXX)
459 - if [[ ${ARCH} == arm ]]; then
460 - export GOARM=$(go_arm)
461 - fi
462 - einfo "GOROOT_BOOTSTRAP is ${GOROOT_BOOTSTRAP}"
463 -
464 - cd src
465 - ./make.bash || die "build failed"
466 -}
467 -
468 -src_test()
469 -{
470 - go_cross_compile && return 0
471 -
472 - cd src
473 - PATH="${GOBIN}:${PATH}" \
474 - ./run.bash -no-rebuild || die "tests failed"
475 -}
476 -
477 -src_install()
478 -{
479 - local bin_path f x
480 -
481 - dodir /usr/lib/go
482 -
483 - # There is a known issue which requires the source tree to be installed [1].
484 - # Once this is fixed, we can consider using the doc use flag to control
485 - # installing the doc and src directories.
486 - # [1] https://golang.org/issue/2775
487 - #
488 - # deliberately use cp to retain permissions
489 - cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
490 - if go_cross_compile; then
491 - bin_path="bin/$(go_tuple)"
492 - else
493 - bin_path=bin
494 - fi
495 - for x in ${bin_path}/*; do
496 - f=${x##*/}
497 - dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
498 - done
499 - einstalldocs
500 -
501 - if [[ ${CHOST} == *-darwin* ]] ; then
502 - # fix install_name for test object (binutils_test) on Darwin, it
503 - # is never used in real circumstances
504 - local libmac64="${EPREFIX}"/usr/lib/go/src/cmd/vendor/github.com/
505 - libmac64+=google/pprof/internal/binutils/testdata/lib_mac_64
506 - install_name_tool -id "${libmac64}" "${D}${libmac64}"
507 - fi
508 -}