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/pypy3/
Date: Sun, 05 Nov 2017 16:23:14
Message-Id: 1509898979.b3a41131840ca45d06ac0769031df16c881d710c.mgorny@gentoo
1 commit: b3a41131840ca45d06ac0769031df16c881d710c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 5 16:07:48 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 5 16:22:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3a41131
7
8 dev-python/pypy3: Generate caches earlier, in compile
9
10 dev-python/pypy3/pypy3-5.9.0.ebuild | 76 +++++++++++++++++++------------------
11 dev-python/pypy3/pypy3-9999.ebuild | 76 +++++++++++++++++++------------------
12 2 files changed, 80 insertions(+), 72 deletions(-)
13
14 diff --git a/dev-python/pypy3/pypy3-5.9.0.ebuild b/dev-python/pypy3/pypy3-5.9.0.ebuild
15 index 5b1e4c9568a..68ba1a3ef97 100644
16 --- a/dev-python/pypy3/pypy3-5.9.0.ebuild
17 +++ b/dev-python/pypy3/pypy3-5.9.0.ebuild
18 @@ -145,6 +145,45 @@ src_compile() {
19 pax-mark m pypy3-c libpypy3-c.so
20
21 #use doc && emake -C pypy/doc html
22 +
23 + einfo "Generating caches and CFFI modules ..."
24 +
25 + # Generate Grammar and PatternGrammar pickles.
26 + "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
27 + || die "Generation of Grammar and PatternGrammar pickles failed"
28 +
29 + # Generate cffi modules
30 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
31 +#cffi_build_scripts = {
32 +# "sqlite3": "_sqlite3_build.py",
33 +# "audioop": "_audioop_build.py",
34 +# "tk": "_tkinter/tklib_build.py",
35 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
36 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
37 +# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
38 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
39 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
40 +# "lzma": "_lzma_build.py",
41 +# "_decimal": "_decimal_build.py",
42 +# "ssl": "_ssl_build.py",
43 + cffi_targets=( audioop syslog pwdgrp resource lzma decimal ssl )
44 + use gdbm && cffi_targets+=( gdbm )
45 + use ncurses && cffi_targets+=( curses )
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 + ../pypy3-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 @@ -195,42 +234,7 @@ src_install() {
65 echo "EPYTHON='${EPYTHON}'" > epython.py || die
66 python_domodule epython.py
67
68 - # Generate Grammar and PatternGrammar pickles.
69 - "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
70 - || die "Generation of Grammar and PatternGrammar pickles failed"
71 -
72 - # Generate cffi modules
73 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
74 -#cffi_build_scripts = {
75 -# "sqlite3": "_sqlite3_build.py",
76 -# "audioop": "_audioop_build.py",
77 -# "tk": "_tkinter/tklib_build.py",
78 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
79 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
80 -# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
81 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
82 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
83 -# "lzma": "_lzma_build.py",
84 -# "_decimal": "_decimal_build.py",
85 -# "ssl": "_ssl_build.py",
86 - cffi_targets=( audioop syslog pwdgrp resource lzma decimal ssl )
87 - use gdbm && cffi_targets+=( gdbm )
88 - use ncurses && cffi_targets+=( curses )
89 - use sqlite && cffi_targets+=( sqlite3 )
90 - use tk && cffi_targets+=( tkinter/tklib )
91 -
92 - local t
93 - # all modules except tkinter output to .
94 - # tkinter outputs to the correct dir ...
95 - cd "${ED%/}${dest}"/lib_pypy || die
96 - for t in "${cffi_targets[@]}"; do
97 - # tkinter doesn't work via -m
98 - "${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
99 - done
100 -
101 - # Cleanup temporary objects
102 - find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
103 - find "${ED%/}${dest}" -type d -empty -delete || die
104 + einfo "Byte-compiling Python standard library..."
105
106 # compile the installed modules
107 python_optimize "${ED%/}${dest}"
108
109 diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
110 index e4c820da59a..92c2f84f5b0 100644
111 --- a/dev-python/pypy3/pypy3-9999.ebuild
112 +++ b/dev-python/pypy3/pypy3-9999.ebuild
113 @@ -172,6 +172,45 @@ src_compile() {
114 pax-mark m pypy3-c libpypy3-c.so
115
116 #use doc && emake -C pypy/doc html
117 +
118 + einfo "Generating caches and CFFI modules ..."
119 +
120 + # Generate Grammar and PatternGrammar pickles.
121 + "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
122 + || die "Generation of Grammar and PatternGrammar pickles failed"
123 +
124 + # Generate cffi modules
125 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
126 +#cffi_build_scripts = {
127 +# "sqlite3": "_sqlite3_build.py",
128 +# "audioop": "_audioop_build.py",
129 +# "tk": "_tkinter/tklib_build.py",
130 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
131 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
132 +# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
133 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
134 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
135 +# "lzma": "_lzma_build.py",
136 +# "_decimal": "_decimal_build.py",
137 +# "ssl": "_ssl_build.py",
138 + cffi_targets=( audioop syslog pwdgrp resource lzma decimal ssl )
139 + use gdbm && cffi_targets+=( gdbm )
140 + use ncurses && cffi_targets+=( curses )
141 + use sqlite && cffi_targets+=( sqlite3 )
142 + use tk && cffi_targets+=( tkinter/tklib )
143 +
144 + local t
145 + # all modules except tkinter output to .
146 + # tkinter outputs to the correct dir ...
147 + cd lib_pypy || die
148 + for t in "${cffi_targets[@]}"; do
149 + # tkinter doesn't work via -m
150 + ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
151 + done
152 +
153 + # Cleanup temporary objects
154 + find -name "_cffi_*.[co]" -delete || die
155 + find -type d -empty -delete || die
156 }
157
158 src_test() {
159 @@ -223,42 +262,7 @@ src_install() {
160 echo "EPYTHON='${EPYTHON}'" > epython.py || die
161 python_domodule epython.py
162
163 - # Generate Grammar and PatternGrammar pickles.
164 - "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
165 - || die "Generation of Grammar and PatternGrammar pickles failed"
166 -
167 - # Generate cffi modules
168 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
169 -#cffi_build_scripts = {
170 -# "sqlite3": "_sqlite3_build.py",
171 -# "audioop": "_audioop_build.py",
172 -# "tk": "_tkinter/tklib_build.py",
173 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
174 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
175 -# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
176 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
177 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
178 -# "lzma": "_lzma_build.py",
179 -# "_decimal": "_decimal_build.py",
180 -# "ssl": "_ssl_build.py",
181 - cffi_targets=( audioop syslog pwdgrp resource lzma decimal ssl )
182 - use gdbm && cffi_targets+=( gdbm )
183 - use ncurses && cffi_targets+=( curses )
184 - use sqlite && cffi_targets+=( sqlite3 )
185 - use tk && cffi_targets+=( tkinter/tklib )
186 -
187 - local t
188 - # all modules except tkinter output to .
189 - # tkinter outputs to the correct dir ...
190 - cd "${ED%/}${dest}"/lib_pypy || die
191 - for t in "${cffi_targets[@]}"; do
192 - # tkinter doesn't work via -m
193 - "${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
194 - done
195 -
196 - # Cleanup temporary objects
197 - find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
198 - find "${ED%/}${dest}" -type d -empty -delete || die
199 + einfo "Byte-compiling Python standard library..."
200
201 # compile the installed modules
202 python_optimize "${ED%/}${dest}"