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: Wed, 24 Oct 2018 16:32:54
Message-Id: 1540398654.e03d31a04b6458e350ad6090b519191fd29ab2a8.williamh@gentoo
1 commit: e03d31a04b6458e350ad6090b519191fd29ab2a8
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 24 16:29:46 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 24 16:30:54 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e03d31a0
7
8 dev-lang/go: 1.10.4 version bump
9
10 closes: https://bugs.gentoo.org/show_bug.cgi?id=668874
11 Package-Manager: Portage-2.3.49, Repoman-2.3.11
12 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
13
14 dev-lang/go/Manifest | 1 +
15 dev-lang/go/go-1.10.4.ebuild | 228 +++++++++++++++++++++++++++++++++++++++++++
16 2 files changed, 229 insertions(+)
17
18 diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
19 index 55761a392d2..5471e77aaa2 100644
20 --- a/dev-lang/go/Manifest
21 +++ b/dev-lang/go/Manifest
22 @@ -12,6 +12,7 @@ DIST go-solaris-amd64-bootstrap-1.8.tbz 54926326 BLAKE2B 0a45312f090d81ebf46fe59
23 DIST go1.10.1.src.tar.gz 18305765 BLAKE2B 61b8db22c50b9a4653244dc18267f405607755932d84ea2c475338a9f4a5421da2bb8cc808dbd166aa35c3c8778180bf47d6e51ebe303bc62e582516919058f9 SHA512 13f6b0643a4f92eeca04444b9fa10de38fc3427daea9aa3227cf9a5738ffee1a3f2e355ba5faf711b8506f7de118bdcd3b9064b65407a22613523e29ffd73415
24 DIST go1.10.2.src.tar.gz 18308678 BLAKE2B 5f16757f879e9be9d2e936bc5e3cefcfd32914dbe7def8252b20ac647c90cfae09dfd7ff782f55cee4b3fecda6cc88c547f20087b571dbd06bc7600510c788bc SHA512 754e60bce1ea3479ebb57bbbb625e3d7875a151e7a6d7a1067478a9e45bde5423f47123d084832bb838acf7675a9d05057b76c1d773e43cae0fb4e7a52acf4a9
25 DIST go1.10.3.src.tar.gz 18323736 BLAKE2B f07ea774378eb25e28fc29ce6d8d7ed84227d4b93bfa93d38a071fe294da30c3cdc3a559d643e7379873df56b0e2731dbd772e385ffcb4b2e93819db3b4e33f2 SHA512 fd2bd5fcb5c6d0a5336c4b1d2cacb368edbb01359297a83bdedc53f6018642598232f00633fc60fde879050f5f26a810c828d46b5d6626cbcc0702d93ad33fbb
26 +DIST go1.10.4.src.tar.gz 18331174 BLAKE2B e16998d81d286f132894fefd31f4139f757b7da3dfc829c389e41ef770bed22b3c9ae7bcf190fb4c83da16cf8e8c34681cfdc5bbc786f9036710e821c9bbd483 SHA512 ead2c06d903670ff4530748aa2fa6a1140fdf32cf3b8d74cd7d6e046af73c79fd5f98d2188062e6845e5c0513c080ed7079a210720c30338cb8730b95aede9f5
27 DIST go1.11.1.src.tar.gz 21097206 BLAKE2B 12303f57a92ec64badffea9e98a0361f48b844d423f3ed454ba4bfdd367425e7b318de1cf9b3e7835585f6dbb01f5c07bfb43adbfcc90a590b35984752ef8d3c SHA512 9c19f40b24f2180563705511a5692932c0db3585939053e6d78eea1f394902d37f05b0386f0e7d0c0266178de7e9bd7b003324ed232ce2e5050c9faafafdd979
28 DIST go1.11.src.tar.gz 21091932 BLAKE2B 029b1c43b6244ab320b24fccca2bac693a0df0f975da2880a24e85fafbd7d6c836f63c609f1df44fb3eacc1c66c3d147858b7a2b9c0c370bb8fdbc8614b35713 SHA512 2758b7924b4b8cffc30b56fbf039b8e23d1a3c42506ed4997bd64531ba742e2c60e95d1fa70cae2ccda45d1959fadccfd2404af87d962530e4b1d3556c4aaf43
29 DIST go1.9.6.src.tar.gz 16397247 BLAKE2B 36c9077177bd7bbe9b40c422c5faf7aa83fdd8a2360051cb026346a9fea35297d892d6c677962c498ea8531c1748d58a55bbb1db7c1cf323a1d65c0b9b8573fd SHA512 f7863a4fe586414c91465a6a82a47097b2593384688a7c68ad3e9981559047b4faf2c134104ad09a64125576dac557809884d9f125d91108dd51746620a368a2
30
31 diff --git a/dev-lang/go/go-1.10.4.ebuild b/dev-lang/go/go-1.10.4.ebuild
32 new file mode 100644
33 index 00000000000..3eecca0eb62
34 --- /dev/null
35 +++ b/dev-lang/go/go-1.10.4.ebuild
36 @@ -0,0 +1,228 @@
37 +# Copyright 1999-2018 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=6
41 +
42 +export CBUILD=${CBUILD:-${CHOST}}
43 +export CTARGET=${CTARGET:-${CHOST}}
44 +
45 +MY_PV=${PV/_/}
46 +
47 +inherit toolchain-funcs
48 +
49 +BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
50 +BOOTSTRAP_VERSION="bootstrap-1.8"
51 +BOOTSTRAP_URI="
52 +amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz )
53 +arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz )
54 +arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz )
55 +ppc64? (
56 + ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz
57 + ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz
58 +)
59 +s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz )
60 +x86? ( ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz )
61 +amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-${BOOTSTRAP_VERSION}.tbz )
62 +x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-${BOOTSTRAP_VERSION}.tbz )
63 +x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz )
64 +x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz )
65 +"
66 +
67 +case ${PV} in
68 +*9999*)
69 + EGIT_REPO_URI="https://github.com/golang/go.git"
70 + inherit git-r3
71 + ;;
72 +*)
73 + SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
74 + S="${WORKDIR}"/go
75 + case ${PV} in
76 + *_beta*|*_rc*) ;;
77 + *)
78 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~s390 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x64-solaris"
79 + # The upstream tests fail under portage but pass if the build is
80 + # run according to their documentation [1].
81 + # I am restricting the tests on released versions until this is
82 + # solved.
83 + # [1] https://golang.org/issues/18442
84 + RESTRICT="test"
85 + ;;
86 + esac
87 +esac
88 +SRC_URI+="!gccgo? ( ${BOOTSTRAP_URI} )"
89 +
90 +DESCRIPTION="A concurrent garbage collected and typesafe programming language"
91 +HOMEPAGE="https://golang.org"
92 +
93 +LICENSE="BSD"
94 +SLOT="0/${PV}"
95 +IUSE="gccgo"
96 +
97 +DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
98 +RDEPEND="!<dev-go/go-tools-0_pre20150902"
99 +
100 +# These test data objects have writable/executable stacks.
101 +QA_EXECSTACK="
102 + usr/lib/go/src/debug/elf/testdata/*.obj
103 + usr/lib/go/src/go/internal/gccgoimporter/testdata/escapeinfo.gox
104 + usr/lib/go/src/go/internal/gccgoimporter/testdata/unicode.gox
105 + usr/lib/go/src/go/internal/gccgoimporter/testdata/time.gox
106 + "
107 +
108 +# Do not complain about CFLAGS, etc, since Go doesn't use them.
109 +QA_FLAGS_IGNORED='.*'
110 +
111 +REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*"
112 +
113 +# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
114 +QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
115 +
116 +# Do not strip this package. Stripping is unsupported upstream and may
117 +# fail.
118 +RESTRICT+=" strip"
119 +
120 +DOCS=(
121 +AUTHORS
122 +CONTRIBUTING.md
123 +CONTRIBUTORS
124 +PATENTS
125 +README.md
126 +)
127 +
128 +go_arch()
129 +{
130 + # By chance most portage arch names match Go
131 + local portage_arch=$(tc-arch $@)
132 + case "${portage_arch}" in
133 + x86) echo 386;;
134 + x64-*) echo amd64;;
135 + ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
136 + s390) echo s390x ;;
137 + *) echo "${portage_arch}";;
138 + esac
139 +}
140 +
141 +go_arm()
142 +{
143 + case "${1:-${CHOST}}" in
144 + armv5*) echo 5;;
145 + armv6*) echo 6;;
146 + armv7*) echo 7;;
147 + *)
148 + die "unknown GOARM for ${1:-${CHOST}}"
149 + ;;
150 + esac
151 +}
152 +
153 +go_os()
154 +{
155 + case "${1:-${CHOST}}" in
156 + *-linux*) echo linux;;
157 + *-darwin*) echo darwin;;
158 + *-freebsd*) echo freebsd;;
159 + *-netbsd*) echo netbsd;;
160 + *-openbsd*) echo openbsd;;
161 + *-solaris*) echo solaris;;
162 + *-cygwin*|*-interix*|*-winnt*)
163 + echo windows
164 + ;;
165 + *)
166 + die "unknown GOOS for ${1:-${CHOST}}"
167 + ;;
168 + esac
169 +}
170 +
171 +go_tuple()
172 +{
173 + echo "$(go_os $@)_$(go_arch $@)"
174 +}
175 +
176 +go_cross_compile()
177 +{
178 + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
179 +}
180 +
181 +pkg_pretend()
182 +{
183 + # make.bash does not understand cross-compiling a cross-compiler
184 + if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then
185 + die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}"
186 + fi
187 +}
188 +
189 +src_unpack()
190 +{
191 + if [[ ${PV} = 9999 ]]; then
192 + git-r3_src_unpack
193 + fi
194 + default
195 +}
196 +
197 +src_compile()
198 +{
199 + export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap
200 + if use gccgo; then
201 + mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
202 + local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version)
203 + [[ -x ${go_binary} ]] || go_binary=$(
204 + find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-$(gcc-major-version) |
205 + sort -V | tail -n1)
206 + [[ -x ${go_binary} ]] ||
207 + die "go-$(gcc-major-version): command not found"
208 + ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
209 + fi
210 + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
211 + export GOROOT="$(pwd)"
212 + export GOBIN="${GOROOT}/bin"
213 +
214 + # Go's build script does not use BUILD/HOST/TARGET consistently. :(
215 + export GOHOSTARCH=$(go_arch ${CBUILD})
216 + export GOHOSTOS=$(go_os ${CBUILD})
217 + export CC=$(tc-getBUILD_CC)
218 +
219 + export GOARCH=$(go_arch)
220 + export GOOS=$(go_os)
221 + export CC_FOR_TARGET=$(tc-getCC)
222 + export CXX_FOR_TARGET=$(tc-getCXX)
223 + if [[ ${ARCH} == arm ]]; then
224 + export GOARM=$(go_arm)
225 + fi
226 + einfo "GOROOT_BOOTSTRAP is ${GOROOT_BOOTSTRAP}"
227 +
228 + cd src
229 + ./make.bash || die "build failed"
230 +}
231 +
232 +src_test()
233 +{
234 + go_cross_compile && return 0
235 +
236 + cd src
237 + PATH="${GOBIN}:${PATH}" \
238 + ./run.bash -no-rebuild || die "tests failed"
239 +}
240 +
241 +src_install()
242 +{
243 + local bin_path f x
244 +
245 + dodir /usr/lib/go
246 +
247 + # There is a known issue which requires the source tree to be installed [1].
248 + # Once this is fixed, we can consider using the doc use flag to control
249 + # installing the doc and src directories.
250 + # [1] https://golang.org/issue/2775
251 + #
252 + # deliberately use cp to retain permissions
253 + cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
254 + if go_cross_compile; then
255 + bin_path="bin/$(go_tuple)"
256 + else
257 + bin_path=bin
258 + fi
259 + for x in ${bin_path}/*; do
260 + f=${x##*/}
261 + dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
262 + done
263 + einstalldocs
264 +}