mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-24 18:58:08 -07:00
dev-python/pypy3: Clean up old versions
This commit is contained in:
@@ -1,4 +1,2 @@
|
||||
DIST pypy3-2.4.0-src.tar.bz2 14693194 SHA256 d9ba207d6eecf8a0dc4414e9f4e92db1abd143e8cc6ec4a6bdcac75b29f104f3 SHA512 7e2b0c21f1833b8cd61251c2d58c6a9f99207e5d582618f0036886ff28dcb313541dce1c36bd1b57b332a36a94b13e416bb7b67110be7c8ece8283749ba712be WHIRLPOOL bd02009c828b7b491b46b260d687d268561e5372766adccbcb58e87a3f1c545f293c54e5cdd6e6b7fb95feb678677137211ee890f106140ce1bc256f8563d2cd
|
||||
DIST pypy3.3-v5.2.0-alpha1-src.tar.bz2 24390595 SHA256 344c2f088c82ea1274964bb0505ab80d3f9e538cc03f91aa109325ddbaa61426 SHA512 1b6bcab12a7f4dd0ac44158b8acafd64de4b9bcc277385ba4c05982381dcd577fa6ec7b2247f70d2671055f3669764b92b4447b32d51ded58c60e6ec23509595 WHIRLPOOL 9455686af04f31da52da812e4f48d773c1ce45180ba067a308a779fa8b468b5a10c446a28d7468e61278801837705e882240a2e17884bc94069e564a5706f177
|
||||
DIST pypy3.3-v5.5.0-alpha-src.tar.bz2 25122033 SHA256 d5591c34d77253e9ed57d182b6f49585b95f7c09c3e121f0e8630e5a7e75ab5f SHA512 b2cf9700e45c452293297edffe08e572dffc3c567026b4b5d9165c1ba1b4d858ffc8a6754f5f28781020016c36440e5c02d07562d075b12444c9c32ea5dd2168 WHIRLPOOL 6bde174969413c55d6d077cd14e737c4f034f19935536af1bffaf3a1caa456d2bf6850760a18c274ad99089bd5ab7331d7d185f914cd6c69f708abf857d35df3
|
||||
DIST python-gentoo-patches-3.3.5-0.tar.xz 12892 SHA256 a7240de9598033cb40f8f273d8104d4e2b1dcaea028d45ac28efaa3c680ff6f7 SHA512 27eef4c2b3f631b000db3f6a5c426d9b498d63a08fe82b1ab7c2c010fb72208109461a5f008d47703852526655b70a734ea95be8742897026db5750bb9cc9d16 WHIRLPOOL edab9222d7da94cab3b1de0e1a27c6c7dbd49194b813a0a1cf9e532063029c4e4f19151c9f4878eeabed3168ff1f97eae7f008280c7ed2897fc14c5516c68d7e
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- rpython/translator/platform/posix.py
|
||||
+++ rpython/translator/platform/posix.py
|
||||
@@ -180,7 +180,7 @@
|
||||
'int main(int argc, char* argv[]) '
|
||||
'{ return $(PYPY_MAIN_FUNCTION)(argc, argv); }" > $@')
|
||||
m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.o'],
|
||||
- '$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) -o $@')
|
||||
+ '$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) \'-Wl,-rpath,$$ORIGIN\' -o $@')
|
||||
|
||||
return m
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
http://bugs.python.org/issue1222585
|
||||
|
||||
--- Lib/distutils/cygwinccompiler.py
|
||||
+++ Lib/distutils/cygwinccompiler.py
|
||||
@@ -136,9 +136,13 @@
|
||||
self.set_executables(compiler='gcc -mcygwin -O -Wall',
|
||||
compiler_so='gcc -mcygwin -mdll -O -Wall',
|
||||
compiler_cxx='g++ -mcygwin -O -Wall',
|
||||
+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
|
||||
linker_exe='gcc -mcygwin',
|
||||
linker_so=('%s -mcygwin %s' %
|
||||
- (self.linker_dll, shared_option)))
|
||||
+ (self.linker_dll, shared_option)),
|
||||
+ linker_exe_cxx='g++ -mcygwin',
|
||||
+ linker_so_cxx=('%s -mcygwin %s' %
|
||||
+ (self.linker_dll, shared_option)))
|
||||
|
||||
# cygwin and mingw32 need different sets of libraries
|
||||
if self.gcc_version == "2.91.57":
|
||||
@@ -162,8 +166,12 @@
|
||||
raise CompileError(msg)
|
||||
else: # for other files use the C-compiler
|
||||
try:
|
||||
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
@@ -294,10 +302,15 @@
|
||||
self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
|
||||
compiler_so='gcc -mno-cygwin -mdll -O -Wall',
|
||||
compiler_cxx='g++ -mno-cygwin -O -Wall',
|
||||
+ compiler_so_cxx='g++ -mno-cygwin -mdll -O -Wall',
|
||||
linker_exe='gcc -mno-cygwin',
|
||||
linker_so='%s -mno-cygwin %s %s'
|
||||
% (self.linker_dll, shared_option,
|
||||
- entry_point))
|
||||
+ entry_point),
|
||||
+ linker_exe_cxx='g++ -mno-cygwin',
|
||||
+ linker_so_cxx='%s -mno-cygwin %s %s'
|
||||
+ % (self.linker_dll, shared_option,
|
||||
+ entry_point))
|
||||
# Maybe we should also append -mthreads, but then the finished
|
||||
# dlls need another dll (mingwm10.dll see Mingw32 docs)
|
||||
# (-mthreads: Support thread-safe exception handling on `Mingw32')
|
||||
--- Lib/distutils/emxccompiler.py
|
||||
+++ Lib/distutils/emxccompiler.py
|
||||
@@ -63,8 +63,12 @@
|
||||
# XXX optimization, warnings etc. should be customizable.
|
||||
self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
+ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
+ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
linker_exe='gcc -Zomf -Zmt -Zcrtdll',
|
||||
- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
|
||||
+ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
|
||||
+ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
|
||||
+ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
|
||||
|
||||
# want the gcc library statically linked (so that we don't have
|
||||
# to distribute a version dependent on the compiler we have)
|
||||
@@ -81,8 +85,12 @@
|
||||
raise CompileError(msg)
|
||||
else: # for other files use the C-compiler
|
||||
try:
|
||||
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
--- Lib/distutils/sysconfig_cpython.py
|
||||
+++ Lib/distutils/sysconfig_cpython.py
|
||||
@@ -170,9 +170,12 @@
|
||||
_osx_support.customize_compiler(_config_vars)
|
||||
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
|
||||
|
||||
- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
|
||||
- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
|
||||
- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
|
||||
+ (cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \
|
||||
+ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
|
||||
+
|
||||
+ cflags = ''
|
||||
+ cxxflags = ''
|
||||
|
||||
newcc = None
|
||||
if 'CC' in os.environ:
|
||||
@@ -181,19 +184,27 @@
|
||||
cxx = os.environ['CXX']
|
||||
if 'LDSHARED' in os.environ:
|
||||
ldshared = os.environ['LDSHARED']
|
||||
+ if 'LDCXXSHARED' in os.environ:
|
||||
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||
if 'CPP' in os.environ:
|
||||
cpp = os.environ['CPP']
|
||||
else:
|
||||
cpp = cc + " -E" # not always
|
||||
if 'LDFLAGS' in os.environ:
|
||||
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||
if 'CFLAGS' in os.environ:
|
||||
- cflags = opt + ' ' + os.environ['CFLAGS']
|
||||
+ cflags = os.environ['CFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||
+ if 'CXXFLAGS' in os.environ:
|
||||
+ cxxflags = os.environ['CXXFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||
if 'CPPFLAGS' in os.environ:
|
||||
cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||
cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||
if 'AR' in os.environ:
|
||||
ar = os.environ['AR']
|
||||
if 'ARFLAGS' in os.environ:
|
||||
@@ -202,13 +213,17 @@
|
||||
archiver = ar + ' ' + ar_flags
|
||||
|
||||
cc_cmd = cc + ' ' + cflags
|
||||
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||
compiler.set_executables(
|
||||
preprocessor=cpp,
|
||||
compiler=cc_cmd,
|
||||
compiler_so=cc_cmd + ' ' + ccshared,
|
||||
- compiler_cxx=cxx,
|
||||
+ compiler_cxx=cxx_cmd,
|
||||
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||
linker_so=ldshared,
|
||||
linker_exe=cc,
|
||||
+ linker_so_cxx=ldcxxshared,
|
||||
+ linker_exe_cxx=cxx,
|
||||
archiver=archiver)
|
||||
|
||||
compiler.shared_lib_extension = shlib_suffix
|
||||
--- Lib/distutils/unixccompiler.py
|
||||
+++ Lib/distutils/unixccompiler.py
|
||||
@@ -52,14 +52,17 @@
|
||||
# are pretty generic; they will probably have to be set by an outsider
|
||||
# (eg. using information discovered by the sysconfig about building
|
||||
# Python extensions).
|
||||
- executables = {'preprocessor' : None,
|
||||
- 'compiler' : ["cc"],
|
||||
- 'compiler_so' : ["cc"],
|
||||
- 'compiler_cxx' : ["cc"],
|
||||
- 'linker_so' : ["cc", "-shared"],
|
||||
- 'linker_exe' : ["cc"],
|
||||
- 'archiver' : ["ar", "-cr"],
|
||||
- 'ranlib' : None,
|
||||
+ executables = {'preprocessor' : None,
|
||||
+ 'compiler' : ["cc"],
|
||||
+ 'compiler_so' : ["cc"],
|
||||
+ 'compiler_cxx' : ["c++"],
|
||||
+ 'compiler_so_cxx' : ["c++"],
|
||||
+ 'linker_so' : ["cc", "-shared"],
|
||||
+ 'linker_exe' : ["cc"],
|
||||
+ 'linker_so_cxx' : ["c++", "-shared"],
|
||||
+ 'linker_exe_cxx' : ["c++"],
|
||||
+ 'archiver' : ["ar", "-cr"],
|
||||
+ 'ranlib' : None,
|
||||
}
|
||||
|
||||
if sys.platform[:6] == "darwin":
|
||||
@@ -108,12 +111,19 @@
|
||||
|
||||
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
||||
compiler_so = self.compiler_so
|
||||
+ compiler_so_cxx = self.compiler_so_cxx
|
||||
if sys.platform == 'darwin':
|
||||
compiler_so = _osx_support.compiler_fixup(compiler_so,
|
||||
cc_args + extra_postargs)
|
||||
+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
|
||||
+ cc_args + extra_postargs)
|
||||
try:
|
||||
- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
@@ -171,22 +181,16 @@
|
||||
ld_args.extend(extra_postargs)
|
||||
self.mkpath(os.path.dirname(output_filename))
|
||||
try:
|
||||
- if target_desc == CCompiler.EXECUTABLE:
|
||||
- linker = self.linker_exe[:]
|
||||
+ if target_lang == "c++":
|
||||
+ if target_desc == CCompiler.EXECUTABLE:
|
||||
+ linker = self.linker_exe_cxx[:]
|
||||
+ else:
|
||||
+ linker = self.linker_so_cxx[:]
|
||||
else:
|
||||
- linker = self.linker_so[:]
|
||||
- if target_lang == "c++" and self.compiler_cxx:
|
||||
- # skip over environment variable settings if /usr/bin/env
|
||||
- # is used to set up the linker's environment.
|
||||
- # This is needed on OSX. Note: this assumes that the
|
||||
- # normal and C++ compiler have the same environment
|
||||
- # settings.
|
||||
- i = 0
|
||||
- if os.path.basename(linker[0]) == "env":
|
||||
- i = 1
|
||||
- while '=' in linker[i]:
|
||||
- i += 1
|
||||
- linker[i] = self.compiler_cxx[i]
|
||||
+ if target_desc == CCompiler.EXECUTABLE:
|
||||
+ linker = self.linker_exe[:]
|
||||
+ else:
|
||||
+ linker = self.linker_so[:]
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
linker = _osx_support.compiler_fixup(linker, ld_args)
|
||||
--- Lib/_osx_support.py
|
||||
+++ Lib/_osx_support.py
|
||||
@@ -14,13 +14,13 @@
|
||||
# configuration variables that may contain universal build flags,
|
||||
# like "-arch" or "-isdkroot", that may need customization for
|
||||
# the user environment
|
||||
-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
|
||||
- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
|
||||
- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
|
||||
- 'PY_CORE_CFLAGS')
|
||||
+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
|
||||
+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
|
||||
+ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
|
||||
|
||||
# configuration variables that may contain compiler calls
|
||||
-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
|
||||
+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
|
||||
|
||||
# prefix added to original configuration variable names
|
||||
_INITPRE = '_OSX_SUPPORT_INITIAL_'
|
||||
@@ -1,34 +0,0 @@
|
||||
Patch by Vadim A. Misbakh-Soloviov (mva)
|
||||
https://bugs.gentoo.org/show_bug.cgi?id=564454
|
||||
|
||||
--- lib_pypy/_curses.py.old 2016-01-18 19:13:00.241886442 +0000
|
||||
+++ lib_pypy/_curses.py 2016-01-18 19:26:01.061885605 +0000
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Reimplementation of the standard extension module '_curses' using cffi."""
|
||||
|
||||
import sys
|
||||
+import platform
|
||||
if sys.platform == 'win32':
|
||||
#This module does not exist in windows
|
||||
raise ImportError('No module named _curses')
|
||||
@@ -10,12 +11,18 @@
|
||||
|
||||
ffi = FFI()
|
||||
|
||||
+# Monkeypatch to make it build against ncurses-6.
|
||||
+# Inspired by https://goo.gl/xvjQcd
|
||||
+_type = "uint32_t"
|
||||
+if platform.machine() == "x86_64":
|
||||
+ _type = "unsigned"
|
||||
+
|
||||
ffi.cdef("""
|
||||
typedef ... WINDOW;
|
||||
typedef ... SCREEN;
|
||||
-typedef unsigned long mmask_t;
|
||||
+typedef """+_type+""" mmask_t;
|
||||
typedef unsigned char bool;
|
||||
-typedef unsigned long chtype;
|
||||
+typedef """+_type+""" chtype;
|
||||
typedef chtype attr_t;
|
||||
|
||||
typedef struct
|
||||
@@ -1,74 +0,0 @@
|
||||
# HG changeset patch
|
||||
# User Philip Jenvey <pjenvey@underboss.org>
|
||||
# Date 1414136649 25200
|
||||
# Branch py3k
|
||||
# Node ID 8c340acffe279d63dd2df525173713b2054619c8
|
||||
# Parent a87e6542c186bdc7408ea027aed83c62820a9c49
|
||||
issue1899: fix broken bytes usage from default
|
||||
|
||||
diff --git a/lib_pypy/_tkinter/app.py b/lib_pypy/_tkinter/app.py
|
||||
--- a/lib_pypy/_tkinter/app.py
|
||||
+++ b/lib_pypy/_tkinter/app.py
|
||||
@@ -439,7 +439,7 @@
|
||||
if isinstance(s, int):
|
||||
return s
|
||||
s = s.encode('utf-8')
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
v = tkffi.new("int*")
|
||||
res = tklib.Tcl_GetBoolean(self.interp, s, v)
|
||||
@@ -451,7 +451,7 @@
|
||||
if isinstance(s, int):
|
||||
return s
|
||||
s = s.encode('utf-8')
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
v = tkffi.new("int*")
|
||||
res = tklib.Tcl_GetInt(self.interp, s, v)
|
||||
@@ -463,7 +463,7 @@
|
||||
if isinstance(s, float):
|
||||
return s
|
||||
s = s.encode('utf-8')
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
v = tkffi.new("double*")
|
||||
res = tklib.Tcl_GetDouble(self.interp, s, v)
|
||||
@@ -472,7 +472,7 @@
|
||||
return v[0]
|
||||
|
||||
def exprboolean(self, s):
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
v = tkffi.new("int*")
|
||||
res = tklib.Tcl_ExprBoolean(self.interp, s, v)
|
||||
@@ -481,7 +481,7 @@
|
||||
return v[0]
|
||||
|
||||
def exprlong(self, s):
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
v = tkffi.new("long*")
|
||||
res = tklib.Tcl_ExprLong(self.interp, s, v)
|
||||
@@ -490,7 +490,7 @@
|
||||
return v[0]
|
||||
|
||||
def exprdouble(self, s):
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
v = tkffi.new("double*")
|
||||
res = tklib.Tcl_ExprDouble(self.interp, s, v)
|
||||
@@ -499,7 +499,7 @@
|
||||
return v[0]
|
||||
|
||||
def exprstring(self, s):
|
||||
- if '\x00' in s:
|
||||
+ if b'\x00' in s:
|
||||
raise TypeError
|
||||
res = tklib.Tcl_ExprString(self.interp, s)
|
||||
if res == tklib.TCL_ERROR:
|
||||
@@ -1,26 +0,0 @@
|
||||
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
|
||||
@@ -1,187 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Id$
|
||||
|
||||
EAPI=5
|
||||
|
||||
# pypy3 needs to be built using python 2
|
||||
PYTHON_COMPAT=( python2_7 pypy )
|
||||
inherit check-reqs eutils multilib multiprocessing pax-utils \
|
||||
python-any-r1 toolchain-funcs versionator
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of Python 3"
|
||||
HOMEPAGE="http://pypy.org/"
|
||||
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 gdbm +jit libressl low-memory ncurses sandbox +shadowstack sqlite cpu_flags_x86_sse2 tk"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0=
|
||||
virtual/libffi:0=
|
||||
virtual/libintl:0=
|
||||
dev-libs/expat:0=
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:= )
|
||||
bzip2? ( app-arch/bzip2:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
ncurses? ( >=sys-libs/ncurses-6.0:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!dev-python/pypy3-bin:0"
|
||||
DEPEND="${RDEPEND}
|
||||
low-memory? ( virtual/pypy:0 )
|
||||
!low-memory? ( ${PYTHON_DEPS} )"
|
||||
# doc? ( dev-python/sphinx )
|
||||
|
||||
S="${WORKDIR}/${P}-src"
|
||||
|
||||
pkg_pretend() {
|
||||
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
|
||||
|
||||
check-reqs_pkg_pretend
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if [[ ${MERGE_TYPE} != binary ]]; then
|
||||
pkg_pretend
|
||||
|
||||
# unset to allow forcing pypy below :)
|
||||
use low-memory && local EPYTHON=
|
||||
if python_is_installed pypy && [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]]; then
|
||||
einfo "Using PyPy to perform the translation."
|
||||
local EPYTHON=pypy
|
||||
else
|
||||
einfo "Using ${EPYTHON:-python2} to perform the translation. Please note that upstream"
|
||||
einfo "recommends using PyPy for that. If you wish to do so, please install"
|
||||
einfo "virtual/pypy and ensure that EPYTHON variable is unset."
|
||||
fi
|
||||
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
epatch \
|
||||
"${FILESDIR}"/${P}-gcc-4.9.patch \
|
||||
"${FILESDIR}/4.0.0-gentoo-path.patch" \
|
||||
"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
|
||||
"${FILESDIR}"/2.3.1-shared-lib.patch # 517002
|
||||
epatch "${FILESDIR}/2.4.0-ncurses6.patch"
|
||||
epatch "${FILESDIR}"/${PN}-2.4.0-libressl.patch
|
||||
epatch "${FILESDIR}/${PN}-2.4.0-fix-tkinter-regression.patch" # 533384
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-e "s^@libdir@^$(get_libdir)^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
epatch "${FILESDIR}"/2.4.0-21_all_distutils_c++.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
epatch_user
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
tc-export CC
|
||||
|
||||
local jit_backend
|
||||
if use jit; then
|
||||
jit_backend='--jit-backend='
|
||||
|
||||
# We only need the explicit sse2 switch for x86.
|
||||
# On other arches we can rely on autodetection which uses
|
||||
# compiler macros. Plus, --jit-backend= doesn't accept all
|
||||
# the modern values...
|
||||
|
||||
if use x86; then
|
||||
if use cpu_flags_x86_sse2; then
|
||||
jit_backend+=x86
|
||||
else
|
||||
jit_backend+=x86-without-sse2
|
||||
fi
|
||||
else
|
||||
jit_backend+=auto
|
||||
fi
|
||||
fi
|
||||
|
||||
local args=(
|
||||
--shared
|
||||
$(usex jit -Ojit -O2)
|
||||
$(usex shadowstack --gcrootfinder=shadowstack '')
|
||||
$(usex sandbox --sandbox '')
|
||||
|
||||
${jit_backend}
|
||||
--make-jobs=$(makeopts_jobs)
|
||||
|
||||
pypy/goal/targetpypystandalone
|
||||
)
|
||||
|
||||
# Avoid linking against libraries disabled by use flags
|
||||
local opts=(
|
||||
bzip2:bz2
|
||||
ncurses:_minimal_curses
|
||||
)
|
||||
|
||||
local opt
|
||||
for opt in "${opts[@]}"; do
|
||||
local flag=${opt%:*}
|
||||
local mod=${opt#*:}
|
||||
|
||||
args+=(
|
||||
$(usex ${flag} --withmod --withoutmod)-${mod}
|
||||
)
|
||||
done
|
||||
|
||||
local interp=( "${PYTHON}" )
|
||||
if use low-memory; then
|
||||
interp=( env PYPY_GC_MAX_DELTA=200MB
|
||||
"${PYTHON}" --jit loop_longevity=300 )
|
||||
fi
|
||||
|
||||
set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}"
|
||||
echo -e "\033[1m${@}\033[0m"
|
||||
"${@}" || die "compile error"
|
||||
|
||||
# Exception occurred:
|
||||
# File "/tmp/1/pypy3-2.4.0-src/pypy/config/makerestdoc.py", line 199, in config_role
|
||||
# assert txt.check()
|
||||
# AssertionError
|
||||
#use doc && emake -C pypy/doc/ html
|
||||
pax-mark m pypy-c libpypy-c.so
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
"${PYTHON}" ./pypy/test_all.py --pypy=./pypy-c lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/$(get_libdir)/pypy3
|
||||
einfo "Installing PyPy ..."
|
||||
insinto "${dest}"
|
||||
doins -r include lib_pypy lib-python pypy-c libpypy-c.so
|
||||
fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so
|
||||
pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
|
||||
dosym ../$(get_libdir)/pypy3/pypy-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED%/}${dest}"/lib_pypy/gdbm.py \
|
||||
"${ED%/}${dest}"/lib-python/*3/test/test_gdbm.py || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED%/}${dest}"/lib_pypy/_sqlite3.py \
|
||||
"${ED%/}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED%/}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED%/}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED%/}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
# Install docs
|
||||
#use doc && dohtml -r pypy/doc/_build/html/
|
||||
|
||||
einfo "Generating caches and byte-compiling ..."
|
||||
|
||||
local -x PYTHON=${ED%/}${dest}/pypy-c
|
||||
local -x LD_LIBRARY_PATH="${ED%/}${dest}"
|
||||
# we can't use eclass function since PyPy is dumb and always gives
|
||||
# paths relative to the interpreter
|
||||
local PYTHON_SITEDIR=${EPREFIX}/usr/$(get_libdir)/pypy3/site-packages
|
||||
python_export pypy3 EPYTHON
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_domodule epython.py
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
"${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi cache
|
||||
# Please keep in sync with pypy/tool/release/package.py!
|
||||
"${PYTHON}" -c "import syslog" || die "Failed to import syslog (cffi)"
|
||||
if use gdbm; then
|
||||
"${PYTHON}" -c "import _gdbm" || die "Failed to import gdbm (cffi)"
|
||||
fi
|
||||
if use ncurses; then
|
||||
"${PYTHON}" -c "import _curses" || die "Failed to import _curses (cffi)"
|
||||
fi
|
||||
if use sqlite; then
|
||||
"${PYTHON}" -c "import _sqlite3" || die "Failed to import _sqlite3 (cffi)"
|
||||
fi
|
||||
if use tk; then
|
||||
"${PYTHON}" -c "import _tkinter" || die "Failed to import _tkinter (cffi)"
|
||||
fi
|
||||
|
||||
# Cleanup temporary objects
|
||||
find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
|
||||
find "${ED%/}${dest}" -type d -empty -delete || die
|
||||
|
||||
# compile the installed modules
|
||||
python_optimize "${ED%/}${dest}"
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Id$
|
||||
|
||||
EAPI=5
|
||||
|
||||
# pypy3 needs to be built using python 2
|
||||
PYTHON_COMPAT=( python2_7 pypy )
|
||||
inherit check-reqs eutils multilib multiprocessing pax-utils python-any-r1 toolchain-funcs versionator
|
||||
|
||||
CPY_PATCHSET_VERSION="3.3.5-0"
|
||||
MY_P=pypy3.3-v${PV/_/-}
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python (3.3) language"
|
||||
HOMEPAGE="http://pypy.org/"
|
||||
SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
|
||||
https://dev.gentoo.org/~floppym/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0/$(get_version_component_range 1-2 ${PV})"
|
||||
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox +shadowstack sqlite cpu_flags_x86_sse2 tk"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0=
|
||||
virtual/libffi:0=
|
||||
virtual/libintl:0=
|
||||
dev-libs/expat:0=
|
||||
!libressl? ( dev-libs/openssl:0=[-bindist] )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
bzip2? ( app-arch/bzip2:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
ncurses? ( sys-libs/ncurses:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!dev-python/pypy3-bin:0"
|
||||
DEPEND="${RDEPEND}
|
||||
low-memory? ( virtual/pypy:0 )
|
||||
!low-memory? ( ${PYTHON_DEPS} )"
|
||||
# doc? ( dev-python/sphinx )
|
||||
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
pkg_pretend() {
|
||||
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
|
||||
|
||||
check-reqs_pkg_pretend
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if [[ ${MERGE_TYPE} != binary ]]; then
|
||||
pkg_pretend
|
||||
|
||||
# unset to allow forcing pypy below :)
|
||||
use low-memory && local EPYTHON=
|
||||
if python_is_installed pypy && [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]]; then
|
||||
einfo "Using PyPy to perform the translation."
|
||||
local EPYTHON=pypy
|
||||
else
|
||||
einfo "Using ${EPYTHON:-python2} to perform the translation. Please note that upstream"
|
||||
einfo "recommends using PyPy for that. If you wish to do so, please install"
|
||||
einfo "virtual/pypy and ensure that EPYTHON variable is unset."
|
||||
fi
|
||||
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \
|
||||
"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
|
||||
"${FILESDIR}"/2.5.0-shared-lib.patch # 517002
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-e "s^@libdir@^$(get_libdir)^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
epatch "${FILESDIR}"/5.2.0-distutils-c++.patch \
|
||||
"${WORKDIR}"/patches/24_all_sqlite-3.8.4.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
epatch_user
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
tc-export CC
|
||||
|
||||
local jit_backend
|
||||
if use jit; then
|
||||
jit_backend='--jit-backend='
|
||||
|
||||
# We only need the explicit sse2 switch for x86.
|
||||
# On other arches we can rely on autodetection which uses
|
||||
# compiler macros. Plus, --jit-backend= doesn't accept all
|
||||
# the modern values...
|
||||
|
||||
if use x86; then
|
||||
if use cpu_flags_x86_sse2; then
|
||||
jit_backend+=x86
|
||||
else
|
||||
jit_backend+=x86-without-sse2
|
||||
fi
|
||||
else
|
||||
jit_backend+=auto
|
||||
fi
|
||||
fi
|
||||
|
||||
local args=(
|
||||
--shared
|
||||
$(usex jit -Ojit -O2)
|
||||
$(usex shadowstack --gcrootfinder=shadowstack '')
|
||||
$(usex sandbox --sandbox '')
|
||||
|
||||
${jit_backend}
|
||||
--make-jobs=$(makeopts_jobs)
|
||||
|
||||
pypy/goal/targetpypystandalone
|
||||
)
|
||||
|
||||
# Avoid linking against libraries disabled by use flags
|
||||
local opts=(
|
||||
bzip2:bz2
|
||||
ncurses:_minimal_curses
|
||||
)
|
||||
|
||||
local opt
|
||||
for opt in "${opts[@]}"; do
|
||||
local flag=${opt%:*}
|
||||
local mod=${opt#*:}
|
||||
|
||||
args+=(
|
||||
$(usex ${flag} --withmod --withoutmod)-${mod}
|
||||
)
|
||||
done
|
||||
|
||||
local interp=( "${PYTHON}" )
|
||||
if use low-memory; then
|
||||
interp=( env PYPY_GC_MAX_DELTA=200MB
|
||||
"${PYTHON}" --jit loop_longevity=300 )
|
||||
fi
|
||||
|
||||
set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}"
|
||||
echo -e "\033[1m${@}\033[0m"
|
||||
"${@}" || die "compile error"
|
||||
|
||||
# Exception occurred:
|
||||
# File "/tmp/1/pypy3-2.4.0-src/pypy/config/makerestdoc.py", line 199, in config_role
|
||||
# assert txt.check()
|
||||
# AssertionError
|
||||
#use doc && emake -C pypy/doc/ html
|
||||
pax-mark m pypy-c libpypy-c.so
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
"${PYTHON}" ./pypy/test_all.py --pypy=./pypy-c lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/$(get_libdir)/pypy3
|
||||
einfo "Installing PyPy ..."
|
||||
insinto "${dest}"
|
||||
doins -r include lib_pypy lib-python pypy-c libpypy-c.so
|
||||
fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so
|
||||
pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
|
||||
dosym ../$(get_libdir)/pypy3/pypy-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED%/}${dest}"/lib_pypy/gdbm.py \
|
||||
"${ED%/}${dest}"/lib-python/*3/test/test_gdbm.py || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED%/}${dest}"/lib_pypy/_sqlite3.py \
|
||||
"${ED%/}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED%/}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED%/}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED%/}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
# Install docs
|
||||
#use doc && dohtml -r pypy/doc/_build/html/
|
||||
|
||||
einfo "Generating caches and byte-compiling ..."
|
||||
|
||||
local -x PYTHON=${ED%/}${dest}/pypy-c
|
||||
local -x LD_LIBRARY_PATH="${ED%/}${dest}"
|
||||
# we can't use eclass function since PyPy is dumb and always gives
|
||||
# paths relative to the interpreter
|
||||
local PYTHON_SITEDIR=${EPREFIX}/usr/$(get_libdir)/pypy3/site-packages
|
||||
python_export pypy3 EPYTHON
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_domodule epython.py
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
"${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
# "lzma": "_lzma_build.py",
|
||||
# "_decimal": "_decimal_build.py",
|
||||
cffi_targets=( audioop syslog pwdgrp resource lzma decimal )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd "${ED%/}${dest}"/lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
"${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
|
||||
find "${ED%/}${dest}" -type d -empty -delete || die
|
||||
|
||||
# compile the installed modules
|
||||
python_optimize "${ED%/}${dest}"
|
||||
}
|
||||
Reference in New Issue
Block a user