public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2015-10-13 17:03 Julian Ospald
  0 siblings, 0 replies; 15+ messages in thread
From: Julian Ospald @ 2015-10-13 17:03 UTC (permalink / raw
  To: gentoo-commits

commit:     0edfac4a30fb6b007940e336cbfd4aad57a9910e
Author:     Julian Ospald <hasufell <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 12 20:39:16 2015 +0000
Commit:     Julian Ospald <hasufell <AT> gentoo <DOT> org>
CommitDate: Tue Oct 13 17:01:57 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0edfac4a

dev-python/pypy3: add libressl support

 dev-python/pypy3/files/pypy3-2.4.0-libressl.patch | 187 ++++++++++++++++++++++
 dev-python/pypy3/pypy3-2.4.0.ebuild               |   6 +-
 2 files changed, 191 insertions(+), 2 deletions(-)

diff --git a/dev-python/pypy3/files/pypy3-2.4.0-libressl.patch b/dev-python/pypy3/files/pypy3-2.4.0-libressl.patch
new file mode 100644
index 0000000..5852939
--- /dev/null
+++ b/dev-python/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/pypy3-2.4.0.ebuild b/dev-python/pypy3/pypy3-2.4.0.ebuild
index 1c66a02..47a824e 100644
--- a/dev-python/pypy3/pypy3-2.4.0.ebuild
+++ b/dev-python/pypy3/pypy3-2.4.0.ebuild
@@ -16,13 +16,14 @@ 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 low-memory ncurses sandbox shadowstack sqlite cpu_flags_x86_sse2 tk"
+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=
-	dev-libs/openssl:0=
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:= )
 	bzip2? ( app-arch/bzip2:0= )
 	gdbm? ( sys-libs/gdbm:0= )
 	ncurses? ( =sys-libs/ncurses-5*:0= )
@@ -79,6 +80,7 @@ src_prepare() {
 		"${FILESDIR}/1.9-scripts-location.patch" \
 		"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
 		"${FILESDIR}"/2.3.1-shared-lib.patch	# 517002
+	epatch "${FILESDIR}"/${PN}-2.4.0-libressl.patch
 
 	epatch_user
 }


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2015-12-20 22:03 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2015-12-20 22:03 UTC (permalink / raw
  To: gentoo-commits

commit:     0dd2eb79f9fe0834698bc21203ad6c8969a10be1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 20 22:01:52 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 20 22:02:51 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dd2eb79

dev-python/pypy3: Add an updated distutils/C++ patch

 dev-python/pypy3/files/21_all_distutils_c++.patch | 251 ++++++++++++++++++++++
 dev-python/pypy3/pypy3-9999.ebuild                |   5 +
 2 files changed, 256 insertions(+)

diff --git a/dev-python/pypy3/files/21_all_distutils_c++.patch b/dev-python/pypy3/files/21_all_distutils_c++.patch
new file mode 100644
index 0000000..f12df8a
--- /dev/null
+++ b/dev-python/pypy3/files/21_all_distutils_c++.patch
@@ -0,0 +1,251 @@
+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' : ["c++"],  # pypy: changed, 'cc' is bogus
+-                   '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_'

diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
index a335b0f..73bd159 100644
--- a/dev-python/pypy3/pypy3-9999.ebuild
+++ b/dev-python/pypy3/pypy3-9999.ebuild
@@ -88,6 +88,11 @@ src_prepare() {
 		-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}"/21_all_distutils_c++.patch
+	popd > /dev/null || die
+
 	epatch_user
 }
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2016-03-03 10:47 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2016-03-03 10:47 UTC (permalink / raw
  To: gentoo-commits

commit:     c1a3387e29099d79b39b4b712031a76eeb250bce
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  3 09:57:09 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Mar  3 10:47:37 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1a3387e

dev-python/pypy3: Drop old

 dev-python/pypy3/files/1.9-scripts-location.patch |  11 --
 dev-python/pypy3/pypy3-2.4.0.ebuild               | 231 ----------------------
 2 files changed, 242 deletions(-)

diff --git a/dev-python/pypy3/files/1.9-scripts-location.patch b/dev-python/pypy3/files/1.9-scripts-location.patch
deleted file mode 100644
index 6ed1285..0000000
--- a/dev-python/pypy3/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',
-         },
-     }

