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/
Date: Sun, 05 Nov 2017 12:20:16
Message-Id: 1509884359.61ee5e7fe94a944842077b4740c6857d2c60ba2a.mgorny@gentoo
1 commit: 61ee5e7fe94a944842077b4740c6857d2c60ba2a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 4 23:59:59 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 5 12:19:19 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61ee5e7f
7
8 dev-python/pypy: Generate caches earlier, in compile
9
10 Generate the caches in compile phase since they are needed for tests.
11
12 Closes: https://bugs.gentoo.org/636490
13
14 dev-python/pypy/pypy-5.9.0.ebuild | 72 ++++++++++++++++++++-------------------
15 dev-python/pypy/pypy-9999.ebuild | 72 ++++++++++++++++++++-------------------
16 2 files changed, 74 insertions(+), 70 deletions(-)
17
18 diff --git a/dev-python/pypy/pypy-5.9.0.ebuild b/dev-python/pypy/pypy-5.9.0.ebuild
19 index 737757a547f..cef567ec30c 100644
20 --- a/dev-python/pypy/pypy-5.9.0.ebuild
21 +++ b/dev-python/pypy/pypy-5.9.0.ebuild
22 @@ -178,6 +178,42 @@ src_compile() {
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 syslog pwdgrp resource )
45 + use gdbm && cffi_targets+=( gdbm )
46 + use ncurses && cffi_targets+=( curses )
47 + use sqlite && cffi_targets+=( sqlite3 )
48 + use tk && cffi_targets+=( tkinter/tklib )
49 +
50 + local t
51 + # all modules except tkinter output to .
52 + # tkinter outputs to the correct dir ...
53 + cd lib_pypy || die
54 + for t in "${cffi_targets[@]}"; do
55 + # tkinter doesn't work via -m
56 + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
57 + done
58 +
59 + # Cleanup temporary objects
60 + find -name "_cffi_*.[co]" -delete || die
61 + find -type d -empty -delete || die
62 }
63
64 src_test() {
65 @@ -216,8 +252,6 @@ src_install() {
66 # Install docs
67 use doc && dodoc -r pypy/doc/_build/html
68
69 - einfo "Generating caches and byte-compiling ..."
70 -
71 local -x PYTHON=${ED%/}${dest}/pypy-c
72 # we can't use eclass function since PyPy is dumb and always gives
73 # paths relative to the interpreter
74 @@ -227,39 +261,7 @@ src_install() {
75 echo "EPYTHON='${EPYTHON}'" > epython.py || die
76 python_domodule epython.py
77
78 - # Generate Grammar and PatternGrammar pickles.
79 - "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
80 - || die "Generation of Grammar and PatternGrammar pickles failed"
81 -
82 - # Generate cffi modules
83 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
84 -#cffi_build_scripts = {
85 -# "sqlite3": "_sqlite3_build.py",
86 -# "audioop": "_audioop_build.py",
87 -# "tk": "_tkinter/tklib_build.py",
88 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
89 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
90 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
91 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
92 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
93 - cffi_targets=( audioop syslog pwdgrp resource )
94 - use gdbm && cffi_targets+=( gdbm )
95 - use ncurses && cffi_targets+=( curses )
96 - use sqlite && cffi_targets+=( sqlite3 )
97 - use tk && cffi_targets+=( tkinter/tklib )
98 -
99 - local t
100 - # all modules except tkinter output to .
101 - # tkinter outputs to the correct dir ...
102 - cd "${ED%/}${dest}"/lib_pypy || die
103 - for t in "${cffi_targets[@]}"; do
104 - # tkinter doesn't work via -m
105 - "${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
106 - done
107 -
108 - # Cleanup temporary objects
109 - find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
110 - find "${ED%/}${dest}" -type d -empty -delete || die
111 + einfo "Byte-compiling Python standard library..."
112
113 # compile the installed modules
114 python_optimize "${ED%/}${dest}"
115
116 diff --git a/dev-python/pypy/pypy-9999.ebuild b/dev-python/pypy/pypy-9999.ebuild
117 index 4fb5eb37b37..08bd414c590 100644
118 --- a/dev-python/pypy/pypy-9999.ebuild
119 +++ b/dev-python/pypy/pypy-9999.ebuild
120 @@ -184,6 +184,42 @@ src_compile() {
121 pax-mark m pypy-c libpypy-c.so
122
123 use doc && emake -C pypy/doc html
124 +
125 + einfo "Generating caches and CFFI modules ..."
126 +
127 + # Generate Grammar and PatternGrammar pickles.
128 + ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
129 + || die "Generation of Grammar and PatternGrammar pickles failed"
130 +
131 + # Generate cffi modules
132 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
133 +#cffi_build_scripts = {
134 +# "sqlite3": "_sqlite3_build.py",
135 +# "audioop": "_audioop_build.py",
136 +# "tk": "_tkinter/tklib_build.py",
137 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
138 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
139 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
140 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
141 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
142 + cffi_targets=( audioop syslog pwdgrp resource )
143 + use gdbm && cffi_targets+=( gdbm )
144 + use ncurses && cffi_targets+=( curses )
145 + use sqlite && cffi_targets+=( sqlite3 )
146 + use tk && cffi_targets+=( tkinter/tklib )
147 +
148 + local t
149 + # all modules except tkinter output to .
150 + # tkinter outputs to the correct dir ...
151 + cd lib_pypy || die
152 + for t in "${cffi_targets[@]}"; do
153 + # tkinter doesn't work via -m
154 + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
155 + done
156 +
157 + # Cleanup temporary objects
158 + find -name "_cffi_*.[co]" -delete || die
159 + find -type d -empty -delete || die
160 }
161
162 src_test() {
163 @@ -222,8 +258,6 @@ src_install() {
164 # Install docs
165 use doc && dodoc -r pypy/doc/_build/html
166
167 - einfo "Generating caches and byte-compiling ..."
168 -
169 local -x PYTHON=${ED%/}${dest}/pypy-c
170 # we can't use eclass function since PyPy is dumb and always gives
171 # paths relative to the interpreter
172 @@ -233,39 +267,7 @@ src_install() {
173 echo "EPYTHON='${EPYTHON}'" > epython.py || die
174 python_domodule epython.py
175
176 - # Generate Grammar and PatternGrammar pickles.
177 - "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
178 - || die "Generation of Grammar and PatternGrammar pickles failed"
179 -
180 - # Generate cffi modules
181 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
182 -#cffi_build_scripts = {
183 -# "sqlite3": "_sqlite3_build.py",
184 -# "audioop": "_audioop_build.py",
185 -# "tk": "_tkinter/tklib_build.py",
186 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
187 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
188 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
189 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
190 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
191 - cffi_targets=( audioop syslog pwdgrp resource )
192 - use gdbm && cffi_targets+=( gdbm )
193 - use ncurses && cffi_targets+=( curses )
194 - use sqlite && cffi_targets+=( sqlite3 )
195 - use tk && cffi_targets+=( tkinter/tklib )
196 -
197 - local t
198 - # all modules except tkinter output to .
199 - # tkinter outputs to the correct dir ...
200 - cd "${ED%/}${dest}"/lib_pypy || die
201 - for t in "${cffi_targets[@]}"; do
202 - # tkinter doesn't work via -m
203 - "${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
204 - done
205 -
206 - # Cleanup temporary objects
207 - find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
208 - find "${ED%/}${dest}" -type d -empty -delete || die
209 + einfo "Byte-compiling Python standard library..."
210
211 # compile the installed modules
212 python_optimize "${ED%/}${dest}"