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