diff --git a/dev-python/pypy3/pypy3-2.4.0.ebuild b/dev-python/pypy3/pypy3-2.4.0.ebuild
deleted file mode 100644
index fdff56a..0000000
--- a/dev-python/pypy3/pypy3-2.4.0.ebuild
+++ /dev/null
@@ -1,231 +0,0 @@
-# Copyright 1999-2015 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-5*: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 )
-PDEPEND="app-admin/python-updater"
-
-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
-	fi
-
-	check-reqs_pkg_pretend
-}
-
-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}/1.9-scripts-location.patch" \
-		"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
-		"${FILESDIR}"/2.3.1-shared-lib.patch	# 517002
-	epatch "${FILESDIR}"/${PN}-2.4.0-libressl.patch
-
-	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 "${ED%/}${INSDESTTREE}/pypy-c"
-}
-
-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() {
-	einfo "Installing PyPy ..."
-	insinto "/usr/$(get_libdir)/pypy3"
-	doins -r include lib_pypy lib-python pypy-c libpypy-c.so
-	fperms a+x ${INSDESTTREE}/pypy-c ${INSDESTTREE}/libpypy-c.so
-	pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" "${ED%/}${INSDESTTREE}/libpypy-c.so"
-	dosym ../$(get_libdir)/pypy3/pypy-c /usr/bin/pypy3
-	dodoc README.rst
-
-	if ! use gdbm; then
-		rm -r "${ED%/}${INSDESTTREE}"/lib_pypy/gdbm.py \
-			"${ED%/}${INSDESTTREE}"/lib-python/*3/test/test_gdbm.py || die
-	fi
-	if ! use sqlite; then
-		rm -r "${ED%/}${INSDESTTREE}"/lib-python/*3/sqlite3 \
-			"${ED%/}${INSDESTTREE}"/lib_pypy/_sqlite3.py \
-			"${ED%/}${INSDESTTREE}"/lib-python/*3/test/test_sqlite.py || die
-	fi
-	if ! use tk; then
-		rm -r "${ED%/}${INSDESTTREE}"/lib-python/*3/{idlelib,tkinter} \
-			"${ED%/}${INSDESTTREE}"/lib_pypy/_tkinter \
-			"${ED%/}${INSDESTTREE}"/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%/}${INSDESTTREE}/pypy-c
-	local -x LD_LIBRARY_PATH="${ED%/}${INSDESTTREE}"
-	# 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%/}${INSDESTTREE}" -name "_cffi_*.[co]" -delete || die
-	find "${ED%/}${INSDESTTREE}" -type d -empty -delete || die
-
-	# compile the installed modules
-	python_optimize "${ED%/}${INSDESTTREE}"
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2016-06-09 19:46 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2016-06-09 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9debc178f21d1a6a4abbf05634f8ebaa843ee619
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 18:54:05 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 19:46:02 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9debc178

dev-python/pypy3: Update the distutils C++ patch

 ...stutils_c++.patch => 5.2.0-distutils-c++.patch} | 147 +++++++++++++--------
 dev-python/pypy3/pypy3-9999.ebuild                 |   2 +-
 2 files changed, 91 insertions(+), 58 deletions(-)

diff --git a/dev-python/pypy3/files/21_all_distutils_c++.patch b/dev-python/pypy3/files/5.2.0-distutils-c++.patch
similarity index 74%
rename from dev-python/pypy3/files/21_all_distutils_c++.patch
rename to dev-python/pypy3/files/5.2.0-distutils-c++.patch
index f12df8a..1251694 100644
--- a/dev-python/pypy3/files/21_all_distutils_c++.patch
+++ b/dev-python/pypy3/files/5.2.0-distutils-c++.patch
@@ -1,8 +1,55 @@
-http://bugs.python.org/issue1222585
+From e3afe6721897c8de830055621313bc0659518415 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 9 Jun 2016 20:48:10 +0200
+Subject: [PATCH] distutils c++ fixes, python3.3 patch updated for pypy3.3
 
---- Lib/distutils/cygwinccompiler.py
-+++ Lib/distutils/cygwinccompiler.py
-@@ -136,9 +136,13 @@
+---
+ lib-python/3/_osx_support.py                | 10 +++---
+ lib-python/3/distutils/cygwinccompiler.py   | 21 +++++++++--
+ lib-python/3/distutils/emxccompiler.py      | 14 ++++++--
+ lib-python/3/distutils/sysconfig_cpython.py | 25 ++++++++++---
+ lib-python/3/distutils/unixccompiler.py     | 54 ++++++++++++++++-------------
+ 5 files changed, 83 insertions(+), 41 deletions(-)
+
+diff --git a/lib-python/3/_osx_support.py b/lib-python/3/_osx_support.py
+index 50b2d17..1d19599 100644
+--- a/lib-python/3/_osx_support.py
++++ b/lib-python/3/_osx_support.py
+@@ -14,13 +14,13 @@ __all__ = [
+ # 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_'
+diff --git a/lib-python/3/distutils/cygwinccompiler.py b/lib-python/3/distutils/cygwinccompiler.py
+index e0074a1..1b383d3 100644
+--- a/lib-python/3/distutils/cygwinccompiler.py
++++ b/lib-python/3/distutils/cygwinccompiler.py
+@@ -124,8 +124,10 @@ class CygwinCCompiler(UnixCCompiler):
+         # dllwrap 2.10.90 is buggy
+         if self.ld_version >= "2.10.90":
+             self.linker_dll = "gcc"
++            self.linker_dll_cxx = "g++"
+         else:
+             self.linker_dll = "dllwrap"
++            self.linker_dll_cxx = "dllwrap"
+ 
+         # ld_version >= "2.13" support -shared so use it instead of
+         # -mdll -static
+@@ -139,9 +141,13 @@ class CygwinCCompiler(UnixCCompiler):
          self.set_executables(compiler='gcc -mcygwin -O -Wall',
                               compiler_so='gcc -mcygwin -mdll -O -Wall',
                               compiler_cxx='g++ -mcygwin -O -Wall',
@@ -13,11 +60,11 @@ http://bugs.python.org/issue1222585
 +                                        (self.linker_dll, shared_option)),
 +                             linker_exe_cxx='g++ -mcygwin',
 +                             linker_so_cxx=('%s -mcygwin %s' %
-+                                            (self.linker_dll, shared_option)))
++                                            (self.linker_dll_cxx, shared_option)))
  
          # cygwin and mingw32 need different sets of libraries
          if self.gcc_version == "2.91.57":
-@@ -162,8 +166,12 @@
+@@ -165,8 +171,12 @@ class CygwinCCompiler(UnixCCompiler):
                  raise CompileError(msg)
          else: # for other files use the C-compiler
              try:
@@ -32,26 +79,26 @@ http://bugs.python.org/issue1222585
              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))
+@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler):
+         self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
+                              compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
+                              compiler_cxx='g++%s -O -Wall' % no_cygwin,
++                             compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin,
+                              linker_exe='gcc%s' % no_cygwin,
+                              linker_so='%s%s %s %s'
+                                     % (self.linker_dll, no_cygwin,
++                                       shared_option, entry_point),
++                             linker_exe_cxx='g++%s' % no_cygwin,
++                             linker_so_cxx='%s%s %s %s'
++                                    % (self.linker_dll_cxx, no_cygwin,
+                                        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 @@
+diff --git a/lib-python/3/distutils/emxccompiler.py b/lib-python/3/distutils/emxccompiler.py
+index 3675f8d..17d2afa 100644
+--- a/lib-python/3/distutils/emxccompiler.py
++++ b/lib-python/3/distutils/emxccompiler.py
+@@ -63,8 +63,12 @@ class EMXCCompiler (UnixCCompiler):
          # 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',
@@ -65,7 +112,7 @@ http://bugs.python.org/issue1222585
  
          # 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 @@
+@@ -81,8 +85,12 @@ class EMXCCompiler (UnixCCompiler):
                  raise CompileError(msg)
          else: # for other files use the C-compiler
              try:
@@ -80,9 +127,11 @@ http://bugs.python.org/issue1222585
              except DistutilsExecError as msg:
                  raise CompileError(msg)
  
---- Lib/distutils/sysconfig_cpython.py
-+++ Lib/distutils/sysconfig_cpython.py
-@@ -170,9 +170,12 @@
+diff --git a/lib-python/3/distutils/sysconfig_cpython.py b/lib-python/3/distutils/sysconfig_cpython.py
+index b947988..3f19020 100644
+--- a/lib-python/3/distutils/sysconfig_cpython.py
++++ b/lib-python/3/distutils/sysconfig_cpython.py
+@@ -191,9 +191,12 @@ def customize_compiler(compiler):
                  _osx_support.customize_compiler(_config_vars)
                  _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
  
@@ -96,9 +145,9 @@ http://bugs.python.org/issue1222585
 +        cflags = ''
 +        cxxflags = ''
  
-         newcc = None
          if 'CC' in os.environ:
-@@ -181,19 +184,27 @@
+             newcc = os.environ['CC']
+@@ -208,19 +211,27 @@ def customize_compiler(compiler):
              cxx = os.environ['CXX']
          if 'LDSHARED' in os.environ:
              ldshared = os.environ['LDSHARED']
@@ -127,7 +176,7 @@ http://bugs.python.org/issue1222585
          if 'AR' in os.environ:
              ar = os.environ['AR']
          if 'ARFLAGS' in os.environ:
-@@ -202,13 +213,17 @@
+@@ -229,13 +240,17 @@ def customize_compiler(compiler):
              archiver = ar + ' ' + ar_flags
  
          cc_cmd = cc + ' ' + cflags
@@ -146,9 +195,11 @@ http://bugs.python.org/issue1222585
              archiver=archiver)
  
          compiler.shared_lib_extension = shlib_suffix
---- Lib/distutils/unixccompiler.py
-+++ Lib/distutils/unixccompiler.py
-@@ -52,14 +52,17 @@
+diff --git a/lib-python/3/distutils/unixccompiler.py b/lib-python/3/distutils/unixccompiler.py
+index 6819d50..19345ee 100644
+--- a/lib-python/3/distutils/unixccompiler.py
++++ b/lib-python/3/distutils/unixccompiler.py
+@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
      # are pretty generic; they will probably have to be set by an outsider
      # (eg. using information discovered by the sysconfig about building
      # Python extensions).
@@ -174,7 +225,7 @@ http://bugs.python.org/issue1222585
                    }
  
      if sys.platform[:6] == "darwin":
-@@ -108,12 +111,19 @@
+@@ -123,12 +126,19 @@ class UnixCCompiler(CCompiler):
  
      def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
          compiler_so = self.compiler_so
@@ -196,7 +247,7 @@ http://bugs.python.org/issue1222585
          except DistutilsExecError as msg:
              raise CompileError(msg)
  
-@@ -171,22 +181,16 @@
+@@ -186,22 +196,16 @@ class UnixCCompiler(CCompiler):
                  ld_args.extend(extra_postargs)
              self.mkpath(os.path.dirname(output_filename))
              try:
@@ -228,24 +279,6 @@ http://bugs.python.org/issue1222585
  
                  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_'
+-- 
+2.8.4
+

diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
index 8eb168a..031660c 100644
--- a/dev-python/pypy3/pypy3-9999.ebuild
+++ b/dev-python/pypy3/pypy3-9999.ebuild
@@ -92,7 +92,7 @@ src_prepare() {
 
 	# apply CPython stdlib patches
 	pushd lib-python/3 > /dev/null || die
-	epatch "${FILESDIR}"/21_all_distutils_c++.patch
+	epatch "${FILESDIR}"/5.2.0-distutils-c++.patch
 	popd > /dev/null || die
 
 	epatch_user


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2017-02-17 11:44 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2017-02-17 11:44 UTC (permalink / raw
  To: gentoo-commits

commit:     263ad26d0c5a2726ff00bc3760e9b6aedbefb62d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 17 11:36:50 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 11:44:40 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=263ad26d

dev-python/pypy3: Clean up old versions

 dev-python/pypy3/Manifest                          |   2 -
 dev-python/pypy3/files/2.3.1-shared-lib.patch      |  11 -
 .../pypy3/files/2.4.0-21_all_distutils_c++.patch   | 251 --------------------
 dev-python/pypy3/files/2.4.0-ncurses6.patch        |  34 ---
 .../files/pypy3-2.4.0-fix-tkinter-regression.patch |  74 ------
 dev-python/pypy3/files/pypy3-2.4.0-gcc-4.9.patch   |  26 ---
 dev-python/pypy3/files/pypy3-2.4.0-libressl.patch  | 187 ---------------
 dev-python/pypy3/pypy3-2.4.0-r2.ebuild             | 242 --------------------
 dev-python/pypy3/pypy3-5.2.0_alpha1.ebuild         | 253 ---------------------
 9 files changed, 1080 deletions(-)

diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
index 6335aa6f53..c0b031fee6 100644
--- a/dev-python/pypy3/Manifest
+++ b/dev-python/pypy3/Manifest
@@ -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

diff --git a/dev-python/pypy3/files/2.3.1-shared-lib.patch b/dev-python/pypy3/files/2.3.1-shared-lib.patch
deleted file mode 100644
index ae1139f898..0000000000
--- a/dev-python/pypy3/files/2.3.1-shared-lib.patch
+++ /dev/null
@@ -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
- 

diff --git a/dev-python/pypy3/files/2.4.0-21_all_distutils_c++.patch b/dev-python/pypy3/files/2.4.0-21_all_distutils_c++.patch
deleted file mode 100644
index 90525d56ae..0000000000
--- a/dev-python/pypy3/files/2.4.0-21_all_distutils_c++.patch
+++ /dev/null
@@ -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_'

diff --git a/dev-python/pypy3/files/2.4.0-ncurses6.patch b/dev-python/pypy3/files/2.4.0-ncurses6.patch
deleted file mode 100644
index 63a450ff42..0000000000
--- a/dev-python/pypy3/files/2.4.0-ncurses6.patch
+++ /dev/null
@@ -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

diff --git a/dev-python/pypy3/files/pypy3-2.4.0-fix-tkinter-regression.patch b/dev-python/pypy3/files/pypy3-2.4.0-fix-tkinter-regression.patch
deleted file mode 100644
index a92152ee84..0000000000
--- a/dev-python/pypy3/files/pypy3-2.4.0-fix-tkinter-regression.patch
+++ /dev/null
@@ -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:

diff --git a/dev-python/pypy3/files/pypy3-2.4.0-gcc-4.9.patch b/dev-python/pypy3/files/pypy3-2.4.0-gcc-4.9.patch
deleted file mode 100644
index dd3a688c45..0000000000
--- a/dev-python/pypy3/files/pypy3-2.4.0-gcc-4.9.patch
+++ /dev/null
@@ -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

diff --git a/dev-python/pypy3/files/pypy3-2.4.0-libressl.patch b/dev-python/pypy3/files/pypy3-2.4.0-libressl.patch
deleted file mode 100644
index 5852939c50..0000000000
--- a/dev-python/pypy3/files/pypy3-2.4.0-libressl.patch
+++ /dev/null
@@ -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
-

diff --git a/dev-python/pypy3/pypy3-2.4.0-r2.ebuild b/dev-python/pypy3/pypy3-2.4.0-r2.ebuild
deleted file mode 100644
index f86bdd0333..0000000000
--- a/dev-python/pypy3/pypy3-2.4.0-r2.ebuild
+++ /dev/null
@@ -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}"
-}

diff --git a/dev-python/pypy3/pypy3-5.2.0_alpha1.ebuild b/dev-python/pypy3/pypy3-5.2.0_alpha1.ebuild
deleted file mode 100644
index 97d47ed932..0000000000
--- a/dev-python/pypy3/pypy3-5.2.0_alpha1.ebuild
+++ /dev/null
@@ -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}"
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2017-04-25 21:49 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2017-04-25 21:49 UTC (permalink / raw
  To: gentoo-commits

commit:     7523d3ebbbdec0ea5bccedce6185a5454e01a39e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 25 15:58:49 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Apr 25 21:49:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7523d3eb

dev-python/pypy3: Bump 9999 to EAPI 6

 dev-python/pypy3/files/2.5.0-shared-lib.patch |  4 ++--
 dev-python/pypy3/pypy3-9999.ebuild            | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dev-python/pypy3/files/2.5.0-shared-lib.patch b/dev-python/pypy3/files/2.5.0-shared-lib.patch
index ddd74730f3d..b5c877bd58b 100644
--- a/dev-python/pypy3/files/2.5.0-shared-lib.patch
+++ b/dev-python/pypy3/files/2.5.0-shared-lib.patch
@@ -1,6 +1,6 @@
 diff -ur pypy-2.5.0-src.orig/rpython/translator/platform/posix.py pypy-2.5.0-src/rpython/translator/platform/posix.py
---- rpython/translator/platform/posix.py	2015-02-03 05:12:49.000000000 +0800
-+++ rpython/translator/platform/posix.py	2015-03-22 07:36:01.420116684 +0800
+--- a/rpython/translator/platform/posix.py	2015-02-03 05:12:49.000000000 +0800
++++ b/rpython/translator/platform/posix.py	2015-03-22 07:36:01.420116684 +0800
 @@ -183,7 +183,7 @@
                     'int main(int argc, char* argv[]) '
                     '{ return $(PYPY_MAIN_FUNCTION)(argc, argv); }" > $@')

diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
index de0ab069fb8..f22d4d75d87 100644
--- a/dev-python/pypy3/pypy3-9999.ebuild
+++ b/dev-python/pypy3/pypy3-9999.ebuild
@@ -1,14 +1,14 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=6
 
 # pypy3 needs to be built using python 2
 PYTHON_COMPAT=( python2_7 pypy )
 EHG_PROJECT="pypy"
 EHG_REPO_URI="https://bitbucket.org/pypy/pypy"
 EHG_REVISION="py3k"
-inherit check-reqs eutils mercurial multilib multiprocessing pax-utils \
+inherit check-reqs mercurial multiprocessing pax-utils \
 	python-any-r1 toolchain-funcs versionator
 
 DESCRIPTION="A fast, compliant alternative implementation of the Python (3.3) language"
@@ -83,9 +83,9 @@ src_unpack() {
 }
 
 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
+	eapply "${FILESDIR}/4.0.0-gentoo-path.patch"
+	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
+	eapply "${FILESDIR}"/2.5.0-shared-lib.patch	# 517002
 
 	sed -e "s^@EPREFIX@^${EPREFIX}^" \
 		-e "s^@libdir@^$(get_libdir)^" \
@@ -93,10 +93,10 @@ src_prepare() {
 
 	# apply CPython stdlib patches
 	pushd lib-python/3 > /dev/null || die
-	epatch "${FILESDIR}"/5.7.1_all_distutils_cxx.patch
+	eapply "${FILESDIR}"/5.7.1_all_distutils_cxx.patch
 	popd > /dev/null || die
 
-	epatch_user
+	eapply_user
 }
 
 src_configure() {


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2017-04-30 19:22 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2017-04-30 19:22 UTC (permalink / raw
  To: gentoo-commits

commit:     aaa4898d90218cac82b60a5a33df716e06a3976b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 30 16:21:43 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Apr 30 19:22:04 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aaa4898d

dev-python/pypy3: Port -OO builds patch from python3.5

 .../files/python-3.5-distutils-OO-build.patch      | 80 ++++++++++++++++++++++
 .../{pypy3-5.7.1.ebuild => pypy3-5.7.1-r1.ebuild}  |  1 +
 2 files changed, 81 insertions(+)

diff --git a/dev-python/pypy3/files/python-3.5-distutils-OO-build.patch b/dev-python/pypy3/files/python-3.5-distutils-OO-build.patch
new file mode 100644
index 00000000000..ff4446662a9
--- /dev/null
+++ b/dev-python/pypy3/files/python-3.5-distutils-OO-build.patch
@@ -0,0 +1,80 @@
+From 90507018442f9adabb586fd3d0a0206b9c2f2f50 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 5 Jun 2016 08:18:01 +0200
+Subject: [PATCH] distutils: make -OO enable both opt-1 and opt-2 optimization
+
+Bug: http://bugs.python.org/issue27226
+Bug: https://bugs.gentoo.org/585060
+---
+ distutils/command/build_py.py    |  8 ++++----
+ distutils/command/install_lib.py | 12 ++++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/distutils/command/build_py.py b/distutils/command/build_py.py
+index cf0ca57..838d4e4 100644
+--- a/distutils/command/build_py.py
++++ b/distutils/command/build_py.py
+@@ -315,9 +315,9 @@ class build_py (Command):
+                 if self.compile:
+                     outputs.append(importlib.util.cache_from_source(
+                         filename, optimization=''))
+-                if self.optimize > 0:
++                for opt in range(1, self.optimize + 1):
+                     outputs.append(importlib.util.cache_from_source(
+-                        filename, optimization=self.optimize))
++                        filename, optimization=opt))
+ 
+         outputs += [
+             os.path.join(build_dir, filename)
+@@ -387,8 +387,8 @@ class build_py (Command):
+         if self.compile:
+             byte_compile(files, optimize=0,
+                          force=self.force, prefix=prefix, dry_run=self.dry_run)
+-        if self.optimize > 0:
+-            byte_compile(files, optimize=self.optimize,
++        for opt in range(1, self.optimize + 1):
++            byte_compile(files, optimize=opt,
+                          force=self.force, prefix=prefix, dry_run=self.dry_run)
+ 
+ class build_py_2to3(build_py, Mixin2to3):
+diff --git a/distutils/command/install_lib.py b/distutils/command/install_lib.py
+index 6154cf0..049b662 100644
+--- a/distutils/command/install_lib.py
++++ b/distutils/command/install_lib.py
+@@ -24,8 +24,8 @@ class install_lib(Command):
+     #   2) compile .pyc only (--compile --no-optimize; default)
+     #   3) compile .pyc and "opt-1" .pyc (--compile --optimize)
+     #   4) compile "opt-1" .pyc only (--no-compile --optimize)
+-    #   5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
+-    #   6) compile "opt-2" .pyc only (--no-compile --optimize-more)
++    #   5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more)
++    #   6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more)
+     #
+     # The UI for this is two options, 'compile' and 'optimize'.
+     # 'compile' is strictly boolean, and only decides whether to
+@@ -132,8 +132,8 @@ class install_lib(Command):
+             byte_compile(files, optimize=0,
+                          force=self.force, prefix=install_root,
+                          dry_run=self.dry_run)
+-        if self.optimize > 0:
+-            byte_compile(files, optimize=self.optimize,
++        for opt in range(1, self.optimize + 1):
++            byte_compile(files, optimize=opt,
+                          force=self.force, prefix=install_root,
+                          verbose=self.verbose, dry_run=self.dry_run)
+ 
+@@ -167,9 +167,9 @@ class install_lib(Command):
+             if self.compile:
+                 bytecode_files.append(importlib.util.cache_from_source(
+                     py_file, optimization=''))
+-            if self.optimize > 0:
++            for opt in range(1, self.optimize + 1):
+                 bytecode_files.append(importlib.util.cache_from_source(
+-                    py_file, optimization=self.optimize))
++                    py_file, optimization=opt))
+ 
+         return bytecode_files
+ 
+-- 
+2.8.3
+

diff --git a/dev-python/pypy3/pypy3-5.7.1.ebuild b/dev-python/pypy3/pypy3-5.7.1-r1.ebuild
similarity index 99%
rename from dev-python/pypy3/pypy3-5.7.1.ebuild
rename to dev-python/pypy3/pypy3-5.7.1-r1.ebuild
index 9a1165e12a1..7633d4b3dcc 100644
--- a/dev-python/pypy3/pypy3-5.7.1.ebuild
+++ b/dev-python/pypy3/pypy3-5.7.1-r1.ebuild
@@ -88,6 +88,7 @@ src_prepare() {
 	# apply CPython stdlib patches
 	pushd lib-python/3 > /dev/null || die
 	eapply "${FILESDIR}"/5.7.1_all_distutils_cxx.patch
+	eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
 	popd > /dev/null || die
 
 	eapply_user


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2017-06-09 23:10 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2017-06-09 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     8bb3a46e04cc4583c4f115506c711e20e5166ca7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  9 11:57:07 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun  9 23:09:51 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bb3a46e

dev-python/pypy3: Bump to 5.8.0

 dev-python/pypy3/Manifest                          |   1 +
 .../pypy3/files/5.8.0_all_distutils_cxx.patch      | 342 +++++++++++++++++++++
 dev-python/pypy3/pypy3-5.8.0.ebuild                | 236 ++++++++++++++
 3 files changed, 579 insertions(+)

diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
index 3bd62e86f5f..84c8dbad617 100644
--- a/dev-python/pypy3/Manifest
+++ b/dev-python/pypy3/Manifest
@@ -1,3 +1,4 @@
 DIST pypy3-v5.7.1-src.tar.bz2 28811162 SHA256 40ece0145282980ac121390f13709404c0532896507d5767496381180b631bd0 SHA512 f8ead8214ad7d89fe80e24d97b13ece7f2c80b2f11446257a2eab0e3025fc7d8fec26474b0e9eb2b2e3ccd629532dd062829459361b601add12e40793bd5aa60 WHIRLPOOL 180a5cb39c9a5e3840f4940463dd9cccf44486f11a657d2ac644d1eac4561068f08905fdadc495918fb0ceaf018d4b85a3e5756ca6d99a020310b46bdb16ef87
+DIST pypy3-v5.8.0-src.tar.bz2 28986883 SHA256 9d090127335c3c0fd2b14c8835bf91752e62756e55ea06aad3353f24a6854223 SHA512 d78b4c899a5643028664365ed973a7b292a8e5b3989cc75203cd381ea3cda7dd73121c574726e23dca86e8364fcfcf42c372c9deee438c805f30d6e1c4ac115a WHIRLPOOL b7567fa21e3ded400a72ec06197184df37e0b5893adfb55622ea9afb668bfbda7ebbecd9b80660efef42f160838966d103c4181a9b07355e873981b35f4bf104
 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

diff --git a/dev-python/pypy3/files/5.8.0_all_distutils_cxx.patch b/dev-python/pypy3/files/5.8.0_all_distutils_cxx.patch
new file mode 100644
index 00000000000..5d89ce2711c
--- /dev/null
+++ b/dev-python/pypy3/files/5.8.0_all_distutils_cxx.patch
@@ -0,0 +1,342 @@
+From b2f2c9d23996d431d606ac7d8ed731a5302b4e97 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 25 Apr 2017 17:42:33 +0200
+Subject: [PATCH] Fancy distutils C++ support, rebased for PyPy3.5
+
+https://bugs.python.org/issue1222585
+---
+ _osx_support.py                | 10 +++---
+ distutils/cygwinccompiler.py   | 21 +++++++++--
+ distutils/sysconfig_cpython.py | 25 ++++++++++---
+ distutils/sysconfig_pypy.py    | 35 +++++++++++++++----
+ distutils/unixccompiler.py     | 54 ++++++++++++++++-------------
+ 5 files changed, 100 insertions(+), 45 deletions(-)
+
+diff --git a/_osx_support.py b/_osx_support.py
+index 13fcd8b..0525be1 100644
+--- a/_osx_support.py
++++ b/_osx_support.py
+@@ -14,13 +14,13 @@ __all__ = [
+ # 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_'
+diff --git a/distutils/cygwinccompiler.py b/distutils/cygwinccompiler.py
+index c879646..a6157fb 100644
+--- a/distutils/cygwinccompiler.py
++++ b/distutils/cygwinccompiler.py
+@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler):
+         # dllwrap 2.10.90 is buggy
+         if self.ld_version >= "2.10.90":
+             self.linker_dll = "gcc"
++            self.linker_dll_cxx = "g++"
+         else:
+             self.linker_dll = "dllwrap"
++            self.linker_dll_cxx = "dllwrap"
+ 
+         # ld_version >= "2.13" support -shared so use it instead of
+         # -mdll -static
+@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler):
+         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_cxx, shared_option)))
+ 
+         # cygwin and mingw32 need different sets of libraries
+         if self.gcc_version == "2.91.57":
+@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler):
+                 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)
+ 
+@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler):
+         self.set_executables(compiler='gcc -O -Wall',
+                              compiler_so='gcc -mdll -O -Wall',
+                              compiler_cxx='g++ -O -Wall',
++                             compiler_so_cxx='g++ -mdll -O -Wall',
+                              linker_exe='gcc',
+                              linker_so='%s %s %s'
+                                         % (self.linker_dll, shared_option,
++                                           entry_point),
++                             linker_exe_cxx='g++',
++                             linker_so_cxx='%s %s %s'
++                                        % (self.linker_dll_cxx, shared_option,
+                                            entry_point))
+         # Maybe we should also append -mthreads, but then the finished
+         # dlls need another dll (mingwm10.dll see Mingw32 docs)
+diff --git a/distutils/sysconfig_cpython.py b/distutils/sysconfig_cpython.py
+index 573724d..0a04f33 100644
+--- a/distutils/sysconfig_cpython.py
++++ b/distutils/sysconfig_cpython.py
+@@ -173,9 +173,12 @@ def customize_compiler(compiler):
+                 _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 = ''
+ 
+         if 'CC' in os.environ:
+             newcc = os.environ['CC']
+@@ -190,19 +193,27 @@ def customize_compiler(compiler):
+             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:
+@@ -211,13 +222,17 @@ def customize_compiler(compiler):
+             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
+diff --git a/distutils/sysconfig_pypy.py b/distutils/sysconfig_pypy.py
+index a0a8dec..aa97c4e 100644
+--- a/distutils/sysconfig_pypy.py
++++ b/distutils/sysconfig_pypy.py
+@@ -72,6 +72,7 @@ def _init_posix():
+     g['CFLAGS'] = "-DNDEBUG -O2"
+     g['CCSHARED'] = "-fPIC"
+     g['LDSHARED'] = "cc -pthread -shared"
++    g['LDCXXSHARED'] = "c++ -pthread -shared"
+     g['EXT_SUFFIX'] = so_ext
+     g['SHLIB_SUFFIX'] = so_ext
+     g['SO'] = so_ext  # deprecated in Python 3, for backward compatibility
+@@ -156,36 +157,52 @@ def customize_compiler(compiler):
+                 _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 = ''
+ 
+         if 'CC' in os.environ:
+             newcc = os.environ['CC']
+-            if (sys.platform == 'darwin'
++            if (True
+                     and 'LDSHARED' not in os.environ
+                     and ldshared.startswith(cc)):
+                 # On OS X, if CC is overridden, use that as the default
+                 #       command for LDSHARED as well
++                # Gentoo: s/OS X/every system/
+                 ldshared = newcc + ldshared[len(cc):]
+             cc = newcc
+         if 'CXX' in os.environ:
+-            cxx = os.environ['CXX']
++            newcxx = os.environ['CXX']
++            if ('LDCXXSHARED' not in os.environ
++                    and ldcxxshared.startswith(cxx)):
++                ldcxxshared = newcxx + ldcxxshared[len(cxx):]
++            cxx = newcxx
+         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:
+@@ -194,13 +211,17 @@ def customize_compiler(compiler):
+             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
+diff --git a/distutils/unixccompiler.py b/distutils/unixccompiler.py
+index 254b22d..c9cacc1 100644
+--- a/distutils/unixccompiler.py
++++ b/distutils/unixccompiler.py
+@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
+     # 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' : ["c++"],  # pypy: changed, 'cc' is bogus
+-                   '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":
+@@ -125,12 +128,19 @@ class UnixCCompiler(CCompiler):
+ 
+     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)
+ 
+@@ -188,22 +198,16 @@ class UnixCCompiler(CCompiler):
+                 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)
+-- 
+2.12.2
+

diff --git a/dev-python/pypy3/pypy3-5.8.0.ebuild b/dev-python/pypy3/pypy3-5.8.0.ebuild
new file mode 100644
index 00000000000..c51213fe70e
--- /dev/null
+++ b/dev-python/pypy3/pypy3-5.8.0.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# pypy3 needs to be built using python 2
+PYTHON_COMPAT=( python2_7 pypy )
+inherit check-reqs pax-utils python-any-r1 toolchain-funcs versionator
+
+MY_P=pypy3-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"
+
+LICENSE="MIT"
+# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
+SLOT="0/58"
+KEYWORDS="~amd64 ~amd64-linux"
+IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox sqlite 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() {
+	eapply "${FILESDIR}/4.0.0-gentoo-path.patch"
+	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
+	eapply "${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
+	eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
+	eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
+	popd > /dev/null || die
+
+	eapply_user
+}
+
+src_configure() {
+	tc-export CC
+
+	local args=(
+		--shared
+		$(usex jit -Ojit -O2)
+		$(usex sandbox --sandbox '')
+
+		--jit_backend=auto
+
+		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
+
+	# translate into the C sources
+	# we're going to make them ourselves since otherwise pypy does not
+	# free up the unneeded memory before spawning the compiler
+	set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
+	echo -e "\033[1m${@}\033[0m"
+	"${@}" || die "translation failed"
+}
+
+src_compile() {
+	emake -C "${T}"/usession*-0/testing_1
+
+	# copy back to make sys.prefix happy
+	cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
+	pax-mark m pypy3-c libpypy3-c.so
+
+	#use doc && emake -C pypy/doc html
+}
+
+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=./pypy3-c lib-python || die
+}
+
+src_install() {
+	local dest=/usr/$(get_libdir)/pypy3
+	einfo "Installing PyPy ..."
+	exeinto "${dest}"
+	doexe pypy3-c libpypy3-c.so
+	pax-mark m "${ED%/}${dest}/pypy3-c" "${ED%/}${dest}/libpypy3-c.so"
+	insinto "${dest}"
+	doins -r include lib_pypy lib-python
+	dosym ../$(get_libdir)/pypy3/pypy3-c /usr/bin/pypy3
+	dodoc README.rst
+
+	if ! use gdbm; then
+		rm -r "${ED%/}${dest}"/lib_pypy/_gdbm* || die
+	fi
+	if ! use sqlite; then
+		rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
+			"${ED%/}${dest}"/lib_pypy/_sqlite3* \
+			"${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}/pypy3-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",
+#    "ssl": "_ssl_build.py",
+	cffi_targets=( audioop syslog pwdgrp resource lzma decimal ssl )
+	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}"
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2019-10-18 16:24 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2019-10-18 16:24 UTC (permalink / raw
  To: gentoo-commits

commit:     3a339e9997a03f170066624b4eb7c4e92f0eddb4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 17 17:34:59 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct 18 16:24:18 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a339e99

dev-python/pypy3: Bump to 7.2.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/Manifest                          |   1 +
 dev-python/pypy3/files/7.2.0-distutils-cxx.patch   | 306 +++++++++++++++++++++
 .../{pypy3-9999.ebuild => pypy3-7.2.0.ebuild}      |  49 ++--
 dev-python/pypy3/pypy3-9999.ebuild                 |  35 ++-
 4 files changed, 342 insertions(+), 49 deletions(-)

diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
index d687ce6ca9f..1c2085f148f 100644
--- a/dev-python/pypy3/Manifest
+++ b/dev-python/pypy3/Manifest
@@ -1 +1,2 @@
 DIST pypy3.6-v7.1.1-src.tar.bz2 23171982 BLAKE2B be43528bc6f3e02d146016a4969bd8c7a9e880a3bd3b77f441aac6d22ef67700f71e0171ec000066bd2c0bd506db64af69d6b75b59a92222dd0353ee70e6629b SHA512 17e78f9c7080d597a6283d8e8247d1ca78f09a14ff221db8c3d90d255b5befc73102b317ca34a80979e544d5ee72f3e5e649f89d185a085f4cc15012da4d0473
+DIST pypy3.6-v7.2.0-src.tar.bz2 21850076 BLAKE2B 756ea3034fe8971c979ec83c9cbfac55a680f3ef03b276475aa4318f3480ae5ede609b8413412df64db553a33979670498b1f97184f3b57406619c9db7f01127 SHA512 bcbb53062a473d504bcc082cf6286f6169c83d1f38d22c4d7c4e46ddc32bca9d91e71194637e6650db5bec02b29fe262b22fe236d627b6bc3e6e0c59c66c07cc

diff --git a/dev-python/pypy3/files/7.2.0-distutils-cxx.patch b/dev-python/pypy3/files/7.2.0-distutils-cxx.patch
new file mode 100644
index 00000000000..89a38050c80
--- /dev/null
+++ b/dev-python/pypy3/files/7.2.0-distutils-cxx.patch
@@ -0,0 +1,306 @@
+diff --git a/lib-python/3/distutils/cygwinccompiler.py b/lib-python/3/distutils/cygwinccompiler.py
+index 1c36990..ead3174 100644
+--- a/lib-python/3/distutils/cygwinccompiler.py
++++ b/lib-python/3/distutils/cygwinccompiler.py
+@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler):
+         # dllwrap 2.10.90 is buggy
+         if self.ld_version >= "2.10.90":
+             self.linker_dll = "gcc"
++            self.linker_dll_cxx = "g++"
+         else:
+             self.linker_dll = "dllwrap"
++            self.linker_dll_cxx = "dllwrap"
+ 
+         # ld_version >= "2.13" support -shared so use it instead of
+         # -mdll -static
+@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler):
+         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_cxx, shared_option)))
+ 
+         # cygwin and mingw32 need different sets of libraries
+         if self.gcc_version == "2.91.57":
+@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler):
+                 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)
+ 
+@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler):
+         self.set_executables(compiler='gcc -O -Wall',
+                              compiler_so='gcc -mdll -O -Wall',
+                              compiler_cxx='g++ -O -Wall',
++                             compiler_so_cxx='g++ -mdll -O -Wall',
+                              linker_exe='gcc',
+                              linker_so='%s %s %s'
+                                         % (self.linker_dll, shared_option,
++                                           entry_point),
++                             linker_exe_cxx='g++',
++                             linker_so_cxx='%s %s %s'
++                                        % (self.linker_dll_cxx, shared_option,
+                                            entry_point))
+         # Maybe we should also append -mthreads, but then the finished
+         # dlls need another dll (mingwm10.dll see Mingw32 docs)
+diff --git a/lib-python/3/distutils/sysconfig_cpython.py b/lib-python/3/distutils/sysconfig_cpython.py
+index b8340f1..a8c5473 100644
+--- a/lib-python/3/distutils/sysconfig_cpython.py
++++ b/lib-python/3/distutils/sysconfig_cpython.py
+@@ -170,9 +170,12 @@ def customize_compiler(compiler):
+                 _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 = ''
+ 
+         if 'CC' in os.environ:
+             newcc = os.environ['CC']
+@@ -187,19 +190,27 @@ def customize_compiler(compiler):
+             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:
+@@ -208,13 +219,17 @@ def customize_compiler(compiler):
+             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
+diff --git a/lib-python/3/distutils/sysconfig_pypy.py b/lib-python/3/distutils/sysconfig_pypy.py
+index bf1748e..70dfd72 100644
+--- a/lib-python/3/distutils/sysconfig_pypy.py
++++ b/lib-python/3/distutils/sysconfig_pypy.py
+@@ -145,36 +145,52 @@ def customize_compiler(compiler):
+                 _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 = ''
+ 
+         if 'CC' in os.environ:
+             newcc = os.environ['CC']
+-            if (sys.platform == 'darwin'
++            if (True
+                     and 'LDSHARED' not in os.environ
+                     and ldshared.startswith(cc)):
+                 # On OS X, if CC is overridden, use that as the default
+                 #       command for LDSHARED as well
++                # Gentoo: s/OS X/every system/
+                 ldshared = newcc + ldshared[len(cc):]
+             cc = newcc
+         if 'CXX' in os.environ:
+-            cxx = os.environ['CXX']
++            newcxx = os.environ['CXX']
++            if ('LDCXXSHARED' not in os.environ
++                    and ldcxxshared.startswith(cxx)):
++                ldcxxshared = newcxx + ldcxxshared[len(cxx):]
++            cxx = newcxx
+         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:
+@@ -183,13 +199,17 @@ def customize_compiler(compiler):
+             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
+diff --git a/lib-python/3/distutils/unixccompiler.py b/lib-python/3/distutils/unixccompiler.py
+index 2944ceb..cf2f219 100644
+--- a/lib-python/3/distutils/unixccompiler.py
++++ b/lib-python/3/distutils/unixccompiler.py
+@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
+     # 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' : ["c++"],  # pypy: changed, 'cc' is bogus
+-                   '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":
+@@ -125,12 +128,19 @@ class UnixCCompiler(CCompiler):
+ 
+     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)
+ 
+@@ -188,22 +198,16 @@ class UnixCCompiler(CCompiler):
+                 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)
+diff --git a/lib_pypy/_sysconfigdata.py b/lib_pypy/_sysconfigdata.py
+index 4d2b0bc..5ed9641 100644
+--- a/lib_pypy/_sysconfigdata.py
++++ b/lib_pypy/_sysconfigdata.py
+@@ -15,6 +15,7 @@ build_time_vars = {
+     'CFLAGS': "-DNDEBUG -O2",
+     'CCSHARED': "-fPIC",
+     'LDSHARED': "cc -pthread -shared",
++    'LDCXXSHARED': "c++ -pthread -shared",
+     'EXT_SUFFIX': so_ext,
+     'SHLIB_SUFFIX': ".so",
+     'AR': "ar",

diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-7.2.0.ebuild
similarity index 86%
copy from dev-python/pypy3/pypy3-9999.ebuild
copy to dev-python/pypy3/pypy3-7.2.0.ebuild
index d6e6b0856ea..b703db56d2d 100644
--- a/dev-python/pypy3/pypy3-9999.ebuild
+++ b/dev-python/pypy3/pypy3-7.2.0.ebuild
@@ -5,21 +5,18 @@ EAPI=7
 
 # pypy3 needs to be built using python 2
 PYTHON_COMPAT=( python2_7 pypy )
-EHG_PROJECT="pypy"
-EHG_REPO_URI="https://bitbucket.org/pypy/pypy"
-EHG_REVISION="py3.6"
-inherit check-reqs mercurial pax-utils python-any-r1 toolchain-funcs
+inherit check-reqs pax-utils python-any-r1 toolchain-funcs
 
 MY_P=pypy3.6-v${PV}
 
 DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
-HOMEPAGE="http://pypy.org/"
-SRC_URI=""
+HOMEPAGE="https://pypy.org/"
+SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
 
 LICENSE="MIT"
 # pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
-SLOT="0/71-py36"
-KEYWORDS=""
+SLOT="0/72-py36"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
 IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
 	sandbox sqlite tk"
 
@@ -87,16 +84,11 @@ pkg_setup() {
 	fi
 }
 
-src_unpack() {
-	default
-	mercurial_src_unpack
-}
-
 src_prepare() {
 	eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
 	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
 	eapply "${FILESDIR}"/5.9.0-shared-lib.patch	# 517002
-	eapply "${FILESDIR}"/7.0.0_all_distutils_cxx.patch
+	eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
 
 	sed -e "s^@EPREFIX@^${EPREFIX}^" \
 		-i lib-python/3/distutils/command/install.py || die
@@ -188,18 +180,18 @@ src_compile() {
 	# Generate cffi modules
 	# Please keep in sync with pypy/tool/build_cffi_imports.py!
 #cffi_build_scripts = {
+#    "_blake2": "_blake2/_blake2_build.py",
+#    "_ssl": "_ssl_build.py",
 #    "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,
+#    "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",
-#    "_ssl": "_ssl_build.py",
-#    "_blake2": "_blake2/_blake2_build.py",
 #    "_sha3": "_sha3/_sha3_build.py",
 	cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
 		audioop syslog pwdgrp resource lzma decimal )
@@ -208,9 +200,6 @@ src_compile() {
 	use sqlite && cffi_targets+=( sqlite3 )
 	use tk && cffi_targets+=( tkinter/tklib )
 
-	einfo "Please disregard the import errors during CFFI cache generation."
-	einfo "They come from modules not built yet."
-
 	local t
 	# all modules except tkinter output to .
 	# tkinter outputs to the correct dir ...
@@ -239,7 +228,7 @@ src_install() {
 	einfo "Installing PyPy ..."
 	exeinto "${dest}"
 	doexe pypy3-c libpypy3-c.so
-	pax-mark m "${ED%/}${dest}/pypy3-c" "${ED%/}${dest}/libpypy3-c.so"
+	pax-mark m "${ED}${dest}/pypy3-c" "${ED}${dest}/libpypy3-c.so"
 	insinto "${dest}"
 	# preserve mtimes to avoid obsoleting caches
 	insopts -p
@@ -248,22 +237,22 @@ src_install() {
 	dodoc README.rst
 
 	if ! use gdbm; then
-		rm -r "${ED%/}${dest}"/lib_pypy/_gdbm* || die
+		rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
 	fi
 	if ! use sqlite; then
-		rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
-			"${ED%/}${dest}"/lib_pypy/_sqlite3* \
-			"${ED%/}${dest}"/lib-python/*3/test/test_sqlite.py || die
+		rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
+			"${ED}${dest}"/lib_pypy/_sqlite3* \
+			"${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
+		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
 
 	einfo "Generating caches and byte-compiling ..."
 
-	local -x PYTHON=${ED%/}${dest}/pypy3-c
+	local -x PYTHON=${ED}${dest}/pypy3-c
 	# we can't use eclass function since PyPy is dumb and always gives
 	# paths relative to the interpreter
 	local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
@@ -275,5 +264,5 @@ src_install() {
 	einfo "Byte-compiling Python standard library..."
 
 	# compile the installed modules
-	python_optimize "${ED%/}${dest}"
+	python_optimize "${ED}${dest}"
 }

diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
index d6e6b0856ea..12b0e7fae86 100644
--- a/dev-python/pypy3/pypy3-9999.ebuild
+++ b/dev-python/pypy3/pypy3-9999.ebuild
@@ -13,12 +13,12 @@ inherit check-reqs mercurial pax-utils python-any-r1 toolchain-funcs
 MY_P=pypy3.6-v${PV}
 
 DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
-HOMEPAGE="http://pypy.org/"
+HOMEPAGE="https://pypy.org/"
 SRC_URI=""
 
 LICENSE="MIT"
 # pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
-SLOT="0/71-py36"
+SLOT="0/72-py36"
 KEYWORDS=""
 IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
 	sandbox sqlite tk"
@@ -96,7 +96,7 @@ src_prepare() {
 	eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
 	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
 	eapply "${FILESDIR}"/5.9.0-shared-lib.patch	# 517002
-	eapply "${FILESDIR}"/7.0.0_all_distutils_cxx.patch
+	eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
 
 	sed -e "s^@EPREFIX@^${EPREFIX}^" \
 		-i lib-python/3/distutils/command/install.py || die
@@ -188,18 +188,18 @@ src_compile() {
 	# Generate cffi modules
 	# Please keep in sync with pypy/tool/build_cffi_imports.py!
 #cffi_build_scripts = {
+#    "_blake2": "_blake2/_blake2_build.py",
+#    "_ssl": "_ssl_build.py",
 #    "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,
+#    "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",
-#    "_ssl": "_ssl_build.py",
-#    "_blake2": "_blake2/_blake2_build.py",
 #    "_sha3": "_sha3/_sha3_build.py",
 	cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
 		audioop syslog pwdgrp resource lzma decimal )
@@ -208,9 +208,6 @@ src_compile() {
 	use sqlite && cffi_targets+=( sqlite3 )
 	use tk && cffi_targets+=( tkinter/tklib )
 
-	einfo "Please disregard the import errors during CFFI cache generation."
-	einfo "They come from modules not built yet."
-
 	local t
 	# all modules except tkinter output to .
 	# tkinter outputs to the correct dir ...
@@ -239,7 +236,7 @@ src_install() {
 	einfo "Installing PyPy ..."
 	exeinto "${dest}"
 	doexe pypy3-c libpypy3-c.so
-	pax-mark m "${ED%/}${dest}/pypy3-c" "${ED%/}${dest}/libpypy3-c.so"
+	pax-mark m "${ED}${dest}/pypy3-c" "${ED}${dest}/libpypy3-c.so"
 	insinto "${dest}"
 	# preserve mtimes to avoid obsoleting caches
 	insopts -p
@@ -248,22 +245,22 @@ src_install() {
 	dodoc README.rst
 
 	if ! use gdbm; then
-		rm -r "${ED%/}${dest}"/lib_pypy/_gdbm* || die
+		rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
 	fi
 	if ! use sqlite; then
-		rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
-			"${ED%/}${dest}"/lib_pypy/_sqlite3* \
-			"${ED%/}${dest}"/lib-python/*3/test/test_sqlite.py || die
+		rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
+			"${ED}${dest}"/lib_pypy/_sqlite3* \
+			"${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
+		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
 
 	einfo "Generating caches and byte-compiling ..."
 
-	local -x PYTHON=${ED%/}${dest}/pypy3-c
+	local -x PYTHON=${ED}${dest}/pypy3-c
 	# we can't use eclass function since PyPy is dumb and always gives
 	# paths relative to the interpreter
 	local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
@@ -275,5 +272,5 @@ src_install() {
 	einfo "Byte-compiling Python standard library..."
 
 	# compile the installed modules
-	python_optimize "${ED%/}${dest}"
+	python_optimize "${ED}${dest}"
 }


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2019-11-01  8:07 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2019-11-01  8:07 UTC (permalink / raw
  To: gentoo-commits

commit:     75a8f49809d9c082d9bbd6403aa0d637f5d93eac
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  1 07:45:49 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov  1 08:03:21 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75a8f498

dev-python/pypy3: Fix Gentoo path patch

Bug: https://bugs.gentoo.org/465546
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/files/7.0.0-gentoo-path.patch                 | 2 +-
 dev-python/pypy3/{pypy3-7.2.0.ebuild => pypy3-7.2.0-r1.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-python/pypy3/files/7.0.0-gentoo-path.patch b/dev-python/pypy3/files/7.0.0-gentoo-path.patch
index 17409fa89a4..135e496f253 100644
--- a/dev-python/pypy3/files/7.0.0-gentoo-path.patch
+++ b/dev-python/pypy3/files/7.0.0-gentoo-path.patch
@@ -39,7 +39,7 @@ index 77a1827d4b..255603967f 100644
          if (hasattr(sys, 'pypy_version_info') and
              not name.endswith(('_user', '_home'))):
 -            name = 'pypy'
-+            if self.install_base == os.path.normpath('@EPREFIX@/usr/lib/pypy3.5'):
++            if self.install_base == os.path.normpath('@EPREFIX@/usr/lib/pypy3.6'):
 +                # override paths for system-wide install
 +                name = 'gentoo'
 +            else:

diff --git a/dev-python/pypy3/pypy3-7.2.0.ebuild b/dev-python/pypy3/pypy3-7.2.0-r1.ebuild
similarity index 100%
rename from dev-python/pypy3/pypy3-7.2.0.ebuild
rename to dev-python/pypy3/pypy3-7.2.0-r1.ebuild


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2019-11-01  8:07 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2019-11-01  8:07 UTC (permalink / raw
  To: gentoo-commits

commit:     90fcaad7b9e9fe8e49c35f232138225ea2ab2c9c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  1 07:49:58 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov  1 08:03:37 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90fcaad7

dev-python/pypy3: Drop 7.1.1

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/Manifest                          |   1 -
 .../pypy3/files/7.0.0_all_distutils_cxx.patch      | 347 ---------------------
 dev-python/pypy3/pypy3-7.1.1.ebuild                | 271 ----------------
 3 files changed, 619 deletions(-)

diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
index 1c2085f148f..4fa9943404f 100644
--- a/dev-python/pypy3/Manifest
+++ b/dev-python/pypy3/Manifest
@@ -1,2 +1 @@
-DIST pypy3.6-v7.1.1-src.tar.bz2 23171982 BLAKE2B be43528bc6f3e02d146016a4969bd8c7a9e880a3bd3b77f441aac6d22ef67700f71e0171ec000066bd2c0bd506db64af69d6b75b59a92222dd0353ee70e6629b SHA512 17e78f9c7080d597a6283d8e8247d1ca78f09a14ff221db8c3d90d255b5befc73102b317ca34a80979e544d5ee72f3e5e649f89d185a085f4cc15012da4d0473
 DIST pypy3.6-v7.2.0-src.tar.bz2 21850076 BLAKE2B 756ea3034fe8971c979ec83c9cbfac55a680f3ef03b276475aa4318f3480ae5ede609b8413412df64db553a33979670498b1f97184f3b57406619c9db7f01127 SHA512 bcbb53062a473d504bcc082cf6286f6169c83d1f38d22c4d7c4e46ddc32bca9d91e71194637e6650db5bec02b29fe262b22fe236d627b6bc3e6e0c59c66c07cc

diff --git a/dev-python/pypy3/files/7.0.0_all_distutils_cxx.patch b/dev-python/pypy3/files/7.0.0_all_distutils_cxx.patch
deleted file mode 100644
index a9099e5c9dc..00000000000
--- a/dev-python/pypy3/files/7.0.0_all_distutils_cxx.patch
+++ /dev/null
@@ -1,347 +0,0 @@
-From 5c396fb8b644e5de82d9b54cdb088ea673e16e14 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Tue, 25 Apr 2017 17:42:33 +0200
-Subject: [PATCH] Fancy distutils C++ support, rebased for PyPy3.5/7.0.0
-
-https://bugs.python.org/issue1222585
----
- lib-python/3/_osx_support.py                | 10 ++--
- lib-python/3/distutils/cygwinccompiler.py   | 21 ++++++--
- lib-python/3/distutils/sysconfig_cpython.py | 25 ++++++++--
- lib-python/3/distutils/sysconfig_pypy.py    | 34 ++++++++++---
- lib-python/3/distutils/unixccompiler.py     | 54 +++++++++++----------
- lib_pypy/_sysconfigdata.py                  |  1 +
- 6 files changed, 100 insertions(+), 45 deletions(-)
-
-diff --git a/lib-python/3/_osx_support.py b/lib-python/3/_osx_support.py
-index 13fcd8b8d2..0525be1cbc 100644
---- a/lib-python/3/_osx_support.py
-+++ b/lib-python/3/_osx_support.py
-@@ -14,13 +14,13 @@ __all__ = [
- # 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_'
-diff --git a/lib-python/3/distutils/cygwinccompiler.py b/lib-python/3/distutils/cygwinccompiler.py
-index c879646c0f..a6157fbd5f 100644
---- a/lib-python/3/distutils/cygwinccompiler.py
-+++ b/lib-python/3/distutils/cygwinccompiler.py
-@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler):
-         # dllwrap 2.10.90 is buggy
-         if self.ld_version >= "2.10.90":
-             self.linker_dll = "gcc"
-+            self.linker_dll_cxx = "g++"
-         else:
-             self.linker_dll = "dllwrap"
-+            self.linker_dll_cxx = "dllwrap"
- 
-         # ld_version >= "2.13" support -shared so use it instead of
-         # -mdll -static
-@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler):
-         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_cxx, shared_option)))
- 
-         # cygwin and mingw32 need different sets of libraries
-         if self.gcc_version == "2.91.57":
-@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler):
-                 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)
- 
-@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler):
-         self.set_executables(compiler='gcc -O -Wall',
-                              compiler_so='gcc -mdll -O -Wall',
-                              compiler_cxx='g++ -O -Wall',
-+                             compiler_so_cxx='g++ -mdll -O -Wall',
-                              linker_exe='gcc',
-                              linker_so='%s %s %s'
-                                         % (self.linker_dll, shared_option,
-+                                           entry_point),
-+                             linker_exe_cxx='g++',
-+                             linker_so_cxx='%s %s %s'
-+                                        % (self.linker_dll_cxx, shared_option,
-                                            entry_point))
-         # Maybe we should also append -mthreads, but then the finished
-         # dlls need another dll (mingwm10.dll see Mingw32 docs)
-diff --git a/lib-python/3/distutils/sysconfig_cpython.py b/lib-python/3/distutils/sysconfig_cpython.py
-index 573724ddd7..0a04f33a86 100644
---- a/lib-python/3/distutils/sysconfig_cpython.py
-+++ b/lib-python/3/distutils/sysconfig_cpython.py
-@@ -173,9 +173,12 @@ def customize_compiler(compiler):
-                 _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 = ''
- 
-         if 'CC' in os.environ:
-             newcc = os.environ['CC']
-@@ -190,19 +193,27 @@ def customize_compiler(compiler):
-             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:
-@@ -211,13 +222,17 @@ def customize_compiler(compiler):
-             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
-diff --git a/lib-python/3/distutils/sysconfig_pypy.py b/lib-python/3/distutils/sysconfig_pypy.py
-index bf1748e300..70dfd72a1a 100644
---- a/lib-python/3/distutils/sysconfig_pypy.py
-+++ b/lib-python/3/distutils/sysconfig_pypy.py
-@@ -145,36 +145,52 @@ def customize_compiler(compiler):
-                 _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 = ''
- 
-         if 'CC' in os.environ:
-             newcc = os.environ['CC']
--            if (sys.platform == 'darwin'
-+            if (True
-                     and 'LDSHARED' not in os.environ
-                     and ldshared.startswith(cc)):
-                 # On OS X, if CC is overridden, use that as the default
-                 #       command for LDSHARED as well
-+                # Gentoo: s/OS X/every system/
-                 ldshared = newcc + ldshared[len(cc):]
-             cc = newcc
-         if 'CXX' in os.environ:
--            cxx = os.environ['CXX']
-+            newcxx = os.environ['CXX']
-+            if ('LDCXXSHARED' not in os.environ
-+                    and ldcxxshared.startswith(cxx)):
-+                ldcxxshared = newcxx + ldcxxshared[len(cxx):]
-+            cxx = newcxx
-         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:
-@@ -183,13 +199,17 @@ def customize_compiler(compiler):
-             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
-diff --git a/lib-python/3/distutils/unixccompiler.py b/lib-python/3/distutils/unixccompiler.py
-index 32030ed150..1db3d5498b 100644
---- a/lib-python/3/distutils/unixccompiler.py
-+++ b/lib-python/3/distutils/unixccompiler.py
-@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
-     # 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' : ["c++"],  # pypy: changed, 'cc' is bogus
--                   '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":
-@@ -125,12 +128,19 @@ class UnixCCompiler(CCompiler):
- 
-     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)
- 
-@@ -188,22 +198,16 @@ class UnixCCompiler(CCompiler):
-                 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)
-diff --git a/lib_pypy/_sysconfigdata.py b/lib_pypy/_sysconfigdata.py
-index 2ceafe80bf..ee3f802c41 100644
---- a/lib_pypy/_sysconfigdata.py
-+++ b/lib_pypy/_sysconfigdata.py
-@@ -15,6 +15,7 @@ build_time_vars = {
-     'CFLAGS': "-DNDEBUG -O2",
-     'CCSHARED': "-fPIC",
-     'LDSHARED': "cc -pthread -shared",
-+    'LDCXXSHARED': "c++ -pthread -shared",
-     'EXT_SUFFIX': so_ext,
-     'SHLIB_SUFFIX': ".so",
-     'AR': "ar",
--- 
-2.20.1
-

diff --git a/dev-python/pypy3/pypy3-7.1.1.ebuild b/dev-python/pypy3/pypy3-7.1.1.ebuild
deleted file mode 100644
index 344f0da4013..00000000000
--- a/dev-python/pypy3/pypy3-7.1.1.ebuild
+++ /dev/null
@@ -1,271 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# pypy3 needs to be built using python 2
-PYTHON_COMPAT=( python2_7 pypy )
-inherit check-reqs pax-utils python-any-r1 toolchain-funcs
-
-MY_P=pypy3.6-v${PV}
-
-DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
-HOMEPAGE="http://pypy.org/"
-SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
-
-LICENSE="MIT"
-# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
-SLOT="0/71-py36"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
-	sandbox sqlite 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 )
-	!low-memory? (
-		|| (
-			virtual/pypy
-			(
-				dev-lang/python:2.7
-				dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
-			)
-		)
-	)"
-
-S="${WORKDIR}/${MY_P}-src"
-
-check_env() {
-	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
-}
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} != binary ]] && check_env
-}
-
-pkg_setup() {
-	if [[ ${MERGE_TYPE} != binary ]]; then
-		check_env
-
-		# 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() {
-	eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
-	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
-	eapply "${FILESDIR}"/5.9.0-shared-lib.patch	# 517002
-	eapply "${FILESDIR}"/7.0.0_all_distutils_cxx.patch
-
-	sed -e "s^@EPREFIX@^${EPREFIX}^" \
-		-i lib-python/3/distutils/command/install.py || die
-
-	# apply CPython stdlib patches
-	pushd lib-python/3 > /dev/null || die
-	eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
-	popd > /dev/null || die
-
-	eapply_user
-}
-
-src_configure() {
-	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 sandbox --sandbox '')
-
-		${jit_backend}
-
-		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
-
-	# translate into the C sources
-	# we're going to make them ourselves since otherwise pypy does not
-	# free up the unneeded memory before spawning the compiler
-	set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
-	echo -e "\033[1m${@}\033[0m"
-	"${@}" || die "translation failed"
-}
-
-src_compile() {
-	emake -C "${T}"/usession*-0/testing_1
-
-	# copy back to make sys.prefix happy
-	cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
-	pax-mark m pypy3-c libpypy3-c.so
-
-	einfo "Generating caches and CFFI modules ..."
-
-	# Generate Grammar and PatternGrammar pickles.
-	./pypy3-c -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",
-#    "_ssl": "_ssl_build.py",
-#    "_blake2": "_blake2/_blake2_build.py",
-#    "_sha3": "_sha3/_sha3_build.py",
-	cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
-		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 )
-
-	einfo "Please disregard the import errors during CFFI cache generation."
-	einfo "They come from modules not built yet."
-
-	local t
-	# all modules except tkinter output to .
-	# tkinter outputs to the correct dir ...
-	cd lib_pypy || die
-	for t in "${cffi_targets[@]}"; do
-		# tkinter doesn't work via -m
-		../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
-	done
-
-	# Cleanup temporary objects
-	find -name "_cffi_*.[co]" -delete || die
-	find -type d -empty -delete || die
-}
-
-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=./pypy3-c -vv lib-python || die
-}
-
-src_install() {
-	local dest=/usr/lib/pypy3.6
-	einfo "Installing PyPy ..."
-	exeinto "${dest}"
-	doexe pypy3-c libpypy3-c.so
-	pax-mark m "${ED%/}${dest}/pypy3-c" "${ED%/}${dest}/libpypy3-c.so"
-	insinto "${dest}"
-	# preserve mtimes to avoid obsoleting caches
-	insopts -p
-	doins -r include lib_pypy lib-python
-	dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
-	dodoc README.rst
-
-	if ! use gdbm; then
-		rm -r "${ED%/}${dest}"/lib_pypy/_gdbm* || die
-	fi
-	if ! use sqlite; then
-		rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
-			"${ED%/}${dest}"/lib_pypy/_sqlite3* \
-			"${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
-
-	einfo "Generating caches and byte-compiling ..."
-
-	local -x PYTHON=${ED%/}${dest}/pypy3-c
-	# we can't use eclass function since PyPy is dumb and always gives
-	# paths relative to the interpreter
-	local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
-	python_export pypy3 EPYTHON
-
-	echo "EPYTHON='${EPYTHON}'" > epython.py || die
-	python_domodule epython.py
-
-	einfo "Byte-compiling Python standard library..."
-
-	# compile the installed modules
-	python_optimize "${ED%/}${dest}"
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2019-12-30 11:59 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2019-12-30 11:59 UTC (permalink / raw
  To: gentoo-commits

commit:     829f4b98aa35399577598c004a87d256136a8684
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 30 11:04:45 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec 30 11:57:54 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=829f4b98

dev-python/pypy3: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/Manifest                     |   2 -
 dev-python/pypy3/files/5.9.0-shared-lib.patch |  12 --
 dev-python/pypy3/metadata.xml                 |   3 -
 dev-python/pypy3/pypy3-7.2.0-r1.ebuild        | 268 --------------------------
 dev-python/pypy3/pypy3-7.3.0_rc1.ebuild       | 268 --------------------------
 5 files changed, 553 deletions(-)

diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
index c62cafb9ced..ba24d510819 100644
--- a/dev-python/pypy3/Manifest
+++ b/dev-python/pypy3/Manifest
@@ -1,3 +1 @@
-DIST pypy3.6-v7.2.0-src.tar.bz2 21850076 BLAKE2B 756ea3034fe8971c979ec83c9cbfac55a680f3ef03b276475aa4318f3480ae5ede609b8413412df64db553a33979670498b1f97184f3b57406619c9db7f01127 SHA512 bcbb53062a473d504bcc082cf6286f6169c83d1f38d22c4d7c4e46ddc32bca9d91e71194637e6650db5bec02b29fe262b22fe236d627b6bc3e6e0c59c66c07cc
 DIST pypy3.6-v7.3.0-src.tar.bz2 21937786 BLAKE2B c53ac32a9cca1c4624160eae9f11b5705a59613f1e5100fbb0ee86118de5a7845b8fa5087165d7f5a077d20337dfca14a1c7eadbe768995e20e249ec271ac10d SHA512 313a4254262dd8d8b995a50bddbc360cfb67add0818e51a3e9ce25bda6a9b639e9fea8efe7da6adda76dff0a86a364544a13faa516e51b9ea6c25ec99223b435
-DIST pypy3.6-v7.3.0rc1-src.tar.bz2 22009224 BLAKE2B f5b2557369a8ba101ef38c46437a6b2af03521a5cdbedd2d1b1ee6c1349b66b7bf740290620e1143b544ca7cbcac960192cca889ac253585185bd7776b487110 SHA512 3f39b0b1454f2063b321221453487b42ee96d08ecaf5a19dc788a2b9975e9601c39ccb6e7b0de54ee81c24f4def217d8ddaa09ed5541a857c77d05f9cfc62c05

diff --git a/dev-python/pypy3/files/5.9.0-shared-lib.patch b/dev-python/pypy3/files/5.9.0-shared-lib.patch
deleted file mode 100644
index 5d89d3b15a3..00000000000
--- a/dev-python/pypy3/files/5.9.0-shared-lib.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -dupr a/rpython/translator/platform/posix.py b/rpython/translator/platform/posix.py
---- a/rpython/translator/platform/posix.py	2017-10-05 20:17:25.009954656 +0200
-+++ b/rpython/translator/platform/posix.py	2017-10-05 20:17:31.115666386 +0200
-@@ -227,7 +227,7 @@ class BasePosix(Platform):
-                    '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 $@ $(RPATH_FLAGS)', '$(MAKE) postcompile BIN=$(DEFAULT_TARGET)'])
-+                   ['$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) \'-Wl,-rpath,$$ORIGIN\' -o $@', '$(MAKE) postcompile BIN=$(DEFAULT_TARGET)'])
- 
-         return m
- 

diff --git a/dev-python/pypy3/metadata.xml b/dev-python/pypy3/metadata.xml
index 89f86a0b2be..fa323d0cd24 100644
--- a/dev-python/pypy3/metadata.xml
+++ b/dev-python/pypy3/metadata.xml
@@ -6,9 +6,6 @@
 		<name>Python</name>
 	</maintainer>
 	<use>
-		<flag name="low-memory">Build using PyPy with the engine configured towards low memory footprint.
-			This makes it possible to build PyPy using ~3.5G of RAM on amd64 and ~half of that on x86,
-			at the cost of lengthened build time.</flag>
 		<flag name="sandbox">Enable sandboxing functionality</flag>
 	</use>
 	<upstream>

diff --git a/dev-python/pypy3/pypy3-7.2.0-r1.ebuild b/dev-python/pypy3/pypy3-7.2.0-r1.ebuild
deleted file mode 100644
index 0b49fbb2bc8..00000000000
--- a/dev-python/pypy3/pypy3-7.2.0-r1.ebuild
+++ /dev/null
@@ -1,268 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# pypy3 needs to be built using python 2
-PYTHON_COMPAT=( python2_7 pypy )
-inherit check-reqs pax-utils python-any-r1 toolchain-funcs
-
-MY_P=pypy3.6-v${PV}
-
-DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
-HOMEPAGE="https://pypy.org/"
-SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
-
-LICENSE="MIT"
-# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
-SLOT="0/72-py36"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
-	sandbox sqlite 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: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 )
-	!low-memory? (
-		|| (
-			virtual/pypy
-			(
-				dev-lang/python:2.7
-				dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
-			)
-		)
-	)"
-
-S="${WORKDIR}/${MY_P}-src"
-
-check_env() {
-	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
-}
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} != binary ]] && check_env
-}
-
-pkg_setup() {
-	if [[ ${MERGE_TYPE} != binary ]]; then
-		check_env
-
-		# 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() {
-	eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
-	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
-	eapply "${FILESDIR}"/5.9.0-shared-lib.patch	# 517002
-	eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
-
-	sed -e "s^@EPREFIX@^${EPREFIX}^" \
-		-i lib-python/3/distutils/command/install.py || die
-
-	# apply CPython stdlib patches
-	pushd lib-python/3 > /dev/null || die
-	eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
-	popd > /dev/null || die
-
-	eapply_user
-}
-
-src_configure() {
-	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 sandbox --sandbox '')
-
-		${jit_backend}
-
-		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
-
-	# translate into the C sources
-	# we're going to make them ourselves since otherwise pypy does not
-	# free up the unneeded memory before spawning the compiler
-	set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
-	echo -e "\033[1m${@}\033[0m"
-	"${@}" || die "translation failed"
-}
-
-src_compile() {
-	emake -C "${T}"/usession*-0/testing_1
-
-	# copy back to make sys.prefix happy
-	cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
-	pax-mark m pypy3-c libpypy3-c.so
-
-	einfo "Generating caches and CFFI modules ..."
-
-	# Generate Grammar and PatternGrammar pickles.
-	./pypy3-c -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 = {
-#    "_blake2": "_blake2/_blake2_build.py",
-#    "_ssl": "_ssl_build.py",
-#    "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",
-#    "_sha3": "_sha3/_sha3_build.py",
-	cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
-		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 lib_pypy || die
-	for t in "${cffi_targets[@]}"; do
-		# tkinter doesn't work via -m
-		../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
-	done
-
-	# Cleanup temporary objects
-	find -name "_cffi_*.[co]" -delete || die
-	find -type d -empty -delete || die
-}
-
-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=./pypy3-c -vv lib-python || die
-}
-
-src_install() {
-	local dest=/usr/lib/pypy3.6
-	einfo "Installing PyPy ..."
-	exeinto "${dest}"
-	doexe pypy3-c libpypy3-c.so
-	pax-mark m "${ED}${dest}/pypy3-c" "${ED}${dest}/libpypy3-c.so"
-	insinto "${dest}"
-	# preserve mtimes to avoid obsoleting caches
-	insopts -p
-	doins -r include lib_pypy lib-python
-	dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
-	dodoc README.rst
-
-	if ! use gdbm; then
-		rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
-	fi
-	if ! use sqlite; then
-		rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
-			"${ED}${dest}"/lib_pypy/_sqlite3* \
-			"${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
-
-	einfo "Generating caches and byte-compiling ..."
-
-	local -x PYTHON=${ED}${dest}/pypy3-c
-	# we can't use eclass function since PyPy is dumb and always gives
-	# paths relative to the interpreter
-	local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
-	python_export pypy3 EPYTHON
-
-	echo "EPYTHON='${EPYTHON}'" > epython.py || die
-	python_domodule epython.py
-
-	einfo "Byte-compiling Python standard library..."
-
-	# compile the installed modules
-	python_optimize "${ED}${dest}"
-}

diff --git a/dev-python/pypy3/pypy3-7.3.0_rc1.ebuild b/dev-python/pypy3/pypy3-7.3.0_rc1.ebuild
deleted file mode 100644
index 50bd413a6da..00000000000
--- a/dev-python/pypy3/pypy3-7.3.0_rc1.ebuild
+++ /dev/null
@@ -1,268 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# pypy3 needs to be built using python 2
-PYTHON_COMPAT=( python2_7 pypy )
-inherit check-reqs pax-utils python-any-r1 toolchain-funcs
-
-MY_P=pypy3.6-v${PV/_/}
-
-DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
-HOMEPAGE="https://pypy.org/"
-SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
-
-LICENSE="MIT"
-# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
-SLOT="0/pypy36-pp73"
-KEYWORDS=""
-IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
-	sandbox sqlite 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: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 )
-	!low-memory? (
-		|| (
-			virtual/pypy
-			(
-				dev-lang/python:2.7
-				dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
-			)
-		)
-	)"
-
-S="${WORKDIR}/${MY_P}-src"
-
-check_env() {
-	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
-}
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} != binary ]] && check_env
-}
-
-pkg_setup() {
-	if [[ ${MERGE_TYPE} != binary ]]; then
-		check_env
-
-		# 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() {
-	eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
-	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
-	eapply "${FILESDIR}"/5.9.0-shared-lib.patch	# 517002
-	eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
-
-	sed -e "s^@EPREFIX@^${EPREFIX}^" \
-		-i lib-python/3/distutils/command/install.py || die
-
-	# apply CPython stdlib patches
-	pushd lib-python/3 > /dev/null || die
-	eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
-	popd > /dev/null || die
-
-	eapply_user
-}
-
-src_configure() {
-	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 sandbox --sandbox '')
-
-		${jit_backend}
-
-		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
-
-	# translate into the C sources
-	# we're going to make them ourselves since otherwise pypy does not
-	# free up the unneeded memory before spawning the compiler
-	set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
-	echo -e "\033[1m${@}\033[0m"
-	"${@}" || die "translation failed"
-}
-
-src_compile() {
-	emake -C "${T}"/usession*-0/testing_1
-
-	# copy back to make sys.prefix happy
-	cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
-	pax-mark m pypy3-c libpypy3-c.so
-
-	einfo "Generating caches and CFFI modules ..."
-
-	# Generate Grammar and PatternGrammar pickles.
-	./pypy3-c -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 = {
-#    "_blake2": "_blake2/_blake2_build.py",
-#    "_ssl": "_ssl_build.py",
-#    "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",
-#    "_sha3": "_sha3/_sha3_build.py",
-	cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
-		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 lib_pypy || die
-	for t in "${cffi_targets[@]}"; do
-		# tkinter doesn't work via -m
-		../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
-	done
-
-	# Cleanup temporary objects
-	find -name "_cffi_*.[co]" -delete || die
-	find -type d -empty -delete || die
-}
-
-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=./pypy3-c -vv lib-python || die
-}
-
-src_install() {
-	local dest=/usr/lib/pypy3.6
-	einfo "Installing PyPy ..."
-	exeinto "${dest}"
-	doexe pypy3-c libpypy3-c.so
-	pax-mark m "${ED}${dest}/pypy3-c" "${ED}${dest}/libpypy3-c.so"
-	insinto "${dest}"
-	# preserve mtimes to avoid obsoleting caches
-	insopts -p
-	doins -r include lib_pypy lib-python
-	dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
-	dodoc README.rst
-
-	if ! use gdbm; then
-		rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
-	fi
-	if ! use sqlite; then
-		rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
-			"${ED}${dest}"/lib_pypy/_sqlite3* \
-			"${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
-
-	einfo "Generating caches and byte-compiling ..."
-
-	local -x PYTHON=${ED}${dest}/pypy3-c
-	# we can't use eclass function since PyPy is dumb and always gives
-	# paths relative to the interpreter
-	local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
-	python_export pypy3 EPYTHON
-
-	echo "EPYTHON='${EPYTHON}'" > epython.py || die
-	python_domodule epython.py
-
-	einfo "Byte-compiling Python standard library..."
-
-	# compile the installed modules
-	python_optimize "${ED}${dest}"
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2020-04-11  7:49 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2020-04-11  7:49 UTC (permalink / raw
  To: gentoo-commits

commit:     acbaf54ebedf109203ebe5f4fd6803ecbd36626d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 11 04:53:04 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 11 07:49:05 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acbaf54e

dev-python/pypy3: Bump to 7.3.1

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/Manifest                      |   1 +
 dev-python/pypy3/files/7.3.1-gentoo-path.patch |  42 +++++
 dev-python/pypy3/pypy3-7.3.1.ebuild            | 219 +++++++++++++++++++++++++
 3 files changed, 262 insertions(+)

diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
index ba24d510819..c119fbd7162 100644
--- a/dev-python/pypy3/Manifest
+++ b/dev-python/pypy3/Manifest
@@ -1 +1,2 @@
 DIST pypy3.6-v7.3.0-src.tar.bz2 21937786 BLAKE2B c53ac32a9cca1c4624160eae9f11b5705a59613f1e5100fbb0ee86118de5a7845b8fa5087165d7f5a077d20337dfca14a1c7eadbe768995e20e249ec271ac10d SHA512 313a4254262dd8d8b995a50bddbc360cfb67add0818e51a3e9ce25bda6a9b639e9fea8efe7da6adda76dff0a86a364544a13faa516e51b9ea6c25ec99223b435
+DIST pypy3.6-v7.3.1-src.tar.bz2 22712809 BLAKE2B 4250b3fe98c611b9635319c106b80e88ab469eab5f883babb738e175e7b7adc22c85f8ef3fdce1cdc127b521beef8d6c7862e188d8c8889c39f90136d6bbe374 SHA512 f8e32aae7f01225e0e4d6763eaac40fc02dffc3d0b6a30f22d422147f9be4f3290ea78160a912ffae311dea3d503eb31a7a4f3999d3b541fbccd93d1cef4ca56

diff --git a/dev-python/pypy3/files/7.3.1-gentoo-path.patch b/dev-python/pypy3/files/7.3.1-gentoo-path.patch
new file mode 100644
index 00000000000..fb73aec41de
--- /dev/null
+++ b/dev-python/pypy3/files/7.3.1-gentoo-path.patch
@@ -0,0 +1,42 @@
+From 6d439c6718625bb7dce32b0afdc6a3d5168a21e5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 11 Apr 2020 07:01:27 +0200
+Subject: [PATCH] Support Gentoo install scheme
+
+---
+ lib-python/3/distutils/command/install.py | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/lib-python/3/distutils/command/install.py b/lib-python/3/distutils/command/install.py
+index 6fe62be..a4e9f0d 100644
+--- a/lib-python/3/distutils/command/install.py
++++ b/lib-python/3/distutils/command/install.py
+@@ -97,6 +97,13 @@ INSTALL_SCHEMES = {
+         'scripts': '$base/Scripts',
+         'data'   : '$base',
+         },
++    'gentoo': {
++        'purelib': '$base/site-packages',
++        'platlib': '$base/site-packages',
++        'headers': '$base/include',
++        'scripts': '@EPREFIX@/usr/bin',
++        'data'   : '@EPREFIX@/usr',
++        },
+     }
+ 
+ # The keys to an installation scheme; if any new types of files are to be
+@@ -483,7 +490,10 @@ class install (Command):
+         # it's the caller's problem if they supply a bad name!
+         if (hasattr(sys, 'pypy_version_info') and
+                 not name.endswith(('_user', '_home'))):
+-            if os.name == 'nt':
++            if self.install_base == os.path.normpath('@EPREFIX@/usr/lib/pypy2.7'):
++                # override paths for system-wide install
++                name = 'gentoo'
++            elif os.name == 'nt':
+                 name = 'pypy_nt'
+             else:
+                 name = 'pypy'
+-- 
+2.26.0
+

diff --git a/dev-python/pypy3/pypy3-7.3.1.ebuild b/dev-python/pypy3/pypy3-7.3.1.ebuild
new file mode 100644
index 00000000000..ef18fb89b9f
--- /dev/null
+++ b/dev-python/pypy3/pypy3-7.3.1.ebuild
@@ -0,0 +1,219 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 )
+inherit pax-utils python-any-r1
+
+MY_P=pypy3.6-v${PV/_/}
+
+DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
+HOMEPAGE="https://pypy.org/"
+SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
+S="${WORKDIR}/${MY_P}-src"
+
+LICENSE="MIT"
+# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
+SLOT="0/pypy36-pp73"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	|| (
+		dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
+		dev-python/pypy3-exe-bin:${PV}
+	)
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:0= )
+	gdbm? ( sys-libs/gdbm:0= )
+	sqlite? ( dev-db/sqlite:3= )
+	tk? (
+		dev-lang/tk:0=
+		dev-tcltk/tix:0=
+	)
+	!<dev-python/pypy3-bin-7.3.0:0"
+DEPEND="${RDEPEND}
+	test? (
+		${PYTHON_DEPS}
+		!!dev-python/pytest-forked
+	)"
+
+pkg_setup() {
+	use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
+	eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
+	eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
+
+	sed -e "s^@EPREFIX@^${EPREFIX}^" \
+		-i lib-python/3/distutils/command/install.py || die
+
+	# apply CPython stdlib patches
+	pushd lib-python/3 > /dev/null || die
+	eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
+	popd > /dev/null || die
+
+	# tests are copied from cpython and apparently not adjusted to pypy3
+	# or marked XFAIL
+	sed -i -e 's:test_runeval_step:_&:' \
+		lib-python/3/test/test_bdb.py || die
+	sed -i -e 's:test_set_nomemory:_&:' \
+		-e '/class PyMemDebugTests/i@unittest.skip("Broken on pypy3")' \
+		lib-python/3/test/test_capi.py || die
+	sed -i -e 's:test_crashing_decode_handler:_&:' \
+		lib-python/3/test/test_codeccallbacks.py || die
+	sed -i -e 's:test_unicode:_&:' \
+		lib-python/3/test/test_dbm_gnu.py || die
+	sed -i -e 's:test_jumpy:_&:' \
+		lib-python/3/test/test_dis.py || die
+	sed -i -e 's:test_generator_doesnt_retain_old_exc:_&:' \
+		-e 's:test_generator_finalizing_and_exc_info:_&:' \
+		-e 's:test_generator_leaking:_&:' \
+		lib-python/3/test/test_exceptions.py || die
+	sed -i -e 's:test_locale:_&:' \
+		lib-python/3/test/test_format.py || die
+	sed -i -e 's:test_ast_line_numbers:_&:' \
+		-e 's:test_backslashes_in_string_part:_&:' \
+		lib-python/3/test/test_fstring.py || die
+	sed -i -e 's:test_decompressor_bug_28275:_&:' \
+		lib-python/3/test/test_lzma.py || die
+	sed -i -e 's:test_listdir_bytes_like:_&:' \
+		-e 's:test_putenv:_&:' \
+		lib-python/3/test/test_posix.py || die
+	sed -i -e 's:test_auto_history:_&:' \
+		-e 's:test_history_size:_&:' \
+		lib-python/3/test/test_readline.py || die
+	sed -i -e 's:CheckDMLDoesNotAutoCommitBefore:_&:' \
+		-e 's:CheckImmediateTransactionalDDL:_&:' \
+		-e 's:CheckTransactionalDDL:_&:' \
+		lib-python/3/sqlite3/test/transactions.py || die
+	sed -i -e 's:test_pha_optional:_&:' \
+		-e 's:test_pha_required:_&:' \
+		lib-python/3/test/test_ssl.py || die
+	sed -i -e 's:test_eval_bytes_invalid_escape:_&:' \
+		-e 's:test_eval_str_invalid_escape:_&:' \
+		lib-python/3/test/test_string_literals.py || die
+	# the first one's broken by sandbox, the second by our env
+	sed -i -e 's:test_empty_env:_&:' \
+		-e 's:test_executable:_&:' \
+		lib-python/3/test/test_subprocess.py || die
+	sed -i -e 's:test_jump_out_of_async_for_block:_&:' \
+		-e 's:test_jump_over_async_for_block_before_else:_&:' \
+		-e 's:test_no_jump_.*wards_into_async_for_block:_&:' \
+		-e 's:test_no_jump_into_async_for_block_before_else:_&:' \
+		-e 's:test_no_jump_from_yield:_&:' \
+		lib-python/3/test/test_sys_settrace.py || die
+	sed -i -e 's:test_circular_imports:_&:' \
+		lib-python/3/test/test_threaded_import.py || die
+
+	eapply_user
+}
+
+src_compile() {
+	# copy over to make sys.prefix happy
+	cp -p "${BROOT}"/usr/lib/pypy3.6/pypy3-c-${PV} pypy3-c || die
+	cp -p "${BROOT}"/usr/lib/pypy3.6/include/${PV}/* include/ || die
+	# (not installed by pypy)
+	rm pypy/module/cpyext/include/_numpypy/numpy/README || die
+	mv pypy/module/cpyext/include/* include/ || die
+	mv pypy/module/cpyext/parse/*.h include/ || die
+	pax-mark m pypy3-c
+
+	einfo "Generating caches and CFFI modules ..."
+
+	# Generate Grammar and PatternGrammar pickles.
+	./pypy3-c -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 = {
+#    "_blake2": "_blake2/_blake2_build.py",
+#    "_ssl": "_ssl_build.py",
+#    "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",
+#    "_sha3": "_sha3/_sha3_build.py",
+	cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
+		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 lib_pypy || die
+	for t in "${cffi_targets[@]}"; do
+		# tkinter doesn't work via -m
+		../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
+	done
+
+	# Cleanup temporary objects
+	find -name "_cffi_*.[co]" -delete || die
+	find -type d -empty -delete || die
+}
+
+src_test() {
+	# (unset)
+	local -x PYTHONDONTWRITEBYTECODE=
+	local -x COLUMNS=80
+
+	# Test runner requires Python 2 too. However, it spawns PyPy3
+	# internally so that we end up testing the correct interpreter.
+	"${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
+}
+
+src_install() {
+	local dest=/usr/lib/pypy3.6
+	einfo "Installing PyPy ..."
+	dosym pypy3-c-${PV} "${dest}/pypy3-c"
+	insinto "${dest}"
+	# preserve mtimes to avoid obsoleting caches
+	insopts -p
+	doins -r include lib_pypy lib-python
+
+	# replace copied headers with symlinks
+	for x in "${BROOT}"/usr/lib/pypy3.6/include/${PV}/*; do
+		dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
+	done
+
+	dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
+	dodoc README.rst
+
+	if ! use gdbm; then
+		rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
+	fi
+	if ! use sqlite; then
+		rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
+			"${ED}${dest}"/lib_pypy/_sqlite3* \
+			"${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
+
+	local -x EPYTHON=pypy3
+	local -x PYTHON=${ED}${dest}/pypy3-c
+
+	echo "EPYTHON='${EPYTHON}'" > epython.py || die
+	python_moduleinto /usr/lib/pypy3.6/site-packages
+	python_domodule epython.py
+
+	einfo "Byte-compiling Python standard library..."
+	python_optimize "${ED}${dest}"
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2020-06-30 18:50 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2020-06-30 18:50 UTC (permalink / raw
  To: gentoo-commits

commit:     19ed19a661de36d2e2098d16477eb46c63c93639
Author:     Tom Gillespie <tgbugs <AT> gmail <DOT> com>
AuthorDate: Mon Mar  2 05:37:24 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 30 18:50:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19ed19a6

dev-python/pypy3: fix headers install_dir

Related to https://bugs.gentoo.org/465546

Signed-off-by: Tom Gillespie <tgbugs <AT> gmail.com>
Closes: https://bugs.gentoo.org/729962
Closes: https://github.com/gentoo/gentoo/pull/14820
[rebased for 7.3.1]
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/files/7.3.1-gentoo-path.patch                 | 2 +-
 dev-python/pypy3/{pypy3-7.3.1.ebuild => pypy3-7.3.1-r1.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-python/pypy3/files/7.3.1-gentoo-path.patch b/dev-python/pypy3/files/7.3.1-gentoo-path.patch
index fb73aec41de..c9809f89b88 100644
--- a/dev-python/pypy3/files/7.3.1-gentoo-path.patch
+++ b/dev-python/pypy3/files/7.3.1-gentoo-path.patch
@@ -18,7 +18,7 @@ index 6fe62be..a4e9f0d 100644
 +    'gentoo': {
 +        'purelib': '$base/site-packages',
 +        'platlib': '$base/site-packages',
-+        'headers': '$base/include',
++        'headers': '$base/include/$dist_name',
 +        'scripts': '@EPREFIX@/usr/bin',
 +        'data'   : '@EPREFIX@/usr',
 +        },

diff --git a/dev-python/pypy3/pypy3-7.3.1.ebuild b/dev-python/pypy3/pypy3-7.3.1-r1.ebuild
similarity index 100%
rename from dev-python/pypy3/pypy3-7.3.1.ebuild
rename to dev-python/pypy3/pypy3-7.3.1-r1.ebuild


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/
@ 2020-08-02  9:35 Michał Górny
  0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2020-08-02  9:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ae017fcc14207aadf50344392d7d869e7ef1eb53
Author:     Tom Gillespie <tgbugs <AT> gmail <DOT> com>
AuthorDate: Sun Aug  2 08:38:19 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  2 09:35:01 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae017fcc

dev-python/pypy3: fix gentoo-path.patch and rev bump

Test that install_path starts with '/usr/lib/pypy' instead of doing an
exact equality == test against the specific pypy version. This will
allow the patch to be reused between pypy and pypy3 without the risk of
having the gentoo specific fix fail to be detected due to a mismatched
pypy version number. This also prevents the need to maintain an exact
match the pypy version in the future since it will continue to change
and I assume there is also the possibility that both pypy3.6 and pypy3.7
might be installed on the same system at the same time.

Also rev bump so that users will recieve the fix.

This also removes a blocker for https://bugs.gentoo.org/729958 and
https://github.com/gentoo/gentoo/pull/16466.

Closes: https://bugs.gentoo.org/735140
Related-to: https://bugs.gentoo.org/729958
Signed-off-by: Tom Gillespie <tgbugs <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/16943
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3/files/7.3.1-gentoo-path.patch                    | 2 +-
 dev-python/pypy3/{pypy3-7.3.1-r1.ebuild => pypy3-7.3.1-r2.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-python/pypy3/files/7.3.1-gentoo-path.patch b/dev-python/pypy3/files/7.3.1-gentoo-path.patch
index c9809f89b88..fba00b9fcac 100644
--- a/dev-python/pypy3/files/7.3.1-gentoo-path.patch
+++ b/dev-python/pypy3/files/7.3.1-gentoo-path.patch
@@ -30,7 +30,7 @@ index 6fe62be..a4e9f0d 100644
          if (hasattr(sys, 'pypy_version_info') and
                  not name.endswith(('_user', '_home'))):
 -            if os.name == 'nt':
-+            if self.install_base == os.path.normpath('@EPREFIX@/usr/lib/pypy2.7'):
++            if self.install_base.startswith(os.path.normpath('@EPREFIX@/usr/lib/pypy')):
 +                # override paths for system-wide install
 +                name = 'gentoo'
 +            elif os.name == 'nt':

diff --git a/dev-python/pypy3/pypy3-7.3.1-r1.ebuild b/dev-python/pypy3/pypy3-7.3.1-r2.ebuild
similarity index 100%
rename from dev-python/pypy3/pypy3-7.3.1-r1.ebuild
rename to dev-python/pypy3/pypy3-7.3.1-r2.ebuild


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-08-02  9:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25 21:49 [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy3/, dev-python/pypy3/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2020-08-02  9:35 Michał Górny
2020-06-30 18:50 Michał Górny
2020-04-11  7:49 Michał Górny
2019-12-30 11:59 Michał Górny
2019-11-01  8:07 Michał Górny
2019-11-01  8:07 Michał Górny
2019-10-18 16:24 Michał Górny
2017-06-09 23:10 Michał Górny
2017-04-30 19:22 Michał Górny
2017-02-17 11:44 Michał Górny
2016-06-09 19:46 Michał Górny
2016-03-03 10:47 Michał Górny
2015-12-20 22:03 Michał Górny
2015-10-13 17:03 Julian Ospald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox