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/files/, dev-python/pypy-bin/
Date: Tue, 25 Apr 2017 21:49:48
Message-Id: 1493156963.2139820ad4f1757fccb18b80e4cf0ee0db8bb107.mgorny@gentoo
1 commit: 2139820ad4f1757fccb18b80e4cf0ee0db8bb107
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 25 19:19:10 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 25 21:49:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2139820a
7
8 dev-python/pypy-bin: Bump to 5.7.1
9
10 dev-python/pypy-bin/Manifest | 7 +
11 ....UnixCCompiler.runtime_library_dir_option.patch | 4 +-
12 .../pypy-bin/files/5.7.1_all_distutils_cxx.patch | 388 +++++++++++++++++++++
13 dev-python/pypy-bin/pypy-bin-5.7.1.ebuild | 189 ++++++++++
14 4 files changed, 586 insertions(+), 2 deletions(-)
15
16 diff --git a/dev-python/pypy-bin/Manifest b/dev-python/pypy-bin/Manifest
17 index 8136b27f39b..b730043c8b0 100644
18 --- a/dev-python/pypy-bin/Manifest
19 +++ b/dev-python/pypy-bin/Manifest
20 @@ -5,5 +5,12 @@ DIST pypy-bin-5.6.0-x86+bzip2+jit+ncurses+shadowstack+sse2.tar.lz 10451373 SHA25
21 DIST pypy-bin-5.6.0-x86+bzip2+jit+ncurses+sse2.tar.lz 11678153 SHA256 3a1cafb572f3565862dce0e4a3386bcd63da26eb17a39301637e7751b827c2d4 SHA512 9608eed3c1583c09ce504b47a6efd82edaf27e83fc6471ee4e478a3167fcf38cae57470ba0246ef6e56398922ec270e81ceb75e7a6d0744a02f5bca454fa33cf WHIRLPOOL 24ad25b4cd686976de99494943135ad2fbb56898981f26e1ff339ea5b0d96171f0e65e24afa40374cfabcae75887ce4e59ab8a5f323bc4af41e1ccc38fc5d74c
22 DIST pypy-bin-5.6.0-x86+bzip2+ncurses+sse2.tar.lz 6075399 SHA256 14e3dde904e6ee5b8d276f6785cf8a3339e3689f5d151d0b146f76cde77b7ca2 SHA512 b2c6ce1415b7c49be7c69a02c744884b03ccd17227d8c66c0b042f8b5421e006c3e81353f20d6c74bc886ff10927d2efaf0f4b938571e165678135e18870e06b WHIRLPOOL fc3c3e0554d96a52c0a9631080250a6fd825d3ccf5d3c31da172c6f820fea6106b7c4f1094ea2fe838deb786a6ce8b0e78a9a78b7864394c828db32d9c31adc1
23 DIST pypy-bin-5.6.0-x86+bzip2+ncurses.tar.lz 6073628 SHA256 a667781d65abee8f535769a08cc9cf7e39ae2c12f6aa71cab32de53baf21ceb3 SHA512 adfe5c01c575378c537dc72eaa6cf98cf2f8f2642abeefcfde70f0930f26202b6c08bb715e0c6cf058495fcf1baa035f43e0452014e90e249a27118bcece4dda WHIRLPOOL 4b74440e22fc76c128d8330df57a54dd48a5d5b4fd390f6b912ace46a34d58b03f4a1f6990a274bd1ea8c88615e5f1d1fe56a124a25e1d6618798d7c3a00646a
24 +DIST pypy-bin-5.7.1-amd64+bzip2+jit+ncurses.tar.lz 12313034 SHA256 410f32b11f6d28ea4bdc59d6ee9de4239178b16834fcd35bf5e9f462e3a51ebd SHA512 e6a66b2aeb3b3d2fd8b99ef5d0fa49b9e99752f9baa996280d14d9031b4103795bd5f0180755e3a360889b808267e19939b32e504bd91811df3875c9ae634775 WHIRLPOOL 1ab24432bc071d2aea1c0023817a8ef89444b560f21276d7f66c4d5a3c72662eda4b2ec13b39a60920dade363b39051f610af8505f011b5cb626ff2cdebb65cb
25 +DIST pypy-bin-5.7.1-amd64+bzip2+ncurses.tar.lz 7104886 SHA256 76373ee444a173287d02dda552a07bf029ee7b3c1d5b94784cf13b53d0b12584 SHA512 fed7f2f3ae78f7e1723cb22cd2de1772b2afb633e84714335e06c91ef8062ba1216f3539b2f49e1570e174e823417c83d30d9cff852c6118241b8ff7fe16d627 WHIRLPOOL b661b9a6f4033e15a6d398f724455ad7b9c06bf5ab2a4a06656a4a0888adfee5abfcefe6c27e1d9e4c38c99d38d944523cf1afd2da1084e7fefc9a6c91c89e6a
26 +DIST pypy-bin-5.7.1-x86+bzip2+jit+ncurses+sse2.tar.lz 9956906 SHA256 25638e27a0939268014c35b94f4b5e9031d5f3a92cb51e96adbe4b59befbb579 SHA512 1ef83113f832a71ee4370381f21a07c24059a3b1bd2cad14846f06aa4d8319c14cb3633314f81f6ee898ecd9d2612bd03b72a3c1a87264ff34214f716e13bc4f WHIRLPOOL 8896245974d5a9b7b524edc888399c88e1dd651561017a8688405ad82d9906ff5c81e899cee57eb64506903af583439045dc5fe7f8f5592d071642fb8bb6d9e2
27 +DIST pypy-bin-5.7.1-x86+bzip2+ncurses+sse2.tar.lz 5958810 SHA256 05228eabb25b02aea0c80aca4902ee3d81c3767e64daae5662c4797b39ed6a07 SHA512 e27e84e4a060a7c20bcb862da7d0f32508f5588753b067d726d7cd43835307853a7409203c0bbb98844ac59affc03ea43dc650266d74c345a1afcb7e528f1a8f WHIRLPOOL 2169a6e306643669573434dc065235dc5272c8dffd34a09b136e5a23cd2b8bb70fef552cdf3d79018c7e3b3b1c4edb4d7dcde0a4feb550827dbeafea514742aa
28 +DIST pypy-bin-5.7.1-x86+bzip2+ncurses.tar.lz 5984920 SHA256 a1507fb0d55633b28fe6c249291f4dbf0097cfaf2e2a8d36f20636c5ccd34ea3 SHA512 769f62cb3768b762a09f83926ea695d2aea01f8bb3f33d921607f454a9f1d9ab30fc5400787274d1d94a8ca5b82027d737df4e5e693d639b6944c22eb69e75f8 WHIRLPOOL 825a531ae629015022ce1260e11258ee057535ae8e491f9f08fb90cc38a6eda4f02a5f9e32c8ecb85cdeb81c5de9f2353c415abd83d05e107ebce3669560b484
29 DIST pypy2-v5.6.0-src.tar.bz2 18388539 SHA256 7411448045f77eb9e087afdce66fe7eafda1876c9e17aad88cf891f762b608b0 SHA512 a92ef611ae2417aaa202b9f5c75dd86e82fc2549e53bab3164cccff37d131542bc71cbce6aaedf428d3dfc7d59a2d3b3a5ed03e3a3439628f29d43c4d30a64de WHIRLPOOL 896894225407f8cd462b094d77723880f6a423d60a79e5d3cf4e0804737fdd0337fc668b05573902fe81f826798b2046cb115c8d230f0810ec0ad2508590ee4a
30 +DIST pypy2-v5.7.1-src.tar.bz2 18940413 SHA256 d01bee43c6df79f7bbc1149bb3e85f489491fb2358a6a1f9a7f0d6e07715832f SHA512 1ad2dddb40c28d2d3e95a9f0730e765d981dee6e2d0664cf1274eb7c1021690a848c3485c846eac8a8b64425b44946b5b2d223058ec4699155a2122ee7d38b75 WHIRLPOOL e0223d889a26f8a5bc5097561dbe617ff9b11972590f3a8d717d572798a2d685540bc6059e4ce4ff73ce0db9d2476a4274f17dad1f825fb780726d6ecd78a4c8
31 DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77
32 +DIST python-gentoo-patches-2.7.13-0.tar.xz 13292 SHA256 271835eb36125d09cc5e904ef23a5263acd8e5f513202a8d4f8a9a0f64fc80a8 SHA512 d70f6baba1a465a752c515e33dfdee2a5cc75400fadfb8ea0bd1e82d50089abdf02d7726c697850dc47de2054aa494bbdc08de2673c260b54e609f29dab259ad WHIRLPOOL 6a6d8b099fa814839bf5b3455b3889205c649ef522b35c3a501831d63d0e916d7747b83ac9b8991f8f8c34b328478d84cf7a12a32161ce0fec37204f9c019e2d
33
34 diff --git a/dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch b/dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
35 index b3d5235000d..65321bb60e6 100644
36 --- a/dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
37 +++ b/dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
38 @@ -1,5 +1,5 @@
39 ---- lib-python/2.7/distutils/unixccompiler.py
40 -+++ lib-python/2.7/distutils/unixccompiler.py
41 +--- a/lib-python/2.7/distutils/unixccompiler.py
42 ++++ b/lib-python/2.7/distutils/unixccompiler.py
43 @@ -297,7 +297,7 @@
44 # this time, there's no way to determine this information from
45 # the configuration data stored in the Python installation, so
46
47 diff --git a/dev-python/pypy-bin/files/5.7.1_all_distutils_cxx.patch b/dev-python/pypy-bin/files/5.7.1_all_distutils_cxx.patch
48 new file mode 100644
49 index 00000000000..8249fbc91db
50 --- /dev/null
51 +++ b/dev-python/pypy-bin/files/5.7.1_all_distutils_cxx.patch
52 @@ -0,0 +1,388 @@
53 +From 9bf4611231faa0dc9ae64c6a7a8b55a3290a3ca2 Mon Sep 17 00:00:00 2001
54 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
55 +Date: Tue, 25 Apr 2017 07:14:11 +0200
56 +Subject: [PATCH] Fancy patch for distutils C++ support, rebased for pypy5.7
57 +
58 +http://bugs.python.org/issue1222585
59 +http://bugs.gentoo.org/show_bug.cgi?id=599918
60 +---
61 + _osx_support.py | 10 ++---
62 + distutils/cygwinccompiler.py | 21 ++++++++--
63 + distutils/emxccompiler.py | 14 +++++--
64 + distutils/sysconfig_cpython.py | 26 ++++++++++---
65 + distutils/sysconfig_pypy.py | 37 ++++++++++++++----
66 + distutils/unixccompiler.py | 55 ++++++++++++++-------------
67 + 6 files changed, 112 insertions(+), 51 deletions(-)
68 +
69 +diff --git a/_osx_support.py b/_osx_support.py
70 +index d2aaae7..8bcdb05 100644
71 +--- a/_osx_support.py
72 ++++ b/_osx_support.py
73 +@@ -14,13 +14,13 @@ __all__ = [
74 + # configuration variables that may contain universal build flags,
75 + # like "-arch" or "-isdkroot", that may need customization for
76 + # the user environment
77 +-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
78 +- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
79 +- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
80 +- 'PY_CORE_CFLAGS')
81 ++_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
82 ++ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
83 ++ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
84 ++ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
85 +
86 + # configuration variables that may contain compiler calls
87 +-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
88 ++_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
89 +
90 + # prefix added to original configuration variable names
91 + _INITPRE = '_OSX_SUPPORT_INITIAL_'
92 +diff --git a/distutils/cygwinccompiler.py b/distutils/cygwinccompiler.py
93 +index 767400c..7133097 100644
94 +--- a/distutils/cygwinccompiler.py
95 ++++ b/distutils/cygwinccompiler.py
96 +@@ -120,8 +120,10 @@ class CygwinCCompiler (UnixCCompiler):
97 + # dllwrap 2.10.90 is buggy
98 + if self.ld_version >= "2.10.90":
99 + self.linker_dll = "gcc"
100 ++ self.linker_dll_cxx = "g++"
101 + else:
102 + self.linker_dll = "dllwrap"
103 ++ self.linker_dll_cxx = "dllwrap"
104 +
105 + # ld_version >= "2.13" support -shared so use it instead of
106 + # -mdll -static
107 +@@ -135,9 +137,13 @@ class CygwinCCompiler (UnixCCompiler):
108 + self.set_executables(compiler='gcc -mcygwin -O -Wall',
109 + compiler_so='gcc -mcygwin -mdll -O -Wall',
110 + compiler_cxx='g++ -mcygwin -O -Wall',
111 ++ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
112 + linker_exe='gcc -mcygwin',
113 + linker_so=('%s -mcygwin %s' %
114 +- (self.linker_dll, shared_option)))
115 ++ (self.linker_dll, shared_option)),
116 ++ linker_exe_cxx='g++ -mcygwin',
117 ++ linker_so_cxx=('%s -mcygwin %s' %
118 ++ (self.linker_dll_cxx, shared_option)))
119 +
120 + # cygwin and mingw32 need different sets of libraries
121 + if self.gcc_version == "2.91.57":
122 +@@ -163,8 +169,12 @@ class CygwinCCompiler (UnixCCompiler):
123 + raise CompileError, msg
124 + else: # for other files use the C-compiler
125 + try:
126 +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
127 +- extra_postargs)
128 ++ if self.detect_language(src) == 'c++':
129 ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
130 ++ extra_postargs)
131 ++ else:
132 ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
133 ++ extra_postargs)
134 + except DistutilsExecError, msg:
135 + raise CompileError, msg
136 +
137 +@@ -330,9 +340,14 @@ class Mingw32CCompiler (CygwinCCompiler):
138 + self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
139 + compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
140 + compiler_cxx='g++%s -O -Wall' % no_cygwin,
141 ++ compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin,
142 + linker_exe='gcc%s' % no_cygwin,
143 + linker_so='%s%s %s %s'
144 + % (self.linker_dll, no_cygwin,
145 ++ shared_option, entry_point),
146 ++ linker_exe_cxx='g++%s' % no_cygwin,
147 ++ linker_so_cxx='%s%s %s %s'
148 ++ % (self.linker_dll_cxx, no_cygwin,
149 + shared_option, entry_point))
150 + # Maybe we should also append -mthreads, but then the finished
151 + # dlls need another dll (mingwm10.dll see Mingw32 docs)
152 +diff --git a/distutils/emxccompiler.py b/distutils/emxccompiler.py
153 +index a017205..bdc532c 100644
154 +--- a/distutils/emxccompiler.py
155 ++++ b/distutils/emxccompiler.py
156 +@@ -65,8 +65,12 @@ class EMXCCompiler (UnixCCompiler):
157 + # XXX optimization, warnings etc. should be customizable.
158 + self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
159 + compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
160 ++ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
161 ++ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
162 + linker_exe='gcc -Zomf -Zmt -Zcrtdll',
163 +- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
164 ++ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
165 ++ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
166 ++ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
167 +
168 + # want the gcc library statically linked (so that we don't have
169 + # to distribute a version dependent on the compiler we have)
170 +@@ -83,8 +87,12 @@ class EMXCCompiler (UnixCCompiler):
171 + raise CompileError, msg
172 + else: # for other files use the C-compiler
173 + try:
174 +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
175 +- extra_postargs)
176 ++ if self.detect_language(src) == 'c++':
177 ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
178 ++ extra_postargs)
179 ++ else:
180 ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
181 ++ extra_postargs)
182 + except DistutilsExecError, msg:
183 + raise CompileError, msg
184 +
185 +diff --git a/distutils/sysconfig_cpython.py b/distutils/sysconfig_cpython.py
186 +index 35f39e4..8dd032d 100644
187 +--- a/distutils/sysconfig_cpython.py
188 ++++ b/distutils/sysconfig_cpython.py
189 +@@ -171,10 +171,12 @@ def customize_compiler(compiler):
190 + _osx_support.customize_compiler(_config_vars)
191 + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
192 +
193 +- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
194 +- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
195 +- 'CCSHARED', 'LDSHARED', 'SO', 'AR',
196 +- 'ARFLAGS')
197 ++ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \
198 ++ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
199 ++ 'SO', 'AR', 'ARFLAGS')
200 ++
201 ++ cflags = ''
202 ++ cxxflags = ''
203 +
204 + if 'CC' in os.environ:
205 + newcc = os.environ['CC']
206 +@@ -189,19 +191,27 @@ def customize_compiler(compiler):
207 + cxx = os.environ['CXX']
208 + if 'LDSHARED' in os.environ:
209 + ldshared = os.environ['LDSHARED']
210 ++ if 'LDCXXSHARED' in os.environ:
211 ++ ldcxxshared = os.environ['LDCXXSHARED']
212 + if 'CPP' in os.environ:
213 + cpp = os.environ['CPP']
214 + else:
215 + cpp = cc + " -E" # not always
216 + if 'LDFLAGS' in os.environ:
217 + ldshared = ldshared + ' ' + os.environ['LDFLAGS']
218 ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
219 + if 'CFLAGS' in os.environ:
220 +- cflags = opt + ' ' + os.environ['CFLAGS']
221 ++ cflags = os.environ['CFLAGS']
222 + ldshared = ldshared + ' ' + os.environ['CFLAGS']
223 ++ if 'CXXFLAGS' in os.environ:
224 ++ cxxflags = os.environ['CXXFLAGS']
225 ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
226 + if 'CPPFLAGS' in os.environ:
227 + cpp = cpp + ' ' + os.environ['CPPFLAGS']
228 + cflags = cflags + ' ' + os.environ['CPPFLAGS']
229 ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
230 + ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
231 ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
232 + if 'AR' in os.environ:
233 + ar = os.environ['AR']
234 + if 'ARFLAGS' in os.environ:
235 +@@ -210,13 +220,17 @@ def customize_compiler(compiler):
236 + archiver = ar + ' ' + ar_flags
237 +
238 + cc_cmd = cc + ' ' + cflags
239 ++ cxx_cmd = cxx + ' ' + cxxflags
240 + compiler.set_executables(
241 + preprocessor=cpp,
242 + compiler=cc_cmd,
243 + compiler_so=cc_cmd + ' ' + ccshared,
244 +- compiler_cxx=cxx,
245 ++ compiler_cxx=cxx_cmd,
246 ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
247 + linker_so=ldshared,
248 + linker_exe=cc,
249 ++ linker_so_cxx=ldcxxshared,
250 ++ linker_exe_cxx=cxx,
251 + archiver=archiver)
252 +
253 + compiler.shared_lib_extension = so_ext
254 +diff --git a/distutils/sysconfig_pypy.py b/distutils/sysconfig_pypy.py
255 +index 368f232..4fe1f08 100644
256 +--- a/distutils/sysconfig_pypy.py
257 ++++ b/distutils/sysconfig_pypy.py
258 +@@ -67,6 +67,7 @@ def _init_posix():
259 + g['CFLAGS'] = "-DNDEBUG -O2"
260 + g['CCSHARED'] = "-fPIC"
261 + g['LDSHARED'] = "gcc -pthread -shared"
262 ++ g['LDCXXSHARED'] = "g++ -pthread -shared"
263 + g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
264 + g['AR'] = "ar"
265 + g['ARFLAGS'] = "rc"
266 +@@ -85,6 +86,7 @@ def _init_posix():
267 + # just a guess
268 + arch = platform.machine()
269 + g['LDSHARED'] += ' -undefined dynamic_lookup'
270 ++ g['LDCXXSHARED'] += ' -undefined dynamic_lookup'
271 + g['CC'] += ' -arch %s' % (arch,)
272 +
273 + global _config_vars
274 +@@ -168,37 +170,52 @@ def customize_compiler(compiler):
275 + _osx_support.customize_compiler(_config_vars)
276 + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
277 +
278 +- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
279 +- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
280 +- 'CCSHARED', 'LDSHARED', 'SO', 'AR',
281 +- 'ARFLAGS')
282 ++ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \
283 ++ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
284 ++ 'SO', 'AR', 'ARFLAGS')
285 ++
286 ++ cflags = ''
287 ++ cxxflags = ''
288 +
289 + if 'CC' in os.environ:
290 + newcc = os.environ['CC']
291 +- if (sys.platform == 'darwin'
292 ++ if (True
293 + and 'LDSHARED' not in os.environ
294 + and ldshared.startswith(cc)):
295 + # On OS X, if CC is overridden, use that as the default
296 + # command for LDSHARED as well
297 ++ # Gentoo: s/OS X/every system/
298 + ldshared = newcc + ldshared[len(cc):]
299 + cc = newcc
300 + if 'CXX' in os.environ:
301 +- cxx = os.environ['CXX']
302 ++ newcxx = os.environ['CXX']
303 ++ if ('LDCXXSHARED' not in os.environ
304 ++ and ldcxxshared.startswith(cxx)):
305 ++ ldcxxshared = newcxx + ldcxxshared[len(cxx):]
306 ++ cxx = newcxx
307 + if 'LDSHARED' in os.environ:
308 + ldshared = os.environ['LDSHARED']
309 ++ if 'LDCXXSHARED' in os.environ:
310 ++ ldcxxshared = os.environ['LDCXXSHARED']
311 + if 'CPP' in os.environ:
312 + cpp = os.environ['CPP']
313 + else:
314 + cpp = cc + " -E" # not always
315 + if 'LDFLAGS' in os.environ:
316 + ldshared = ldshared + ' ' + os.environ['LDFLAGS']
317 ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
318 + if 'CFLAGS' in os.environ:
319 +- cflags = opt + ' ' + os.environ['CFLAGS']
320 ++ cflags = os.environ['CFLAGS']
321 + ldshared = ldshared + ' ' + os.environ['CFLAGS']
322 ++ if 'CXXFLAGS' in os.environ:
323 ++ cxxflags = os.environ['CXXFLAGS']
324 ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
325 + if 'CPPFLAGS' in os.environ:
326 + cpp = cpp + ' ' + os.environ['CPPFLAGS']
327 + cflags = cflags + ' ' + os.environ['CPPFLAGS']
328 ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
329 + ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
330 ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
331 + if 'AR' in os.environ:
332 + ar = os.environ['AR']
333 + if 'ARFLAGS' in os.environ:
334 +@@ -207,13 +224,17 @@ def customize_compiler(compiler):
335 + archiver = ar + ' ' + ar_flags
336 +
337 + cc_cmd = cc + ' ' + cflags
338 ++ cxx_cmd = cxx + ' ' + cxxflags
339 + compiler.set_executables(
340 + preprocessor=cpp,
341 + compiler=cc_cmd,
342 + compiler_so=cc_cmd + ' ' + ccshared,
343 +- compiler_cxx=cxx,
344 ++ compiler_cxx=cxx_cmd,
345 ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
346 + linker_so=ldshared,
347 + linker_exe=cc,
348 ++ linker_so_cxx=ldcxxshared,
349 ++ linker_exe_cxx=cxx,
350 + archiver=archiver)
351 +
352 + compiler.shared_lib_extension = so_ext
353 +diff --git a/distutils/unixccompiler.py b/distutils/unixccompiler.py
354 +index dee88a5..558b568 100644
355 +--- a/distutils/unixccompiler.py
356 ++++ b/distutils/unixccompiler.py
357 +@@ -55,14 +55,17 @@ class UnixCCompiler(CCompiler):
358 + # are pretty generic; they will probably have to be set by an outsider
359 + # (eg. using information discovered by the sysconfig about building
360 + # Python extensions).
361 +- executables = {'preprocessor' : None,
362 +- 'compiler' : ["cc"],
363 +- 'compiler_so' : ["cc"],
364 +- 'compiler_cxx' : ["c++"], # pypy: changed, 'cc' is bogus
365 +- 'linker_so' : ["cc", "-shared"],
366 +- 'linker_exe' : ["cc"],
367 +- 'archiver' : ["ar", "-cr"],
368 +- 'ranlib' : None,
369 ++ executables = {'preprocessor' : None,
370 ++ 'compiler' : ["cc"],
371 ++ 'compiler_so' : ["cc"],
372 ++ 'compiler_cxx' : ["c++"],
373 ++ 'compiler_so_cxx' : ["c++"],
374 ++ 'linker_so' : ["cc", "-shared"],
375 ++ 'linker_exe' : ["cc"],
376 ++ 'linker_so_cxx' : ["c++", "-shared"],
377 ++ 'linker_exe_cxx' : ["c++"],
378 ++ 'archiver' : ["ar", "-cr"],
379 ++ 'ranlib' : None,
380 + }
381 +
382 + if sys.platform[:6] == "darwin":
383 +@@ -129,12 +132,19 @@ class UnixCCompiler(CCompiler):
384 +
385 + def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
386 + compiler_so = self.compiler_so
387 ++ compiler_so_cxx = self.compiler_so_cxx
388 + if sys.platform == 'darwin':
389 + compiler_so = _osx_support.compiler_fixup(compiler_so,
390 + cc_args + extra_postargs)
391 ++ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
392 ++ cc_args + extra_postargs)
393 + try:
394 +- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
395 +- extra_postargs)
396 ++ if self.detect_language(src) == 'c++':
397 ++ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
398 ++ extra_postargs)
399 ++ else:
400 ++ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
401 ++ extra_postargs)
402 + except DistutilsExecError, msg:
403 + raise CompileError, msg
404 +
405 +@@ -191,23 +201,16 @@ class UnixCCompiler(CCompiler):
406 + ld_args.extend(extra_postargs)
407 + self.mkpath(os.path.dirname(output_filename))
408 + try:
409 +- if target_desc == CCompiler.EXECUTABLE:
410 +- linker = self.linker_exe[:]
411 ++ if target_lang == "c++":
412 ++ if target_desc == CCompiler.EXECUTABLE:
413 ++ linker = self.linker_exe_cxx[:]
414 ++ else:
415 ++ linker = self.linker_so_cxx[:]
416 + else:
417 +- linker = self.linker_so[:]
418 +- if target_lang == "c++" and self.compiler_cxx:
419 +- # skip over environment variable settings if /usr/bin/env
420 +- # is used to set up the linker's environment.
421 +- # This is needed on OSX. Note: this assumes that the
422 +- # normal and C++ compiler have the same environment
423 +- # settings.
424 +- i = 0
425 +- if os.path.basename(linker[0]) == "env":
426 +- i = 1
427 +- while '=' in linker[i]:
428 +- i = i + 1
429 +-
430 +- linker[i] = self.compiler_cxx[i]
431 ++ if target_desc == CCompiler.EXECUTABLE:
432 ++ linker = self.linker_exe[:]
433 ++ else:
434 ++ linker = self.linker_so[:]
435 +
436 + if sys.platform == 'darwin':
437 + linker = _osx_support.compiler_fixup(linker, ld_args)
438 +--
439 +2.12.2
440 +
441
442 diff --git a/dev-python/pypy-bin/pypy-bin-5.7.1.ebuild b/dev-python/pypy-bin/pypy-bin-5.7.1.ebuild
443 new file mode 100644
444 index 00000000000..aaa6411b77b
445 --- /dev/null
446 +++ b/dev-python/pypy-bin/pypy-bin-5.7.1.ebuild
447 @@ -0,0 +1,189 @@
448 +# Copyright 1999-2017 Gentoo Foundation
449 +# Distributed under the terms of the GNU General Public License v2
450 +
451 +EAPI=6
452 +
453 +PYTHON_COMPAT=( python2_7 pypy )
454 +inherit pax-utils python-any-r1 unpacker versionator
455 +
456 +BINHOST="https://dev.gentoo.org/~mgorny/dist/pypy-bin/${PV}"
457 +CPY_PATCHSET_VERSION="2.7.13-0"
458 +MY_P=pypy2-v${PV}
459 +
460 +DESCRIPTION="Pre-built version of PyPy"
461 +HOMEPAGE="http://pypy.org/"
462 +SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
463 + https://dev.gentoo.org/~floppym/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz
464 + amd64? (
465 + jit? ( ${BINHOST}/${P}-amd64+bzip2+jit+ncurses.tar.lz )
466 + !jit? ( ${BINHOST}/${P}-amd64+bzip2+ncurses.tar.lz )
467 + )
468 + x86? (
469 + cpu_flags_x86_sse2? (
470 + jit? ( ${BINHOST}/${P}-x86+bzip2+jit+ncurses+sse2.tar.lz )
471 + !jit? ( ${BINHOST}/${P}-x86+bzip2+ncurses+sse2.tar.lz )
472 + )
473 + !cpu_flags_x86_sse2? (
474 + !jit? ( ${BINHOST}/${P}-x86+bzip2+ncurses.tar.lz )
475 + )
476 + )"
477 +
478 +# Supported variants
479 +REQUIRED_USE="x86? ( !cpu_flags_x86_sse2? ( !jit ) )"
480 +
481 +LICENSE="MIT"
482 +# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
483 +SLOT="0/41"
484 +KEYWORDS="~amd64 ~x86"
485 +IUSE="doc gdbm +jit sqlite cpu_flags_x86_sse2 test tk"
486 +
487 +# yep, world would be easier if people started filling subslots...
488 +RDEPEND="
489 + app-arch/bzip2:0=
490 + dev-libs/expat:0=
491 + dev-libs/libffi:0=
492 + dev-libs/openssl:0=[-bindist]
493 + sys-libs/glibc:2.2=
494 + sys-libs/ncurses:0/6
495 + sys-libs/zlib:0=
496 + gdbm? ( sys-libs/gdbm:0= )
497 + sqlite? ( dev-db/sqlite:3= )
498 + tk? (
499 + dev-lang/tk:0=
500 + dev-tcltk/tix:0=
501 + )
502 + !dev-python/pypy:0"
503 +DEPEND="${RDEPEND}
504 + app-arch/lzip
505 + app-arch/xz-utils
506 + doc? ( ${PYTHON_DEPS}
507 + dev-python/sphinx )"
508 +
509 +S=${WORKDIR}/${MY_P}-src
510 +
511 +QA_PREBUILT="
512 + usr/lib*/pypy/pypy-c
513 + usr/lib*/pypy/libpypy-c.so"
514 +
515 +pkg_setup() {
516 + if [[ ${MERGE_TYPE} != binary ]]; then
517 + use doc && python-any-r1_pkg_setup
518 + fi
519 +}
520 +
521 +src_prepare() {
522 + eapply "${FILESDIR}/4.0.0-gentoo-path.patch"
523 + eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
524 +
525 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
526 + -e "s^@libdir@^$(get_libdir)^" \
527 + -i lib-python/2.7/distutils/command/install.py || die
528 +
529 + # apply CPython stdlib patches
530 + pushd lib-python/2.7 > /dev/null || die
531 + # TODO: cpy turkish locale patch now fixes C code
532 + # probably needs better port to pypy, if it is broken there
533 + eapply "${FILESDIR}"/5.7.1_all_distutils_cxx.patch
534 + eapply "${WORKDIR}"/patches/62_all_xml.use_pyxml.patch
535 + popd > /dev/null || die
536 +
537 + eapply_user
538 +}
539 +
540 +src_compile() {
541 + # Tadaam! PyPy compiled!
542 + mv "${WORKDIR}"/${P}*/{libpypy-c.so,pypy-c} . || die
543 + mv "${WORKDIR}"/${P}*/include/*.h include/ || die
544 + # (not installed by pypy)
545 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
546 + mv pypy/module/cpyext/include/* include/ || die
547 + mv pypy/module/cpyext/parse/*.h include/ || die
548 +
549 + use doc && emake -C pypy/doc/ html
550 + #needed even without jit :( also needed in both compile and install phases
551 + pax-mark m pypy-c libpypy-c.so
552 +}
553 +
554 +src_test() {
555 + # (unset)
556 + local -x PYTHONDONTWRITEBYTECODE
557 +
558 + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c lib-python || die
559 +}
560 +
561 +src_install() {
562 + local dest=/usr/$(get_libdir)/pypy
563 + einfo "Installing PyPy ..."
564 + insinto "${dest}"
565 + doins -r include lib_pypy lib-python pypy-c libpypy-c.so
566 + fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so
567 + pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
568 + dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy
569 + dodoc README.rst
570 +
571 + if ! use gdbm; then
572 + rm -r "${ED%/}${dest}"/lib_pypy/gdbm.py \
573 + "${ED%/}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
574 + fi
575 + if ! use sqlite; then
576 + rm -r "${ED%/}${dest}"/lib-python/*2.7/sqlite3 \
577 + "${ED%/}${dest}"/lib_pypy/_sqlite3.py \
578 + "${ED%/}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
579 + fi
580 + if ! use tk; then
581 + rm -r "${ED%/}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
582 + "${ED%/}${dest}"/lib_pypy/_tkinter \
583 + "${ED%/}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
584 + fi
585 +
586 + # Install docs
587 + use doc && dodoc -r pypy/doc/_build/html
588 +
589 + einfo "Generating caches and byte-compiling ..."
590 +
591 + local -x PYTHON=${ED%/}${dest}/pypy-c
592 + local -x LD_LIBRARY_PATH="${ED%/}${dest}"
593 + # we can't use eclass function since PyPy is dumb and always gives
594 + # paths relative to the interpreter
595 + local PYTHON_SITEDIR=${EPREFIX}/usr/$(get_libdir)/pypy/site-packages
596 + python_export pypy EPYTHON
597 +
598 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
599 + python_domodule epython.py
600 +
601 + # Generate Grammar and PatternGrammar pickles.
602 + "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
603 + || die "Generation of Grammar and PatternGrammar pickles failed"
604 +
605 + # Generate cffi modules
606 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
607 +#cffi_build_scripts = {
608 +# "sqlite3": "_sqlite3_build.py",
609 +# "audioop": "_audioop_build.py",
610 +# "tk": "_tkinter/tklib_build.py",
611 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
612 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
613 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
614 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
615 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
616 + cffi_targets=( audioop curses syslog pwdgrp resource )
617 + use gdbm && cffi_targets+=( gdbm )
618 + use sqlite && cffi_targets+=( sqlite3 )
619 + use tk && cffi_targets+=( tkinter/tklib )
620 +
621 + local t
622 + # all modules except tkinter output to .
623 + # tkinter outputs to the correct dir ...
624 + cd "${ED%/}${dest}"/lib_pypy || die
625 + for t in "${cffi_targets[@]}"; do
626 + # tkinter doesn't work via -m
627 + "${PYTHON}" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
628 + done
629 +
630 + # Cleanup temporary objects
631 + find "${ED%/}${dest}" -name "_cffi_*.[co]" -delete || die
632 + find "${ED%/}${dest}" -type d -empty -delete || die
633 +
634 + # compile the installed modules
635 + python_optimize "${ED%/}${dest}"
636 +}