diff options
Diffstat (limited to 'dev-lang/python/files')
-rw-r--r-- | dev-lang/python/files/3.6-blake2.patch | 37 | ||||
-rw-r--r-- | dev-lang/python/files/3.6.1-test_socket-AEAD.patch | 75 | ||||
-rw-r--r-- | dev-lang/python/files/pydoc.conf | 6 | ||||
-rw-r--r-- | dev-lang/python/files/pydoc.init | 24 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch | 24 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.7.10-system-libffi.patch | 36 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch | 18 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch | 13 | ||||
-rw-r--r-- | dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch | 13 | ||||
-rw-r--r-- | dev-lang/python/files/python-3.4.5-cross.patch | 11 | ||||
-rw-r--r-- | dev-lang/python/files/python-3.5-distutils-OO-build.patch | 80 |
11 files changed, 337 insertions, 0 deletions
diff --git a/dev-lang/python/files/3.6-blake2.patch b/dev-lang/python/files/3.6-blake2.patch new file mode 100644 index 000000000000..48ee58559524 --- /dev/null +++ b/dev-lang/python/files/3.6-blake2.patch @@ -0,0 +1,37 @@ +From 2e7c906c085a01ea8175a19e1e143257abc8f566 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Sun, 30 Jul 2017 11:17:39 -0400 +Subject: [PATCH] blake2: remove commented code + +The nested comments cause a build failure. + +Bug: https://bugs.gentoo.org/608586 +--- + Modules/_blake2/impl/blake2s-load-xop.h | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/Modules/_blake2/impl/blake2s-load-xop.h b/Modules/_blake2/impl/blake2s-load-xop.h +index a3b5d65e2d..7e76c399c6 100644 +--- a/Modules/_blake2/impl/blake2s-load-xop.h ++++ b/Modules/_blake2/impl/blake2s-load-xop.h +@@ -18,17 +18,6 @@ + + #define TOB(x) ((x)*4*0x01010101 + 0x03020100) /* ..or not TOB */ + +-/* Basic VPPERM emulation, for testing purposes */ +-/*static __m128i _mm_perm_epi8(const __m128i src1, const __m128i src2, const __m128i sel) +-{ +- const __m128i sixteen = _mm_set1_epi8(16); +- const __m128i t0 = _mm_shuffle_epi8(src1, sel); +- const __m128i s1 = _mm_shuffle_epi8(src2, _mm_sub_epi8(sel, sixteen)); +- const __m128i mask = _mm_or_si128(_mm_cmpeq_epi8(sel, sixteen), +- _mm_cmpgt_epi8(sel, sixteen)); /* (>=16) = 0xff : 00 */ +- return _mm_blendv_epi8(t0, s1, mask); +-}*/ +- + #define LOAD_MSG_0_1(buf) \ + buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) ); + +-- +2.13.3 + diff --git a/dev-lang/python/files/3.6.1-test_socket-AEAD.patch b/dev-lang/python/files/3.6.1-test_socket-AEAD.patch new file mode 100644 index 000000000000..426e3371441c --- /dev/null +++ b/dev-lang/python/files/3.6.1-test_socket-AEAD.patch @@ -0,0 +1,75 @@ +From 4ac01f0ff3e3c9c02f5cc8c55f2fbe4639808f5e Mon Sep 17 00:00:00 2001 +From: Mariatta <Mariatta@users.noreply.github.com> +Date: Thu, 16 Mar 2017 20:58:42 -0700 +Subject: [PATCH] update test_socket AEAD test for kernel 4.9 and up (GH-133) + (GH-548) + +(cherry picked from commit 9764c151c51480a7ca6042b1ccd69be2620ff360) +--- + Lib/test/test_socket.py | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py +index 5315d475df..1508f20c9f 100644 +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -5479,7 +5479,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + self.assertEqual(len(dec), msglen * multiplier) + self.assertEqual(dec, msg * multiplier) + +- @support.requires_linux_version(4, 3) # see test_aes_cbc ++ @support.requires_linux_version(4, 9) # see issue29324 + def test_aead_aes_gcm(self): + key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c') + iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2') +@@ -5502,8 +5502,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + op.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, iv=iv, + assoclen=assoclen, flags=socket.MSG_MORE) + op.sendall(assoc, socket.MSG_MORE) +- op.sendall(plain, socket.MSG_MORE) +- op.sendall(b'\x00' * taglen) ++ op.sendall(plain) + res = op.recv(assoclen + len(plain) + taglen) + self.assertEqual(expected_ct, res[assoclen:-taglen]) + self.assertEqual(expected_tag, res[-taglen:]) +@@ -5511,7 +5510,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + # now with msg + op, _ = algo.accept() + with op: +- msg = assoc + plain + b'\x00' * taglen ++ msg = assoc + plain + op.sendmsg_afalg([msg], op=socket.ALG_OP_ENCRYPT, iv=iv, + assoclen=assoclen) + res = op.recv(assoclen + len(plain) + taglen) +@@ -5522,7 +5521,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + pack_uint32 = struct.Struct('I').pack + op, _ = algo.accept() + with op: +- msg = assoc + plain + b'\x00' * taglen ++ msg = assoc + plain + op.sendmsg( + [msg], + ([socket.SOL_ALG, socket.ALG_SET_OP, pack_uint32(socket.ALG_OP_ENCRYPT)], +@@ -5530,7 +5529,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + [socket.SOL_ALG, socket.ALG_SET_AEAD_ASSOCLEN, pack_uint32(assoclen)], + ) + ) +- res = op.recv(len(msg)) ++ res = op.recv(len(msg) + taglen) + self.assertEqual(expected_ct, res[assoclen:-taglen]) + self.assertEqual(expected_tag, res[-taglen:]) + +@@ -5540,8 +5539,8 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + msg = assoc + expected_ct + expected_tag + op.sendmsg_afalg([msg], op=socket.ALG_OP_DECRYPT, iv=iv, + assoclen=assoclen) +- res = op.recv(len(msg)) +- self.assertEqual(plain, res[assoclen:-taglen]) ++ res = op.recv(len(msg) - taglen) ++ self.assertEqual(plain, res[assoclen:]) + + @support.requires_linux_version(4, 3) # see test_aes_cbc + def test_drbg_pr_sha256(self): +-- +2.12.2 + diff --git a/dev-lang/python/files/pydoc.conf b/dev-lang/python/files/pydoc.conf new file mode 100644 index 000000000000..3c6920cc96c4 --- /dev/null +++ b/dev-lang/python/files/pydoc.conf @@ -0,0 +1,6 @@ +# /etc/init.d/pydoc.conf + +# This file contains the configuration for pydoc's internal webserver. + +# Default port for Python's pydoc server. +@PYDOC_PORT_VARIABLE@="7464" diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init new file mode 100644 index 000000000000..f8e05636da4e --- /dev/null +++ b/dev-lang/python/files/pydoc.init @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public Licence v2 + +start() { + local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}" + + if [ -z "${pydoc_port}" ]; then + eerror "Port not set" + return 1 + fi + + ebegin "Starting pydoc server on port ${pydoc_port}" + start-stop-daemon --start --background --make-pidfile \ + --pidfile /var/run/@PYDOC@.pid \ + --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}" + eend $? +} + +stop() { + ebegin "Stopping pydoc server" + start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid + eend $? +} 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 new file mode 100644 index 000000000000..38433de925ed --- /dev/null +++ b/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch @@ -0,0 +1,24 @@ +https://bugs.python.org/issue25397 + +improve the cross-compile tests to be more focused + +--- a/configure.ac ++++ b/configure.ac +@@ -1339,7 +1339,7 @@ if test "$GCC" = "yes" + then + AC_MSG_CHECKING(whether gcc supports ParseTuple __format__) + save_CFLAGS=$CFLAGS +- CFLAGS="$CFLAGS -Werror -Wformat" ++ CFLAGS="$CFLAGS -Werror=format" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]]) + ],[ +@@ -4458,7 +4458,7 @@ then + [ac_cv_have_long_long_format="cross -- assuming no" + if test x$GCC = xyes; then + save_CFLAGS=$CFLAGS +- CFLAGS="$CFLAGS -Werror -Wformat" ++ CFLAGS="$CFLAGS -Werror=format" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <stddef.h> 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 new file mode 100644 index 000000000000..0b49b794bd8d --- /dev/null +++ b/dev-lang/python/files/python-2.7.10-system-libffi.patch @@ -0,0 +1,36 @@ +make sure we respect the system libffi setting in our build config. +the compiler probing is fragile and can break in some situations. + +--- a/setup.py ++++ b/setup.py +@@ -2069,7 +2069,7 @@ class PyBuildExt(build_ext): + return True + + def detect_ctypes(self, inc_dirs, lib_dirs): +- self.use_system_libffi = False ++ self.use_system_libffi = ('--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")) + include_dirs = [] + extra_compile_args = [] + extra_link_args = [] +@@ -2113,7 +2113,7 @@ class PyBuildExt(build_ext): + sources=['_ctypes/_ctypes_test.c']) + self.extensions.extend([ext, ext_test]) + +- if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"): ++ if not self.use_system_libffi: + return + + if host_platform == 'darwin': +@@ -2141,10 +2141,10 @@ class PyBuildExt(build_ext): + ffi_lib = lib_name + break + +- if ffi_inc and ffi_lib: ++ if ffi_inc: + ext.include_dirs.extend(ffi_inc) ++ if ffi_lib: + ext.libraries.append(ffi_lib) +- self.use_system_libffi = True + + + class PyBuildInstall(install): 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 new file mode 100644 index 000000000000..a762dfb10882 --- /dev/null +++ b/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch @@ -0,0 +1,18 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1000,12 +1000,12 @@ + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ 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 new file mode 100644 index 000000000000..38ce6f78b91b --- /dev/null +++ b/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch @@ -0,0 +1,13 @@ +do not hardcode /usr/include paths + +--- a/configure.ac ++++ b/configure.ac +@@ -4316,7 +4316,7 @@ fi + + # first curses configure check + ac_save_cppflags="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags ncursesw`" + + AC_CHECK_HEADERS(curses.h ncurses.h) + 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 new file mode 100644 index 000000000000..8bfad1142789 --- /dev/null +++ b/dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch @@ -0,0 +1,13 @@ +do not hardcode /usr/include paths + +--- a/configure.ac ++++ b/configure.ac +@@ -4402,7 +4402,7 @@ fi + + # first curses header check + ac_save_cppflags="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags ncursesw`" + + AC_CHECK_HEADERS(curses.h ncurses.h) + diff --git a/dev-lang/python/files/python-3.4.5-cross.patch b/dev-lang/python/files/python-3.4.5-cross.patch new file mode 100644 index 000000000000..7a016ffbd488 --- /dev/null +++ b/dev-lang/python/files/python-3.4.5-cross.patch @@ -0,0 +1,11 @@ +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -729,7 +729,7 @@ + if sysconfig.get_config_var('Py_ENABLE_SHARED'): + pythonlib = 'python{}.{}{}'.format( + sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, +- sys.abiflags) ++ sysconfig.get_config_var('ABIFLAGS')) + return ext.libraries + [pythonlib] + else: + return ext.libraries 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 new file mode 100644 index 000000000000..8af8c30c76fe --- /dev/null +++ b/dev-lang/python/files/python-3.5-distutils-OO-build.patch @@ -0,0 +1,80 @@ +From 90507018442f9adabb586fd3d0a0206b9c2f2f50 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sun, 5 Jun 2016 08:18:01 +0200 +Subject: [PATCH] distutils: make -OO enable both opt-1 and opt-2 optimization + +Bug: http://bugs.python.org/issue27226 +Bug: https://bugs.gentoo.org/585060 +--- + Lib/distutils/command/build_py.py | 8 ++++---- + Lib/distutils/command/install_lib.py | 12 ++++++------ + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py +index cf0ca57..838d4e4 100644 +--- a/Lib/distutils/command/build_py.py ++++ b/Lib/distutils/command/build_py.py +@@ -315,9 +315,9 @@ class build_py (Command): + if self.compile: + outputs.append(importlib.util.cache_from_source( + filename, optimization='')) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + outputs.append(importlib.util.cache_from_source( +- filename, optimization=self.optimize)) ++ filename, optimization=opt)) + + outputs += [ + os.path.join(build_dir, filename) +@@ -387,8 +387,8 @@ class build_py (Command): + if self.compile: + byte_compile(files, optimize=0, + force=self.force, prefix=prefix, dry_run=self.dry_run) +- if self.optimize > 0: +- byte_compile(files, optimize=self.optimize, ++ for opt in range(1, self.optimize + 1): ++ byte_compile(files, optimize=opt, + force=self.force, prefix=prefix, dry_run=self.dry_run) + + class build_py_2to3(build_py, Mixin2to3): +diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py +index 6154cf0..049b662 100644 +--- a/Lib/distutils/command/install_lib.py ++++ b/Lib/distutils/command/install_lib.py +@@ -24,8 +24,8 @@ class install_lib(Command): + # 2) compile .pyc only (--compile --no-optimize; default) + # 3) compile .pyc and "opt-1" .pyc (--compile --optimize) + # 4) compile "opt-1" .pyc only (--no-compile --optimize) +- # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more) +- # 6) compile "opt-2" .pyc only (--no-compile --optimize-more) ++ # 5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more) ++ # 6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more) + # + # The UI for this is two options, 'compile' and 'optimize'. + # 'compile' is strictly boolean, and only decides whether to +@@ -132,8 +132,8 @@ class install_lib(Command): + byte_compile(files, optimize=0, + force=self.force, prefix=install_root, + dry_run=self.dry_run) +- if self.optimize > 0: +- byte_compile(files, optimize=self.optimize, ++ for opt in range(1, self.optimize + 1): ++ byte_compile(files, optimize=opt, + force=self.force, prefix=install_root, + verbose=self.verbose, dry_run=self.dry_run) + +@@ -167,9 +167,9 @@ class install_lib(Command): + if self.compile: + bytecode_files.append(importlib.util.cache_from_source( + py_file, optimization='')) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + bytecode_files.append(importlib.util.cache_from_source( +- py_file, optimization=self.optimize)) ++ py_file, optimization=opt)) + + return bytecode_files + +-- +2.8.3 + |