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