commit:     b3a41131840ca45d06ac0769031df16c881d710c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  5 16:07:48 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov  5 16:22:59 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3a41131

dev-python/pypy3: Generate caches earlier, in compile

 dev-python/pypy3/pypy3-5.9.0.ebuild | 76 +++++++++++++++++++------------------
 dev-python/pypy3/pypy3-9999.ebuild  | 76 +++++++++++++++++++------------------
 2 files changed, 80 insertions(+), 72 deletions(-)

diff --git a/dev-python/pypy3/pypy3-5.9.0.ebuild 
b/dev-python/pypy3/pypy3-5.9.0.ebuild
index 5b1e4c9568a..68ba1a3ef97 100644
--- a/dev-python/pypy3/pypy3-5.9.0.ebuild
+++ b/dev-python/pypy3/pypy3-5.9.0.ebuild
@@ -145,6 +145,45 @@ src_compile() {
        pax-mark m pypy3-c libpypy3-c.so
 
        #use doc && emake -C pypy/doc html
+
+       einfo "Generating caches and CFFI modules ..."
+
+       # 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 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() {
@@ -195,42 +234,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,
-#    "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
+       einfo "Byte-compiling Python standard library..."
 
        # compile the installed modules
        python_optimize "${ED%/}${dest}"

diff --git a/dev-python/pypy3/pypy3-9999.ebuild 
b/dev-python/pypy3/pypy3-9999.ebuild
index e4c820da59a..92c2f84f5b0 100644
--- a/dev-python/pypy3/pypy3-9999.ebuild
+++ b/dev-python/pypy3/pypy3-9999.ebuild
@@ -172,6 +172,45 @@ src_compile() {
        pax-mark m pypy3-c libpypy3-c.so
 
        #use doc && emake -C pypy/doc html
+
+       einfo "Generating caches and CFFI modules ..."
+
+       # 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 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() {
@@ -223,42 +262,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,
-#    "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
+       einfo "Byte-compiling Python standard library..."
 
        # compile the installed modules
        python_optimize "${ED%/}${dest}"

Reply via email to