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