Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy-bin/
Date: Sun, 05 Nov 2017 16:23:14
Message-Id: 1509898978.f7ef866a84bacbcd370fcda8bbabc60374b8ebbd.mgorny@gentoo
1 commit: f7ef866a84bacbcd370fcda8bbabc60374b8ebbd
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 5 14:48:35 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 5 16:22:58 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7ef866a
7
8 dev-python/pypy-bin: Sync to dev-python/pypy
9
10 dev-python/pypy-bin/pypy-bin-5.9.0.ebuild | 82 ++++++++++++++++---------------
11 1 file changed, 42 insertions(+), 40 deletions(-)
12
13 diff --git a/dev-python/pypy-bin/pypy-bin-5.9.0.ebuild b/dev-python/pypy-bin/pypy-bin-5.9.0.ebuild
14 index b528c67b35d..0ebeca4356f 100644
15 --- a/dev-python/pypy-bin/pypy-bin-5.9.0.ebuild
16 +++ b/dev-python/pypy-bin/pypy-bin-5.9.0.ebuild
17 @@ -99,9 +99,44 @@ src_compile() {
18 mv pypy/module/cpyext/include/* include/ || die
19 mv pypy/module/cpyext/parse/*.h include/ || die
20
21 - use doc && emake -C pypy/doc/ html
22 - #needed even without jit :( also needed in both compile and install phases
23 pax-mark m pypy-c libpypy-c.so
24 +
25 + use doc && emake -C pypy/doc html
26 +
27 + einfo "Generating caches and CFFI modules ..."
28 +
29 + # Generate Grammar and PatternGrammar pickles.
30 + ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
31 + || die "Generation of Grammar and PatternGrammar pickles failed"
32 +
33 + # Generate cffi modules
34 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
35 +#cffi_build_scripts = {
36 +# "sqlite3": "_sqlite3_build.py",
37 +# "audioop": "_audioop_build.py",
38 +# "tk": "_tkinter/tklib_build.py",
39 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
40 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
41 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
42 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
43 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
44 + cffi_targets=( audioop curses syslog pwdgrp resource )
45 + use gdbm && cffi_targets+=( gdbm )
46 + use sqlite && cffi_targets+=( sqlite3 )
47 + use tk && cffi_targets+=( tkinter/tklib )
48 +
49 + local t
50 + # all modules except tkinter output to .
51 + # tkinter outputs to the correct dir ...
52 + cd lib_pypy || die
53 + for t in "${cffi_targets[@]}"; do
54 + # tkinter doesn't work via -m
55 + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
56 + done
57 +
58 + # Cleanup temporary objects
59 + find -name "_cffi_*.[co]" -delete || die
60 + find -type d -empty -delete || die
61 }
62
63 src_test() {
64 @@ -114,10 +149,11 @@ src_test() {
65 src_install() {
66 local dest=/usr/$(get_libdir)/pypy
67 einfo "Installing PyPy ..."
68 - insinto "${dest}"
69 - doins -r include lib_pypy lib-python pypy-c libpypy-c.so
70 - fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so
71 + exeinto "${dest}"
72 + doexe pypy-c libpypy-c.so
73 pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
74 + insinto "${dest}"
75 + doins -r include lib_pypy lib-python
76 dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy
77 dodoc README.rst
78
79 @@ -139,10 +175,7 @@ src_install() {
80 # Install docs
81 use doc && dodoc -r pypy/doc/_build/html
82
83 - einfo "Generating caches and byte-compiling ..."
84 -
85 local -x PYTHON=${ED%/}${dest}/pypy-c
86 - local -x LD_LIBRARY_PATH="${ED%/}${dest}"
87 # we can't use eclass function since PyPy is dumb and always gives
88 # paths relative to the interpreter
89 local PYTHON_SITEDIR=${EPREFIX}/usr/$(get_libdir)/pypy/site-packages
90 @@ -151,38 +184,7 @@ src_install() {
91 echo "EPYTHON='${EPYTHON}'" > epython.py || die
92 python_domodule epython.py
93
94 - # Generate Grammar and PatternGrammar pickles.
95 - "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
96 - || die "Generation of Grammar and PatternGrammar pickles failed"
97 -
98 - # Generate cffi modules
99 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
100 -#cffi_build_scripts = {
101 -# "sqlite3": "_sqlite3_build.py",
102 -# "audioop": "_audioop_build.py",
103 -# "tk": "_tkinter/tklib_build.py",
104 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
105 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
106 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
107 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
108 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
109 - cffi_targets=( audioop curses syslog pwdgrp resource )
110 - use gdbm && cffi_targets+=( gdbm )
111 - use sqlite && cffi_targets+=( sqlite3 )
112 - use tk && cffi_targets+=( tkinter/tklib )
113 -
114 - local t
115 - # all modules except tkinter output to .
116 - # tkinter outputs to the correct dir ...
117 - cd "${ED%/}${dest}"/lib_pypy || die
118 - for t in "${cffi_targets[@]}"; do
119 - # tkinter doesn't work via -m
120 - "${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
121 - done
122 -
123 - # Cleanup temporary objects
124 - find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
125 - find "${ED%/}${dest}" -type d -empty -delete || die
126 + einfo "Byte-compiling Python standard library..."
127
128 # compile the installed modules
129 python_optimize "${ED%/}${dest}"