summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-11-05 17:07:48 +0100
committerMichał Górny <mgorny@gentoo.org>2017-11-05 17:22:59 +0100
commitb3a41131840ca45d06ac0769031df16c881d710c (patch)
treeba7a17117039a6af4dddb9d6ffd0ac2fa1753d95 /dev-python
parentdev-python/pypy3: Remove unnecessary LD_LIBRARY_PATH (diff)
downloadgentoo-b3a41131840ca45d06ac0769031df16c881d710c.tar.gz
gentoo-b3a41131840ca45d06ac0769031df16c881d710c.tar.bz2
gentoo-b3a41131840ca45d06ac0769031df16c881d710c.zip
dev-python/pypy3: Generate caches earlier, in compile
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/pypy3/pypy3-5.9.0.ebuild76
-rw-r--r--dev-python/pypy3/pypy3-9999.ebuild76
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 5b1e4c9568a6..68ba1a3ef97c 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 e4c820da59af..92c2f84f5b09 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}"