Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/mgorny:master commit in: dev-binpkg/pypy3/, dev-binpkg/pypy3/files/, dev-python/pypy3-binpackage/, ...
Date: Wed, 02 Mar 2016 16:01:56
Message-Id: 1456934496.1ccca16c532cd3f8d17b2a3a29e5a9c9661749f7.mgorny@gentoo
1 commit: 1ccca16c532cd3f8d17b2a3a29e5a9c9661749f7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 2 16:01:36 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 2 16:01:36 2016 +0000
6 URL: https://gitweb.gentoo.org/dev/mgorny.git/commit/?id=1ccca16c
7
8 dev-binpkg/pypy3: Update
9
10 .../pypy3-binpackage => dev-binpkg/pypy3}/Manifest | 0
11 .../pypy3}/files/2.3.1-shared-lib.patch | 0
12 dev-binpkg/pypy3/files/pypy3-2.4.0-gcc-4.9.patch | 26 +++
13 dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch | 187 +++++++++++++++++++++
14 .../pypy3}/metadata.xml | 0
15 .../pypy3/pypy3-2.4.0.ebuild | 38 +++--
16 ....UnixCCompiler.runtime_library_dir_option.patch | 11 --
17 .../files/1.9-scripts-location.patch | 11 --
18 8 files changed, 233 insertions(+), 40 deletions(-)
19
20 diff --git a/dev-python/pypy3-binpackage/Manifest b/dev-binpkg/pypy3/Manifest
21 similarity index 100%
22 rename from dev-python/pypy3-binpackage/Manifest
23 rename to dev-binpkg/pypy3/Manifest
24
25 diff --git a/dev-python/pypy3-binpackage/files/2.3.1-shared-lib.patch b/dev-binpkg/pypy3/files/2.3.1-shared-lib.patch
26 similarity index 100%
27 rename from dev-python/pypy3-binpackage/files/2.3.1-shared-lib.patch
28 rename to dev-binpkg/pypy3/files/2.3.1-shared-lib.patch
29
30 diff --git a/dev-binpkg/pypy3/files/pypy3-2.4.0-gcc-4.9.patch b/dev-binpkg/pypy3/files/pypy3-2.4.0-gcc-4.9.patch
31 new file mode 100644
32 index 0000000..dd3a688
33 --- /dev/null
34 +++ b/dev-binpkg/pypy3/files/pypy3-2.4.0-gcc-4.9.patch
35 @@ -0,0 +1,26 @@
36 +Description: Expect cmovnb and jnb
37 + Fixes an FTBFS since gcc 4.9.2, which is emmiting new operations
38 +Author: Stefano Rivera <stefanor@××××××.org>
39 +Forwarded: https://bitbucket.org/pypy/pypy/commits/c1abec418acf30bb04891c3249bc12cbe8f48d4a
40 +Bug-Debian: https://bugs.debian.org/771137
41 +Last-Update: 2014-11-26
42 +
43 +--- a/rpython/translator/c/gcc/trackgcroot.py
44 ++++ b/rpython/translator/c/gcc/trackgcroot.py
45 +@@ -590,7 +590,7 @@
46 +
47 + # The various cmov* operations
48 + for name in '''
49 +- e ne g ge l le a ae b be p np s ns o no
50 ++ e ne g ge l le a ae b be nb p np s ns o no
51 + '''.split():
52 + locals()['visit_cmov' + name] = binary_insn
53 + locals()['visit_cmov' + name + 'l'] = binary_insn
54 +@@ -837,6 +837,7 @@
55 + visit_jb = conditional_jump
56 + visit_jbe = conditional_jump
57 + visit_jp = conditional_jump
58 ++ visit_jnb = conditional_jump
59 + visit_jnp = conditional_jump
60 + visit_js = conditional_jump
61 + visit_jns = conditional_jump
62
63 diff --git a/dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch b/dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch
64 new file mode 100644
65 index 0000000..5852939
66 --- /dev/null
67 +++ b/dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch
68 @@ -0,0 +1,187 @@
69 +From 66bef80988c9efe60b61c6bc05f3206b4c3df7e8 Mon Sep 17 00:00:00 2001
70 +From: hasufell <hasufell@g.o>
71 +Date: Mon, 12 Oct 2015 20:43:50 +0200
72 +Subject: [PATCH] Add LibreSSL support, patches backported from upstream
73 +
74 +https://bitbucket.org/pypy/pypy/pull-requests/333/deal-with-platforms-without-rand_egd-take/diff
75 +---
76 + pypy/module/_ssl/interp_ssl.py | 34 +++++++++++++++-----------
77 + pypy/module/_ssl/test/test_ssl.py | 8 +++---
78 + rpython/rlib/ropenssl.py | 6 ++++-
79 + rpython/rtyper/tool/rffi_platform.py | 12 ++++++---
80 + rpython/rtyper/tool/test/test_rffi_platform.py | 24 +++++++++++++++++-
81 + 5 files changed, 61 insertions(+), 23 deletions(-)
82 +
83 +diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
84 +index 0cac165..f210167 100644
85 +--- a/pypy/module/_ssl/interp_ssl.py
86 ++++ b/pypy/module/_ssl/interp_ssl.py
87 +@@ -310,20 +310,26 @@ if HAVE_OPENSSL_RAND:
88 + res = libssl_RAND_status()
89 + return space.wrap(res)
90 +
91 +- @unwrap_spec(path=str)
92 +- def RAND_egd(space, path):
93 +- """RAND_egd(path) -> bytes
94 +-
95 +- Queries the entropy gather daemon (EGD) on socket path. Returns number
96 +- of bytes read. Raises socket.sslerror if connection to EGD fails or
97 +- if it does provide enough data to seed PRNG."""
98 +- with rffi.scoped_str2charp(path) as socket_path:
99 +- bytes = libssl_RAND_egd(socket_path)
100 +- if bytes == -1:
101 +- raise ssl_error(space,
102 +- "EGD connection failed or EGD did not return "
103 +- "enough data to seed the PRNG")
104 +- return space.wrap(bytes)
105 ++ if HAVE_OPENSSL_RAND_EGD:
106 ++ @unwrap_spec(path=str)
107 ++ def RAND_egd(space, path):
108 ++ """RAND_egd(path) -> bytes
109 ++
110 ++ Queries the entropy gather daemon (EGD) on socket path. Returns number
111 ++ of bytes read. Raises socket.sslerror if connection to EGD fails or
112 ++ if it does provide enough data to seed PRNG."""
113 ++ with rffi.scoped_str2charp(path) as socket_path:
114 ++ bytes = libssl_RAND_egd(socket_path)
115 ++ if bytes == -1:
116 ++ raise ssl_error(space,
117 ++ "EGD connection failed or EGD did not return "
118 ++ "enough data to seed the PRNG")
119 ++ return space.wrap(bytes)
120 ++ else:
121 ++ # Dummy func for platforms missing RAND_egd(). Most likely LibreSSL.
122 ++ @unwrap_spec(path=str)
123 ++ def RAND_egd(space, path):
124 ++ raise ssl_error(space, "RAND_egd unavailable")
125 +
126 +
127 + class SSLSocket(W_Root):
128 +diff --git a/pypy/module/_ssl/test/test_ssl.py b/pypy/module/_ssl/test/test_ssl.py
129 +index 3204610..9722fd5 100644
130 +--- a/pypy/module/_ssl/test/test_ssl.py
131 ++++ b/pypy/module/_ssl/test/test_ssl.py
132 +@@ -33,7 +33,8 @@ class AppTestSSL:
133 + assert isinstance(_ssl.OPENSSL_VERSION_INFO, tuple)
134 + assert len(_ssl.OPENSSL_VERSION_INFO) == 5
135 + assert isinstance(_ssl.OPENSSL_VERSION, str)
136 +- assert 'openssl' in _ssl.OPENSSL_VERSION.lower()
137 ++ lower_version = _ssl.OPENSSL_VERSION.lower()
138 ++ assert 'openssl' in lower_version or "libressl" in lower_version
139 +
140 + def test_RAND_add(self):
141 + import _ssl
142 +@@ -64,8 +65,9 @@ class AppTestSSL:
143 +
144 + def test_sslwrap(self):
145 + import ssl, _socket, sys, gc
146 +- if sys.platform == 'darwin' or 'freebsd' in sys.platform:
147 +- skip("hangs indefinitely on OSX & FreeBSD (also on CPython)")
148 ++ if sys.platform == 'darwin' or 'freebsd' in sys.platform or \
149 ++ 'openbsd' in sys.platform:
150 ++ skip("hangs indefinitely on OSX & BSD (also on CPython)")
151 + s = _socket.socket()
152 + ss = ssl.wrap_socket(s)
153 +
154 +diff --git a/rpython/rlib/ropenssl.py b/rpython/rlib/ropenssl.py
155 +index c36779d..6fe45d0 100644
156 +--- a/rpython/rlib/ropenssl.py
157 ++++ b/rpython/rlib/ropenssl.py
158 +@@ -168,6 +168,9 @@ OBJ_NAME = rffi.CArrayPtr(OBJ_NAME_st)
159 +
160 + HAVE_OPENSSL_RAND = OPENSSL_VERSION_NUMBER >= 0x0090500f
161 + HAVE_SSL_CTX_CLEAR_OPTIONS = OPENSSL_VERSION_NUMBER >= 0x009080df
162 ++HAVE_OPENSSL_RAND_EGD = rffi_platform.has('RAND_egd("/")',
163 ++ '#include <openssl/rand.h>',
164 ++ libraries=['ssl', 'crypto'])
165 +
166 + def external(name, argtypes, restype, **kw):
167 + kw['compilation_info'] = eci
168 +@@ -194,7 +197,8 @@ ssl_external('CRYPTO_set_id_callback',
169 + if HAVE_OPENSSL_RAND:
170 + ssl_external('RAND_add', [rffi.CCHARP, rffi.INT, rffi.DOUBLE], lltype.Void)
171 + ssl_external('RAND_status', [], rffi.INT)
172 +- ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT)
173 ++ if HAVE_OPENSSL_RAND_EGD:
174 ++ ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT)
175 + ssl_external('SSL_CTX_new', [SSL_METHOD], SSL_CTX)
176 + ssl_external('SSL_get_SSL_CTX', [SSL], SSL_CTX)
177 + ssl_external('TLSv1_method', [], SSL_METHOD)
178 +diff --git a/rpython/rtyper/tool/rffi_platform.py b/rpython/rtyper/tool/rffi_platform.py
179 +index 1760877..1d56c20 100755
180 +--- a/rpython/rtyper/tool/rffi_platform.py
181 ++++ b/rpython/rtyper/tool/rffi_platform.py
182 +@@ -17,12 +17,15 @@ from rpython.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong, intmask
183 + #
184 + # Helpers for simple cases
185 +
186 +-def eci_from_header(c_header_source, include_dirs=None):
187 ++def eci_from_header(c_header_source, include_dirs=None, libraries=None):
188 + if include_dirs is None:
189 + include_dirs = []
190 ++ if libraries is None:
191 ++ libraries = []
192 + return ExternalCompilationInfo(
193 + post_include_bits=[c_header_source],
194 +- include_dirs=include_dirs
195 ++ include_dirs=include_dirs,
196 ++ libraries=libraries,
197 + )
198 +
199 + def getstruct(name, c_header_source, interesting_fields):
200 +@@ -75,9 +78,10 @@ def getintegerfunctionresult(function, args=None, c_header_source='', includes=[
201 + CConfig._compilation_info_.includes = includes
202 + return configure(CConfig)['RESULT']
203 +
204 +-def has(name, c_header_source, include_dirs=None):
205 ++def has(name, c_header_source, include_dirs=None, libraries=None):
206 + class CConfig:
207 +- _compilation_info_ = eci_from_header(c_header_source, include_dirs)
208 ++ _compilation_info_ = \
209 ++ eci_from_header(c_header_source, include_dirs, libraries)
210 + HAS = Has(name)
211 + return configure(CConfig)['HAS']
212 +
213 +diff --git a/rpython/rtyper/tool/test/test_rffi_platform.py b/rpython/rtyper/tool/test/test_rffi_platform.py
214 +index bfa069e..4feae87 100644
215 +--- a/rpython/rtyper/tool/test/test_rffi_platform.py
216 ++++ b/rpython/rtyper/tool/test/test_rffi_platform.py
217 +@@ -271,12 +271,34 @@ def test_array():
218 + [("d_name", lltype.FixedSizeArray(rffi.CHAR, 1))])
219 + assert dirent.c_d_name.length == 32
220 +
221 +-def test_has():
222 ++def test_has_0001():
223 + assert rffi_platform.has("x", "int x = 3;")
224 + assert not rffi_platform.has("x", "")
225 + # has() should also not crash if it is given an invalid #include
226 + assert not rffi_platform.has("x", "#include <some/path/which/cannot/exist>")
227 +
228 ++def test_has_0002():
229 ++ assert rffi_platform.has("pow", "#include <math.h>", libraries=["m"])
230 ++
231 ++def test_has_0003():
232 ++ """multiple libraries"""
233 ++ assert rffi_platform.has("pow", "#include <math.h>", libraries=["m", "c"])
234 ++
235 ++def test_has_0004():
236 ++ """bogus symbol name"""
237 ++ assert not rffi_platform.has("pow", "#include <math.h>",
238 ++ libraries=["boguslibname"])
239 ++
240 ++def test_has_0005():
241 ++ """bogus symbol name and lib name"""
242 ++ assert not rffi_platform.has("bogus_symbol_name", "#include <math.h>",
243 ++ libraries=["boguslibname"])
244 ++
245 ++def test_has_0006():
246 ++ """missing include"""
247 ++ assert not rffi_platform.has("pow", "", libraries=["m"])
248 ++
249 ++
250 + def test_verify_eci():
251 + eci = ExternalCompilationInfo()
252 + rffi_platform.verify_eci(eci)
253 +--
254 +2.6.1
255 +
256
257 diff --git a/dev-python/pypy3-binpackage/metadata.xml b/dev-binpkg/pypy3/metadata.xml
258 similarity index 100%
259 rename from dev-python/pypy3-binpackage/metadata.xml
260 rename to dev-binpkg/pypy3/metadata.xml
261
262 diff --git a/dev-python/pypy3-binpackage/pypy3-binpackage-2.4.0.ebuild b/dev-binpkg/pypy3/pypy3-2.4.0.ebuild
263 similarity index 82%
264 rename from dev-python/pypy3-binpackage/pypy3-binpackage-2.4.0.ebuild
265 rename to dev-binpkg/pypy3/pypy3-2.4.0.ebuild
266 index a505b12..b44ac88 100644
267 --- a/dev-python/pypy3-binpackage/pypy3-binpackage-2.4.0.ebuild
268 +++ b/dev-binpkg/pypy3/pypy3-2.4.0.ebuild
269 @@ -1,6 +1,6 @@
270 -# Copyright 1999-2014 Gentoo Foundation
271 +# Copyright 1999-2015 Gentoo Foundation
272 # Distributed under the terms of the GNU General Public License v2
273 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-2.2.1.ebuild,v 1.2 2014/03/12 09:14:21 mgorny Exp $
274 +# $Id$
275
276 EAPI=5
277
278 @@ -8,16 +8,15 @@ EAPI=5
279 PYTHON_COMPAT=( python2_7 pypy )
280 inherit check-reqs eutils multilib multiprocessing pax-utils \
281 python-any-r1 toolchain-funcs versionator
282 -MY_P=pypy3-${PV}
283
284 -DESCRIPTION="A fast, compliant alternative implementation of the Python language"
285 +DESCRIPTION="A fast, compliant alternative implementation of Python 3"
286 HOMEPAGE="http://pypy.org/"
287 -SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
288 +SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${P}-src.tar.bz2"
289
290 LICENSE="MIT"
291 SLOT="0/$(get_version_component_range 1-2 ${PV})"
292 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
293 -IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack sse2"
294 +IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack cpu_flags_x86_sse2"
295
296 DEPEND=">=sys-libs/zlib-1.1.3
297 virtual/libffi
298 @@ -30,15 +29,17 @@ DEPEND=">=sys-libs/zlib-1.1.3
299 low-memory? ( virtual/pypy:0 )
300 !low-memory? ( ${PYTHON_DEPS} )"
301
302 -S="${WORKDIR}/${MY_P}-src"
303 +S="${WORKDIR}/${P}-src"
304
305 pkg_pretend() {
306 - if use low-memory; then
307 - CHECKREQS_MEMORY="1750M"
308 - use amd64 && CHECKREQS_MEMORY="3500M"
309 - else
310 - CHECKREQS_MEMORY="3G"
311 - use amd64 && CHECKREQS_MEMORY="6G"
312 + if [[ ${MERGE_TYPE} != binary ]]; then
313 + if use low-memory; then
314 + CHECKREQS_MEMORY="1750M"
315 + use amd64 && CHECKREQS_MEMORY="3500M"
316 + else
317 + CHECKREQS_MEMORY="3G"
318 + use amd64 && CHECKREQS_MEMORY="6G"
319 + fi
320 fi
321
322 check-reqs_pkg_pretend
323 @@ -85,9 +86,10 @@ pkg_setup() {
324 }
325
326 src_prepare() {
327 - epatch "${FILESDIR}/1.9-scripts-location.patch" \
328 - "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
329 + epatch \
330 + "${FILESDIR}"/${P}-gcc-4.9.patch \
331 "${FILESDIR}"/2.3.1-shared-lib.patch # 517002
332 + epatch "${FILESDIR}"/${PN}-2.4.0-libressl.patch
333
334 epatch_user
335 }
336 @@ -105,7 +107,7 @@ src_compile() {
337 # the modern values...
338
339 if use x86; then
340 - if use sse2; then
341 + if use cpu_flags_x86_sse2; then
342 jit_backend+=x86
343 else
344 jit_backend+=x86-without-sse2
345 @@ -158,11 +160,11 @@ src_compile() {
346
347 src_install() {
348 local flags=( bzip2 jit ncurses sandbox shadowstack )
349 - use x86 && flags+=( sse2 )
350 + use x86 && flags+=( cpu_flags_x86_sse2 )
351 local f suffix="-${ARCH}"
352
353 for f in ${flags[@]}; do
354 - use ${f} && suffix+="+${f}"
355 + use ${f} && suffix+="+${f#cpu_flags_x86_}"
356 done
357
358 local BIN_P=pypy3-bin-${PV}
359
360 diff --git a/dev-python/pypy3-binpackage/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch b/dev-python/pypy3-binpackage/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
361 deleted file mode 100644
362 index 29d99dc..0000000
363 --- a/dev-python/pypy3-binpackage/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
364 +++ /dev/null
365 @@ -1,11 +0,0 @@
366 ---- a/lib-python/3/distutils/unixccompiler.py
367 -+++ b/lib-python/3/distutils/unixccompiler.py
368 -@@ -297,7 +297,7 @@
369 - # this time, there's no way to determine this information from
370 - # the configuration data stored in the Python installation, so
371 - # we use this hack.
372 -- compiler = os.path.basename(sysconfig.get_config_var("CC"))
373 -+ compiler = os.path.basename(self.compiler[0])
374 - if sys.platform[:6] == "darwin":
375 - # MacOSX's linker doesn't understand the -R flag at all
376 - return "-L" + dir
377
378 diff --git a/dev-python/pypy3-binpackage/files/1.9-scripts-location.patch b/dev-python/pypy3-binpackage/files/1.9-scripts-location.patch
379 deleted file mode 100644
380 index 6ed1285..0000000
381 --- a/dev-python/pypy3-binpackage/files/1.9-scripts-location.patch
382 +++ /dev/null
383 @@ -1,11 +0,0 @@
384 ---- a/lib-python/3/distutils/command/install.py
385 -+++ b/lib-python/3/distutils/command/install.py
386 -@@ -87,7 +87,7 @@
387 - 'purelib': '$base/site-packages',
388 - 'platlib': '$base/site-packages',
389 - 'headers': '$base/include',
390 -- 'scripts': '$base/bin',
391 -+ 'scripts': '/usr/bin',
392 - 'data' : '$base',
393 - },
394 - }