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/, dev-python/pypy3/files/
Date: Fri, 01 Nov 2019 08:07:24
Message-Id: 1572595417.90fcaad7b9e9fe8e49c35f232138225ea2ab2c9c.mgorny@gentoo
1 commit: 90fcaad7b9e9fe8e49c35f232138225ea2ab2c9c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 1 07:49:58 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 1 08:03:37 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90fcaad7
7
8 dev-python/pypy3: Drop 7.1.1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy3/Manifest | 1 -
13 .../pypy3/files/7.0.0_all_distutils_cxx.patch | 347 ---------------------
14 dev-python/pypy3/pypy3-7.1.1.ebuild | 271 ----------------
15 3 files changed, 619 deletions(-)
16
17 diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
18 index 1c2085f148f..4fa9943404f 100644
19 --- a/dev-python/pypy3/Manifest
20 +++ b/dev-python/pypy3/Manifest
21 @@ -1,2 +1 @@
22 -DIST pypy3.6-v7.1.1-src.tar.bz2 23171982 BLAKE2B be43528bc6f3e02d146016a4969bd8c7a9e880a3bd3b77f441aac6d22ef67700f71e0171ec000066bd2c0bd506db64af69d6b75b59a92222dd0353ee70e6629b SHA512 17e78f9c7080d597a6283d8e8247d1ca78f09a14ff221db8c3d90d255b5befc73102b317ca34a80979e544d5ee72f3e5e649f89d185a085f4cc15012da4d0473
23 DIST pypy3.6-v7.2.0-src.tar.bz2 21850076 BLAKE2B 756ea3034fe8971c979ec83c9cbfac55a680f3ef03b276475aa4318f3480ae5ede609b8413412df64db553a33979670498b1f97184f3b57406619c9db7f01127 SHA512 bcbb53062a473d504bcc082cf6286f6169c83d1f38d22c4d7c4e46ddc32bca9d91e71194637e6650db5bec02b29fe262b22fe236d627b6bc3e6e0c59c66c07cc
24
25 diff --git a/dev-python/pypy3/files/7.0.0_all_distutils_cxx.patch b/dev-python/pypy3/files/7.0.0_all_distutils_cxx.patch
26 deleted file mode 100644
27 index a9099e5c9dc..00000000000
28 --- a/dev-python/pypy3/files/7.0.0_all_distutils_cxx.patch
29 +++ /dev/null
30 @@ -1,347 +0,0 @@
31 -From 5c396fb8b644e5de82d9b54cdb088ea673e16e14 Mon Sep 17 00:00:00 2001
32 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
33 -Date: Tue, 25 Apr 2017 17:42:33 +0200
34 -Subject: [PATCH] Fancy distutils C++ support, rebased for PyPy3.5/7.0.0
35 -
36 -https://bugs.python.org/issue1222585
37 ----
38 - lib-python/3/_osx_support.py | 10 ++--
39 - lib-python/3/distutils/cygwinccompiler.py | 21 ++++++--
40 - lib-python/3/distutils/sysconfig_cpython.py | 25 ++++++++--
41 - lib-python/3/distutils/sysconfig_pypy.py | 34 ++++++++++---
42 - lib-python/3/distutils/unixccompiler.py | 54 +++++++++++----------
43 - lib_pypy/_sysconfigdata.py | 1 +
44 - 6 files changed, 100 insertions(+), 45 deletions(-)
45 -
46 -diff --git a/lib-python/3/_osx_support.py b/lib-python/3/_osx_support.py
47 -index 13fcd8b8d2..0525be1cbc 100644
48 ---- a/lib-python/3/_osx_support.py
49 -+++ b/lib-python/3/_osx_support.py
50 -@@ -14,13 +14,13 @@ __all__ = [
51 - # configuration variables that may contain universal build flags,
52 - # like "-arch" or "-isdkroot", that may need customization for
53 - # the user environment
54 --_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
55 -- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
56 -- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
57 -- 'PY_CORE_CFLAGS')
58 -+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
59 -+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
60 -+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
61 -+ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
62 -
63 - # configuration variables that may contain compiler calls
64 --_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
65 -+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
66 -
67 - # prefix added to original configuration variable names
68 - _INITPRE = '_OSX_SUPPORT_INITIAL_'
69 -diff --git a/lib-python/3/distutils/cygwinccompiler.py b/lib-python/3/distutils/cygwinccompiler.py
70 -index c879646c0f..a6157fbd5f 100644
71 ---- a/lib-python/3/distutils/cygwinccompiler.py
72 -+++ b/lib-python/3/distutils/cygwinccompiler.py
73 -@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler):
74 - # dllwrap 2.10.90 is buggy
75 - if self.ld_version >= "2.10.90":
76 - self.linker_dll = "gcc"
77 -+ self.linker_dll_cxx = "g++"
78 - else:
79 - self.linker_dll = "dllwrap"
80 -+ self.linker_dll_cxx = "dllwrap"
81 -
82 - # ld_version >= "2.13" support -shared so use it instead of
83 - # -mdll -static
84 -@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler):
85 - self.set_executables(compiler='gcc -mcygwin -O -Wall',
86 - compiler_so='gcc -mcygwin -mdll -O -Wall',
87 - compiler_cxx='g++ -mcygwin -O -Wall',
88 -+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
89 - linker_exe='gcc -mcygwin',
90 - linker_so=('%s -mcygwin %s' %
91 -- (self.linker_dll, shared_option)))
92 -+ (self.linker_dll, shared_option)),
93 -+ linker_exe_cxx='g++ -mcygwin',
94 -+ linker_so_cxx=('%s -mcygwin %s' %
95 -+ (self.linker_dll_cxx, shared_option)))
96 -
97 - # cygwin and mingw32 need different sets of libraries
98 - if self.gcc_version == "2.91.57":
99 -@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler):
100 - raise CompileError(msg)
101 - else: # for other files use the C-compiler
102 - try:
103 -- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
104 -- extra_postargs)
105 -+ if self.detect_language(src) == 'c++':
106 -+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
107 -+ extra_postargs)
108 -+ else:
109 -+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
110 -+ extra_postargs)
111 - except DistutilsExecError as msg:
112 - raise CompileError(msg)
113 -
114 -@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler):
115 - self.set_executables(compiler='gcc -O -Wall',
116 - compiler_so='gcc -mdll -O -Wall',
117 - compiler_cxx='g++ -O -Wall',
118 -+ compiler_so_cxx='g++ -mdll -O -Wall',
119 - linker_exe='gcc',
120 - linker_so='%s %s %s'
121 - % (self.linker_dll, shared_option,
122 -+ entry_point),
123 -+ linker_exe_cxx='g++',
124 -+ linker_so_cxx='%s %s %s'
125 -+ % (self.linker_dll_cxx, shared_option,
126 - entry_point))
127 - # Maybe we should also append -mthreads, but then the finished
128 - # dlls need another dll (mingwm10.dll see Mingw32 docs)
129 -diff --git a/lib-python/3/distutils/sysconfig_cpython.py b/lib-python/3/distutils/sysconfig_cpython.py
130 -index 573724ddd7..0a04f33a86 100644
131 ---- a/lib-python/3/distutils/sysconfig_cpython.py
132 -+++ b/lib-python/3/distutils/sysconfig_cpython.py
133 -@@ -173,9 +173,12 @@ def customize_compiler(compiler):
134 - _osx_support.customize_compiler(_config_vars)
135 - _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
136 -
137 -- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
138 -- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
139 -- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
140 -+ (cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \
141 -+ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
142 -+ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
143 -+
144 -+ cflags = ''
145 -+ cxxflags = ''
146 -
147 - if 'CC' in os.environ:
148 - newcc = os.environ['CC']
149 -@@ -190,19 +193,27 @@ def customize_compiler(compiler):
150 - cxx = os.environ['CXX']
151 - if 'LDSHARED' in os.environ:
152 - ldshared = os.environ['LDSHARED']
153 -+ if 'LDCXXSHARED' in os.environ:
154 -+ ldcxxshared = os.environ['LDCXXSHARED']
155 - if 'CPP' in os.environ:
156 - cpp = os.environ['CPP']
157 - else:
158 - cpp = cc + " -E" # not always
159 - if 'LDFLAGS' in os.environ:
160 - ldshared = ldshared + ' ' + os.environ['LDFLAGS']
161 -+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
162 - if 'CFLAGS' in os.environ:
163 -- cflags = opt + ' ' + os.environ['CFLAGS']
164 -+ cflags = os.environ['CFLAGS']
165 - ldshared = ldshared + ' ' + os.environ['CFLAGS']
166 -+ if 'CXXFLAGS' in os.environ:
167 -+ cxxflags = os.environ['CXXFLAGS']
168 -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
169 - if 'CPPFLAGS' in os.environ:
170 - cpp = cpp + ' ' + os.environ['CPPFLAGS']
171 - cflags = cflags + ' ' + os.environ['CPPFLAGS']
172 -+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
173 - ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
174 -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
175 - if 'AR' in os.environ:
176 - ar = os.environ['AR']
177 - if 'ARFLAGS' in os.environ:
178 -@@ -211,13 +222,17 @@ def customize_compiler(compiler):
179 - archiver = ar + ' ' + ar_flags
180 -
181 - cc_cmd = cc + ' ' + cflags
182 -+ cxx_cmd = cxx + ' ' + cxxflags
183 - compiler.set_executables(
184 - preprocessor=cpp,
185 - compiler=cc_cmd,
186 - compiler_so=cc_cmd + ' ' + ccshared,
187 -- compiler_cxx=cxx,
188 -+ compiler_cxx=cxx_cmd,
189 -+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
190 - linker_so=ldshared,
191 - linker_exe=cc,
192 -+ linker_so_cxx=ldcxxshared,
193 -+ linker_exe_cxx=cxx,
194 - archiver=archiver)
195 -
196 - compiler.shared_lib_extension = shlib_suffix
197 -diff --git a/lib-python/3/distutils/sysconfig_pypy.py b/lib-python/3/distutils/sysconfig_pypy.py
198 -index bf1748e300..70dfd72a1a 100644
199 ---- a/lib-python/3/distutils/sysconfig_pypy.py
200 -+++ b/lib-python/3/distutils/sysconfig_pypy.py
201 -@@ -145,36 +145,52 @@ def customize_compiler(compiler):
202 - _osx_support.customize_compiler(_config_vars)
203 - _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
204 -
205 -- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
206 -- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
207 -- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
208 -+ (cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \
209 -+ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
210 -+ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
211 -+
212 -+ cflags = ''
213 -+ cxxflags = ''
214 -
215 - if 'CC' in os.environ:
216 - newcc = os.environ['CC']
217 -- if (sys.platform == 'darwin'
218 -+ if (True
219 - and 'LDSHARED' not in os.environ
220 - and ldshared.startswith(cc)):
221 - # On OS X, if CC is overridden, use that as the default
222 - # command for LDSHARED as well
223 -+ # Gentoo: s/OS X/every system/
224 - ldshared = newcc + ldshared[len(cc):]
225 - cc = newcc
226 - if 'CXX' in os.environ:
227 -- cxx = os.environ['CXX']
228 -+ newcxx = os.environ['CXX']
229 -+ if ('LDCXXSHARED' not in os.environ
230 -+ and ldcxxshared.startswith(cxx)):
231 -+ ldcxxshared = newcxx + ldcxxshared[len(cxx):]
232 -+ cxx = newcxx
233 - if 'LDSHARED' in os.environ:
234 - ldshared = os.environ['LDSHARED']
235 -+ if 'LDCXXSHARED' in os.environ:
236 -+ ldcxxshared = os.environ['LDCXXSHARED']
237 - if 'CPP' in os.environ:
238 - cpp = os.environ['CPP']
239 - else:
240 - cpp = cc + " -E" # not always
241 - if 'LDFLAGS' in os.environ:
242 - ldshared = ldshared + ' ' + os.environ['LDFLAGS']
243 -+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
244 - if 'CFLAGS' in os.environ:
245 -- cflags = opt + ' ' + os.environ['CFLAGS']
246 -+ cflags = os.environ['CFLAGS']
247 - ldshared = ldshared + ' ' + os.environ['CFLAGS']
248 -+ if 'CXXFLAGS' in os.environ:
249 -+ cxxflags = os.environ['CXXFLAGS']
250 -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
251 - if 'CPPFLAGS' in os.environ:
252 - cpp = cpp + ' ' + os.environ['CPPFLAGS']
253 - cflags = cflags + ' ' + os.environ['CPPFLAGS']
254 -+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
255 - ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
256 -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
257 - if 'AR' in os.environ:
258 - ar = os.environ['AR']
259 - if 'ARFLAGS' in os.environ:
260 -@@ -183,13 +199,17 @@ def customize_compiler(compiler):
261 - archiver = ar + ' ' + ar_flags
262 -
263 - cc_cmd = cc + ' ' + cflags
264 -+ cxx_cmd = cxx + ' ' + cxxflags
265 - compiler.set_executables(
266 - preprocessor=cpp,
267 - compiler=cc_cmd,
268 - compiler_so=cc_cmd + ' ' + ccshared,
269 -- compiler_cxx=cxx,
270 -+ compiler_cxx=cxx_cmd,
271 -+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
272 - linker_so=ldshared,
273 - linker_exe=cc,
274 -+ linker_so_cxx=ldcxxshared,
275 -+ linker_exe_cxx=cxx,
276 - archiver=archiver)
277 -
278 - compiler.shared_lib_extension = shlib_suffix
279 -diff --git a/lib-python/3/distutils/unixccompiler.py b/lib-python/3/distutils/unixccompiler.py
280 -index 32030ed150..1db3d5498b 100644
281 ---- a/lib-python/3/distutils/unixccompiler.py
282 -+++ b/lib-python/3/distutils/unixccompiler.py
283 -@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
284 - # are pretty generic; they will probably have to be set by an outsider
285 - # (eg. using information discovered by the sysconfig about building
286 - # Python extensions).
287 -- executables = {'preprocessor' : None,
288 -- 'compiler' : ["cc"],
289 -- 'compiler_so' : ["cc"],
290 -- 'compiler_cxx' : ["c++"], # pypy: changed, 'cc' is bogus
291 -- 'linker_so' : ["cc", "-shared"],
292 -- 'linker_exe' : ["cc"],
293 -- 'archiver' : ["ar", "-cr"],
294 -- 'ranlib' : None,
295 -+ executables = {'preprocessor' : None,
296 -+ 'compiler' : ["cc"],
297 -+ 'compiler_so' : ["cc"],
298 -+ 'compiler_cxx' : ["c++"],
299 -+ 'compiler_so_cxx' : ["c++"],
300 -+ 'linker_so' : ["cc", "-shared"],
301 -+ 'linker_exe' : ["cc"],
302 -+ 'linker_so_cxx' : ["c++", "-shared"],
303 -+ 'linker_exe_cxx' : ["c++"],
304 -+ 'archiver' : ["ar", "-cr"],
305 -+ 'ranlib' : None,
306 - }
307 -
308 - if sys.platform[:6] == "darwin":
309 -@@ -125,12 +128,19 @@ class UnixCCompiler(CCompiler):
310 -
311 - def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
312 - compiler_so = self.compiler_so
313 -+ compiler_so_cxx = self.compiler_so_cxx
314 - if sys.platform == 'darwin':
315 - compiler_so = _osx_support.compiler_fixup(compiler_so,
316 - cc_args + extra_postargs)
317 -+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
318 -+ cc_args + extra_postargs)
319 - try:
320 -- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
321 -- extra_postargs)
322 -+ if self.detect_language(src) == 'c++':
323 -+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
324 -+ extra_postargs)
325 -+ else:
326 -+ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
327 -+ extra_postargs)
328 - except DistutilsExecError as msg:
329 - raise CompileError(msg)
330 -
331 -@@ -188,22 +198,16 @@ class UnixCCompiler(CCompiler):
332 - ld_args.extend(extra_postargs)
333 - self.mkpath(os.path.dirname(output_filename))
334 - try:
335 -- if target_desc == CCompiler.EXECUTABLE:
336 -- linker = self.linker_exe[:]
337 -+ if target_lang == "c++":
338 -+ if target_desc == CCompiler.EXECUTABLE:
339 -+ linker = self.linker_exe_cxx[:]
340 -+ else:
341 -+ linker = self.linker_so_cxx[:]
342 - else:
343 -- linker = self.linker_so[:]
344 -- if target_lang == "c++" and self.compiler_cxx:
345 -- # skip over environment variable settings if /usr/bin/env
346 -- # is used to set up the linker's environment.
347 -- # This is needed on OSX. Note: this assumes that the
348 -- # normal and C++ compiler have the same environment
349 -- # settings.
350 -- i = 0
351 -- if os.path.basename(linker[0]) == "env":
352 -- i = 1
353 -- while '=' in linker[i]:
354 -- i += 1
355 -- linker[i] = self.compiler_cxx[i]
356 -+ if target_desc == CCompiler.EXECUTABLE:
357 -+ linker = self.linker_exe[:]
358 -+ else:
359 -+ linker = self.linker_so[:]
360 -
361 - if sys.platform == 'darwin':
362 - linker = _osx_support.compiler_fixup(linker, ld_args)
363 -diff --git a/lib_pypy/_sysconfigdata.py b/lib_pypy/_sysconfigdata.py
364 -index 2ceafe80bf..ee3f802c41 100644
365 ---- a/lib_pypy/_sysconfigdata.py
366 -+++ b/lib_pypy/_sysconfigdata.py
367 -@@ -15,6 +15,7 @@ build_time_vars = {
368 - 'CFLAGS': "-DNDEBUG -O2",
369 - 'CCSHARED': "-fPIC",
370 - 'LDSHARED': "cc -pthread -shared",
371 -+ 'LDCXXSHARED': "c++ -pthread -shared",
372 - 'EXT_SUFFIX': so_ext,
373 - 'SHLIB_SUFFIX': ".so",
374 - 'AR': "ar",
375 ---
376 -2.20.1
377 -
378
379 diff --git a/dev-python/pypy3/pypy3-7.1.1.ebuild b/dev-python/pypy3/pypy3-7.1.1.ebuild
380 deleted file mode 100644
381 index 344f0da4013..00000000000
382 --- a/dev-python/pypy3/pypy3-7.1.1.ebuild
383 +++ /dev/null
384 @@ -1,271 +0,0 @@
385 -# Copyright 1999-2019 Gentoo Authors
386 -# Distributed under the terms of the GNU General Public License v2
387 -
388 -EAPI=7
389 -
390 -# pypy3 needs to be built using python 2
391 -PYTHON_COMPAT=( python2_7 pypy )
392 -inherit check-reqs pax-utils python-any-r1 toolchain-funcs
393 -
394 -MY_P=pypy3.6-v${PV}
395 -
396 -DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
397 -HOMEPAGE="http://pypy.org/"
398 -SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
399 -
400 -LICENSE="MIT"
401 -# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
402 -SLOT="0/71-py36"
403 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
404 -IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
405 - sandbox sqlite tk"
406 -
407 -RDEPEND=">=sys-libs/zlib-1.1.3:0=
408 - virtual/libffi:0=
409 - virtual/libintl:0=
410 - dev-libs/expat:0=
411 - !libressl? ( dev-libs/openssl:0=[-bindist] )
412 - libressl? ( dev-libs/libressl:0= )
413 - bzip2? ( app-arch/bzip2:0= )
414 - gdbm? ( sys-libs/gdbm:0= )
415 - ncurses? ( sys-libs/ncurses:0= )
416 - sqlite? ( dev-db/sqlite:3= )
417 - tk? (
418 - dev-lang/tk:0=
419 - dev-tcltk/tix:0=
420 - )
421 - !dev-python/pypy3-bin:0"
422 -DEPEND="${RDEPEND}
423 - low-memory? ( virtual/pypy )
424 - !low-memory? (
425 - || (
426 - virtual/pypy
427 - (
428 - dev-lang/python:2.7
429 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
430 - )
431 - )
432 - )"
433 -
434 -S="${WORKDIR}/${MY_P}-src"
435 -
436 -check_env() {
437 - if use low-memory; then
438 - CHECKREQS_MEMORY="1750M"
439 - use amd64 && CHECKREQS_MEMORY="3500M"
440 - else
441 - CHECKREQS_MEMORY="3G"
442 - use amd64 && CHECKREQS_MEMORY="6G"
443 - fi
444 -
445 - check-reqs_pkg_pretend
446 -}
447 -
448 -pkg_pretend() {
449 - [[ ${MERGE_TYPE} != binary ]] && check_env
450 -}
451 -
452 -pkg_setup() {
453 - if [[ ${MERGE_TYPE} != binary ]]; then
454 - check_env
455 -
456 - # unset to allow forcing pypy below :)
457 - use low-memory && local EPYTHON=
458 - if python_is_installed pypy && [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]]; then
459 - einfo "Using PyPy to perform the translation."
460 - local EPYTHON=pypy
461 - else
462 - einfo "Using ${EPYTHON:-python2} to perform the translation. Please note that upstream"
463 - einfo "recommends using PyPy for that. If you wish to do so, please install"
464 - einfo "virtual/pypy and ensure that EPYTHON variable is unset."
465 - fi
466 -
467 - python-any-r1_pkg_setup
468 - fi
469 -}
470 -
471 -src_prepare() {
472 - eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
473 - eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
474 - eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
475 - eapply "${FILESDIR}"/7.0.0_all_distutils_cxx.patch
476 -
477 - sed -e "s^@EPREFIX@^${EPREFIX}^" \
478 - -i lib-python/3/distutils/command/install.py || die
479 -
480 - # apply CPython stdlib patches
481 - pushd lib-python/3 > /dev/null || die
482 - eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
483 - popd > /dev/null || die
484 -
485 - eapply_user
486 -}
487 -
488 -src_configure() {
489 - tc-export CC
490 -
491 - local jit_backend
492 - if use jit; then
493 - jit_backend='--jit-backend='
494 -
495 - # We only need the explicit sse2 switch for x86.
496 - # On other arches we can rely on autodetection which uses
497 - # compiler macros. Plus, --jit-backend= doesn't accept all
498 - # the modern values...
499 -
500 - if use x86; then
501 - if use cpu_flags_x86_sse2; then
502 - jit_backend+=x86
503 - else
504 - jit_backend+=x86-without-sse2
505 - fi
506 - else
507 - jit_backend+=auto
508 - fi
509 - fi
510 -
511 - local args=(
512 - --shared
513 - $(usex jit -Ojit -O2)
514 - $(usex sandbox --sandbox '')
515 -
516 - ${jit_backend}
517 -
518 - pypy/goal/targetpypystandalone
519 - )
520 -
521 - # Avoid linking against libraries disabled by use flags
522 - local opts=(
523 - bzip2:bz2
524 - ncurses:_minimal_curses
525 - )
526 -
527 - local opt
528 - for opt in "${opts[@]}"; do
529 - local flag=${opt%:*}
530 - local mod=${opt#*:}
531 -
532 - args+=(
533 - $(usex ${flag} --withmod --withoutmod)-${mod}
534 - )
535 - done
536 -
537 - local interp=( "${PYTHON}" )
538 - if use low-memory; then
539 - interp=( env PYPY_GC_MAX_DELTA=200MB
540 - "${PYTHON}" --jit loop_longevity=300 )
541 - fi
542 -
543 - # translate into the C sources
544 - # we're going to make them ourselves since otherwise pypy does not
545 - # free up the unneeded memory before spawning the compiler
546 - set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
547 - echo -e "\033[1m${@}\033[0m"
548 - "${@}" || die "translation failed"
549 -}
550 -
551 -src_compile() {
552 - emake -C "${T}"/usession*-0/testing_1
553 -
554 - # copy back to make sys.prefix happy
555 - cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
556 - pax-mark m pypy3-c libpypy3-c.so
557 -
558 - einfo "Generating caches and CFFI modules ..."
559 -
560 - # Generate Grammar and PatternGrammar pickles.
561 - ./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
562 - || die "Generation of Grammar and PatternGrammar pickles failed"
563 -
564 - # Generate cffi modules
565 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
566 -#cffi_build_scripts = {
567 -# "sqlite3": "_sqlite3_build.py",
568 -# "audioop": "_audioop_build.py",
569 -# "tk": "_tkinter/tklib_build.py",
570 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
571 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
572 -# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
573 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
574 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
575 -# "lzma": "_lzma_build.py",
576 -# "_decimal": "_decimal_build.py",
577 -# "_ssl": "_ssl_build.py",
578 -# "_blake2": "_blake2/_blake2_build.py",
579 -# "_sha3": "_sha3/_sha3_build.py",
580 - cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
581 - audioop syslog pwdgrp resource lzma decimal )
582 - use gdbm && cffi_targets+=( gdbm )
583 - use ncurses && cffi_targets+=( curses )
584 - use sqlite && cffi_targets+=( sqlite3 )
585 - use tk && cffi_targets+=( tkinter/tklib )
586 -
587 - einfo "Please disregard the import errors during CFFI cache generation."
588 - einfo "They come from modules not built yet."
589 -
590 - local t
591 - # all modules except tkinter output to .
592 - # tkinter outputs to the correct dir ...
593 - cd lib_pypy || die
594 - for t in "${cffi_targets[@]}"; do
595 - # tkinter doesn't work via -m
596 - ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
597 - done
598 -
599 - # Cleanup temporary objects
600 - find -name "_cffi_*.[co]" -delete || die
601 - find -type d -empty -delete || die
602 -}
603 -
604 -src_test() {
605 - # (unset)
606 - local -x PYTHONDONTWRITEBYTECODE=
607 -
608 - # Test runner requires Python 2 too. However, it spawns PyPy3
609 - # internally so that we end up testing the correct interpreter.
610 - "${PYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
611 -}
612 -
613 -src_install() {
614 - local dest=/usr/lib/pypy3.6
615 - einfo "Installing PyPy ..."
616 - exeinto "${dest}"
617 - doexe pypy3-c libpypy3-c.so
618 - pax-mark m "${ED%/}${dest}/pypy3-c" "${ED%/}${dest}/libpypy3-c.so"
619 - insinto "${dest}"
620 - # preserve mtimes to avoid obsoleting caches
621 - insopts -p
622 - doins -r include lib_pypy lib-python
623 - dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
624 - dodoc README.rst
625 -
626 - if ! use gdbm; then
627 - rm -r "${ED%/}${dest}"/lib_pypy/_gdbm* || die
628 - fi
629 - if ! use sqlite; then
630 - rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
631 - "${ED%/}${dest}"/lib_pypy/_sqlite3* \
632 - "${ED%/}${dest}"/lib-python/*3/test/test_sqlite.py || die
633 - fi
634 - if ! use tk; then
635 - rm -r "${ED%/}${dest}"/lib-python/*3/{idlelib,tkinter} \
636 - "${ED%/}${dest}"/lib_pypy/_tkinter \
637 - "${ED%/}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
638 - fi
639 -
640 - einfo "Generating caches and byte-compiling ..."
641 -
642 - local -x PYTHON=${ED%/}${dest}/pypy3-c
643 - # we can't use eclass function since PyPy is dumb and always gives
644 - # paths relative to the interpreter
645 - local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
646 - python_export pypy3 EPYTHON
647 -
648 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
649 - python_domodule epython.py
650 -
651 - einfo "Byte-compiling Python standard library..."
652 -
653 - # compile the installed modules
654 - python_optimize "${ED%/}${dest}"
655 -}