1 |
commit: 4f2fcfa4b0c76edea07e6736bf45fc081319c867 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 3 13:05:22 2018 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 3 13:05:22 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4f2fcfa4 |
7 |
|
8 |
dev-lang/python: add missing patches for 3.6 |
9 |
|
10 |
Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6 |
11 |
|
12 |
dev-lang/python/Manifest | 2 +- |
13 |
dev-lang/python/files/3.6.5-disable-nis.patch | 11 ++ |
14 |
.../python/files/python-3.6.5-hash-unaligned.patch | 42 ++++++++ |
15 |
.../python-3.6.5-libressl-compatibility.patch | 114 +++++++++++++++++++++ |
16 |
dev-lang/python/python-3.6.5-r1.ebuild | 3 +- |
17 |
5 files changed, 169 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
20 |
index a69a27b9fa..3ed1a4ef38 100644 |
21 |
--- a/dev-lang/python/Manifest |
22 |
+++ b/dev-lang/python/Manifest |
23 |
@@ -12,4 +12,4 @@ DIST python-gentoo-patches-3.6.4.tar.xz 12888 BLAKE2B 7cf49ae22df53e855f2e99df51 |
24 |
DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 BLAKE2B 75422fc7390f559d9864f6e22a0b85982ccbdb07d5f2507db8e528285e56d1f11d4bc0b21a0b78d5340eafd562220d2f1b9d0a78b1f7c811c5689a426a81f9f3 SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8 |
25 |
DIST python-prefix-3.4.8-gentoo-patches-r0.tar.xz 12928 BLAKE2B d270f27485a70b4186c0d509836f66e6ae8218270cbb0a473b4579de7a8d9fa16eb2387d0441979aa62fc88e54a52f863c58d91b3df64dd6a40ad4bc4236cbb2 SHA512 84554d2b320922d7ac6e20012f847a81d6501693a4d9f2146faa8764fca4fbc5e3bf1c0f352853f1ab34ed905ab13097f2e82285ada54c9b4e219e72b39804c2 |
26 |
DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 BLAKE2B ab0cbc5430e9588f71cfd7b001a07f9a77097262f17e1f980e3945e39855e1c9437117bf4eb2d424dadf701d37d025e09627d7efdbb9f8867714039f62f261a7 SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5 |
27 |
-DIST python-prefix-3.6.3-gentoo-patches-r0.tar.xz 12676 BLAKE2B 5221ae00d16db401d5674947923451d850978d930d9449d9b4f6ae6d117c26971e2f384c5a698b7acc8d62e6a6b673f4ec870da3788f87372593a5ac4897a227 SHA512 9d1673bc7b327be6b7e95491940eeeaa40db9e94f2183f4605a9a5a7fd2e187017164e9b2ef31f3bc8d694e467de6843706d3341b4ce24d4d8717513c246b62f |
28 |
+DIST python-prefix-3.6.5-gentoo-patches-r0.tar.xz 12728 BLAKE2B 8193b5eb59aaa923be299e1a68c62a2341be6d2367eb34a8e03436248a0c180012ba60e738ded7ca7f58849cde070b364761922518a5cdc425602172291aa2b0 SHA512 3bb1a97885112fb853b9ad061f21ba1f661e397d5585d932ddebe3107267be512799f966aef92e599ce2c97a4d51ec48bb214aa999b370b8d5a594e6f92182b6 |
29 |
|
30 |
diff --git a/dev-lang/python/files/3.6.5-disable-nis.patch b/dev-lang/python/files/3.6.5-disable-nis.patch |
31 |
new file mode 100644 |
32 |
index 0000000000..3937c6fe79 |
33 |
--- /dev/null |
34 |
+++ b/dev-lang/python/files/3.6.5-disable-nis.patch |
35 |
@@ -0,0 +1,11 @@ |
36 |
+--- a/setup.py |
37 |
++++ b/setup.py |
38 |
+@@ -1364,7 +1364,7 @@ class PyBuildExt(build_ext): |
39 |
+ else: |
40 |
+ missing.extend(['resource', 'termios']) |
41 |
+ |
42 |
+- nis = self._detect_nis(inc_dirs, lib_dirs) |
43 |
++ nis = None |
44 |
+ if nis is not None: |
45 |
+ exts.append(nis) |
46 |
+ else: |
47 |
|
48 |
diff --git a/dev-lang/python/files/python-3.6.5-hash-unaligned.patch b/dev-lang/python/files/python-3.6.5-hash-unaligned.patch |
49 |
new file mode 100644 |
50 |
index 0000000000..d096887cbf |
51 |
--- /dev/null |
52 |
+++ b/dev-lang/python/files/python-3.6.5-hash-unaligned.patch |
53 |
@@ -0,0 +1,42 @@ |
54 |
+The hash implementation casts the input pointer to uint64_t* and directly reads |
55 |
+from this, which may cause unaligned accesses. Use memcpy() instead so this code |
56 |
+will not crash with SIGBUS on sparc. |
57 |
+ |
58 |
+--- a/Python/pyhash.c 2017-11-29 10:21:20.283094068 +0100 |
59 |
++++ b/Python/pyhash.c 2017-11-29 10:24:26.733087813 +0100 |
60 |
+@@ -369,7 +369,7 @@ |
61 |
+ uint64_t k0 = _le64toh(_Py_HashSecret.siphash.k0); |
62 |
+ uint64_t k1 = _le64toh(_Py_HashSecret.siphash.k1); |
63 |
+ uint64_t b = (uint64_t)src_sz << 56; |
64 |
+- const uint64_t *in = (uint64_t*)src; |
65 |
++ const uint8_t *in = (uint8_t*)src; |
66 |
+ |
67 |
+ uint64_t v0 = k0 ^ 0x736f6d6570736575ULL; |
68 |
+ uint64_t v1 = k1 ^ 0x646f72616e646f6dULL; |
69 |
+@@ -378,11 +378,13 @@ |
70 |
+ |
71 |
+ uint64_t t; |
72 |
+ uint8_t *pt; |
73 |
+- uint8_t *m; |
74 |
++ const uint8_t *m; |
75 |
+ |
76 |
+ while (src_sz >= 8) { |
77 |
+- uint64_t mi = _le64toh(*in); |
78 |
+- in += 1; |
79 |
+- src_sz -= 8; |
80 |
++ uint64_t mi; |
81 |
++ memcpy(&mi, in, sizeof(mi)); |
82 |
++ mi = _le64toh(mi); |
83 |
++ in += sizeof(mi); |
84 |
++ src_sz -= sizeof(mi); |
85 |
+ v3 ^= mi; |
86 |
+ DOUBLE_ROUND(v0,v1,v2,v3); |
87 |
+@@ -391,7 +393,7 @@ |
88 |
+ |
89 |
+ t = 0; |
90 |
+ pt = (uint8_t *)&t; |
91 |
+- m = (uint8_t *)in; |
92 |
++ m = in; |
93 |
+ switch (src_sz) { |
94 |
+ case 7: pt[6] = m[6]; /* fall through */ |
95 |
+ case 6: pt[5] = m[5]; /* fall through */ |
96 |
|
97 |
diff --git a/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch b/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch |
98 |
new file mode 100644 |
99 |
index 0000000000..2f9e6a2bef |
100 |
--- /dev/null |
101 |
+++ b/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch |
102 |
@@ -0,0 +1,114 @@ |
103 |
+From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001 |
104 |
+From: Christian Heimes <christian@××××××.org> |
105 |
+Date: Sat, 24 Mar 2018 18:38:14 +0100 |
106 |
+Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0 |
107 |
+ (GH-6210) (GH-6214) |
108 |
+ |
109 |
+LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects |
110 |
+LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and |
111 |
+LibreSSL < 2.7. |
112 |
+ |
113 |
+Documentation updates and fixes for failing tests will be provided in |
114 |
+another patch set. |
115 |
+ |
116 |
+Signed-off-by: Christian Heimes <christian@××××××.org>. |
117 |
+(cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1) |
118 |
+ |
119 |
+Co-authored-by: Christian Heimes <christian@××××××.org> |
120 |
+--- |
121 |
+ Lib/test/test_ssl.py | 1 + |
122 |
+ .../2018-03-24-15-08-24.bpo-33127.olJmHv.rst | 1 + |
123 |
+ Modules/_ssl.c | 24 ++++++++++++------- |
124 |
+ Tools/ssl/multissltests.py | 3 ++- |
125 |
+ 4 files changed, 20 insertions(+), 9 deletions(-) |
126 |
+ create mode 100644 Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst |
127 |
+ |
128 |
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py |
129 |
+index 8dd3b41450..9785a59a7e 100644 |
130 |
+--- a/Lib/test/test_ssl.py |
131 |
++++ b/Lib/test/test_ssl.py |
132 |
+@@ -1687,6 +1687,7 @@ class SimpleBackgroundTests(unittest.TestCase): |
133 |
+ self.assertEqual(len(ctx.get_ca_certs()), 1) |
134 |
+ |
135 |
+ @needs_sni |
136 |
++ @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"), "needs TLS 1.2") |
137 |
+ def test_context_setget(self): |
138 |
+ # Check that the context of a connected socket can be replaced. |
139 |
+ ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) |
140 |
+diff --git a/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst b/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst |
141 |
+new file mode 100644 |
142 |
+index 0000000000..635aabbde0 |
143 |
+--- /dev/null |
144 |
++++ b/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst |
145 |
+@@ -0,0 +1 @@ |
146 |
++The ssl module now compiles with LibreSSL 2.7.1. |
147 |
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c |
148 |
+index c54e43c2b4..5e007da858 100644 |
149 |
+--- a/Modules/_ssl.c |
150 |
++++ b/Modules/_ssl.c |
151 |
+@@ -106,6 +106,12 @@ struct py_ssl_library_code { |
152 |
+ |
153 |
+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) |
154 |
+ # define OPENSSL_VERSION_1_1 1 |
155 |
++# define PY_OPENSSL_1_1_API 1 |
156 |
++#endif |
157 |
++ |
158 |
++/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */ |
159 |
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL |
160 |
++# define PY_OPENSSL_1_1_API 1 |
161 |
+ #endif |
162 |
+ |
163 |
+ /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1 |
164 |
+@@ -152,16 +158,18 @@ struct py_ssl_library_code { |
165 |
+ #define INVALID_SOCKET (-1) |
166 |
+ #endif |
167 |
+ |
168 |
+-#ifdef OPENSSL_VERSION_1_1 |
169 |
+-/* OpenSSL 1.1.0+ */ |
170 |
+-#ifndef OPENSSL_NO_SSL2 |
171 |
+-#define OPENSSL_NO_SSL2 |
172 |
+-#endif |
173 |
+-#else /* OpenSSL < 1.1.0 */ |
174 |
+-#if defined(WITH_THREAD) |
175 |
++/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */ |
176 |
++#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD) |
177 |
+ #define HAVE_OPENSSL_CRYPTO_LOCK |
178 |
+ #endif |
179 |
+ |
180 |
++#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2) |
181 |
++#define OPENSSL_NO_SSL2 |
182 |
++#endif |
183 |
++ |
184 |
++#ifndef PY_OPENSSL_1_1_API |
185 |
++/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */ |
186 |
++ |
187 |
+ #define TLS_method SSLv23_method |
188 |
+ #define TLS_client_method SSLv23_client_method |
189 |
+ #define TLS_server_method SSLv23_server_method |
190 |
+@@ -227,7 +235,7 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s) |
191 |
+ return s->tlsext_tick_lifetime_hint; |
192 |
+ } |
193 |
+ |
194 |
+-#endif /* OpenSSL < 1.1.0 or LibreSSL */ |
195 |
++#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */ |
196 |
+ |
197 |
+ |
198 |
+ enum py_ssl_error { |
199 |
+diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py |
200 |
+index ce5bbd8530..ba4529ae06 100755 |
201 |
+--- a/Tools/ssl/multissltests.py |
202 |
++++ b/Tools/ssl/multissltests.py |
203 |
+@@ -57,8 +57,9 @@ LIBRESSL_OLD_VERSIONS = [ |
204 |
+ ] |
205 |
+ |
206 |
+ LIBRESSL_RECENT_VERSIONS = [ |
207 |
+- "2.5.3", |
208 |
+ "2.5.5", |
209 |
++ "2.6.4", |
210 |
++ "2.7.1", |
211 |
+ ] |
212 |
+ |
213 |
+ # store files in ../multissl |
214 |
+-- |
215 |
+2.17.0 |
216 |
+ |
217 |
|
218 |
diff --git a/dev-lang/python/python-3.6.5-r1.ebuild b/dev-lang/python/python-3.6.5-r1.ebuild |
219 |
index b23636b07f..bc82204e5a 100644 |
220 |
--- a/dev-lang/python/python-3.6.5-r1.ebuild |
221 |
+++ b/dev-lang/python/python-3.6.5-r1.ebuild |
222 |
@@ -8,7 +8,7 @@ inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs epatch |
223 |
|
224 |
MY_P="Python-${PV}" |
225 |
PATCHSET_VERSION="3.6.4" |
226 |
-PREFIX_PATCHREV="3.6.3-gentoo-patches-r0" |
227 |
+PREFIX_PATCHREV="3.6.5-gentoo-patches-r0" |
228 |
|
229 |
DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
230 |
HOMEPAGE="https://www.python.org/" |
231 |
@@ -77,7 +77,6 @@ src_prepare() { |
232 |
default |
233 |
|
234 |
# Prefix' round of patches |
235 |
- # http://prefix.gentooexperimental.org:8000/python-patches-3_3 |
236 |
EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
237 |
epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV} |