1 |
commit: cd30688e3663f03b986320a1147892ee3b2fc33c |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 12 16:13:05 2020 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 12 16:20:35 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd30688e |
7 |
|
8 |
dev-lang/go: 1.13.6 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.13.6.ebuild | 246 +++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 247 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest |
17 |
index 2d420bf5460..729d5b3637a 100644 |
18 |
--- a/dev-lang/go/Manifest |
19 |
+++ b/dev-lang/go/Manifest |
20 |
@@ -13,3 +13,4 @@ DIST go1.12.13.src.tar.gz 21980338 BLAKE2B 205bee35a947ccd08f36547530e3de7928f5f |
21 |
DIST go1.12.14.src.tar.gz 20726032 BLAKE2B 2defecd29568974c1618ce0da42d9e28ef41904ed3f759b51c7e392ed9dea950a4984efa333e52b413fab3dac8270bb99f60e113712bfc648c4c9af0e19aba7d SHA512 6cd225282fbade8bd7e96789744c7db07f223f5309358ca3768c95c34a099b44bd9ba9adc2ce293a5bbd608237ae6473b86e7bb451db395c647809fc2750dd4c |
22 |
DIST go1.13.4.src.tar.gz 21619153 BLAKE2B 2efc86fd0830b9c8935c856244baaec1e63232dd08b696544da900927ba56fd686b5899ec1640fbcbb21c8c5ac9581cfde3fcb5c06ccfabd0fd2f181b398da46 SHA512 e8155cdceca2ebefd386feef98223bbdc92d9316f7188d4ba701cf43a723b75a9bf67a1eb92ac80987b7a113a2fb6981ef235292bec7dd3964805b7c33abdbb1 |
23 |
DIST go1.13.5.src.tar.gz 21629437 BLAKE2B c39a52e73136a322a1b6b4ee6888672848ff2b3278d8034ec25b93101fff2b63212d66c065d3d974ca7e8686cba8a9ea9c4fedb23cad51b6cd76adae6db6eb42 SHA512 bc9ddb12855c66dba5fe859bd13b7b3163259b8a8b0d3cbf6892e528ae4c6418c6b4c0d49838e7a5fc2e9f404484899b8f30c45e49e7d30109093025b62ed6c0 |
24 |
+DIST go1.13.6.src.tar.gz 21631050 BLAKE2B 8923021d5ff785f5422ee204ee81c986fc066a878a347bc73625974f05045689f694f76147c9bf7956dc59d6e3d3a543f0970e0716df8cd4f6556c28fe23808b SHA512 dffb6e06eea0b1541901dfbed8d28e8cc1eac3184dc40a19ed3637737df796a67a2e7170b228e1003d36b14e6f0f13bb8be9d2a702834a9c06228d1821659528 |
25 |
|
26 |
diff --git a/dev-lang/go/go-1.13.6.ebuild b/dev-lang/go/go-1.13.6.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..5e3547cfead |
29 |
--- /dev/null |
30 |
+++ b/dev-lang/go/go-1.13.6.ebuild |
31 |
@@ -0,0 +1,246 @@ |
32 |
+# Copyright 1999-2019 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+export CBUILD=${CBUILD:-${CHOST}} |
38 |
+export CTARGET=${CTARGET:-${CHOST}} |
39 |
+ |
40 |
+MY_PV=${PV/_/} |
41 |
+ |
42 |
+inherit toolchain-funcs |
43 |
+ |
44 |
+BOOTSTRAP_VERSION="bootstrap-1.8" |
45 |
+BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist" |
46 |
+BOOTSTRAP_URI=" |
47 |
+ ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz |
48 |
+ ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz |
49 |
+ ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz |
50 |
+ ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz |
51 |
+ ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz |
52 |
+ ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz |
53 |
+ ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz |
54 |
+ ${BOOTSTRAP_DIST}/go-freebsd-amd64-${BOOTSTRAP_VERSION}.tbz |
55 |
+ ${BOOTSTRAP_DIST}/go-freebsd-386-${BOOTSTRAP_VERSION}.tbz |
56 |
+ ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz |
57 |
+ ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz |
58 |
+" |
59 |
+ |
60 |
+case ${PV} in |
61 |
+*9999*) |
62 |
+ EGIT_REPO_URI="https://github.com/golang/go.git" |
63 |
+ inherit git-r3 |
64 |
+ ;; |
65 |
+*) |
66 |
+ SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz " |
67 |
+ S="${WORKDIR}"/go |
68 |
+ case ${PV} in |
69 |
+ *_beta*|*_rc*) ;; |
70 |
+ *) |
71 |
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" |
72 |
+ # The upstream tests fail under portage but pass if the build is |
73 |
+ # run according to their documentation [1]. |
74 |
+ # I am restricting the tests on released versions until this is |
75 |
+ # solved. |
76 |
+ # [1] https://golang.org/issues/18442 |
77 |
+ RESTRICT="test" |
78 |
+ ;; |
79 |
+ esac |
80 |
+esac |
81 |
+ |
82 |
+# If gccgo or a previously installed version of dev-lang/go is not being |
83 |
+# used to build Go, there is no way to know the architecture or operating system |
84 |
+# of the build machine, so we need to download all of our bootstrap |
85 |
+# archives to allow this ebuild to work under crossdev. |
86 |
+# |
87 |
+# https://bugs.gentoo.org/671394 |
88 |
+SRC_URI+="!gccgo? ( !system-bootstrap? ( ${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 system-bootstrap" |
96 |
+ |
97 |
+BDEPEND="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/*.gox |
104 |
+ " |
105 |
+ |
106 |
+# Do not complain about CFLAGS, etc, since Go doesn't use them. |
107 |
+QA_FLAGS_IGNORED='.*' |
108 |
+ |
109 |
+REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*" |
110 |
+ |
111 |
+# The tools in /usr/lib/go should not cause the multilib-strict check to fail. |
112 |
+QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*" |
113 |
+ |
114 |
+# Do not strip this package. Stripping is unsupported upstream and may |
115 |
+# fail. |
116 |
+RESTRICT+=" strip" |
117 |
+ |
118 |
+DOCS=( |
119 |
+AUTHORS |
120 |
+CONTRIBUTING.md |
121 |
+CONTRIBUTORS |
122 |
+PATENTS |
123 |
+README.md |
124 |
+) |
125 |
+ |
126 |
+go_arch() |
127 |
+{ |
128 |
+ # By chance most portage arch names match Go |
129 |
+ local portage_arch=$(tc-arch $@) |
130 |
+ case "${portage_arch}" in |
131 |
+ x86) echo 386;; |
132 |
+ x64-*) echo amd64;; |
133 |
+ ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;; |
134 |
+ s390) echo s390x ;; |
135 |
+ *) echo "${portage_arch}";; |
136 |
+ esac |
137 |
+} |
138 |
+ |
139 |
+go_arm() |
140 |
+{ |
141 |
+ case "${1:-${CHOST}}" in |
142 |
+ armv5*) echo 5;; |
143 |
+ armv6*) echo 6;; |
144 |
+ armv7*) echo 7;; |
145 |
+ *) |
146 |
+ die "unknown GOARM for ${1:-${CHOST}}" |
147 |
+ ;; |
148 |
+ esac |
149 |
+} |
150 |
+ |
151 |
+go_os() |
152 |
+{ |
153 |
+ case "${1:-${CHOST}}" in |
154 |
+ *-linux*) echo linux;; |
155 |
+ *-darwin*) echo darwin;; |
156 |
+ *-freebsd*) echo freebsd;; |
157 |
+ *-netbsd*) echo netbsd;; |
158 |
+ *-openbsd*) echo openbsd;; |
159 |
+ *-solaris*) echo solaris;; |
160 |
+ *-cygwin*|*-interix*|*-winnt*) |
161 |
+ echo windows |
162 |
+ ;; |
163 |
+ *) |
164 |
+ die "unknown GOOS for ${1:-${CHOST}}" |
165 |
+ ;; |
166 |
+ esac |
167 |
+} |
168 |
+ |
169 |
+go_tuple() |
170 |
+{ |
171 |
+ echo "$(go_os $@)_$(go_arch $@)" |
172 |
+} |
173 |
+ |
174 |
+go_cross_compile() |
175 |
+{ |
176 |
+ [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] |
177 |
+} |
178 |
+ |
179 |
+pkg_pretend() |
180 |
+{ |
181 |
+ # make.bash does not understand cross-compiling a cross-compiler |
182 |
+ if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then |
183 |
+ die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}" |
184 |
+ fi |
185 |
+ [[ ${MERGE_TYPE} != binary ]] && |
186 |
+ use system-bootstrap && ! has_version "dev-lang/go" && |
187 |
+ die "dev-lang/go must be installed to use the system-bootstrap use flag" |
188 |
+} |
189 |
+ |
190 |
+src_unpack() |
191 |
+{ |
192 |
+ if [[ ${PV} = 9999 ]]; then |
193 |
+ git-r3_src_unpack |
194 |
+ else |
195 |
+ unpack "go${MY_PV}.src.tar.gz" |
196 |
+ fi |
197 |
+ use gccgo || use system-bootstrap || |
198 |
+ unpack "go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-${BOOTSTRAP_VERSION}.tbz" |
199 |
+} |
200 |
+ |
201 |
+src_compile() |
202 |
+{ |
203 |
+ export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-bootstrap |
204 |
+ if use gccgo; then |
205 |
+ mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die |
206 |
+ local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version) |
207 |
+ [[ -x ${go_binary} ]] || go_binary=$( |
208 |
+ find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-$(gcc-major-version) | |
209 |
+ sort -V | tail -n1) |
210 |
+ [[ -x ${go_binary} ]] || |
211 |
+ die "go-$(gcc-major-version): command not found" |
212 |
+ ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die |
213 |
+ elif use system-bootstrap; then |
214 |
+ export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go |
215 |
+ fi |
216 |
+ export GOROOT_FINAL="${EPREFIX}"/usr/lib/go |
217 |
+ export GOROOT="$(pwd)" |
218 |
+ export GOBIN="${GOROOT}/bin" |
219 |
+ |
220 |
+ # Go's build script does not use BUILD/HOST/TARGET consistently. :( |
221 |
+ export GOHOSTARCH=$(go_arch ${CBUILD}) |
222 |
+ export GOHOSTOS=$(go_os ${CBUILD}) |
223 |
+ export CC=$(tc-getBUILD_CC) |
224 |
+ |
225 |
+ export GOARCH=$(go_arch) |
226 |
+ export GOOS=$(go_os) |
227 |
+ export CC_FOR_TARGET=$(tc-getCC) |
228 |
+ export CXX_FOR_TARGET=$(tc-getCXX) |
229 |
+ if [[ ${ARCH} == arm ]]; then |
230 |
+ export GOARM=$(go_arm) |
231 |
+ fi |
232 |
+ |
233 |
+ cd src |
234 |
+ ./make.bash || die "build failed" |
235 |
+} |
236 |
+ |
237 |
+src_test() |
238 |
+{ |
239 |
+ go_cross_compile && return 0 |
240 |
+ |
241 |
+ cd src |
242 |
+ PATH="${GOBIN}:${PATH}" \ |
243 |
+ ./run.bash -no-rebuild || die "tests failed" |
244 |
+} |
245 |
+ |
246 |
+src_install() |
247 |
+{ |
248 |
+ local bin_path f x |
249 |
+ |
250 |
+ dodir /usr/lib/go |
251 |
+ |
252 |
+ # There is a known issue which requires the source tree to be installed [1]. |
253 |
+ # Once this is fixed, we can consider using the doc use flag to control |
254 |
+ # installing the doc and src directories. |
255 |
+ # [1] https://golang.org/issue/2775 |
256 |
+ # |
257 |
+ # deliberately use cp to retain permissions |
258 |
+ cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go |
259 |
+ if go_cross_compile; then |
260 |
+ bin_path="bin/$(go_tuple)" |
261 |
+ else |
262 |
+ bin_path=bin |
263 |
+ fi |
264 |
+ for x in ${bin_path}/*; do |
265 |
+ f=${x##*/} |
266 |
+ dosym ../lib/go/${bin_path}/${f} /usr/bin/${f} |
267 |
+ done |
268 |
+ einstalldocs |
269 |
+ |
270 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
271 |
+ # fix install_name for test object (binutils_test) on Darwin, it |
272 |
+ # is never used in real circumstances |
273 |
+ local libmac64="${EPREFIX}"/usr/lib/go/src/cmd/vendor/github.com/ |
274 |
+ libmac64+=google/pprof/internal/binutils/testdata/lib_mac_64 |
275 |
+ install_name_tool -id "${libmac64}" "${D}${libmac64}" |
276 |
+ fi |
277 |
+} |