1 |
commit: f4771e1d2101e8f4a33651fa23de93bcf66077c5 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 13 18:04:03 2018 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 13 18:04:30 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4771e1d |
7 |
|
8 |
dev-lang/go: 1.9.4 security bump and stable on amd64 for bug #647250 |
9 |
|
10 |
Package-Manager: Portage-2.3.19, Repoman-2.3.6 |
11 |
RepoMan-Options: --force |
12 |
|
13 |
dev-lang/go/Manifest | 1 + |
14 |
dev-lang/go/go-1.9.4.ebuild | 227 ++++++++++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 228 insertions(+) |
16 |
|
17 |
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest |
18 |
index c0d413a307a..a755e0f06cf 100644 |
19 |
--- a/dev-lang/go/Manifest |
20 |
+++ b/dev-lang/go/Manifest |
21 |
@@ -12,3 +12,4 @@ DIST go-solaris-amd64-bootstrap-1.8.tbz 54926326 BLAKE2B 0a45312f090d81ebf46fe59 |
22 |
DIST go1.9.1.src.tar.gz 16377700 BLAKE2B 63558227bdbff43da788c43e082e54dfa0210e53de650b3e2a4ab09c55a9937a0d1fee66be8263653c2d8be774611f2485c7e673b8a5fbc7f7c0adc5fd4fdc1f SHA512 3c5d11089a54c61acd1a4fad9618ddb2058cc783a54564407ee50e37c864deaadfd5effeab623080c136a599096f448aae091ef41d0afca1abfcdb98adf4a793 |
23 |
DIST go1.9.2.src.tar.gz 16383591 BLAKE2B 3ad9d0e7b6b817a4eab7ffcca30ba86a0e50e68ed028b11f54b8813f4b1a9a0598c79d501c733e7fbf77831c8f7df681692f9aa6b860b16a6288dcab59d40226 SHA512 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5 |
24 |
DIST go1.9.3.src.tar.gz 16385451 BLAKE2B 0d16eba4d411a5ddb1915a305725e9762874568abb048cc5c8939e82481d7d530902d532b62c8fe10fe7e31465617171d17cb5aaf3ee51aa29b9a66837bf6874 SHA512 31c564af58b78c648c9bece8fa2ed3334feb80316b07b16f6286319e26d317da90d1af0464c3a2f776a3da72d31b22b063dbc620b93114bf142a11e8a625e527 |
25 |
+DIST go1.9.4.src.tar.gz 16392325 BLAKE2B c5a503e8c539f31a1bbef9c6d89263b7214fb433476830c205153aa07ee0debc273eb004dddd662f81cc6cd2d4d949af654a4f4db1c890530feadc90ce05e630 SHA512 1a7c830e07507ff7b89025adfb5c713444d97301f8ad47ef2564722c1e28186e946350f07e22777fbdd6f2f589c334eb01dfd589e97cb8a86f73669547badb0b |
26 |
|
27 |
diff --git a/dev-lang/go/go-1.9.4.ebuild b/dev-lang/go/go-1.9.4.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..a9a31b5fdef |
30 |
--- /dev/null |
31 |
+++ b/dev-lang/go/go-1.9.4.ebuild |
32 |
@@ -0,0 +1,227 @@ |
33 |
+# Copyright 1999-2018 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="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 ~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="https://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 |
+ einfo "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 |
+} |