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