commit:     8560f90b6217d20450db6d12841f924df086ee42
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon Dec 18 07:25:12 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec 21 03:27:28 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8560f90b

dev-python/pypy: inline python_optimize, restrict to valid files

There's a bunch of testdata that isn't supposed to be compiled. The
CPython build system automatically excludes it, but PyPy doesn't have a
build system so we must do it manually.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34349
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy/pypy-7.3.13.ebuild | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dev-python/pypy/pypy-7.3.13.ebuild 
b/dev-python/pypy/pypy-7.3.13.ebuild
index cefd623b2968..3b82197f2e0a 100644
--- a/dev-python/pypy/pypy-7.3.13.ebuild
+++ b/dev-python/pypy/pypy-7.3.13.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit pax-utils python-utils-r1
+inherit pax-utils
 
 PYPY_PV=${PV%_p*}
 MY_P=pypy2.7-v${PYPY_PV/_}
@@ -288,13 +288,14 @@ src_install() {
        dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
        dodoc README.rst
 
-       local -x EPYTHON=pypy
        local -x PYTHON=${ED}${dest}/pypy-c-${PYPY_PV}
        # temporarily copy to build tree to facilitate module builds
        cp -p "${BROOT}${dest}/pypy-c-${PYPY_PV}" "${PYTHON}" || die
 
        einfo "Byte-compiling Python standard library..."
-       python_optimize "${ED}${dest}"
+       "${PYTHON}" -m compileall \
+               -x 'bad_coding|badsyntax|make_ssl_data|lib2to3/tests/data' \
+               -q -f -d "${dest}" "${ED}/${dest}" || die
 
        # remove to avoid collisions
        rm "${PYTHON}" || die

Reply via email to