summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-binpkg/pypy3/Manifest (renamed from dev-python/pypy3-binpackage/Manifest)0
-rw-r--r--dev-binpkg/pypy3/files/2.3.1-shared-lib.patch (renamed from dev-python/pypy3-binpackage/files/2.3.1-shared-lib.patch)0
-rw-r--r--dev-binpkg/pypy3/files/pypy3-2.4.0-gcc-4.9.patch26
-rw-r--r--dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch187
-rw-r--r--dev-binpkg/pypy3/metadata.xml (renamed from dev-python/pypy3-binpackage/metadata.xml)0
-rw-r--r--dev-binpkg/pypy3/pypy3-2.4.0.ebuild (renamed from dev-python/pypy3-binpackage/pypy3-binpackage-2.4.0.ebuild)38
-rw-r--r--dev-python/pypy3-binpackage/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch11
-rw-r--r--dev-python/pypy3-binpackage/files/1.9-scripts-location.patch11
8 files changed, 233 insertions, 40 deletions
diff --git a/dev-python/pypy3-binpackage/Manifest b/dev-binpkg/pypy3/Manifest
index 1543f05..1543f05 100644
--- a/dev-python/pypy3-binpackage/Manifest
+++ b/dev-binpkg/pypy3/Manifest
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
index ae1139f..ae1139f 100644
--- a/dev-python/pypy3-binpackage/files/2.3.1-shared-lib.patch
+++ b/dev-binpkg/pypy3/files/2.3.1-shared-lib.patch
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
new file mode 100644
index 0000000..dd3a688
--- /dev/null
+++ b/dev-binpkg/pypy3/files/pypy3-2.4.0-gcc-4.9.patch
@@ -0,0 +1,26 @@
+Description: Expect cmovnb and jnb
+ Fixes an FTBFS since gcc 4.9.2, which is emmiting new operations
+Author: Stefano Rivera <stefanor@debian.org>
+Forwarded: https://bitbucket.org/pypy/pypy/commits/c1abec418acf30bb04891c3249bc12cbe8f48d4a
+Bug-Debian: https://bugs.debian.org/771137
+Last-Update: 2014-11-26
+
+--- a/rpython/translator/c/gcc/trackgcroot.py
++++ b/rpython/translator/c/gcc/trackgcroot.py
+@@ -590,7 +590,7 @@
+
+ # The various cmov* operations
+ for name in '''
+- e ne g ge l le a ae b be p np s ns o no
++ e ne g ge l le a ae b be nb p np s ns o no
+ '''.split():
+ locals()['visit_cmov' + name] = binary_insn
+ locals()['visit_cmov' + name + 'l'] = binary_insn
+@@ -837,6 +837,7 @@
+ visit_jb = conditional_jump
+ visit_jbe = conditional_jump
+ visit_jp = conditional_jump
++ visit_jnb = conditional_jump
+ visit_jnp = conditional_jump
+ visit_js = conditional_jump
+ visit_jns = conditional_jump
diff --git a/dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch b/dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch
new file mode 100644
index 0000000..5852939
--- /dev/null
+++ b/dev-binpkg/pypy3/files/pypy3-2.4.0-libressl.patch
@@ -0,0 +1,187 @@
+From 66bef80988c9efe60b61c6bc05f3206b4c3df7e8 Mon Sep 17 00:00:00 2001
+From: hasufell <hasufell@gentoo.org>
+Date: Mon, 12 Oct 2015 20:43:50 +0200
+Subject: [PATCH] Add LibreSSL support, patches backported from upstream
+
+https://bitbucket.org/pypy/pypy/pull-requests/333/deal-with-platforms-without-rand_egd-take/diff
+---
+ pypy/module/_ssl/interp_ssl.py | 34 +++++++++++++++-----------
+ pypy/module/_ssl/test/test_ssl.py | 8 +++---
+ rpython/rlib/ropenssl.py | 6 ++++-
+ rpython/rtyper/tool/rffi_platform.py | 12 ++++++---
+ rpython/rtyper/tool/test/test_rffi_platform.py | 24 +++++++++++++++++-
+ 5 files changed, 61 insertions(+), 23 deletions(-)
+
+diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
+index 0cac165..f210167 100644
+--- a/pypy/module/_ssl/interp_ssl.py
++++ b/pypy/module/_ssl/interp_ssl.py
+@@ -310,20 +310,26 @@ if HAVE_OPENSSL_RAND:
+ res = libssl_RAND_status()
+ return space.wrap(res)
+
+- @unwrap_spec(path=str)
+- def RAND_egd(space, path):
+- """RAND_egd(path) -> bytes
+-
+- Queries the entropy gather daemon (EGD) on socket path. Returns number
+- of bytes read. Raises socket.sslerror if connection to EGD fails or
+- if it does provide enough data to seed PRNG."""
+- with rffi.scoped_str2charp(path) as socket_path:
+- bytes = libssl_RAND_egd(socket_path)
+- if bytes == -1:
+- raise ssl_error(space,
+- "EGD connection failed or EGD did not return "
+- "enough data to seed the PRNG")
+- return space.wrap(bytes)
++ if HAVE_OPENSSL_RAND_EGD:
++ @unwrap_spec(path=str)
++ def RAND_egd(space, path):
++ """RAND_egd(path) -> bytes
++
++ Queries the entropy gather daemon (EGD) on socket path. Returns number
++ of bytes read. Raises socket.sslerror if connection to EGD fails or
++ if it does provide enough data to seed PRNG."""
++ with rffi.scoped_str2charp(path) as socket_path:
++ bytes = libssl_RAND_egd(socket_path)
++ if bytes == -1:
++ raise ssl_error(space,
++ "EGD connection failed or EGD did not return "
++ "enough data to seed the PRNG")
++ return space.wrap(bytes)
++ else:
++ # Dummy func for platforms missing RAND_egd(). Most likely LibreSSL.
++ @unwrap_spec(path=str)
++ def RAND_egd(space, path):
++ raise ssl_error(space, "RAND_egd unavailable")
+
+
+ class SSLSocket(W_Root):
+diff --git a/pypy/module/_ssl/test/test_ssl.py b/pypy/module/_ssl/test/test_ssl.py
+index 3204610..9722fd5 100644
+--- a/pypy/module/_ssl/test/test_ssl.py
++++ b/pypy/module/_ssl/test/test_ssl.py
+@@ -33,7 +33,8 @@ class AppTestSSL:
+ assert isinstance(_ssl.OPENSSL_VERSION_INFO, tuple)
+ assert len(_ssl.OPENSSL_VERSION_INFO) == 5
+ assert isinstance(_ssl.OPENSSL_VERSION, str)
+- assert 'openssl' in _ssl.OPENSSL_VERSION.lower()
++ lower_version = _ssl.OPENSSL_VERSION.lower()
++ assert 'openssl' in lower_version or "libressl" in lower_version
+
+ def test_RAND_add(self):
+ import _ssl
+@@ -64,8 +65,9 @@ class AppTestSSL:
+
+ def test_sslwrap(self):
+ import ssl, _socket, sys, gc
+- if sys.platform == 'darwin' or 'freebsd' in sys.platform:
+- skip("hangs indefinitely on OSX & FreeBSD (also on CPython)")
++ if sys.platform == 'darwin' or 'freebsd' in sys.platform or \
++ 'openbsd' in sys.platform:
++ skip("hangs indefinitely on OSX & BSD (also on CPython)")
+ s = _socket.socket()
+ ss = ssl.wrap_socket(s)
+
+diff --git a/rpython/rlib/ropenssl.py b/rpython/rlib/ropenssl.py
+index c36779d..6fe45d0 100644
+--- a/rpython/rlib/ropenssl.py
++++ b/rpython/rlib/ropenssl.py
+@@ -168,6 +168,9 @@ OBJ_NAME = rffi.CArrayPtr(OBJ_NAME_st)
+
+ HAVE_OPENSSL_RAND = OPENSSL_VERSION_NUMBER >= 0x0090500f
+ HAVE_SSL_CTX_CLEAR_OPTIONS = OPENSSL_VERSION_NUMBER >= 0x009080df
++HAVE_OPENSSL_RAND_EGD = rffi_platform.has('RAND_egd("/")',
++ '#include <openssl/rand.h>',
++ libraries=['ssl', 'crypto'])
+
+ def external(name, argtypes, restype, **kw):
+ kw['compilation_info'] = eci
+@@ -194,7 +197,8 @@ ssl_external('CRYPTO_set_id_callback',
+ if HAVE_OPENSSL_RAND:
+ ssl_external('RAND_add', [rffi.CCHARP, rffi.INT, rffi.DOUBLE], lltype.Void)
+ ssl_external('RAND_status', [], rffi.INT)
+- ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT)
++ if HAVE_OPENSSL_RAND_EGD:
++ ssl_external('RAND_egd', [rffi.CCHARP], rffi.INT)
+ ssl_external('SSL_CTX_new', [SSL_METHOD], SSL_CTX)
+ ssl_external('SSL_get_SSL_CTX', [SSL], SSL_CTX)
+ ssl_external('TLSv1_method', [], SSL_METHOD)
+diff --git a/rpython/rtyper/tool/rffi_platform.py b/rpython/rtyper/tool/rffi_platform.py
+index 1760877..1d56c20 100755
+--- a/rpython/rtyper/tool/rffi_platform.py
++++ b/rpython/rtyper/tool/rffi_platform.py
+@@ -17,12 +17,15 @@ from rpython.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong, intmask
+ #
+ # Helpers for simple cases
+
+-def eci_from_header(c_header_source, include_dirs=None):
++def eci_from_header(c_header_source, include_dirs=None, libraries=None):
+ if include_dirs is None:
+ include_dirs = []
++ if libraries is None:
++ libraries = []
+ return ExternalCompilationInfo(
+ post_include_bits=[c_header_source],
+- include_dirs=include_dirs
++ include_dirs=include_dirs,
++ libraries=libraries,
+ )
+
+ def getstruct(name, c_header_source, interesting_fields):
+@@ -75,9 +78,10 @@ def getintegerfunctionresult(function, args=None, c_header_source='', includes=[
+ CConfig._compilation_info_.includes = includes
+ return configure(CConfig)['RESULT']
+
+-def has(name, c_header_source, include_dirs=None):
++def has(name, c_header_source, include_dirs=None, libraries=None):
+ class CConfig:
+- _compilation_info_ = eci_from_header(c_header_source, include_dirs)
++ _compilation_info_ = \
++ eci_from_header(c_header_source, include_dirs, libraries)
+ HAS = Has(name)
+ return configure(CConfig)['HAS']
+
+diff --git a/rpython/rtyper/tool/test/test_rffi_platform.py b/rpython/rtyper/tool/test/test_rffi_platform.py
+index bfa069e..4feae87 100644
+--- a/rpython/rtyper/tool/test/test_rffi_platform.py
++++ b/rpython/rtyper/tool/test/test_rffi_platform.py
+@@ -271,12 +271,34 @@ def test_array():
+ [("d_name", lltype.FixedSizeArray(rffi.CHAR, 1))])
+ assert dirent.c_d_name.length == 32
+
+-def test_has():
++def test_has_0001():
+ assert rffi_platform.has("x", "int x = 3;")
+ assert not rffi_platform.has("x", "")
+ # has() should also not crash if it is given an invalid #include
+ assert not rffi_platform.has("x", "#include <some/path/which/cannot/exist>")
+
++def test_has_0002():
++ assert rffi_platform.has("pow", "#include <math.h>", libraries=["m"])
++
++def test_has_0003():
++ """multiple libraries"""
++ assert rffi_platform.has("pow", "#include <math.h>", libraries=["m", "c"])
++
++def test_has_0004():
++ """bogus symbol name"""
++ assert not rffi_platform.has("pow", "#include <math.h>",
++ libraries=["boguslibname"])
++
++def test_has_0005():
++ """bogus symbol name and lib name"""
++ assert not rffi_platform.has("bogus_symbol_name", "#include <math.h>",
++ libraries=["boguslibname"])
++
++def test_has_0006():
++ """missing include"""
++ assert not rffi_platform.has("pow", "", libraries=["m"])
++
++
+ def test_verify_eci():
+ eci = ExternalCompilationInfo()
+ rffi_platform.verify_eci(eci)
+--
+2.6.1
+
diff --git a/dev-python/pypy3-binpackage/metadata.xml b/dev-binpkg/pypy3/metadata.xml
index 675ce03..675ce03 100644
--- a/dev-python/pypy3-binpackage/metadata.xml
+++ b/dev-binpkg/pypy3/metadata.xml
diff --git a/dev-python/pypy3-binpackage/pypy3-binpackage-2.4.0.ebuild b/dev-binpkg/pypy3/pypy3-2.4.0.ebuild
index a505b12..b44ac88 100644
--- a/dev-python/pypy3-binpackage/pypy3-binpackage-2.4.0.ebuild
+++ b/dev-binpkg/pypy3/pypy3-2.4.0.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-2.2.1.ebuild,v 1.2 2014/03/12 09:14:21 mgorny Exp $
+# $Id$
EAPI=5
@@ -8,16 +8,15 @@ EAPI=5
PYTHON_COMPAT=( python2_7 pypy )
inherit check-reqs eutils multilib multiprocessing pax-utils \
python-any-r1 toolchain-funcs versionator
-MY_P=pypy3-${PV}
-DESCRIPTION="A fast, compliant alternative implementation of the Python language"
+DESCRIPTION="A fast, compliant alternative implementation of Python 3"
HOMEPAGE="http://pypy.org/"
-SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
+SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${P}-src.tar.bz2"
LICENSE="MIT"
SLOT="0/$(get_version_component_range 1-2 ${PV})"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack sse2"
+IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack cpu_flags_x86_sse2"
DEPEND=">=sys-libs/zlib-1.1.3
virtual/libffi
@@ -30,15 +29,17 @@ DEPEND=">=sys-libs/zlib-1.1.3
low-memory? ( virtual/pypy:0 )
!low-memory? ( ${PYTHON_DEPS} )"
-S="${WORKDIR}/${MY_P}-src"
+S="${WORKDIR}/${P}-src"
pkg_pretend() {
- if use low-memory; then
- CHECKREQS_MEMORY="1750M"
- use amd64 && CHECKREQS_MEMORY="3500M"
- else
- CHECKREQS_MEMORY="3G"
- use amd64 && CHECKREQS_MEMORY="6G"
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if use low-memory; then
+ CHECKREQS_MEMORY="1750M"
+ use amd64 && CHECKREQS_MEMORY="3500M"
+ else
+ CHECKREQS_MEMORY="3G"
+ use amd64 && CHECKREQS_MEMORY="6G"
+ fi
fi
check-reqs_pkg_pretend
@@ -85,9 +86,10 @@ pkg_setup() {
}
src_prepare() {
- epatch "${FILESDIR}/1.9-scripts-location.patch" \
- "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
+ epatch \
+ "${FILESDIR}"/${P}-gcc-4.9.patch \
"${FILESDIR}"/2.3.1-shared-lib.patch # 517002
+ epatch "${FILESDIR}"/${PN}-2.4.0-libressl.patch
epatch_user
}
@@ -105,7 +107,7 @@ src_compile() {
# the modern values...
if use x86; then
- if use sse2; then
+ if use cpu_flags_x86_sse2; then
jit_backend+=x86
else
jit_backend+=x86-without-sse2
@@ -158,11 +160,11 @@ src_compile() {
src_install() {
local flags=( bzip2 jit ncurses sandbox shadowstack )
- use x86 && flags+=( sse2 )
+ use x86 && flags+=( cpu_flags_x86_sse2 )
local f suffix="-${ARCH}"
for f in ${flags[@]}; do
- use ${f} && suffix+="+${f}"
+ use ${f} && suffix+="+${f#cpu_flags_x86_}"
done
local BIN_P=pypy3-bin-${PV}
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
deleted file mode 100644
index 29d99dc..0000000
--- a/dev-python/pypy3-binpackage/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/lib-python/3/distutils/unixccompiler.py
-+++ b/lib-python/3/distutils/unixccompiler.py
-@@ -297,7 +297,7 @@
- # this time, there's no way to determine this information from
- # the configuration data stored in the Python installation, so
- # we use this hack.
-- compiler = os.path.basename(sysconfig.get_config_var("CC"))
-+ compiler = os.path.basename(self.compiler[0])
- if sys.platform[:6] == "darwin":
- # MacOSX's linker doesn't understand the -R flag at all
- return "-L" + dir
diff --git a/dev-python/pypy3-binpackage/files/1.9-scripts-location.patch b/dev-python/pypy3-binpackage/files/1.9-scripts-location.patch
deleted file mode 100644
index 6ed1285..0000000
--- a/dev-python/pypy3-binpackage/files/1.9-scripts-location.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/lib-python/3/distutils/command/install.py
-+++ b/lib-python/3/distutils/command/install.py
-@@ -87,7 +87,7 @@
- 'purelib': '$base/site-packages',
- 'platlib': '$base/site-packages',
- 'headers': '$base/include',
-- 'scripts': '$base/bin',
-+ 'scripts': '/usr/bin',
- 'data' : '$base',
- },
- }