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