Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/riscv:master commit in: dev-lang/python/, dev-lang/python/files/
Date: Thu, 02 May 2019 22:25:30
Message-Id: 1556835910.4d79e4909ed110cddbe65129ca529645e6e1a19c.dilfridge@gentoo
1 commit: 4d79e4909ed110cddbe65129ca529645e6e1a19c
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 2 22:25:10 2019 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Thu May 2 22:25:10 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/riscv.git/commit/?id=4d79e490
7
8 dev-lang/python: drop, not needed anymore
9
10 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
11
12 dev-lang/python/Manifest | 2 -
13 dev-lang/python/files/3.4-getentropy-linux.patch | 40 ---
14 dev-lang/python/files/3.6-disable-nis.patch | 21 --
15 dev-lang/python/files/3.6.5-disable-nis.patch | 11 -
16 dev-lang/python/files/pydoc.conf | 6 -
17 dev-lang/python/files/pydoc.init | 24 --
18 .../python-2.7.10-cross-compile-warn-test.patch | 24 --
19 .../python/files/python-2.7.10-system-libffi.patch | 36 ---
20 .../files/python-2.7.5-nonfatal-compileall.patch | 18 --
21 .../files/python-2.7.9-ncurses-pkg-config.patch | 13 -
22 .../files/python-3.4.3-ncurses-pkg-config.patch | 13 -
23 dev-lang/python/files/python-3.4.5-cross.patch | 11 -
24 .../files/python-3.5-distutils-OO-build.patch | 80 -----
25 .../python/files/python-3.5.5-hash-unaligned.patch | 43 ---
26 .../python-3.5.5-libressl-compatibility.patch | 69 ----
27 .../python/files/python-3.6.5-hash-unaligned.patch | 42 ---
28 .../python-3.6.5-libressl-compatibility.patch | 114 -------
29 .../python/files/python-3.6.8-reducepath.patch | 22 --
30 dev-lang/python/metadata.xml | 13 -
31 dev-lang/python/python-3.6.8-r1.ebuild | 351 ---------------------
32 20 files changed, 953 deletions(-)
33
34 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
35 deleted file mode 100644
36 index d2f2f32..0000000
37 --- a/dev-lang/python/Manifest
38 +++ /dev/null
39 @@ -1,2 +0,0 @@
40 -DIST Python-3.6.8.tar.xz 17212420 BLAKE2B e104b49a35492b622080ab81a446c0cdd1223e8ddf95c4e1b262762a027664b59f3e4deeda4ba7177115d780e48b6764a053acef640a645327df428d2e4820cd SHA512 b17867e451ebe662f50df83ed112d3656c089e7d750651ea640052b01b713b58e66aac9e082f71fd16f5b5510bc9b797f5ccd30f5399581e9aa406197f02938a
41 -DIST python-gentoo-patches-3.6.8.tar.xz 11224 BLAKE2B 5fe38282bcf28df18e0bd37756c880ae191ea738dc92f1cf83f682cfdc52525b9c44287dc99191a73d75c90672ab501b56adf49515b35ff1fdee88c8dc07b175 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df
42
43 diff --git a/dev-lang/python/files/3.4-getentropy-linux.patch b/dev-lang/python/files/3.4-getentropy-linux.patch
44 deleted file mode 100644
45 index 9f12389..0000000
46 --- a/dev-lang/python/files/3.4-getentropy-linux.patch
47 +++ /dev/null
48 @@ -1,40 +0,0 @@
49 -From 5635d44079e1bbd9c495951ede8d078e7b8d67d5 Mon Sep 17 00:00:00 2001
50 -From: Victor Stinner <victor.stinner@×××××.com>
51 -Date: Mon, 9 Jan 2017 11:10:41 +0100
52 -Subject: [PATCH] Don't use getentropy() on Linux
53 -
54 -Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but
55 -read from /dev/urandom to get random bytes, for example in os.urandom(). On
56 -Linux, getentropy() is implemented which getrandom() is blocking mode, whereas
57 -os.urandom() should not block.
58 ----
59 - Python/random.c | 13 ++++++++++---
60 - 1 file changed, 10 insertions(+), 3 deletions(-)
61 -
62 -diff --git a/Python/random.c b/Python/random.c
63 -index af3d0bd0d5..dc6400d3b8 100644
64 ---- a/Python/random.c
65 -+++ b/Python/random.c
66 -@@ -67,9 +67,16 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
67 - return 0;
68 - }
69 -
70 --/* Issue #25003: Don' use getentropy() on Solaris (available since
71 -- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
72 --#elif defined(HAVE_GETENTROPY) && !defined(sun)
73 -+/* Issue #25003: Don't use getentropy() on Solaris (available since
74 -+ Solaris 11.3), it is blocking whereas os.urandom() should not block.
75 -+
76 -+ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
77 -+ implements it with the getrandom() syscall which can fail with ENOSYS,
78 -+ and this error is not supported in py_getentropy() and getrandom() is called
79 -+ with flags=0 which blocks until system urandom is initialized, which is not
80 -+ the desired behaviour to seed the Python hash secret nor for os.urandom():
81 -+ see the PEP 524 which was only implemented in Python 3.6. */
82 -+#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
83 - #define PY_GETENTROPY 1
84 -
85 - /* Fill buffer with size pseudo-random bytes generated by getentropy().
86 ---
87 -2.15.0.rc2
88 -
89
90 diff --git a/dev-lang/python/files/3.6-disable-nis.patch b/dev-lang/python/files/3.6-disable-nis.patch
91 deleted file mode 100644
92 index 4e81847..0000000
93 --- a/dev-lang/python/files/3.6-disable-nis.patch
94 +++ /dev/null
95 @@ -1,21 +0,0 @@
96 ---- a/setup.py
97 -+++ b/setup.py
98 -@@ -1332,17 +1332,7 @@ class PyBuildExt(build_ext):
99 - # Jeremy Hylton's rlimit interface
100 - exts.append( Extension('resource', ['resource.c']) )
101 -
102 -- # Sun yellow pages. Some systems have the functions in libc.
103 -- if (host_platform not in ['cygwin', 'qnx6'] and
104 -- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
105 -- if (self.compiler.find_library_file(lib_dirs, 'nsl')):
106 -- libs = ['nsl']
107 -- else:
108 -- libs = []
109 -- exts.append( Extension('nis', ['nismodule.c'],
110 -- libraries = libs) )
111 -- else:
112 -- missing.append('nis')
113 -+ missing.append('nis')
114 - else:
115 - missing.extend(['nis', 'resource', 'termios'])
116 -
117
118 diff --git a/dev-lang/python/files/3.6.5-disable-nis.patch b/dev-lang/python/files/3.6.5-disable-nis.patch
119 deleted file mode 100644
120 index 3937c6f..0000000
121 --- a/dev-lang/python/files/3.6.5-disable-nis.patch
122 +++ /dev/null
123 @@ -1,11 +0,0 @@
124 ---- a/setup.py
125 -+++ b/setup.py
126 -@@ -1364,7 +1364,7 @@ class PyBuildExt(build_ext):
127 - else:
128 - missing.extend(['resource', 'termios'])
129 -
130 -- nis = self._detect_nis(inc_dirs, lib_dirs)
131 -+ nis = None
132 - if nis is not None:
133 - exts.append(nis)
134 - else:
135
136 diff --git a/dev-lang/python/files/pydoc.conf b/dev-lang/python/files/pydoc.conf
137 deleted file mode 100644
138 index 3c6920c..0000000
139 --- a/dev-lang/python/files/pydoc.conf
140 +++ /dev/null
141 @@ -1,6 +0,0 @@
142 -# /etc/init.d/pydoc.conf
143 -
144 -# This file contains the configuration for pydoc's internal webserver.
145 -
146 -# Default port for Python's pydoc server.
147 -@PYDOC_PORT_VARIABLE@="7464"
148
149 diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init
150 deleted file mode 100644
151 index 148ce0b..0000000
152 --- a/dev-lang/python/files/pydoc.init
153 +++ /dev/null
154 @@ -1,24 +0,0 @@
155 -#!/sbin/openrc-run
156 -# Copyright 1999-2019 Gentoo Authors
157 -# Distributed under the terms of the GNU General Public Licence v2
158 -
159 -start() {
160 - local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}"
161 -
162 - if [ -z "${pydoc_port}" ]; then
163 - eerror "Port not set"
164 - return 1
165 - fi
166 -
167 - ebegin "Starting pydoc server on port ${pydoc_port}"
168 - start-stop-daemon --start --background --make-pidfile \
169 - --pidfile /var/run/@PYDOC@.pid \
170 - --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}"
171 - eend $?
172 -}
173 -
174 -stop() {
175 - ebegin "Stopping pydoc server"
176 - start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid
177 - eend $?
178 -}
179
180 diff --git a/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch b/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch
181 deleted file mode 100644
182 index 38433de..0000000
183 --- a/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch
184 +++ /dev/null
185 @@ -1,24 +0,0 @@
186 -https://bugs.python.org/issue25397
187 -
188 -improve the cross-compile tests to be more focused
189 -
190 ---- a/configure.ac
191 -+++ b/configure.ac
192 -@@ -1339,7 +1339,7 @@ if test "$GCC" = "yes"
193 - then
194 - AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
195 - save_CFLAGS=$CFLAGS
196 -- CFLAGS="$CFLAGS -Werror -Wformat"
197 -+ CFLAGS="$CFLAGS -Werror=format"
198 - AC_COMPILE_IFELSE([
199 - AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
200 - ],[
201 -@@ -4458,7 +4458,7 @@ then
202 - [ac_cv_have_long_long_format="cross -- assuming no"
203 - if test x$GCC = xyes; then
204 - save_CFLAGS=$CFLAGS
205 -- CFLAGS="$CFLAGS -Werror -Wformat"
206 -+ CFLAGS="$CFLAGS -Werror=format"
207 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
208 - #include <stdio.h>
209 - #include <stddef.h>
210
211 diff --git a/dev-lang/python/files/python-2.7.10-system-libffi.patch b/dev-lang/python/files/python-2.7.10-system-libffi.patch
212 deleted file mode 100644
213 index 0b49b79..0000000
214 --- a/dev-lang/python/files/python-2.7.10-system-libffi.patch
215 +++ /dev/null
216 @@ -1,36 +0,0 @@
217 -make sure we respect the system libffi setting in our build config.
218 -the compiler probing is fragile and can break in some situations.
219 -
220 ---- a/setup.py
221 -+++ b/setup.py
222 -@@ -2069,7 +2069,7 @@ class PyBuildExt(build_ext):
223 - return True
224 -
225 - def detect_ctypes(self, inc_dirs, lib_dirs):
226 -- self.use_system_libffi = False
227 -+ self.use_system_libffi = ('--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"))
228 - include_dirs = []
229 - extra_compile_args = []
230 - extra_link_args = []
231 -@@ -2113,7 +2113,7 @@ class PyBuildExt(build_ext):
232 - sources=['_ctypes/_ctypes_test.c'])
233 - self.extensions.extend([ext, ext_test])
234 -
235 -- if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
236 -+ if not self.use_system_libffi:
237 - return
238 -
239 - if host_platform == 'darwin':
240 -@@ -2141,10 +2141,10 @@ class PyBuildExt(build_ext):
241 - ffi_lib = lib_name
242 - break
243 -
244 -- if ffi_inc and ffi_lib:
245 -+ if ffi_inc:
246 - ext.include_dirs.extend(ffi_inc)
247 -+ if ffi_lib:
248 - ext.libraries.append(ffi_lib)
249 -- self.use_system_libffi = True
250 -
251 -
252 - class PyBuildInstall(install):
253
254 diff --git a/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch b/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch
255 deleted file mode 100644
256 index a762dfb..0000000
257 --- a/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch
258 +++ /dev/null
259 @@ -1,18 +0,0 @@
260 -diff --git a/Makefile.pre.in b/Makefile.pre.in
261 ---- a/Makefile.pre.in
262 -+++ b/Makefile.pre.in
263 -@@ -1000,12 +1000,12 @@
264 - $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
265 - $(DESTDIR)$(LIBDEST)/distutils/tests ; \
266 - fi
267 -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
268 -+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
269 - $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
270 - -d $(LIBDEST) -f \
271 - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
272 - $(DESTDIR)$(LIBDEST)
273 -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
274 -+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
275 - $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
276 - -d $(LIBDEST) -f \
277 - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
278
279 diff --git a/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch b/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch
280 deleted file mode 100644
281 index 38ce6f7..0000000
282 --- a/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch
283 +++ /dev/null
284 @@ -1,13 +0,0 @@
285 -do not hardcode /usr/include paths
286 -
287 ---- a/configure.ac
288 -+++ b/configure.ac
289 -@@ -4316,7 +4316,7 @@ fi
290 -
291 - # first curses configure check
292 - ac_save_cppflags="$CPPFLAGS"
293 --CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
294 -+CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags ncursesw`"
295 -
296 - AC_CHECK_HEADERS(curses.h ncurses.h)
297 -
298
299 diff --git a/dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch b/dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch
300 deleted file mode 100644
301 index 8bfad11..0000000
302 --- a/dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch
303 +++ /dev/null
304 @@ -1,13 +0,0 @@
305 -do not hardcode /usr/include paths
306 -
307 ---- a/configure.ac
308 -+++ b/configure.ac
309 -@@ -4402,7 +4402,7 @@ fi
310 -
311 - # first curses header check
312 - ac_save_cppflags="$CPPFLAGS"
313 --CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
314 -+CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags ncursesw`"
315 -
316 - AC_CHECK_HEADERS(curses.h ncurses.h)
317 -
318
319 diff --git a/dev-lang/python/files/python-3.4.5-cross.patch b/dev-lang/python/files/python-3.4.5-cross.patch
320 deleted file mode 100644
321 index 7a016ff..0000000
322 --- a/dev-lang/python/files/python-3.4.5-cross.patch
323 +++ /dev/null
324 @@ -1,11 +0,0 @@
325 ---- a/Lib/distutils/command/build_ext.py
326 -+++ b/Lib/distutils/command/build_ext.py
327 -@@ -729,7 +729,7 @@
328 - if sysconfig.get_config_var('Py_ENABLE_SHARED'):
329 - pythonlib = 'python{}.{}{}'.format(
330 - sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff,
331 -- sys.abiflags)
332 -+ sysconfig.get_config_var('ABIFLAGS'))
333 - return ext.libraries + [pythonlib]
334 - else:
335 - return ext.libraries
336
337 diff --git a/dev-lang/python/files/python-3.5-distutils-OO-build.patch b/dev-lang/python/files/python-3.5-distutils-OO-build.patch
338 deleted file mode 100644
339 index 8af8c30..0000000
340 --- a/dev-lang/python/files/python-3.5-distutils-OO-build.patch
341 +++ /dev/null
342 @@ -1,80 +0,0 @@
343 -From 90507018442f9adabb586fd3d0a0206b9c2f2f50 Mon Sep 17 00:00:00 2001
344 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
345 -Date: Sun, 5 Jun 2016 08:18:01 +0200
346 -Subject: [PATCH] distutils: make -OO enable both opt-1 and opt-2 optimization
347 -
348 -Bug: http://bugs.python.org/issue27226
349 -Bug: https://bugs.gentoo.org/585060
350 ----
351 - Lib/distutils/command/build_py.py | 8 ++++----
352 - Lib/distutils/command/install_lib.py | 12 ++++++------
353 - 2 files changed, 10 insertions(+), 10 deletions(-)
354 -
355 -diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
356 -index cf0ca57..838d4e4 100644
357 ---- a/Lib/distutils/command/build_py.py
358 -+++ b/Lib/distutils/command/build_py.py
359 -@@ -315,9 +315,9 @@ class build_py (Command):
360 - if self.compile:
361 - outputs.append(importlib.util.cache_from_source(
362 - filename, optimization=''))
363 -- if self.optimize > 0:
364 -+ for opt in range(1, self.optimize + 1):
365 - outputs.append(importlib.util.cache_from_source(
366 -- filename, optimization=self.optimize))
367 -+ filename, optimization=opt))
368 -
369 - outputs += [
370 - os.path.join(build_dir, filename)
371 -@@ -387,8 +387,8 @@ class build_py (Command):
372 - if self.compile:
373 - byte_compile(files, optimize=0,
374 - force=self.force, prefix=prefix, dry_run=self.dry_run)
375 -- if self.optimize > 0:
376 -- byte_compile(files, optimize=self.optimize,
377 -+ for opt in range(1, self.optimize + 1):
378 -+ byte_compile(files, optimize=opt,
379 - force=self.force, prefix=prefix, dry_run=self.dry_run)
380 -
381 - class build_py_2to3(build_py, Mixin2to3):
382 -diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
383 -index 6154cf0..049b662 100644
384 ---- a/Lib/distutils/command/install_lib.py
385 -+++ b/Lib/distutils/command/install_lib.py
386 -@@ -24,8 +24,8 @@ class install_lib(Command):
387 - # 2) compile .pyc only (--compile --no-optimize; default)
388 - # 3) compile .pyc and "opt-1" .pyc (--compile --optimize)
389 - # 4) compile "opt-1" .pyc only (--no-compile --optimize)
390 -- # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
391 -- # 6) compile "opt-2" .pyc only (--no-compile --optimize-more)
392 -+ # 5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more)
393 -+ # 6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more)
394 - #
395 - # The UI for this is two options, 'compile' and 'optimize'.
396 - # 'compile' is strictly boolean, and only decides whether to
397 -@@ -132,8 +132,8 @@ class install_lib(Command):
398 - byte_compile(files, optimize=0,
399 - force=self.force, prefix=install_root,
400 - dry_run=self.dry_run)
401 -- if self.optimize > 0:
402 -- byte_compile(files, optimize=self.optimize,
403 -+ for opt in range(1, self.optimize + 1):
404 -+ byte_compile(files, optimize=opt,
405 - force=self.force, prefix=install_root,
406 - verbose=self.verbose, dry_run=self.dry_run)
407 -
408 -@@ -167,9 +167,9 @@ class install_lib(Command):
409 - if self.compile:
410 - bytecode_files.append(importlib.util.cache_from_source(
411 - py_file, optimization=''))
412 -- if self.optimize > 0:
413 -+ for opt in range(1, self.optimize + 1):
414 - bytecode_files.append(importlib.util.cache_from_source(
415 -- py_file, optimization=self.optimize))
416 -+ py_file, optimization=opt))
417 -
418 - return bytecode_files
419 -
420 ---
421 -2.8.3
422 -
423
424 diff --git a/dev-lang/python/files/python-3.5.5-hash-unaligned.patch b/dev-lang/python/files/python-3.5.5-hash-unaligned.patch
425 deleted file mode 100644
426 index c418f40..0000000
427 --- a/dev-lang/python/files/python-3.5.5-hash-unaligned.patch
428 +++ /dev/null
429 @@ -1,43 +0,0 @@
430 -The hash implementation casts the input pointer to uint64_t* and directly reads
431 -from this, which may cause unaligned accesses. Use memcpy() instead so this code
432 -will not crash with SIGBUS on sparc.
433 -
434 ---- a/Python/pyhash.c 2017-11-29 10:21:20.283094068 +0100
435 -+++ b/Python/pyhash.c 2017-11-29 10:24:26.733087813 +0100
436 -@@ -372,7 +372,7 @@ siphash24(const void *src, Py_ssize_t sr
437 - PY_UINT64_T k0 = _le64toh(_Py_HashSecret.siphash.k0);
438 - PY_UINT64_T k1 = _le64toh(_Py_HashSecret.siphash.k1);
439 - PY_UINT64_T b = (PY_UINT64_T)src_sz << 56;
440 -- const PY_UINT64_T *in = (PY_UINT64_T*)src;
441 -+ const PY_UINT8_T *in = (PY_UINT8_T*)src;
442 -
443 - PY_UINT64_T v0 = k0 ^ 0x736f6d6570736575ULL;
444 - PY_UINT64_T v1 = k1 ^ 0x646f72616e646f6dULL;
445 -@@ -381,12 +381,14 @@ siphash24(const void *src, Py_ssize_t sr
446 -
447 - PY_UINT64_T t;
448 - PY_UINT8_T *pt;
449 -- PY_UINT8_T *m;
450 -+ const PY_UINT8_T *m;
451 -
452 - while (src_sz >= 8) {
453 -- PY_UINT64_T mi = _le64toh(*in);
454 -- in += 1;
455 -- src_sz -= 8;
456 -+ PY_UINT64_T mi;
457 -+ memcpy(&mi, in, sizeof(mi));
458 -+ mi = _le64toh(mi);
459 -+ in += sizeof(mi);
460 -+ src_sz -= sizeof(mi);
461 - v3 ^= mi;
462 - DOUBLE_ROUND(v0,v1,v2,v3);
463 - v0 ^= mi;
464 -@@ -394,7 +396,7 @@ siphash24(const void *src, Py_ssize_t sr
465 -
466 - t = 0;
467 - pt = (PY_UINT8_T *)&t;
468 -- m = (PY_UINT8_T *)in;
469 -+ m = in;
470 - switch (src_sz) {
471 - case 7: pt[6] = m[6];
472 - case 6: pt[5] = m[5];
473
474 diff --git a/dev-lang/python/files/python-3.5.5-libressl-compatibility.patch b/dev-lang/python/files/python-3.5.5-libressl-compatibility.patch
475 deleted file mode 100644
476 index 67d57d0..0000000
477 --- a/dev-lang/python/files/python-3.5.5-libressl-compatibility.patch
478 +++ /dev/null
479 @@ -1,69 +0,0 @@
480 -# From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001
481 -# From: Christian Heimes <christian@××××××.org>
482 -# Date: Sat, 24 Mar 2018 18:38:14 +0100
483 -# Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0
484 -# (GH-6210) (GH-6214)
485 -#
486 -# LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
487 -# LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
488 -# LibreSSL < 2.7.
489 -
490 -# Documentation updates and fixes for failing tests will be provided in
491 -# another patch set.
492 -
493 -# Signed-off-by: Christian Heimes <christian@××××××.org>.
494 -# (cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
495 -
496 -# Co-authored-by: Christian Heimes <christian@××××××.org>
497 -# Patch modified by Aaron Bauman <bman@g.o> for 3.5.5
498 -
499 ---- a/Modules/_ssl.c 2018-04-13 18:33:17.397649561 -0400
500 -+++ b/Modules/_ssl.c 2018-04-13 18:40:22.319852014 -0400
501 -@@ -101,6 +101,12 @@
502 -
503 - #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
504 - # define OPENSSL_VERSION_1_1 1
505 -+# define PY_OPENSSL_1_1_API 1
506 -+#endif
507 -+
508 -+/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
509 -+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
510 -+# define PY_OPENSSL_1_1_API 1
511 - #endif
512 -
513 - /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
514 -@@ -129,16 +135,18 @@
515 - #define INVALID_SOCKET (-1)
516 - #endif
517 -
518 --#ifdef OPENSSL_VERSION_1_1
519 --/* OpenSSL 1.1.0+ */
520 --#ifndef OPENSSL_NO_SSL2
521 --#define OPENSSL_NO_SSL2
522 --#endif
523 --#else /* OpenSSL < 1.1.0 */
524 --#if defined(WITH_THREAD)
525 -+/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
526 -+#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
527 - #define HAVE_OPENSSL_CRYPTO_LOCK
528 - #endif
529 -
530 -+#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
531 -+#define OPENSSL_NO_SSL2
532 -+#endif
533 -+
534 -+#ifndef PY_OPENSSL_1_1_API
535 -+/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
536 -+
537 - #define TLS_method SSLv23_method
538 -
539 - static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
540 -@@ -187,7 +195,7 @@
541 - {
542 - return store->param;
543 - }
544 --#endif /* OpenSSL < 1.1.0 or LibreSSL */
545 -+#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
546 -
547 -
548 - enum py_ssl_error {
549
550 diff --git a/dev-lang/python/files/python-3.6.5-hash-unaligned.patch b/dev-lang/python/files/python-3.6.5-hash-unaligned.patch
551 deleted file mode 100644
552 index d096887..0000000
553 --- a/dev-lang/python/files/python-3.6.5-hash-unaligned.patch
554 +++ /dev/null
555 @@ -1,42 +0,0 @@
556 -The hash implementation casts the input pointer to uint64_t* and directly reads
557 -from this, which may cause unaligned accesses. Use memcpy() instead so this code
558 -will not crash with SIGBUS on sparc.
559 -
560 ---- a/Python/pyhash.c 2017-11-29 10:21:20.283094068 +0100
561 -+++ b/Python/pyhash.c 2017-11-29 10:24:26.733087813 +0100
562 -@@ -369,7 +369,7 @@
563 - uint64_t k0 = _le64toh(_Py_HashSecret.siphash.k0);
564 - uint64_t k1 = _le64toh(_Py_HashSecret.siphash.k1);
565 - uint64_t b = (uint64_t)src_sz << 56;
566 -- const uint64_t *in = (uint64_t*)src;
567 -+ const uint8_t *in = (uint8_t*)src;
568 -
569 - uint64_t v0 = k0 ^ 0x736f6d6570736575ULL;
570 - uint64_t v1 = k1 ^ 0x646f72616e646f6dULL;
571 -@@ -378,11 +378,13 @@
572 -
573 - uint64_t t;
574 - uint8_t *pt;
575 -- uint8_t *m;
576 -+ const uint8_t *m;
577 -
578 - while (src_sz >= 8) {
579 -- uint64_t mi = _le64toh(*in);
580 -- in += 1;
581 -- src_sz -= 8;
582 -+ uint64_t mi;
583 -+ memcpy(&mi, in, sizeof(mi));
584 -+ mi = _le64toh(mi);
585 -+ in += sizeof(mi);
586 -+ src_sz -= sizeof(mi);
587 - v3 ^= mi;
588 - DOUBLE_ROUND(v0,v1,v2,v3);
589 -@@ -391,7 +393,7 @@
590 -
591 - t = 0;
592 - pt = (uint8_t *)&t;
593 -- m = (uint8_t *)in;
594 -+ m = in;
595 - switch (src_sz) {
596 - case 7: pt[6] = m[6]; /* fall through */
597 - case 6: pt[5] = m[5]; /* fall through */
598
599 diff --git a/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch b/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch
600 deleted file mode 100644
601 index 2f9e6a2..0000000
602 --- a/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch
603 +++ /dev/null
604 @@ -1,114 +0,0 @@
605 -From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001
606 -From: Christian Heimes <christian@××××××.org>
607 -Date: Sat, 24 Mar 2018 18:38:14 +0100
608 -Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0
609 - (GH-6210) (GH-6214)
610 -
611 -LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
612 -LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
613 -LibreSSL < 2.7.
614 -
615 -Documentation updates and fixes for failing tests will be provided in
616 -another patch set.
617 -
618 -Signed-off-by: Christian Heimes <christian@××××××.org>.
619 -(cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
620 -
621 -Co-authored-by: Christian Heimes <christian@××××××.org>
622 ----
623 - Lib/test/test_ssl.py | 1 +
624 - .../2018-03-24-15-08-24.bpo-33127.olJmHv.rst | 1 +
625 - Modules/_ssl.c | 24 ++++++++++++-------
626 - Tools/ssl/multissltests.py | 3 ++-
627 - 4 files changed, 20 insertions(+), 9 deletions(-)
628 - create mode 100644 Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
629 -
630 -diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
631 -index 8dd3b41450..9785a59a7e 100644
632 ---- a/Lib/test/test_ssl.py
633 -+++ b/Lib/test/test_ssl.py
634 -@@ -1687,6 +1687,7 @@ class SimpleBackgroundTests(unittest.TestCase):
635 - self.assertEqual(len(ctx.get_ca_certs()), 1)
636 -
637 - @needs_sni
638 -+ @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"), "needs TLS 1.2")
639 - def test_context_setget(self):
640 - # Check that the context of a connected socket can be replaced.
641 - ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
642 -diff --git a/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst b/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
643 -new file mode 100644
644 -index 0000000000..635aabbde0
645 ---- /dev/null
646 -+++ b/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
647 -@@ -0,0 +1 @@
648 -+The ssl module now compiles with LibreSSL 2.7.1.
649 -diff --git a/Modules/_ssl.c b/Modules/_ssl.c
650 -index c54e43c2b4..5e007da858 100644
651 ---- a/Modules/_ssl.c
652 -+++ b/Modules/_ssl.c
653 -@@ -106,6 +106,12 @@ struct py_ssl_library_code {
654 -
655 - #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
656 - # define OPENSSL_VERSION_1_1 1
657 -+# define PY_OPENSSL_1_1_API 1
658 -+#endif
659 -+
660 -+/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
661 -+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
662 -+# define PY_OPENSSL_1_1_API 1
663 - #endif
664 -
665 - /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
666 -@@ -152,16 +158,18 @@ struct py_ssl_library_code {
667 - #define INVALID_SOCKET (-1)
668 - #endif
669 -
670 --#ifdef OPENSSL_VERSION_1_1
671 --/* OpenSSL 1.1.0+ */
672 --#ifndef OPENSSL_NO_SSL2
673 --#define OPENSSL_NO_SSL2
674 --#endif
675 --#else /* OpenSSL < 1.1.0 */
676 --#if defined(WITH_THREAD)
677 -+/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
678 -+#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
679 - #define HAVE_OPENSSL_CRYPTO_LOCK
680 - #endif
681 -
682 -+#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
683 -+#define OPENSSL_NO_SSL2
684 -+#endif
685 -+
686 -+#ifndef PY_OPENSSL_1_1_API
687 -+/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
688 -+
689 - #define TLS_method SSLv23_method
690 - #define TLS_client_method SSLv23_client_method
691 - #define TLS_server_method SSLv23_server_method
692 -@@ -227,7 +235,7 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s)
693 - return s->tlsext_tick_lifetime_hint;
694 - }
695 -
696 --#endif /* OpenSSL < 1.1.0 or LibreSSL */
697 -+#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
698 -
699 -
700 - enum py_ssl_error {
701 -diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
702 -index ce5bbd8530..ba4529ae06 100755
703 ---- a/Tools/ssl/multissltests.py
704 -+++ b/Tools/ssl/multissltests.py
705 -@@ -57,8 +57,9 @@ LIBRESSL_OLD_VERSIONS = [
706 - ]
707 -
708 - LIBRESSL_RECENT_VERSIONS = [
709 -- "2.5.3",
710 - "2.5.5",
711 -+ "2.6.4",
712 -+ "2.7.1",
713 - ]
714 -
715 - # store files in ../multissl
716 ---
717 -2.17.0
718 -
719
720 diff --git a/dev-lang/python/files/python-3.6.8-reducepath.patch b/dev-lang/python/files/python-3.6.8-reducepath.patch
721 deleted file mode 100644
722 index 5f39097..0000000
723 --- a/dev-lang/python/files/python-3.6.8-reducepath.patch
724 +++ /dev/null
725 @@ -1,22 +0,0 @@
726 -ONLY FOR MULTILIB RISCV!
727 -Handles the extra / in the libdir... -dilfridge
728 -
729 -diff -ruN Python-3.6.8.orig/Modules/getpath.c Python-3.6.8/Modules/getpath.c
730 ---- Python-3.6.8.orig/Modules/getpath.c 2018-12-23 22:37:14.000000000 +0100
731 -+++ Python-3.6.8/Modules/getpath.c 2019-04-21 01:05:35.127440301 +0200
732 -@@ -796,6 +796,7 @@
733 - if (pfound > 0) {
734 - reduce(prefix);
735 - reduce(prefix);
736 -+ reduce(prefix);
737 - /* The prefix is the root directory, but reduce() chopped
738 - * off the "/". */
739 - if (!prefix[0])
740 -@@ -808,6 +809,7 @@
741 - reduce(exec_prefix);
742 - reduce(exec_prefix);
743 - reduce(exec_prefix);
744 -+ reduce(exec_prefix);
745 - if (!exec_prefix[0])
746 - wcscpy(exec_prefix, separator);
747 - }
748
749 diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml
750 deleted file mode 100644
751 index 8662752..0000000
752 --- a/dev-lang/python/metadata.xml
753 +++ /dev/null
754 @@ -1,13 +0,0 @@
755 -<?xml version="1.0" encoding="UTF-8"?>
756 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
757 -<pkgmetadata>
758 -<maintainer type="project">
759 - <email>python@g.o</email>
760 - <name>Python</name>
761 -</maintainer>
762 -<use>
763 - <flag name="bluetooth">Build Bluetooth protocol support in socket module</flag>
764 - <flag name="threads">Enable threading support. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING)</flag>
765 - <flag name="wininst">Install Windows executables required to create an executable installer for MS Windows.</flag>
766 -</use>
767 -</pkgmetadata>
768
769 diff --git a/dev-lang/python/python-3.6.8-r1.ebuild b/dev-lang/python/python-3.6.8-r1.ebuild
770 deleted file mode 100644
771 index b362845..0000000
772 --- a/dev-lang/python/python-3.6.8-r1.ebuild
773 +++ /dev/null
774 @@ -1,351 +0,0 @@
775 -# Copyright 1999-2019 Gentoo Authors
776 -# Distributed under the terms of the GNU General Public License v2
777 -
778 -EAPI="6"
779 -WANT_LIBTOOL="none"
780 -
781 -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
782 -
783 -MY_P="Python-${PV}"
784 -PATCHSET_VERSION="3.6.8"
785 -
786 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
787 -HOMEPAGE="https://www.python.org/"
788 -SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
789 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
790 -
791 -LICENSE="PSF-2"
792 -SLOT="3.6/3.6m"
793 -KEYWORDS="~riscv"
794 -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
795 -RESTRICT="!test? ( test )"
796 -
797 -# Do not add a dependency on dev-lang/python to this ebuild.
798 -# If you need to apply a patch which requires python for bootstrapping, please
799 -# run the bootstrap code on your dev box and include the results in the
800 -# patchset. See bug 447752.
801 -
802 -RDEPEND="app-arch/bzip2:0=
803 - app-arch/xz-utils:0=
804 - >=sys-libs/zlib-1.1.3:0=
805 - virtual/libffi:=
806 - virtual/libintl
807 - gdbm? ( sys-libs/gdbm:0=[berkdb] )
808 - ncurses? ( >=sys-libs/ncurses-5.2:0= )
809 - readline? ( >=sys-libs/readline-4.1:0= )
810 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
811 - ssl? (
812 - !libressl? ( dev-libs/openssl:0= )
813 - libressl? ( dev-libs/libressl:0= )
814 - )
815 - tk? (
816 - >=dev-lang/tcl-8.0:0=
817 - >=dev-lang/tk-8.0:0=
818 - dev-tcltk/blt:0=
819 - dev-tcltk/tix
820 - )
821 - xml? ( >=dev-libs/expat-2.1:0= )
822 - !!<sys-apps/sandbox-2.6-r1"
823 -# bluetooth requires headers from bluez
824 -DEPEND="${RDEPEND}
825 - bluetooth? ( net-wireless/bluez )
826 - test? ( app-arch/xz-utils[extra-filters(+)] )
827 - virtual/pkgconfig
828 - !sys-devel/gcc[libffi(-)]"
829 -RDEPEND+=" !build? ( app-misc/mime-types )"
830 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
831 -
832 -S="${WORKDIR}/${MY_P}"
833 -PYVER=${SLOT%/*}
834 -
835 -src_prepare() {
836 - # Ensure that internal copies of expat, libffi and zlib are not used.
837 - rm -fr Modules/expat
838 - rm -fr Modules/_ctypes/libffi*
839 - rm -fr Modules/zlib
840 -
841 - local PATCHES=(
842 - "${WORKDIR}/patches"
843 - )
844 -
845 - default
846 -
847 - eapply "${FILESDIR}/${P}-reducepath.patch" # only for multilib riscv
848 -
849 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
850 - Lib/distutils/command/install.py \
851 - Lib/distutils/sysconfig.py \
852 - Lib/site.py \
853 - Lib/sysconfig.py \
854 - Lib/test/test_site.py \
855 - Makefile.pre.in \
856 - Modules/Setup.dist \
857 - Modules/getpath.c \
858 - configure.ac \
859 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
860 -
861 - eautoreconf
862 -}
863 -
864 -src_configure() {
865 - local disable
866 - # disable automagic bluetooth headers detection
867 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
868 - use gdbm || disable+=" gdbm"
869 - use ncurses || disable+=" _curses _curses_panel"
870 - use readline || disable+=" readline"
871 - use sqlite || disable+=" _sqlite3"
872 - use ssl || export PYTHON_DISABLE_SSL="1"
873 - use tk || disable+=" _tkinter"
874 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
875 - export PYTHON_DISABLE_MODULES="${disable}"
876 -
877 - if ! use xml; then
878 - ewarn "You have configured Python without XML support."
879 - ewarn "This is NOT a recommended configuration as you"
880 - ewarn "may face problems parsing any XML documents."
881 - fi
882 -
883 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
884 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
885 - fi
886 -
887 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
888 - append-flags -fwrapv
889 - fi
890 -
891 - filter-flags -malign-double
892 -
893 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
894 - if is-flagq -O3; then
895 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
896 - use hardened && replace-flags -O3 -O2
897 - fi
898 -
899 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
900 - tc-export CXX
901 -
902 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
903 - # Needed on FreeBSD unless Python 3.2 is already installed.
904 - # Please query BSD team before removing this!
905 - append-ldflags "-L."
906 -
907 - local dbmliborder
908 - if use gdbm; then
909 - dbmliborder+="${dbmliborder:+:}gdbm"
910 - fi
911 -
912 - local myeconfargs=(
913 - --with-fpectl
914 - --enable-shared
915 - $(use_enable ipv6)
916 - $(use_with threads)
917 - --infodir='${prefix}/share/info'
918 - --mandir='${prefix}/share/man'
919 - --with-computed-gotos
920 - --with-dbmliborder="${dbmliborder}"
921 - --with-libc=
922 - --enable-loadable-sqlite-extensions
923 - --without-ensurepip
924 - --with-system-expat
925 - --with-system-ffi
926 - )
927 -
928 - OPT="" econf "${myeconfargs[@]}"
929 -
930 - if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
931 - eerror "configure has detected that the sem_open function is broken."
932 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
933 - die "Broken sem_open function (bug 496328)"
934 - fi
935 -}
936 -
937 -src_compile() {
938 - # Ensure sed works as expected
939 - # https://bugs.gentoo.org/594768
940 - local -x LC_ALL=C
941 -
942 - emake CPPFLAGS= CFLAGS= LDFLAGS=
943 -
944 - # Work around bug 329499. See also bug 413751 and 457194.
945 - if has_version dev-libs/libffi[pax_kernel]; then
946 - pax-mark E python
947 - else
948 - pax-mark m python
949 - fi
950 -}
951 -
952 -src_test() {
953 - # Tests will not work when cross compiling.
954 - if tc-is-cross-compiler; then
955 - elog "Disabling tests due to crosscompiling."
956 - return
957 - fi
958 -
959 - # Skip failing tests.
960 - local skipped_tests="gdb"
961 -
962 - for test in ${skipped_tests}; do
963 - mv "${S}"/Lib/test/test_${test}.py "${T}"
964 - done
965 -
966 - # bug 660358
967 - local -x COLUMNS=80
968 -
969 - local -x PYTHONDONTWRITEBYTECODE=
970 -
971 - emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
972 - local result=$?
973 -
974 - for test in ${skipped_tests}; do
975 - mv "${T}/test_${test}.py" "${S}"/Lib/test
976 - done
977 -
978 - elog "The following tests have been skipped:"
979 - for test in ${skipped_tests}; do
980 - elog "test_${test}.py"
981 - done
982 -
983 - elog "If you would like to run them, you may:"
984 - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
985 - elog "and run the tests separately."
986 -
987 - if [[ ${result} -ne 0 ]]; then
988 - die "emake test failed"
989 - fi
990 -}
991 -
992 -src_install() {
993 - local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
994 -
995 - emake DESTDIR="${D}" altinstall
996 -
997 - sed \
998 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
999 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
1000 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
1001 -
1002 - # Fix collisions between different slots of Python.
1003 - rm -f "${ED}usr/$(get_libdir)/libpython3.so"
1004 -
1005 - # Cheap hack to get version with ABIFLAGS
1006 - local abiver=$(cd "${ED}usr/include"; echo python*)
1007 - if [[ ${abiver} != python${PYVER} ]]; then
1008 - # Replace python3.X with a symlink to python3.Xm
1009 - rm "${ED}usr/bin/python${PYVER}" || die
1010 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1011 - # Create python3.X-config symlink
1012 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1013 - # Create python-3.5m.pc symlink
1014 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1015 - fi
1016 -
1017 - # python seems to get rebuilt in src_install (bug 569908)
1018 - # Work around it for now.
1019 - if has_version dev-libs/libffi[pax_kernel]; then
1020 - pax-mark E "${ED}usr/bin/${abiver}"
1021 - else
1022 - pax-mark m "${ED}usr/bin/${abiver}"
1023 - fi
1024 -
1025 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
1026 - use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
1027 -
1028 - use threads || rm -r "${libdir}/multiprocessing" || die
1029 - use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
1030 -
1031 - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
1032 -
1033 - if use examples; then
1034 - insinto /usr/share/doc/${PF}/examples
1035 - find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
1036 - doins -r "${S}"/Tools
1037 - fi
1038 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1039 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1040 - emake --no-print-directory -s -f - 2>/dev/null)
1041 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1042 -
1043 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1044 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1045 - sed \
1046 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1047 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1048 - -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
1049 -
1050 - # for python-exec
1051 - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
1052 -
1053 - # if not using a cross-compiler, use the fresh binary
1054 - if ! tc-is-cross-compiler; then
1055 - local -x PYTHON=./python
1056 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
1057 - else
1058 - vars=( PYTHON "${vars[@]}" )
1059 - fi
1060 -
1061 - python_export "python${PYVER}" "${vars[@]}"
1062 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1063 - python_domodule epython.py
1064 -
1065 - # python-exec wrapping support
1066 - local pymajor=${PYVER%.*}
1067 - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
1068 - # python and pythonX
1069 - ln -s "../../../bin/${abiver}" \
1070 - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
1071 - ln -s "python${pymajor}" \
1072 - "${D}${PYTHON_SCRIPTDIR}/python" || die
1073 - # python-config and pythonX-config
1074 - # note: we need to create a wrapper rather than symlinking it due
1075 - # to some random dirname(argv[0]) magic performed by python-config
1076 - cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
1077 - #!/bin/sh
1078 - exec "${abiver}-config" "\${@}"
1079 - EOF
1080 - chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
1081 - ln -s "python${pymajor}-config" \
1082 - "${D}${PYTHON_SCRIPTDIR}/python-config" || die
1083 - # 2to3, pydoc, pyvenv
1084 - ln -s "../../../bin/2to3-${PYVER}" \
1085 - "${D}${PYTHON_SCRIPTDIR}/2to3" || die
1086 - ln -s "../../../bin/pydoc${PYVER}" \
1087 - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
1088 - ln -s "../../../bin/pyvenv-${PYVER}" \
1089 - "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
1090 - # idle
1091 - if use tk; then
1092 - ln -s "../../../bin/idle${PYVER}" \
1093 - "${D}${PYTHON_SCRIPTDIR}/idle" || die
1094 - fi
1095 -}
1096 -
1097 -pkg_preinst() {
1098 - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
1099 - python_updater_warning="1"
1100 - fi
1101 -}
1102 -
1103 -eselect_python_update() {
1104 - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
1105 - eselect python update
1106 - fi
1107 -
1108 - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
1109 - eselect python update --python${PV%%.*}
1110 - fi
1111 -}
1112 -
1113 -pkg_postinst() {
1114 - eselect_python_update
1115 -
1116 - if [[ "${python_updater_warning}" == "1" ]]; then
1117 - ewarn "You have just upgraded from an older version of Python."
1118 - ewarn
1119 - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
1120 - fi
1121 -}
1122 -
1123 -pkg_postrm() {
1124 - eselect_python_update
1125 -}