diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-11-05 00:59:59 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-11-05 13:19:19 +0100 |
commit | 61ee5e7fe94a944842077b4740c6857d2c60ba2a (patch) | |
tree | 99b731025c5689045c2b0f98bc86e9cbc00497c7 /dev-python/pypy/pypy-9999.ebuild | |
parent | dev-python/pypy: Remove incorrect pytest dep (diff) | |
download | gentoo-61ee5e7fe94a944842077b4740c6857d2c60ba2a.tar.gz gentoo-61ee5e7fe94a944842077b4740c6857d2c60ba2a.tar.bz2 gentoo-61ee5e7fe94a944842077b4740c6857d2c60ba2a.zip |
dev-python/pypy: Generate caches earlier, in compile
Generate the caches in compile phase since they are needed for tests.
Closes: https://bugs.gentoo.org/636490
Diffstat (limited to 'dev-python/pypy/pypy-9999.ebuild')
-rw-r--r-- | dev-python/pypy/pypy-9999.ebuild | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/dev-python/pypy/pypy-9999.ebuild b/dev-python/pypy/pypy-9999.ebuild index 4fb5eb37b370..08bd414c5901 100644 --- a/dev-python/pypy/pypy-9999.ebuild +++ b/dev-python/pypy/pypy-9999.ebuild @@ -184,6 +184,42 @@ src_compile() { pax-mark m pypy-c libpypy-c.so use doc && emake -C pypy/doc html + + einfo "Generating caches and CFFI modules ..." + + # Generate Grammar and PatternGrammar pickles. + ./pypy-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, + cffi_targets=( audioop syslog pwdgrp resource ) + 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 + ../pypy-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() { @@ -222,8 +258,6 @@ src_install() { # Install docs use doc && dodoc -r pypy/doc/_build/html - einfo "Generating caches and byte-compiling ..." - local -x PYTHON=${ED%/}${dest}/pypy-c # we can't use eclass function since PyPy is dumb and always gives # paths relative to the interpreter @@ -233,39 +267,7 @@ src_install() { 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, - cffi_targets=( audioop syslog pwdgrp resource ) - 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 + einfo "Byte-compiling Python standard library..." # compile the installed modules python_optimize "${ED%/}${dest}" |