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