1 |
commit: a85aadd9f207634b86ae7aac4c99b698c9f772e0 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 3 09:51:14 2016 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 3 10:47:37 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a85aadd9 |
7 |
|
8 |
dev-python/pypy3-bin: Copy patches from dev-python/pypy3 |
9 |
|
10 |
.../files/2.4.0-21_all_distutils_c++.patch | 251 +++++++++++++++++++++ |
11 |
.../pypy3-bin/files/pypy3-2.4.0-libressl.patch | 187 +++++++++++++++ |
12 |
dev-python/pypy3-bin/pypy3-bin-2.4.0-r4.ebuild | 13 +- |
13 |
3 files changed, 448 insertions(+), 3 deletions(-) |
14 |
|
15 |
diff --git a/dev-python/pypy3-bin/files/2.4.0-21_all_distutils_c++.patch b/dev-python/pypy3-bin/files/2.4.0-21_all_distutils_c++.patch |
16 |
new file mode 100644 |
17 |
index 0000000..90525d5 |
18 |
--- /dev/null |
19 |
+++ b/dev-python/pypy3-bin/files/2.4.0-21_all_distutils_c++.patch |
20 |
@@ -0,0 +1,251 @@ |
21 |
+http://bugs.python.org/issue1222585 |
22 |
+ |
23 |
+--- Lib/distutils/cygwinccompiler.py |
24 |
++++ Lib/distutils/cygwinccompiler.py |
25 |
+@@ -136,9 +136,13 @@ |
26 |
+ self.set_executables(compiler='gcc -mcygwin -O -Wall', |
27 |
+ compiler_so='gcc -mcygwin -mdll -O -Wall', |
28 |
+ compiler_cxx='g++ -mcygwin -O -Wall', |
29 |
++ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall', |
30 |
+ linker_exe='gcc -mcygwin', |
31 |
+ linker_so=('%s -mcygwin %s' % |
32 |
+- (self.linker_dll, shared_option))) |
33 |
++ (self.linker_dll, shared_option)), |
34 |
++ linker_exe_cxx='g++ -mcygwin', |
35 |
++ linker_so_cxx=('%s -mcygwin %s' % |
36 |
++ (self.linker_dll, shared_option))) |
37 |
+ |
38 |
+ # cygwin and mingw32 need different sets of libraries |
39 |
+ if self.gcc_version == "2.91.57": |
40 |
+@@ -162,8 +166,12 @@ |
41 |
+ raise CompileError(msg) |
42 |
+ else: # for other files use the C-compiler |
43 |
+ try: |
44 |
+- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + |
45 |
+- extra_postargs) |
46 |
++ if self.detect_language(src) == 'c++': |
47 |
++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + |
48 |
++ extra_postargs) |
49 |
++ else: |
50 |
++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + |
51 |
++ extra_postargs) |
52 |
+ except DistutilsExecError as msg: |
53 |
+ raise CompileError(msg) |
54 |
+ |
55 |
+@@ -294,10 +302,15 @@ |
56 |
+ self.set_executables(compiler='gcc -mno-cygwin -O -Wall', |
57 |
+ compiler_so='gcc -mno-cygwin -mdll -O -Wall', |
58 |
+ compiler_cxx='g++ -mno-cygwin -O -Wall', |
59 |
++ compiler_so_cxx='g++ -mno-cygwin -mdll -O -Wall', |
60 |
+ linker_exe='gcc -mno-cygwin', |
61 |
+ linker_so='%s -mno-cygwin %s %s' |
62 |
+ % (self.linker_dll, shared_option, |
63 |
+- entry_point)) |
64 |
++ entry_point), |
65 |
++ linker_exe_cxx='g++ -mno-cygwin', |
66 |
++ linker_so_cxx='%s -mno-cygwin %s %s' |
67 |
++ % (self.linker_dll, shared_option, |
68 |
++ entry_point)) |
69 |
+ # Maybe we should also append -mthreads, but then the finished |
70 |
+ # dlls need another dll (mingwm10.dll see Mingw32 docs) |
71 |
+ # (-mthreads: Support thread-safe exception handling on `Mingw32') |
72 |
+--- Lib/distutils/emxccompiler.py |
73 |
++++ Lib/distutils/emxccompiler.py |
74 |
+@@ -63,8 +63,12 @@ |
75 |
+ # XXX optimization, warnings etc. should be customizable. |
76 |
+ self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', |
77 |
+ compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', |
78 |
++ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', |
79 |
++ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', |
80 |
+ linker_exe='gcc -Zomf -Zmt -Zcrtdll', |
81 |
+- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll') |
82 |
++ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll', |
83 |
++ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll', |
84 |
++ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll') |
85 |
+ |
86 |
+ # want the gcc library statically linked (so that we don't have |
87 |
+ # to distribute a version dependent on the compiler we have) |
88 |
+@@ -81,8 +85,12 @@ |
89 |
+ raise CompileError(msg) |
90 |
+ else: # for other files use the C-compiler |
91 |
+ try: |
92 |
+- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + |
93 |
+- extra_postargs) |
94 |
++ if self.detect_language(src) == 'c++': |
95 |
++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + |
96 |
++ extra_postargs) |
97 |
++ else: |
98 |
++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + |
99 |
++ extra_postargs) |
100 |
+ except DistutilsExecError as msg: |
101 |
+ raise CompileError(msg) |
102 |
+ |
103 |
+--- Lib/distutils/sysconfig_cpython.py |
104 |
++++ Lib/distutils/sysconfig_cpython.py |
105 |
+@@ -170,9 +170,12 @@ |
106 |
+ _osx_support.customize_compiler(_config_vars) |
107 |
+ _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' |
108 |
+ |
109 |
+- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ |
110 |
+- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', |
111 |
+- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') |
112 |
++ (cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \ |
113 |
++ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', |
114 |
++ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') |
115 |
++ |
116 |
++ cflags = '' |
117 |
++ cxxflags = '' |
118 |
+ |
119 |
+ newcc = None |
120 |
+ if 'CC' in os.environ: |
121 |
+@@ -181,19 +184,27 @@ |
122 |
+ cxx = os.environ['CXX'] |
123 |
+ if 'LDSHARED' in os.environ: |
124 |
+ ldshared = os.environ['LDSHARED'] |
125 |
++ if 'LDCXXSHARED' in os.environ: |
126 |
++ ldcxxshared = os.environ['LDCXXSHARED'] |
127 |
+ if 'CPP' in os.environ: |
128 |
+ cpp = os.environ['CPP'] |
129 |
+ else: |
130 |
+ cpp = cc + " -E" # not always |
131 |
+ if 'LDFLAGS' in os.environ: |
132 |
+ ldshared = ldshared + ' ' + os.environ['LDFLAGS'] |
133 |
++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] |
134 |
+ if 'CFLAGS' in os.environ: |
135 |
+- cflags = opt + ' ' + os.environ['CFLAGS'] |
136 |
++ cflags = os.environ['CFLAGS'] |
137 |
+ ldshared = ldshared + ' ' + os.environ['CFLAGS'] |
138 |
++ if 'CXXFLAGS' in os.environ: |
139 |
++ cxxflags = os.environ['CXXFLAGS'] |
140 |
++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] |
141 |
+ if 'CPPFLAGS' in os.environ: |
142 |
+ cpp = cpp + ' ' + os.environ['CPPFLAGS'] |
143 |
+ cflags = cflags + ' ' + os.environ['CPPFLAGS'] |
144 |
++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] |
145 |
+ ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] |
146 |
++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] |
147 |
+ if 'AR' in os.environ: |
148 |
+ ar = os.environ['AR'] |
149 |
+ if 'ARFLAGS' in os.environ: |
150 |
+@@ -202,13 +213,17 @@ |
151 |
+ archiver = ar + ' ' + ar_flags |
152 |
+ |
153 |
+ cc_cmd = cc + ' ' + cflags |
154 |
++ cxx_cmd = cxx + ' ' + cxxflags |
155 |
+ compiler.set_executables( |
156 |
+ preprocessor=cpp, |
157 |
+ compiler=cc_cmd, |
158 |
+ compiler_so=cc_cmd + ' ' + ccshared, |
159 |
+- compiler_cxx=cxx, |
160 |
++ compiler_cxx=cxx_cmd, |
161 |
++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, |
162 |
+ linker_so=ldshared, |
163 |
+ linker_exe=cc, |
164 |
++ linker_so_cxx=ldcxxshared, |
165 |
++ linker_exe_cxx=cxx, |
166 |
+ archiver=archiver) |
167 |
+ |
168 |
+ compiler.shared_lib_extension = shlib_suffix |
169 |
+--- Lib/distutils/unixccompiler.py |
170 |
++++ Lib/distutils/unixccompiler.py |
171 |
+@@ -52,14 +52,17 @@ |
172 |
+ # are pretty generic; they will probably have to be set by an outsider |
173 |
+ # (eg. using information discovered by the sysconfig about building |
174 |
+ # Python extensions). |
175 |
+- executables = {'preprocessor' : None, |
176 |
+- 'compiler' : ["cc"], |
177 |
+- 'compiler_so' : ["cc"], |
178 |
+- 'compiler_cxx' : ["cc"], |
179 |
+- 'linker_so' : ["cc", "-shared"], |
180 |
+- 'linker_exe' : ["cc"], |
181 |
+- 'archiver' : ["ar", "-cr"], |
182 |
+- 'ranlib' : None, |
183 |
++ executables = {'preprocessor' : None, |
184 |
++ 'compiler' : ["cc"], |
185 |
++ 'compiler_so' : ["cc"], |
186 |
++ 'compiler_cxx' : ["c++"], |
187 |
++ 'compiler_so_cxx' : ["c++"], |
188 |
++ 'linker_so' : ["cc", "-shared"], |
189 |
++ 'linker_exe' : ["cc"], |
190 |
++ 'linker_so_cxx' : ["c++", "-shared"], |
191 |
++ 'linker_exe_cxx' : ["c++"], |
192 |
++ 'archiver' : ["ar", "-cr"], |
193 |
++ 'ranlib' : None, |
194 |
+ } |
195 |
+ |
196 |
+ if sys.platform[:6] == "darwin": |
197 |
+@@ -108,12 +111,19 @@ |
198 |
+ |
199 |
+ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): |
200 |
+ compiler_so = self.compiler_so |
201 |
++ compiler_so_cxx = self.compiler_so_cxx |
202 |
+ if sys.platform == 'darwin': |
203 |
+ compiler_so = _osx_support.compiler_fixup(compiler_so, |
204 |
+ cc_args + extra_postargs) |
205 |
++ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, |
206 |
++ cc_args + extra_postargs) |
207 |
+ try: |
208 |
+- self.spawn(compiler_so + cc_args + [src, '-o', obj] + |
209 |
+- extra_postargs) |
210 |
++ if self.detect_language(src) == 'c++': |
211 |
++ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + |
212 |
++ extra_postargs) |
213 |
++ else: |
214 |
++ self.spawn(compiler_so + cc_args + [src, '-o', obj] + |
215 |
++ extra_postargs) |
216 |
+ except DistutilsExecError as msg: |
217 |
+ raise CompileError(msg) |
218 |
+ |
219 |
+@@ -171,22 +181,16 @@ |
220 |
+ ld_args.extend(extra_postargs) |
221 |
+ self.mkpath(os.path.dirname(output_filename)) |
222 |
+ try: |
223 |
+- if target_desc == CCompiler.EXECUTABLE: |
224 |
+- linker = self.linker_exe[:] |
225 |
++ if target_lang == "c++": |
226 |
++ if target_desc == CCompiler.EXECUTABLE: |
227 |
++ linker = self.linker_exe_cxx[:] |
228 |
++ else: |
229 |
++ linker = self.linker_so_cxx[:] |
230 |
+ else: |
231 |
+- linker = self.linker_so[:] |
232 |
+- if target_lang == "c++" and self.compiler_cxx: |
233 |
+- # skip over environment variable settings if /usr/bin/env |
234 |
+- # is used to set up the linker's environment. |
235 |
+- # This is needed on OSX. Note: this assumes that the |
236 |
+- # normal and C++ compiler have the same environment |
237 |
+- # settings. |
238 |
+- i = 0 |
239 |
+- if os.path.basename(linker[0]) == "env": |
240 |
+- i = 1 |
241 |
+- while '=' in linker[i]: |
242 |
+- i += 1 |
243 |
+- linker[i] = self.compiler_cxx[i] |
244 |
++ if target_desc == CCompiler.EXECUTABLE: |
245 |
++ linker = self.linker_exe[:] |
246 |
++ else: |
247 |
++ linker = self.linker_so[:] |
248 |
+ |
249 |
+ if sys.platform == 'darwin': |
250 |
+ linker = _osx_support.compiler_fixup(linker, ld_args) |
251 |
+--- Lib/_osx_support.py |
252 |
++++ Lib/_osx_support.py |
253 |
+@@ -14,13 +14,13 @@ |
254 |
+ # configuration variables that may contain universal build flags, |
255 |
+ # like "-arch" or "-isdkroot", that may need customization for |
256 |
+ # the user environment |
257 |
+-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', |
258 |
+- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', |
259 |
+- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', |
260 |
+- 'PY_CORE_CFLAGS') |
261 |
++_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS', |
262 |
++ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED', |
263 |
++ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', |
264 |
++ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS') |
265 |
+ |
266 |
+ # configuration variables that may contain compiler calls |
267 |
+-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') |
268 |
++_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX') |
269 |
+ |
270 |
+ # prefix added to original configuration variable names |
271 |
+ _INITPRE = '_OSX_SUPPORT_INITIAL_' |
272 |
|
273 |
diff --git a/dev-python/pypy3-bin/files/pypy3-2.4.0-libressl.patch b/dev-python/pypy3-bin/files/pypy3-2.4.0-libressl.patch |
274 |
new file mode 100644 |
275 |
index 0000000..5852939 |
276 |
--- /dev/null |
277 |
+++ b/dev-python/pypy3-bin/files/pypy3-2.4.0-libressl.patch |
278 |
@@ -0,0 +1,187 @@ |
279 |
+From 66bef80988c9efe60b61c6bc05f3206b4c3df7e8 Mon Sep 17 00:00:00 2001 |
280 |
+From: hasufell <hasufell@g.o> |
281 |
+Date: Mon, 12 Oct 2015 20:43:50 +0200 |
282 |
+Subject: [PATCH] Add LibreSSL support, patches backported from upstream |
283 |
+ |
284 |
+https://bitbucket.org/pypy/pypy/pull-requests/333/deal-with-platforms-without-rand_egd-take/diff |
285 |
+--- |
286 |
+ pypy/module/_ssl/interp_ssl.py | 34 +++++++++++++++----------- |
287 |
+ pypy/module/_ssl/test/test_ssl.py | 8 +++--- |
288 |
+ rpython/rlib/ropenssl.py | 6 ++++- |
289 |
+ rpython/rtyper/tool/rffi_platform.py | 12 ++++++--- |
290 |
+ rpython/rtyper/tool/test/test_rffi_platform.py | 24 +++++++++++++++++- |
291 |
+ 5 files changed, 61 insertions(+), 23 deletions(-) |
292 |
+ |
293 |
+diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py |
294 |
+index 0cac165..f210167 100644 |
295 |
+--- a/pypy/module/_ssl/interp_ssl.py |
296 |
++++ b/pypy/module/_ssl/interp_ssl.py |
297 |
+@@ -310,20 +310,26 @@ if HAVE_OPENSSL_RAND: |
298 |
+ res = libssl_RAND_status() |
299 |
+ return space.wrap(res) |
300 |
+ |
301 |
+- @unwrap_spec(path=str) |
302 |
+- def RAND_egd(space, path): |
303 |
+- """RAND_egd(path) -> bytes |
304 |
+- |
305 |
+- Queries the entropy gather daemon (EGD) on socket path. Returns number |
306 |
+- of bytes read. Raises socket.sslerror if connection to EGD fails or |
307 |
+- if it does provide enough data to seed PRNG.""" |
308 |
+- with rffi.scoped_str2charp(path) as socket_path: |
309 |
+- bytes = libssl_RAND_egd(socket_path) |
310 |
+- if bytes == -1: |
311 |
+- raise ssl_error(space, |
312 |
+- "EGD connection failed or EGD did not return " |
313 |
+- "enough data to seed the PRNG") |
314 |
+- return space.wrap(bytes) |
315 |
++ if HAVE_OPENSSL_RAND_EGD: |
316 |
++ @unwrap_spec(path=str) |
317 |
++ def RAND_egd(space, path): |
318 |
++ """RAND_egd(path) -> bytes |
319 |
++ |
320 |
++ Queries the entropy gather daemon (EGD) on socket path. Returns number |
321 |
++ of bytes read. Raises socket.sslerror if connection to EGD fails or |
322 |
++ if it does provide enough data to seed PRNG.""" |
323 |
++ with rffi.scoped_str2charp(path) as socket_path: |
324 |
++ bytes = libssl_RAND_egd(socket_path) |
325 |
++ if bytes == -1: |
326 |
++ raise ssl_error(space, |
327 |
++ "EGD connection failed or EGD did not return " |
328 |
++ "enough data to seed the PRNG") |
329 |
++ return space.wrap(bytes) |
330 |
++ else: |
331 |
++ # Dummy func for platforms missing RAND_egd(). Most likely LibreSSL. |
332 |
++ @unwrap_spec(path=str) |
333 |
++ def RAND_egd(space, path): |
334 |
++ raise ssl_error(space, "RAND_egd unavailable") |
335 |
+ |
336 |
+ |
337 |
+ class SSLSocket(W_Root): |
338 |
+diff --git a/pypy/module/_ssl/test/test_ssl.py b/pypy/module/_ssl/test/test_ssl.py |
339 |
+index 3204610..9722fd5 100644 |
340 |
+--- a/pypy/module/_ssl/test/test_ssl.py |
341 |
++++ b/pypy/module/_ssl/test/test_ssl.py |
342 |
+@@ -33,7 +33,8 @@ class AppTestSSL: |
343 |
+ assert isinstance(_ssl.OPENSSL_VERSION_INFO, tuple) |
344 |
+ assert len(_ssl.OPENSSL_VERSION_INFO) == 5 |
345 |
+ assert isinstance(_ssl.OPENSSL_VERSION, str) |
346 |
+- assert 'openssl' in _ssl.OPENSSL_VERSION.lower() |
347 |
++ lower_version = _ssl.OPENSSL_VERSION.lower() |
348 |
++ assert 'openssl' in lower_version or "libressl" in lower_version |
349 |
+ |
350 |
+ def test_RAND_add(self): |
351 |
+ import _ssl |
352 |
+@@ -64,8 +65,9 @@ class AppTestSSL: |
353 |
+ |
354 |
+ def test_sslwrap(self): |
355 |
+ import ssl, _socket, sys, gc |
356 |
+- if sys.platform == 'darwin' or 'freebsd' in sys.platform: |
357 |
+- skip("hangs indefinitely on OSX & FreeBSD (also on CPython)") |
358 |
++ if sys.platform == 'darwin' or 'freebsd' in sys.platform or \ |
359 |
++ 'openbsd' in sys.platform: |
360 |
++ skip("hangs indefinitely on OSX & BSD (also on CPython)") |
361 |
+ s = _socket.socket() |
362 |
+ ss = ssl.wrap_socket(s) |
363 |
+ |
364 |
+diff --git a/rpython/rlib/ropenssl.py b/rpython/rlib/ropenssl.py |
365 |
+index c36779d..6fe45d0 100644 |
366 |
+--- a/rpython/rlib/ropenssl.py |
367 |
++++ b/rpython/rlib/ropenssl.py |
368 |
+@@ -168,6 +168,9 @@ OBJ_NAME = rffi.CArrayPtr(OBJ_NAME_st) |
369 |
+ |
370 |
+ HAVE_OPENSSL_RAND = OPENSSL_VERSION_NUMBER >= 0x0090500f |
371 |
+ HAVE_SSL_CTX_CLEAR_OPTIONS = OPENSSL_VERSION_NUMBER >= 0x009080df |
372 |
++HAVE_OPENSSL_RAND_EGD = rffi_platform.has('RAND_egd("/")', |
373 |
++ '#include <openssl/rand.h>', |
374 |
++ libraries=['ssl', 'crypto']) |
375 |
+ |
376 |
+ def external(name, argtypes, restype, **kw): |
377 |
+ kw['compilation_info'] = eci |
378 |
+@@ -194,7 +197,8 @@ ssl_external('CRYPTO_set_id_callback', |
379 |
+ if HAVE_OPENSSL_RAND: |
380 |
+ ssl_external('RAND_add', [rffi.CCHARP, rffi.INT, rffi.DOUBLE], lltype.Void) |
381 |
+ ssl_external('RAND_status', [], rffi.INT) |
382 |
+- ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT) |
383 |
++ if HAVE_OPENSSL_RAND_EGD: |
384 |
++ ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT) |
385 |
+ ssl_external('SSL_CTX_new', [SSL_METHOD], SSL_CTX) |
386 |
+ ssl_external('SSL_get_SSL_CTX', [SSL], SSL_CTX) |
387 |
+ ssl_external('TLSv1_method', [], SSL_METHOD) |
388 |
+diff --git a/rpython/rtyper/tool/rffi_platform.py b/rpython/rtyper/tool/rffi_platform.py |
389 |
+index 1760877..1d56c20 100755 |
390 |
+--- a/rpython/rtyper/tool/rffi_platform.py |
391 |
++++ b/rpython/rtyper/tool/rffi_platform.py |
392 |
+@@ -17,12 +17,15 @@ from rpython.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong, intmask |
393 |
+ # |
394 |
+ # Helpers for simple cases |
395 |
+ |
396 |
+-def eci_from_header(c_header_source, include_dirs=None): |
397 |
++def eci_from_header(c_header_source, include_dirs=None, libraries=None): |
398 |
+ if include_dirs is None: |
399 |
+ include_dirs = [] |
400 |
++ if libraries is None: |
401 |
++ libraries = [] |
402 |
+ return ExternalCompilationInfo( |
403 |
+ post_include_bits=[c_header_source], |
404 |
+- include_dirs=include_dirs |
405 |
++ include_dirs=include_dirs, |
406 |
++ libraries=libraries, |
407 |
+ ) |
408 |
+ |
409 |
+ def getstruct(name, c_header_source, interesting_fields): |
410 |
+@@ -75,9 +78,10 @@ def getintegerfunctionresult(function, args=None, c_header_source='', includes=[ |
411 |
+ CConfig._compilation_info_.includes = includes |
412 |
+ return configure(CConfig)['RESULT'] |
413 |
+ |
414 |
+-def has(name, c_header_source, include_dirs=None): |
415 |
++def has(name, c_header_source, include_dirs=None, libraries=None): |
416 |
+ class CConfig: |
417 |
+- _compilation_info_ = eci_from_header(c_header_source, include_dirs) |
418 |
++ _compilation_info_ = \ |
419 |
++ eci_from_header(c_header_source, include_dirs, libraries) |
420 |
+ HAS = Has(name) |
421 |
+ return configure(CConfig)['HAS'] |
422 |
+ |
423 |
+diff --git a/rpython/rtyper/tool/test/test_rffi_platform.py b/rpython/rtyper/tool/test/test_rffi_platform.py |
424 |
+index bfa069e..4feae87 100644 |
425 |
+--- a/rpython/rtyper/tool/test/test_rffi_platform.py |
426 |
++++ b/rpython/rtyper/tool/test/test_rffi_platform.py |
427 |
+@@ -271,12 +271,34 @@ def test_array(): |
428 |
+ [("d_name", lltype.FixedSizeArray(rffi.CHAR, 1))]) |
429 |
+ assert dirent.c_d_name.length == 32 |
430 |
+ |
431 |
+-def test_has(): |
432 |
++def test_has_0001(): |
433 |
+ assert rffi_platform.has("x", "int x = 3;") |
434 |
+ assert not rffi_platform.has("x", "") |
435 |
+ # has() should also not crash if it is given an invalid #include |
436 |
+ assert not rffi_platform.has("x", "#include <some/path/which/cannot/exist>") |
437 |
+ |
438 |
++def test_has_0002(): |
439 |
++ assert rffi_platform.has("pow", "#include <math.h>", libraries=["m"]) |
440 |
++ |
441 |
++def test_has_0003(): |
442 |
++ """multiple libraries""" |
443 |
++ assert rffi_platform.has("pow", "#include <math.h>", libraries=["m", "c"]) |
444 |
++ |
445 |
++def test_has_0004(): |
446 |
++ """bogus symbol name""" |
447 |
++ assert not rffi_platform.has("pow", "#include <math.h>", |
448 |
++ libraries=["boguslibname"]) |
449 |
++ |
450 |
++def test_has_0005(): |
451 |
++ """bogus symbol name and lib name""" |
452 |
++ assert not rffi_platform.has("bogus_symbol_name", "#include <math.h>", |
453 |
++ libraries=["boguslibname"]) |
454 |
++ |
455 |
++def test_has_0006(): |
456 |
++ """missing include""" |
457 |
++ assert not rffi_platform.has("pow", "", libraries=["m"]) |
458 |
++ |
459 |
++ |
460 |
+ def test_verify_eci(): |
461 |
+ eci = ExternalCompilationInfo() |
462 |
+ rffi_platform.verify_eci(eci) |
463 |
+-- |
464 |
+2.6.1 |
465 |
+ |
466 |
|
467 |
diff --git a/dev-python/pypy3-bin/pypy3-bin-2.4.0-r4.ebuild b/dev-python/pypy3-bin/pypy3-bin-2.4.0-r4.ebuild |
468 |
index 2a4fa3e..adee3b6 100644 |
469 |
--- a/dev-python/pypy3-bin/pypy3-bin-2.4.0-r4.ebuild |
470 |
+++ b/dev-python/pypy3-bin/pypy3-bin-2.4.0-r4.ebuild |
471 |
@@ -82,14 +82,21 @@ QA_PREBUILT=" |
472 |
usr/lib*/pypy3/libpypy-c.so" |
473 |
|
474 |
src_prepare() { |
475 |
- epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \ |
476 |
- "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \ |
477 |
- "${FILESDIR}/2.4.0-ncurses6.patch" |
478 |
+ epatch \ |
479 |
+ "${FILESDIR}/4.0.0-gentoo-path.patch" \ |
480 |
+ "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" |
481 |
+ epatch "${FILESDIR}/2.4.0-ncurses6.patch" |
482 |
+ epatch "${FILESDIR}"/pypy3-2.4.0-libressl.patch |
483 |
|
484 |
sed -e "s^@EPREFIX@^${EPREFIX}^" \ |
485 |
-e "s^@libdir@^$(get_libdir)^" \ |
486 |
-i lib-python/3/distutils/command/install.py || die |
487 |
|
488 |
+ # apply CPython stdlib patches |
489 |
+ pushd lib-python/3 > /dev/null || die |
490 |
+ epatch "${FILESDIR}"/2.4.0-21_all_distutils_c++.patch |
491 |
+ popd > /dev/null || die |
492 |
+ |
493 |
epatch_user |
494 |
} |