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