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: Thu, 10 Sep 2020 15:44:56
Message-Id: 1599752654.e5cb8f08fbfa16ba25da790ff60c37b45210117f.williamh@gentoo
1 commit: e5cb8f08fbfa16ba25da790ff60c37b45210117f
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 10 15:43:32 2020 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 10 15:44:14 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5cb8f08
7
8 dev-lang/go: 1.14.9 bump
9
10 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
11
12 dev-lang/go/Manifest | 1 +
13 dev-lang/go/go-1.14.9.ebuild | 188 +++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 189 insertions(+)
15
16 diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
17 index 57fcb80f772..778f24c7941 100644
18 --- a/dev-lang/go/Manifest
19 +++ b/dev-lang/go/Manifest
20 @@ -1,5 +1,6 @@
21 DIST go1.14.7.src.tar.gz 22534747 BLAKE2B ab43abeec9d636dd88eaa10dc210f5d11d487df35238a00548e1f56a86bdf2375e7c180ee6e1cea53591528714fa70333e3336db61eacfdeb5f51b2d5ea86a45 SHA512 3f1133c66d7795ceb6c5793db90616613244d7561abaef6b059602992c0b7a53b6b6ebbcf69add4769a58542e9dc55871bcfe3d64d4cd9f3569bd435ade86dee
22 DIST go1.14.8.src.tar.gz 22535549 BLAKE2B b7630dd95b8252150937f49a164af4c8a1b9f186db9f8ec9f5e2589762a96c5c22aa8fc3a9f697cb2b884844962cea41ea789283e07f3b7b3be3343af1056573 SHA512 c7f2826d9f674591b183f209e8854875273a6ac846f93ae1da841a0c80943d9b8fa04cdad389a339bbdf583913ab71646dff15afa9b4ad8be47e12041fe71c45
23 +DIST go1.14.9.src.tar.gz 22540282 BLAKE2B 84f52ce4200c4f31aacb08b270a9e13e4753a9dc21aa2e6566cca95ea21f2d4bded9303bb7dbcd93c1ea8bb81100692f19b7129313278a821159e7a4c7a2f7f0 SHA512 318ca9dc4c55ea3a942aad0b8ede4d66a6fea9571ece56922cc8f4f167c4bfc77182cb4ef72be6d34a70e396e1549baf92a505fde785f4aff6b4c1318e86a526
24 DIST go1.15.1.src.tar.gz 23009031 BLAKE2B bf944570b77eb7a04f751daaf653a43260d03b1b0d413529beef9ec0879064be67130f65d1a38947b605f6b7deba51f8d832818ac44fb738482203f7c618ebb1 SHA512 08728dd7c64467482b1b17d1bd852ae6ca329062da95e10e91535e096b6ddd32d0e34a5e1f7b736175863c5543b6623406fc89b057273afc3f434ea97b343cfe
25 DIST go1.15.2.src.tar.gz 23012667 BLAKE2B 776531cb4ff1a4023739b4f37828a098b5ea9df1f6b08940119fb39bb6edf08ae40ba9b513e340bbfbec8075778d31df3825816f6680d88fdb53cde2c235d9b8 SHA512 c8b69556ddbbae4790c923547d90259c2208490ed26e75b6318dcc19893f50788e17207140deed1fe9d1e214b9a8f3769242fb7dfd06ebac37ba2c67f0281a73
26 DIST go1.15.src.tar.gz 23002901 BLAKE2B a04bfb5d8bb6377e92d5d8c96f11d39b9bb878f4f9a3221baa5f42bcc822b562a209fd5d2d2a643f3b72df2db494899b2f7a446f1a9a8e25bf0df56ef87f3b7f SHA512 7d85382bcc6a0625dfa3d07196ab364860846367ed67697a7b1516b0af551a72bc4873882141fc3c7a60d39f2e27b33f6693e8b18b608de76fc9a55b5eac55ea
27
28 diff --git a/dev-lang/go/go-1.14.9.ebuild b/dev-lang/go/go-1.14.9.ebuild
29 new file mode 100644
30 index 00000000000..fa07749bdeb
31 --- /dev/null
32 +++ b/dev-lang/go/go-1.14.9.ebuild
33 @@ -0,0 +1,188 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +export CBUILD=${CBUILD:-${CHOST}}
40 +export CTARGET=${CTARGET:-${CHOST}}
41 +
42 +MY_PV=${PV/_/}
43 +
44 +inherit toolchain-funcs
45 +
46 +case ${PV} in
47 +*9999*)
48 + EGIT_REPO_URI="https://github.com/golang/go.git"
49 + inherit git-r3
50 + ;;
51 +*)
52 + SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
53 + S="${WORKDIR}"/go
54 + case ${PV} in
55 + *_beta*|*_rc*) ;;
56 + *)
57 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
58 + ;;
59 + esac
60 +esac
61 +
62 +DESCRIPTION="A concurrent garbage collected and typesafe programming language"
63 +HOMEPAGE="https://golang.org"
64 +
65 +LICENSE="BSD"
66 +SLOT="0/${PV}"
67 +
68 +BDEPEND="|| (
69 + dev-lang/go
70 + dev-lang/go-bootstrap )"
71 +RDEPEND="!<dev-go/go-tools-0_pre20150902"
72 +
73 +# Do not complain about CFLAGS, etc, since Go doesn't use them.
74 +QA_FLAGS_IGNORED='.*'
75 +
76 +# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
77 +QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
78 +
79 +# Do not strip this package. Stripping is unsupported upstream and may
80 +# fail.
81 +RESTRICT+=" strip"
82 +
83 +DOCS=(
84 +AUTHORS
85 +CONTRIBUTING.md
86 +CONTRIBUTORS
87 +PATENTS
88 +README.md
89 +)
90 +
91 +go_arch()
92 +{
93 + # By chance most portage arch names match Go
94 + local portage_arch=$(tc-arch $@)
95 + case "${portage_arch}" in
96 + x86) echo 386;;
97 + x64-*) echo amd64;;
98 + ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
99 + s390) echo s390x ;;
100 + *) echo "${portage_arch}";;
101 + esac
102 +}
103 +
104 +go_arm()
105 +{
106 + case "${1:-${CHOST}}" in
107 + armv5*) echo 5;;
108 + armv6*) echo 6;;
109 + armv7*) echo 7;;
110 + *)
111 + die "unknown GOARM for ${1:-${CHOST}}"
112 + ;;
113 + esac
114 +}
115 +
116 +go_os()
117 +{
118 + case "${1:-${CHOST}}" in
119 + *-linux*) echo linux;;
120 + *-darwin*) echo darwin;;
121 + *-freebsd*) echo freebsd;;
122 + *-netbsd*) echo netbsd;;
123 + *-openbsd*) echo openbsd;;
124 + *-solaris*) echo solaris;;
125 + *-cygwin*|*-interix*|*-winnt*)
126 + echo windows
127 + ;;
128 + *)
129 + die "unknown GOOS for ${1:-${CHOST}}"
130 + ;;
131 + esac
132 +}
133 +
134 +go_tuple()
135 +{
136 + echo "$(go_os $@)_$(go_arch $@)"
137 +}
138 +
139 +go_cross_compile()
140 +{
141 + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
142 +}
143 +
144 +src_compile()
145 +{
146 + if has_version -b dev-lang/go; then
147 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
148 + elif has_version -b dev-lang/go-bootstrap; then
149 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
150 + else
151 + eerror "Go cannot be built without go or go-bootstrap installed"
152 + die "Should not be here, please report a bug"
153 + fi
154 +
155 + export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
156 + export GOROOT="$(pwd)"
157 + export GOBIN="${GOROOT}/bin"
158 +
159 + # Go's build script does not use BUILD/HOST/TARGET consistently. :(
160 + export GOHOSTARCH=$(go_arch ${CBUILD})
161 + export GOHOSTOS=$(go_os ${CBUILD})
162 + export CC=$(tc-getBUILD_CC)
163 +
164 + export GOARCH=$(go_arch)
165 + export GOOS=$(go_os)
166 + export CC_FOR_TARGET=$(tc-getCC)
167 + export CXX_FOR_TARGET=$(tc-getCXX)
168 + if [[ ${ARCH} == arm ]]; then
169 + export GOARM=$(go_arm)
170 + fi
171 +
172 + cd src
173 + bash -x ./make.bash || die "build failed"
174 +}
175 +
176 +src_test()
177 +{
178 + go_cross_compile && return 0
179 +
180 + cd src
181 + PATH="${GOBIN}:${PATH}" \
182 + ./run.bash -no-rebuild || die "tests failed"
183 + cd ..
184 + rm -fr pkg/*_race || die
185 + rm -fr pkg/obj/go-build || die
186 +}
187 +
188 +src_install()
189 +{
190 + local bin_path f x
191 +
192 + dodir /usr/lib/go
193 +
194 + # There is a known issue which requires the source tree to be installed [1].
195 + # Once this is fixed, we can consider using the doc use flag to control
196 + # installing the doc and src directories.
197 + # [1] https://golang.org/issue/2775
198 + #
199 + # deliberately use cp to retain permissions
200 + cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
201 + # testdata directories are not needed on the installed system
202 + rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
203 + if go_cross_compile; then
204 + bin_path="bin/$(go_tuple)"
205 + else
206 + bin_path=bin
207 + fi
208 + for x in ${bin_path}/*; do
209 + f=${x##*/}
210 + dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
211 + done
212 + einstalldocs
213 +
214 + if [[ ${CHOST} == *-darwin* ]] ; then
215 + # fix install_name for test object (binutils_test) on Darwin, it
216 + # is never used in real circumstances
217 + local libmac64="${EPREFIX}"/usr/lib/go/src/cmd/vendor/github.com/
218 + libmac64+=google/pprof/internal/binutils/testdata/lib_mac_64
219 + install_name_tool -id "${libmac64}" "${D}${libmac64}"
220 + fi
221 +}