public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2020-12-10 20:46 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2020-12-10 20:46 UTC (permalink / raw
  To: gentoo-commits

tils-OO-build.patch dev-lang/python/files/python-3.5.4-libffi-pkgconfig.patch dev-lang/python/files/python-3.5.5-hash-unaligned.patch dev-lang/python/files/python-3.5.5-libressl-compatibility.patch dev-lang/python/files/python-3.6.5-hash-unaligned.patch dev-lang/python/files/python-3.6.5-libressl-compatibility.patch dev-lang/python/python-3.6.8.ebuild dev-lang/python/python-3.8.5.ebuild dev-lang/python/python-3.8.6.ebuild
X-VCS-Directories: dev-lang/python/files/ dev-lang/python/
X-VCS-Committer: grobian
X-VCS-Committer-Name: Fabian Groffen
X-VCS-Revision: bba0a3b1196af251652b4a679828aa59ceb171c9
X-VCS-Branch: master
Date: Thu, 10 Dec 2020 20:46:26 +0000 (UTC)

commit:     bba0a3b1196af251652b4a679828aa59ceb171c9
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 10 20:45:27 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec 10 20:46:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=bba0a3b1

dev-lang/python: sync with gx86, cleanup, fix for darwin9

Package-Manager: Portage-3.0.12-prefix, Repoman-3.0.2
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-lang/python/Manifest                           |   7 +-
 dev-lang/python/files/2.7-disable-nis.patch        |  21 --
 dev-lang/python/files/3.4-getentropy-linux.patch   |  40 ---
 dev-lang/python/files/3.5-secondary-targets.patch  |  19 --
 dev-lang/python/files/3.5.1-cross-compile.patch    |  75 ------
 dev-lang/python/files/3.6-blake2.patch             |  37 ---
 dev-lang/python/files/3.6-disable-nis.patch        |  21 --
 dev-lang/python/files/3.6.5-disable-nis.patch      |  11 -
 dev-lang/python/files/CVE-2013-4238_py27.patch     | 247 ------------------
 dev-lang/python/files/CVE-2013-4238_py33.patch     | 241 -----------------
 .../files/python-2.5.2-cygwin-find_library.patch   |  34 ---
 .../files/python-2.7-aix-dlopen-soname.patch       |  63 -----
 dev-lang/python/files/python-2.7-issue16248.patch  |  19 --
 dev-lang/python/files/python-2.7-issue17919.patch  |  54 ----
 dev-lang/python/files/python-2.7-issue18235.patch  |  45 ----
 dev-lang/python/files/python-2.7-issue18851.patch  | 287 ---------------------
 .../python/files/python-2.7-libffi-pkgconfig.patch |  44 ----
 .../files/python-2.7-libressl-compatibility.patch  |  92 -------
 .../python/files/python-2.7.10-semaphore-pid.patch |  51 ----
 .../files/python-2.7.10-semaphore-urandom.patch    |  38 ---
 .../python/files/python-2.7.5-library-path.patch   |  25 --
 .../files/python-2.7.5-re_unsigned_ptrdiff.patch   |  23 --
 ...ython-2.7.6-recvfrom_into_buffer_overflow.patch |  17 --
 .../python/files/python-3.2-CVE-2013-2099.patch    |  51 ----
 .../python/files/python-3.2-CVE-2014-1912.patch    |  51 ----
 .../python/files/python-3.2-CVE-2014-4616.patch    |  39 ---
 dev-lang/python/files/python-3.2-issue16248.patch  |  19 --
 dev-lang/python/files/python-3.2-issue17919.patch  |  74 ------
 dev-lang/python/files/python-3.2-issue18235.patch  |  45 ----
 dev-lang/python/files/python-3.2-issue19521.patch  |  87 -------
 dev-lang/python/files/python-3.2-issue19529.patch  |  14 -
 .../python/files/python-3.2-libffi-pkgconfig.patch |  44 ----
 .../python/files/python-3.3-CVE-2013-2099.patch    |  51 ----
 dev-lang/python/files/python-3.3-issue17919.patch  | 112 --------
 dev-lang/python/files/python-3.3-issue18235.patch  |  35 ---
 dev-lang/python/files/python-3.3-issue21811.patch  |  46 ----
 dev-lang/python/files/python-3.4-gcc-5.patch       |  37 ---
 .../files/python-3.4.3-ncurses-pkg-config.patch    |  13 -
 dev-lang/python/files/python-3.4.5-cross.patch     |  11 -
 .../files/python-3.5-distutils-OO-build.patch      |  80 ------
 .../files/python-3.5.4-libffi-pkgconfig.patch      |  44 ----
 .../python/files/python-3.5.5-hash-unaligned.patch |  43 ---
 .../python-3.5.5-libressl-compatibility.patch      |  69 -----
 .../python/files/python-3.6.5-hash-unaligned.patch |  42 ---
 .../python-3.6.5-libressl-compatibility.patch      | 114 --------
 dev-lang/python/python-3.8.5.ebuild                |   1 -
 .../{python-3.6.8.ebuild => python-3.8.6.ebuild}   | 227 ++++++++--------
 47 files changed, 106 insertions(+), 2754 deletions(-)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 0727452c09..790642a69d 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,15 +1,14 @@
 DIST Python-2.7.16.tar.xz 12752104 BLAKE2B 7d6b5b853f9974d44e04dd35ecdffaab87511e183b4b01dd4f8f4ee109c4b4ab208f045708f69717be9d3a706aa078b71438ed482c062c0b89c12730eae074ae SHA512 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
-DIST Python-3.6.8.tar.xz 17212420 BLAKE2B e104b49a35492b622080ab81a446c0cdd1223e8ddf95c4e1b262762a027664b59f3e4deeda4ba7177115d780e48b6764a053acef640a645327df428d2e4820cd SHA512 b17867e451ebe662f50df83ed112d3656c089e7d750651ea640052b01b713b58e66aac9e082f71fd16f5b5510bc9b797f5ccd30f5399581e9aa406197f02938a
 DIST Python-3.7.8.tar.xz 17399552 BLAKE2B 4bf6c47b1132b6d31a79232002c4d38e2cd123ac05d52b21d6bfba5a4e19ec9130b8df8698d5ce6627e4297c4cf756643f036e694e36364c235306c72ef34bf8 SHA512 d2ba299e3cf8ed0f8fed9317f42bcd8d9af7e0e6175939b4be1be289c1658418bed17899e2608d762ffb15575021956cf6bf2054d7863c04b3bd7642f5b8c7ea
 DIST Python-3.8.5.tar.xz 18019640 BLAKE2B bb3e0566afe28759e4ab129ad0986a0fc5103514f2e2b22ff4aa3973c3173ebdd24d4267fbaf903841814a611fd9ea122673e5a1918934366e5c0efaef9d7517 SHA512 460cee65d7df7150694590575502d7f22e548ebfc99c8f8b363eef8bf30ee72e58d8ffacb1d607824f877f880eb9fd6775a508388029583e1e1df3380f3f9587
+DIST Python-3.8.6.tar.xz 18233864 BLAKE2B c8a8ef6055e344dda30eb808804cfa62016b4f840257cffd5a495e5932f5696e50579d49b8181a487c9cd4a89bdb95656e80981039783a21d20f7980aa2c9883 SHA512 22faec84f6e172e1ac7c6bd6fd37e9b6ae4afc91cf5136aa8cac8ebbed8d18793f9196e8749b8ccc43447cb6c41cb450f65ea72dd363c06dfaeb14e0455f5560
 DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd
-DIST python-gentoo-patches-3.6.8.tar.xz 11224 BLAKE2B 5fe38282bcf28df18e0bd37756c880ae191ea738dc92f1cf83f682cfdc52525b9c44287dc99191a73d75c90672ab501b56adf49515b35ff1fdee88c8dc07b175 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df
 DIST python-gentoo-patches-3.7.8-r3.tar.xz 13232 BLAKE2B 9df47b1f61d08f62a80221bc48d73ec27cd74a9ade8219912c5b02eaea919b70d91b1154837cd03c0129a5839186e9c970167ca3398129c044c25c7853f1f920 SHA512 e1477d425cb6125ca2286d816f4aa4e9e3c789d6a4f4907bd7b78549598356cae5766f642e2cad9e7c3abe2e82c12cf3cb7db3513be68aa213cb64cc0abc678a
 DIST python-gentoo-patches-3.8.5.tar.xz 11280 BLAKE2B 163c577da75f4ec0ebe86b5a08bea96d5ae406020bd211439b1405c0f8a5dddc9422a9ea5b16eed195433cbec010d9def3126a578d3f9716325482216b9e4d62 SHA512 6b7f72b8deb87fb7a169e97391185823984b5e9c99ec5232504c670843fbe0ca76afe32fc3fbe1f850ec6c42e9325cf4697022f36f7b00a4028b324069dd4d5b
+DIST python-gentoo-patches-3.8.6.tar.xz 10956 BLAKE2B e3241d97f886d0a37f85735102db8f00902df59ee12e8501b6c7f549dd4b26a6289bf34ff8dba02b369ed7875fad3d18e177afe9e367db4cb06f2ee908482f9e SHA512 7afa8e54f7b7e6ab35edc16d4214384b8ad8a03068d1984656876d6477b278af931e8c797d03d1bed2f10f9d58ac387db1a43921e54fb17cf4b779f33820abc0
 DIST python-prefix-2.7.16-gentoo-patches-r0.tar.xz 14636 BLAKE2B 54320f5197bb7adeca1e7c97447253e6535a11f380b6d66bc2ce46fa671fe23697aced8fd5619633a00e3ea19ae9dbc3ffe2981173d83dcab6b447d514555c43 SHA512 5380d9b92eb81603ec4d60ff9c940a3a061c06bd6f593d5837e600da5d4417b529d20d98d758aa95cef18fac10bdb5c33f90fa943deb15fdaf048492cf286581
-DIST python-prefix-3.6.8-gentoo-patches-r0.tar.xz 12732 BLAKE2B 82c91f451aff1dcda6182dfc05f5566261d5ffa36bbf5527931a442e46563220884ca1fb192a7226411f5e0f7c59f347f6f1ed1ffa34aec0eb5208b22cc3f756 SHA512 e52587d5c9169b75f79e942cf5bbade9e499335f7e242ec262bc678e136f1d857803d4a8cb9630fdb8847ea1ab4c293aebf2d498e630984accea48ee0c3723f5
 DIST python-prefix-gentoo-3.7.8-patches-r0.tar.xz 13068 BLAKE2B 32e8baf8a0d5bdcb973ba880dbc35a3bd5c6cba88bf2f647e18fc4839fe8bae94658e403e050bcecc5dd5ddadf5beaf8a489829bc2835589d77b968628c29233 SHA512 1a7c17424edc43b36867d45ac019f48734444328bf17b5eddd07a2b63ef26e74147dea83e1286a9e45372acc85640a8d72fed33cbe551170acd785fe12b43d74
 DIST python-prefix-gentoo-3.8.5-patches-r0.tar.xz 8948 BLAKE2B e2da338a00a239355e9d4c79bd46c78b54671017120ff79497a9a95a8e3c3096870a8667667f633de6216e83b574c8e65a8e7bfafd51c84595dca6fe9ccb78ed SHA512 8ae712782a255da8bf451b063e86e92c34a32bccce8ac00d76c0a4b0087cee8ea085f80827b49ec61fea18dc4924d4780c6d2f577c8f5d982d6482dde6e02091
+DIST python-prefix-gentoo-3.8.6-patches-r0.tar.xz 7688 BLAKE2B ea18ea2b5fc35a06d1f98b81fc9709dad271c6e9eefbeebdfe5acc712cec309e256ae27ab8ae5fbbda35c580e101f2e2979b81b8a9eca5b9f40c22cbe3fcee05 SHA512 7dd4c59da47a53c9ee7a6af42a16761ad71a8b7f977f8bdf93db4af2bedc337de8bea597e9dad05a2a5f440963c2b56b4b77352a0bf7bb6f1136550e5c9c5df0
 DIST python2-cygwinports-7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd16650cb5fc4a2c54fdac0228326f25cfba4fcd098ac9d689312d3e0dde6fca57f720d5235361d6462461cf018325c23fda9139e0f1683055aff SHA512 cabc21d2d7379daf1f4bafe7ab00b70e5b4f707d3102496b96ff0dfdced26347097ad771c69e0b9488b7c54b1ef36f9bc019bee72f1ffcbb55dcd0e71095edfe
-DIST python36-cygwinports-f11d606e98b00f5b143cba92bfee8b7f5ba779b0.zip 15874 BLAKE2B 4d6759dfa7afef796abb25dac94a8dac955638960c0335b0be59d88438d9ac3c1fa3e6e51280ff0ac8f30a77f7129f4d784791f84de80bd5fb57fde3e11fa0e8 SHA512 5d0a286a9444019d70a831432794a3d44ea981f141c327118679c1f16e694525b7d469138b174f1afe02ce069fc8d8ec5be0c924faab04ec24e9f35ab453acc2
 DIST python37-cygwinports-6df749d21f131eeafa485d40eb1294b28d30ba6a.tar.gz 8102 BLAKE2B 7331142fc9c2fd71e5ec5ae45d6aaebe8e39430b5719d01a673966a5ba10b344bba924d6f7f05cc444cedbf28b11cef2db1c2613ebf45fcceb90354895b9b42c SHA512 da669c3a518af73c4caa7c9cc35af2fd971f98e7ba9b91ae0223b2f031e74acc70644fb2411ad5a8d4b39e2c449b5c256bea4877d957030cb81c0d08e84b38dd

diff --git a/dev-lang/python/files/2.7-disable-nis.patch b/dev-lang/python/files/2.7-disable-nis.patch
deleted file mode 100644
index 5a6cb3e403..0000000000
--- a/dev-lang/python/files/2.7-disable-nis.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/setup.py
-+++ b/setup.py
-@@ -1346,17 +1346,7 @@ class PyBuildExt(build_ext):
-             else:
-                 missing.append('resource')
- 
--            # Sun yellow pages. Some systems have the functions in libc.
--            if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and
--                find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
--                if (self.compiler.find_library_file(lib_dirs, 'nsl')):
--                    libs = ['nsl']
--                else:
--                    libs = []
--                exts.append( Extension('nis', ['nismodule.c'],
--                                       libraries = libs) )
--            else:
--                missing.append('nis')
-+            missing.append('nis')
-         else:
-             missing.extend(['nis', 'resource', 'termios'])
- 

diff --git a/dev-lang/python/files/3.4-getentropy-linux.patch b/dev-lang/python/files/3.4-getentropy-linux.patch
deleted file mode 100644
index 9f12389bb2..0000000000
--- a/dev-lang/python/files/3.4-getentropy-linux.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 5635d44079e1bbd9c495951ede8d078e7b8d67d5 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <victor.stinner@gmail.com>
-Date: Mon, 9 Jan 2017 11:10:41 +0100
-Subject: [PATCH] Don't use getentropy() on Linux
-
-Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but
-read from /dev/urandom to get random bytes, for example in os.urandom().  On
-Linux, getentropy() is implemented which getrandom() is blocking mode, whereas
-os.urandom() should not block.
----
- Python/random.c | 13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/Python/random.c b/Python/random.c
-index af3d0bd0d5..dc6400d3b8 100644
---- a/Python/random.c
-+++ b/Python/random.c
-@@ -67,9 +67,16 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
-     return 0;
- }
- 
--/* Issue #25003: Don' use getentropy() on Solaris (available since
-- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
--#elif defined(HAVE_GETENTROPY) && !defined(sun)
-+/* Issue #25003: Don't use getentropy() on Solaris (available since
-+   Solaris 11.3), it is blocking whereas os.urandom() should not block.
-+
-+   Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
-+   implements it with the getrandom() syscall which can fail with ENOSYS,
-+   and this error is not supported in py_getentropy() and getrandom() is called
-+   with flags=0 which blocks until system urandom is initialized, which is not
-+   the desired behaviour to seed the Python hash secret nor for os.urandom():
-+   see the PEP 524 which was only implemented in Python 3.6. */
-+#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
- #define PY_GETENTROPY 1
- 
- /* Fill buffer with size pseudo-random bytes generated by getentropy().
--- 
-2.15.0.rc2
-

diff --git a/dev-lang/python/files/3.5-secondary-targets.patch b/dev-lang/python/files/3.5-secondary-targets.patch
deleted file mode 100644
index eb3b0c71e7..0000000000
--- a/dev-lang/python/files/3.5-secondary-targets.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Mark all targets as "secondary"
-
-This allows make to avoid rebuilding unnecessary intermediate files, which
-is useful when cross-compiling.
-
-See Parser/pgen and Programs/_freeze_importlib in Makefile.pre.in.
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1672,6 +1672,8 @@
- .PHONY: smelly funny patchcheck touch altmaninstall commoninstall
- .PHONY: gdbhooks
- 
-+.SECONDARY:
-+
- # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
- # Local Variables:
- # mode: makefile

diff --git a/dev-lang/python/files/3.5.1-cross-compile.patch b/dev-lang/python/files/3.5.1-cross-compile.patch
deleted file mode 100644
index 25a518bd1e..0000000000
--- a/dev-lang/python/files/3.5.1-cross-compile.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-# HG changeset patch
-# User Martin Panter <vadmium+py@gmail.com>
-# Date 1461373124 0
-# Node ID 66e40df31faca467937c7b9d5d2e825471f97822
-# Parent  a246047734b3496a7dc4ebaf1f0232dadf22eab6
-Issue #22359: Disable running cross-compiled _freeze_importlib and pgen
-
-Patch by Xavier de Gaye.
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -221,6 +221,7 @@ LIBOBJS=	@LIBOBJS@
- PYTHON=		python$(EXE)
- BUILDPYTHON=	python$(BUILDEXE)
- 
-+cross_compiling=@cross_compiling@
- PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
- _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
- BUILD_GNU_TYPE=	@build@
-@@ -718,12 +719,16 @@ Programs/_freeze_importlib: Programs/_fr
- 	$(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
- 
- Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
--	./Programs/_freeze_importlib \
--		$(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
-+	if test "$(cross_compiling)" != "yes"; then \
-+	    ./Programs/_freeze_importlib \
-+	        $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h; \
-+	fi
- 
- Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
--	./Programs/_freeze_importlib \
--		$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
-+	if test "$(cross_compiling)" != "yes"; then \
-+	    ./Programs/_freeze_importlib \
-+	        $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h; \
-+	fi
- 
- 
- ############################################################################
-@@ -784,10 +789,18 @@ Python/sysmodule.o: $(srcdir)/Python/sys
- $(IO_OBJS): $(IO_H)
- 
- $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
--		@$(MKDIR_P) Include
--		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-+	@$(MKDIR_P) Include
-+	if test "$(cross_compiling)" != "yes"; then \
-+		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \
-+	else \
-+		cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \
-+	fi
- $(GRAMMAR_C): $(GRAMMAR_H)
--		touch $(GRAMMAR_C)
-+	if test "$(cross_compiling)" != "yes"; then \
-+		touch $(GRAMMAR_C); \
-+	else \
-+		cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \
-+	fi
- 
- $(PGEN): $(PGENOBJS)
- 		$(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -49,6 +49,7 @@ fi
- AC_CONFIG_SRCDIR([Include/object.h])
- AC_CONFIG_HEADER(pyconfig.h)
- 
-+AC_SUBST(cross_compiling)
- AC_CANONICAL_HOST
- AC_SUBST(build)
- AC_SUBST(host)
-

diff --git a/dev-lang/python/files/3.6-blake2.patch b/dev-lang/python/files/3.6-blake2.patch
deleted file mode 100644
index 48ee585595..0000000000
--- a/dev-lang/python/files/3.6-blake2.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-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-disable-nis.patch b/dev-lang/python/files/3.6-disable-nis.patch
deleted file mode 100644
index 4e81847b50..0000000000
--- a/dev-lang/python/files/3.6-disable-nis.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/setup.py
-+++ b/setup.py
-@@ -1332,17 +1332,7 @@ class PyBuildExt(build_ext):
-             # Jeremy Hylton's rlimit interface
-             exts.append( Extension('resource', ['resource.c']) )
- 
--            # Sun yellow pages. Some systems have the functions in libc.
--            if (host_platform not in ['cygwin', 'qnx6'] and
--                find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
--                if (self.compiler.find_library_file(lib_dirs, 'nsl')):
--                    libs = ['nsl']
--                else:
--                    libs = []
--                exts.append( Extension('nis', ['nismodule.c'],
--                                       libraries = libs) )
--            else:
--                missing.append('nis')
-+            missing.append('nis')
-         else:
-             missing.extend(['nis', 'resource', 'termios'])
- 

diff --git a/dev-lang/python/files/3.6.5-disable-nis.patch b/dev-lang/python/files/3.6.5-disable-nis.patch
deleted file mode 100644
index 3937c6fe79..0000000000
--- a/dev-lang/python/files/3.6.5-disable-nis.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/setup.py
-+++ b/setup.py
-@@ -1364,7 +1364,7 @@ class PyBuildExt(build_ext):
-         else:
-             missing.extend(['resource', 'termios'])
- 
--        nis = self._detect_nis(inc_dirs, lib_dirs)
-+        nis = None
-         if nis is not None:
-             exts.append(nis)
-         else:

diff --git a/dev-lang/python/files/CVE-2013-4238_py27.patch b/dev-lang/python/files/CVE-2013-4238_py27.patch
deleted file mode 100644
index e215589d46..0000000000
--- a/dev-lang/python/files/CVE-2013-4238_py27.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/Lib/test/nullbytecert.pem	Sun Aug 11 18:13:17 2013 +0200
-@@ -0,0 +1,90 @@
-+Certificate:
-+    Data:
-+        Version: 3 (0x2)
-+        Serial Number: 0 (0x0)
-+    Signature Algorithm: sha1WithRSAEncryption
-+        Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+        Validity
-+            Not Before: Aug  7 13:11:52 2013 GMT
-+            Not After : Aug  7 13:12:52 2013 GMT
-+        Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+        Subject Public Key Info:
-+            Public Key Algorithm: rsaEncryption
-+                Public-Key: (2048 bit)
-+                Modulus:
-+                    00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
-+                    03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
-+                    16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
-+                    88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
-+                    32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
-+                    56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
-+                    a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
-+                    45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
-+                    ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
-+                    90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
-+                    7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
-+                    68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
-+                    f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
-+                    f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
-+                    ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
-+                    d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
-+                    9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
-+                    2f:85
-+                Exponent: 65537 (0x10001)
-+        X509v3 extensions:
-+            X509v3 Basic Constraints: critical
-+                CA:FALSE
-+            X509v3 Subject Key Identifier:
-+                88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
-+            X509v3 Key Usage:
-+                Digital Signature, Non Repudiation, Key Encipherment
-+            X509v3 Subject Alternative Name:
-+                *************************************************************
-+                WARNING: The values for DNS, email and URI are WRONG. OpenSSL
-+                         doesn't print the text after a NULL byte.
-+                *************************************************************
-+                DNS:altnull.python.org, email:null@python.org, URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
-+    Signature Algorithm: sha1WithRSAEncryption
-+         ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
-+         a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
-+         3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
-+         86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
-+         56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
-+         de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
-+         3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
-+         60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
-+         d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
-+         25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
-+         1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
-+         4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
-+         0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
-+         5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
-+         c1:ca:a9:94
-+-----BEGIN CERTIFICATE-----
-+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
-+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
-+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
-+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
-+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
-+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
-+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
-+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
-+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
-+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
-+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
-+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
-+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
-+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
-+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
-+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
-+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
-+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
-+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
-+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
-+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
-+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
-+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
-+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
-+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
-+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-+-----END CERTIFICATE-----
-diff -r 9ddc63c039ba Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py	Sun Aug 11 13:04:50 2013 +0300
-+++ b/Lib/test/test_ssl.py	Sun Aug 11 18:13:17 2013 +0200
-@@ -25,6 +25,7 @@
- HOST = test_support.HOST
- CERTFILE = None
- SVN_PYTHON_ORG_ROOT_CERT = None
-+NULLBYTECERT = None
- 
- def handle_error(prefix):
-     exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-@@ -123,6 +124,27 @@
-                           ('DNS', 'projects.forum.nokia.com'))
-                         )
- 
-+    def test_parse_cert_CVE_2013_4073(self):
-+        p = ssl._ssl._test_decode_cert(NULLBYTECERT)
-+        if test_support.verbose:
-+            sys.stdout.write("\n" + pprint.pformat(p) + "\n")
-+        subject = ((('countryName', 'US'),),
-+                   (('stateOrProvinceName', 'Oregon'),),
-+                   (('localityName', 'Beaverton'),),
-+                   (('organizationName', 'Python Software Foundation'),),
-+                   (('organizationalUnitName', 'Python Core Development'),),
-+                   (('commonName', 'null.python.org\x00example.org'),),
-+                   (('emailAddress', 'python-dev@python.org'),))
-+        self.assertEqual(p['subject'], subject)
-+        self.assertEqual(p['issuer'], subject)
-+        self.assertEqual(p['subjectAltName'],
-+                         (('DNS', 'altnull.python.org\x00example.com'),
-+                         ('email', 'null@python.org\x00user@example.org'),
-+                         ('URI', 'http://null.python.org\x00http://example.org'),
-+                         ('IP Address', '192.0.2.1'),
-+                         ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
-+                        )
-+
-     def test_DER_to_PEM(self):
-         with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
-             pem = f.read()
-@@ -1360,7 +1382,7 @@
- 
- 
- def test_main(verbose=False):
--    global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
-+    global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
-     CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
-                             "keycert.pem")
-     SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
-@@ -1368,10 +1390,13 @@
-         "https_svn_python_org_root.pem")
-     NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-                              "nokia.pem")
-+    NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-+                                "nullbytecert.pem")
- 
-     if (not os.path.exists(CERTFILE) or
-         not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
--        not os.path.exists(NOKIACERT)):
-+        not os.path.exists(NOKIACERT) or
-+        not os.path.exists(NULLBYTECERT)):
-         raise test_support.TestFailed("Can't read certificate files!")
- 
-     tests = [BasicTests, BasicSocketTests]
-diff -r 9ddc63c039ba Modules/_ssl.c
---- a/Modules/_ssl.c	Sun Aug 11 13:04:50 2013 +0300
-+++ b/Modules/_ssl.c	Sun Aug 11 18:13:17 2013 +0200
-@@ -741,8 +741,13 @@
- 
-             /* get a rendering of each name in the set of names */
- 
-+            int gntype;
-+            ASN1_STRING *as = NULL;
-+
-             name = sk_GENERAL_NAME_value(names, j);
--            if (name->type == GEN_DIRNAME) {
-+            gntype = name-> type;
-+            switch (gntype) {
-+            case GEN_DIRNAME:
- 
-                 /* we special-case DirName as a tuple of tuples of attributes */
- 
-@@ -764,11 +769,61 @@
-                     goto fail;
-                 }
-                 PyTuple_SET_ITEM(t, 1, v);
-+                break;
- 
--            } else {
-+            case GEN_EMAIL:
-+            case GEN_DNS:
-+            case GEN_URI:
-+                /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
-+                   correctly. */
-+                t = PyTuple_New(2);
-+                if (t == NULL)
-+                    goto fail;
-+                switch (gntype) {
-+                case GEN_EMAIL:
-+                    v = PyUnicode_FromString("email");
-+                    as = name->d.rfc822Name;
-+                    break;
-+                case GEN_DNS:
-+                    v = PyUnicode_FromString("DNS");
-+                    as = name->d.dNSName;
-+                    break;
-+                case GEN_URI:
-+                    v = PyUnicode_FromString("URI");
-+                    as = name->d.uniformResourceIdentifier;
-+                    break;
-+                }
-+                if (v == NULL) {
-+                    Py_DECREF(t);
-+                    goto fail;
-+                }
-+                PyTuple_SET_ITEM(t, 0, v);
-+                v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
-+                                               ASN1_STRING_length(as));
-+                if (v == NULL) {
-+                    Py_DECREF(t);
-+                    goto fail;
-+                }
-+                PyTuple_SET_ITEM(t, 1, v);
-+                break;
- 
-+            default:
-                 /* for everything else, we use the OpenSSL print form */
--
-+                switch (gntype) {
-+                    /* check for new general name type */
-+                    case GEN_OTHERNAME:
-+                    case GEN_X400:
-+                    case GEN_EDIPARTY:
-+                    case GEN_IPADD:
-+                    case GEN_RID:
-+                        break;
-+                    default:
-+                        if (PyErr_Warn(PyExc_RuntimeWarning,
-+				       "Unknown general name type") == -1) {
-+                            goto fail;
-+                        }
-+                        break;
-+                }
-                 (void) BIO_reset(biobuf);
-                 GENERAL_NAME_print(biobuf, name);
-                 len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-@@ -794,6 +849,7 @@
-                     goto fail;
-                 }
-                 PyTuple_SET_ITEM(t, 1, v);
-+		break;
-             }
- 
-             /* and add that rendering to the list */

diff --git a/dev-lang/python/files/CVE-2013-4238_py33.patch b/dev-lang/python/files/CVE-2013-4238_py33.patch
deleted file mode 100644
index 41db4d241b..0000000000
--- a/dev-lang/python/files/CVE-2013-4238_py33.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-diff -r e0f86c3b3685 Lib/test/nullbytecert.pem
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/Lib/test/nullbytecert.pem	Sun Aug 11 18:17:23 2013 +0200
-@@ -0,0 +1,90 @@
-+Certificate:
-+    Data:
-+        Version: 3 (0x2)
-+        Serial Number: 0 (0x0)
-+    Signature Algorithm: sha1WithRSAEncryption
-+        Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+        Validity
-+            Not Before: Aug  7 13:11:52 2013 GMT
-+            Not After : Aug  7 13:12:52 2013 GMT
-+        Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+        Subject Public Key Info:
-+            Public Key Algorithm: rsaEncryption
-+                Public-Key: (2048 bit)
-+                Modulus:
-+                    00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
-+                    03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
-+                    16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
-+                    88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
-+                    32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
-+                    56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
-+                    a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
-+                    45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
-+                    ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
-+                    90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
-+                    7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
-+                    68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
-+                    f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
-+                    f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
-+                    ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
-+                    d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
-+                    9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
-+                    2f:85
-+                Exponent: 65537 (0x10001)
-+        X509v3 extensions:
-+            X509v3 Basic Constraints: critical
-+                CA:FALSE
-+            X509v3 Subject Key Identifier:
-+                88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
-+            X509v3 Key Usage:
-+                Digital Signature, Non Repudiation, Key Encipherment
-+            X509v3 Subject Alternative Name:
-+                *************************************************************
-+                WARNING: The values for DNS, email and URI are WRONG. OpenSSL
-+                         doesn't print the text after a NULL byte.
-+                *************************************************************
-+                DNS:altnull.python.org, email:null@python.org, URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
-+    Signature Algorithm: sha1WithRSAEncryption
-+         ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
-+         a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
-+         3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
-+         86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
-+         56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
-+         de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
-+         3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
-+         60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
-+         d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
-+         25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
-+         1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
-+         4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
-+         0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
-+         5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
-+         c1:ca:a9:94
-+-----BEGIN CERTIFICATE-----
-+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
-+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
-+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
-+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
-+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
-+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
-+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
-+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
-+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
-+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
-+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
-+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
-+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
-+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
-+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
-+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
-+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
-+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
-+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
-+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
-+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
-+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
-+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
-+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
-+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
-+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-+-----END CERTIFICATE-----
-diff -r e0f86c3b3685 Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py	Sun Aug 11 13:04:50 2013 +0300
-+++ b/Lib/test/test_ssl.py	Sun Aug 11 18:17:23 2013 +0200
-@@ -55,6 +55,7 @@
- WRONGCERT = data_file("XXXnonexisting.pem")
- BADKEY = data_file("badkey.pem")
- NOKIACERT = data_file("nokia.pem")
-+NULLBYTECERT = data_file("nullbytecert.pem")
- 
- DHFILE = data_file("dh512.pem")
- BYTES_DHFILE = os.fsencode(DHFILE)
-@@ -162,6 +163,27 @@
-                           ('DNS', 'projects.forum.nokia.com'))
-                         )
- 
-+    def test_parse_cert_CVE_2013_4073(self):
-+        p = ssl._ssl._test_decode_cert(NULLBYTECERT)
-+        if support.verbose:
-+            sys.stdout.write("\n" + pprint.pformat(p) + "\n")
-+        subject = ((('countryName', 'US'),),
-+                   (('stateOrProvinceName', 'Oregon'),),
-+                   (('localityName', 'Beaverton'),),
-+                   (('organizationName', 'Python Software Foundation'),),
-+                   (('organizationalUnitName', 'Python Core Development'),),
-+                   (('commonName', 'null.python.org\x00example.org'),),
-+                   (('emailAddress', 'python-dev@python.org'),))
-+        self.assertEqual(p['subject'], subject)
-+        self.assertEqual(p['issuer'], subject)
-+        self.assertEqual(p['subjectAltName'],
-+                         (('DNS', 'altnull.python.org\x00example.com'),
-+                         ('email', 'null@python.org\x00user@example.org'),
-+                         ('URI', 'http://null.python.org\x00http://example.org'),
-+                         ('IP Address', '192.0.2.1'),
-+                         ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
-+                        )
-+
-     def test_DER_to_PEM(self):
-         with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
-             pem = f.read()
-@@ -294,6 +316,13 @@
-         fail(cert, 'foo.a.com')
-         fail(cert, 'bar.foo.com')
- 
-+        # NULL bytes are bad, CVE-2013-4073
-+        cert = {'subject': ((('commonName',
-+                              'null.python.org\x00example.org'),),)}
-+        ok(cert, 'null.python.org\x00example.org') # or raise an error?
-+        fail(cert, 'example.org')
-+        fail(cert, 'null.python.org')
-+
-         # Slightly fake real-world example
-         cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT',
-                 'subject': ((('commonName', 'linuxfrz.org'),),),
-diff -r e0f86c3b3685 Modules/_ssl.c
---- a/Modules/_ssl.c	Sun Aug 11 13:04:50 2013 +0300
-+++ b/Modules/_ssl.c	Sun Aug 11 18:17:23 2013 +0200
-@@ -771,12 +771,14 @@
-                            ext->value->length));
- 
-         for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
--
-             /* get a rendering of each name in the set of names */
-+            int gntype;
-+            ASN1_STRING *as = NULL;
- 
-             name = sk_GENERAL_NAME_value(names, j);
--            if (name->type == GEN_DIRNAME) {
--
-+            gntype = name-> type;
-+            switch (gntype) {
-+            case GEN_DIRNAME:
-                 /* we special-case DirName as a tuple of
-                    tuples of attributes */
- 
-@@ -798,11 +800,62 @@
-                     goto fail;
-                 }
-                 PyTuple_SET_ITEM(t, 1, v);
-+                break;
- 
--            } else {
-+            case GEN_EMAIL:
-+            case GEN_DNS:
-+            case GEN_URI:
-+                /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
-+                   correctly. */
-+                t = PyTuple_New(2);
-+                if (t == NULL)
-+                    goto fail;
-+                switch (gntype) {
-+                case GEN_EMAIL:
-+                    v = PyUnicode_FromString("email");
-+                    as = name->d.rfc822Name;
-+                    break;
-+                case GEN_DNS:
-+                    v = PyUnicode_FromString("DNS");
-+                    as = name->d.dNSName;
-+                    break;
-+                case GEN_URI:
-+                    v = PyUnicode_FromString("URI");
-+                    as = name->d.uniformResourceIdentifier;
-+                    break;
-+                }
-+                if (v == NULL) {
-+                    Py_DECREF(t);
-+                    goto fail;
-+                }
-+                PyTuple_SET_ITEM(t, 0, v);
-+                v = PyUnicode_FromStringAndSize((char *)ASN1_STRING_data(as),
-+                                                ASN1_STRING_length(as));
-+                if (v == NULL) {
-+                    Py_DECREF(t);
-+                    goto fail;
-+                }
-+                PyTuple_SET_ITEM(t, 1, v);
-+                break;
- 
-+            default:
-                 /* for everything else, we use the OpenSSL print form */
--
-+                switch (gntype) {
-+                    /* check for new general name type */
-+                    case GEN_OTHERNAME:
-+                    case GEN_X400:
-+                    case GEN_EDIPARTY:
-+                    case GEN_IPADD:
-+                    case GEN_RID:
-+                        break;
-+                    default:
-+                        if (PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
-+                                             "Unknown general name type %d",
-+                                             gntype) == -1) {
-+                            goto fail;
-+                        }
-+                        break;
-+                }
-                 (void) BIO_reset(biobuf);
-                 GENERAL_NAME_print(biobuf, name);
-                 len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-@@ -829,6 +882,7 @@
-                     goto fail;
-                 }
-                 PyTuple_SET_ITEM(t, 1, v);
-+                break;
-             }
- 
-             /* and add that rendering to the list */

diff --git a/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch b/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch
deleted file mode 100644
index 381d073b40..0000000000
--- a/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- origsrc/Python-2.5.2/Lib/ctypes/util.py	2007-09-14 15:05:26.000000000 -0500
-+++ src/Python-2.5.2/Lib/ctypes/util.py	2008-11-25 17:54:47.319296200 -0600
-@@ -41,6 +41,20 @@
-                 continue
-         return None
- 
-+elif sys.platform == "cygwin":
-+    def find_library(name):
-+        for libdir in ['/usr/lib', '/usr/local/lib']:
-+            for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]:
-+                implib = os.path.join(libdir, libext)
-+                if not os.path.exists(implib):
-+                    continue
-+                cmd = "dlltool -I " + implib + " 2>/dev/null"
-+                res = os.popen(cmd).read().replace("\n","")
-+                if not res:
-+                    continue
-+                return res
-+        return None
-+
- elif os.name == "posix":
-     # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
-     import re, tempfile, errno
-@@ -157,6 +173,10 @@
-             print cdll.LoadLibrary("libcrypto.dylib")
-             print cdll.LoadLibrary("libSystem.dylib")
-             print cdll.LoadLibrary("System.framework/System")
-+        elif sys.platform == "cygwin":
-+            print cdll.LoadLibrary("cygbz2-1.dll") 
-+            print find_library("crypt")
-+            print cdll.LoadLibrary("cygcrypt-0.dll") 
-         else:
-             print cdll.LoadLibrary("libm.so")
-             print cdll.LoadLibrary("libcrypt.so")

diff --git a/dev-lang/python/files/python-2.7-aix-dlopen-soname.patch b/dev-lang/python/files/python-2.7-aix-dlopen-soname.patch
deleted file mode 100644
index ccd0faca20..0000000000
--- a/dev-lang/python/files/python-2.7-aix-dlopen-soname.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-With libtool, we have shared object file "shr.o" as archive member on AIX,
-see bug#213277 for more details.
-
---- Python/dynload_shlib.c.orig	2014-04-11 15:44:19 +0200
-+++ Python/dynload_shlib.c	2014-04-11 16:25:18 +0200
-@@ -161,6 +161,29 @@
- 
-     handle = dlopen(pathname, dlopenflags);
- 
-+#ifdef RTLD_MEMBER
-+    if (handle == NULL && errno == ENOEXEC) {
-+        /* Exec format error: File exists, try libtool's "aix-soname" variant. */
-+#       ifdef __64BIT__
-+#           define shr_o "(shr_64.o)"
-+#       else
-+#           define shr_o "(shr.o)"
-+#       endif
-+        char *buf = malloc(strlen(pathname) + strlen(shr_o) + 1);
-+        if (buf != NULL) {
-+            sprintf(buf, "%s%s", pathname, shr_o);
-+            dlopenflags |= RTLD_MEMBER;
-+
-+            if (Py_VerboseFlag)
-+                PySys_WriteStderr("dlopen(\"%s\", %x);\n", buf,
-+                          dlopenflags);
-+
-+            handle = dlopen(buf, dlopenflags);
-+            free(buf);
-+        }
-+    }
-+#endif
-+
-     if (handle == NULL) {
-         const char *error = dlerror();
-         if (error == NULL)
---- Modules/dlmodule.c.orig	2014-04-11 16:32:39 +0200
-+++ Modules/dlmodule.c	2014-04-11 16:34:59 +0200
-@@ -185,6 +185,25 @@
- #endif
-     }
-     handle = dlopen(name, mode);
-+
-+#ifdef RTLD_MEMBER
-+    if (handle == NULL && errno == ENOEXEC) {
-+        /* Exec format error: File exists, try libtool's "aix-soname" variant. */
-+#       ifdef __64BIT__
-+#           define shr_o "(shr_64.o)"
-+#       else
-+#           define shr_o "(shr.o)"
-+#       endif
-+        char *buf = malloc(strlen(name) + strlen(shr_o) + 1);
-+        if (buf != NULL) {
-+            sprintf(buf, "%s%s", name, shr_o);
-+            mode |= RTLD_MEMBER;
-+            handle = dlopen(buf, mode);
-+            free(buf);
-+        }
-+    }
-+#endif
-+
-     if (handle == NULL) {
-         char *errmsg = dlerror();
-         if (!errmsg)

diff --git a/dev-lang/python/files/python-2.7-issue16248.patch b/dev-lang/python/files/python-2.7-issue16248.patch
deleted file mode 100644
index ce9c654c56..0000000000
--- a/dev-lang/python/files/python-2.7-issue16248.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-# HG changeset patch
-# User Antoine Pitrou <solipsis@pitrou.net>
-# Date 1375388712 -7200
-# Node ID 0f17aed78168e63ec058c219d03cea7240f83dd6
-# Parent  bb546f6d8ab4f513804d7a420657963881e5b447
-Fix tkinter regression introduced by the security fix in #16248.
-
-diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
---- a/Lib/lib-tk/Tkinter.py
-+++ b/Lib/lib-tk/Tkinter.py
-@@ -1736,7 +1736,7 @@ class Tk(Misc, Wm):
-         # ensure that self.tk is always _something_.
-         self.tk = None
-         if baseName is None:
--            import sys, os
-+            import os
-             baseName = os.path.basename(sys.argv[0])
-             baseName, ext = os.path.splitext(baseName)
-             if ext not in ('.py', '.pyc', '.pyo'):

diff --git a/dev-lang/python/files/python-2.7-issue17919.patch b/dev-lang/python/files/python-2.7-issue17919.patch
deleted file mode 100644
index e75689224a..0000000000
--- a/dev-lang/python/files/python-2.7-issue17919.patch
+++ /dev/null
@@ -1,54 +0,0 @@
---- Modules/selectmodule.c.orig	2013-11-11 17:14:37.966910450 +0100
-+++ Modules/selectmodule.c	2013-11-11 17:17:12.532891570 +0100
-@@ -346,6 +346,7 @@
-         assert(i < self->ufd_len);
-         /* Never overflow */
-         self->ufds[i].fd = (int)PyInt_AsLong(key);
-+        /* Why does a bitfield need to be signed at all? */
-         self->ufds[i].events = (short)PyInt_AsLong(value);
-         i++;
-     }
-@@ -366,10 +367,10 @@
- {
-     PyObject *o, *key, *value;
-     int fd;
--    short events = POLLIN | POLLPRI | POLLOUT;
-+    unsigned short events = POLLIN | POLLPRI | POLLOUT;
-     int err;
- 
--    if (!PyArg_ParseTuple(args, "O|h:register", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "O|H:register", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -409,10 +410,11 @@
- poll_modify(pollObject *self, PyObject *args)
- {
-     PyObject *o, *key, *value;
--    int fd, events;
-+    int fd;
-+    unsigned short events;
-     int err;
- 
--    if (!PyArg_ParseTuple(args, "Oi:modify", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "OH:modify", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -552,11 +554,12 @@
-             }
-             PyTuple_SET_ITEM(value, 0, num);
- 
--            /* The &0xffff is a workaround for AIX.  'revents'
--               is a 16-bit short, and IBM assigned POLLNVAL
-+            /* The 'unsigned' cast is necessary for AIX. 'revents'
-+               is a 16-bit signed short, but IBM assigned POLLNVAL
-                to be 0x8000, so the conversion to int results
--               in a negative number. See SF bug #923315. */
--            num = PyInt_FromLong(self->ufds[i].revents & 0xffff);
-+               in a negative number. See issue17919 and issue923315.
-+               Why does a bitfield need to be signed at all? */
-+            num = PyInt_FromLong((unsigned short)self->ufds[i].revents);
-             if (num == NULL) {
-                 Py_DECREF(value);
-                 goto error;

diff --git a/dev-lang/python/files/python-2.7-issue18235.patch b/dev-lang/python/files/python-2.7-issue18235.patch
deleted file mode 100644
index d4d0fb0673..0000000000
--- a/dev-lang/python/files/python-2.7-issue18235.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Issue #18235: _sysconfigdata.py wrong on AIX installations
-
---- Lib/sysconfig.py
-+++ Lib/sysconfig.py
-@@ -307,7 +307,7 @@
-     # -- these paths are relative to the Python source, but when installed
-     # the scripts are in another directory.
-     if _PYTHON_BUILD:
--        vars['LDSHARED'] = vars['BLDSHARED']
-+        vars['BLDSHARED'] = vars['LDSHARED']
- 
-     # There's a chicken-and-egg situation on OS X with regards to the
-     # _sysconfigdata module after the changes introduced by #15298:
---- Makefile.pre.in
-+++ Makefile.pre.in
-@@ -1123,7 +1123,7 @@
- 		$(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix	\
- 				$(DESTDIR)$(LIBPL)/makexp_aix;		\
- 		echo "$(LIBPL)/makexp_aix";			\
--		$(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix	\
-+		$(INSTALL_SCRIPT) $(abs_builddir)/Modules/ld_so_aix	\
- 				$(DESTDIR)$(LIBPL)/ld_so_aix;		\
- 		echo "$(LIBPL)/ld_so_aix";			\
- 		echo; echo "See Misc/AIX-NOTES for details.";	\
---- Modules/ld_so_aix.in
-+++ Modules/ld_so_aix.in
-@@ -70,6 +70,7 @@
- fi
- 
- makexp=`dirname $0`/makexp_aix
-+test -x "${makexp}" || makexp="@abs_srcdir@/makexp_aix"
- 
- # Check for existence of compiler.
- CC=$1; shift
---- configure.ac
-+++ configure.ac
-@@ -1958,7 +1958,7 @@
- then
- 	case $ac_sys_system/$ac_sys_release in
- 	AIX*)
--		BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
-+		BLDSHARED="\$(abs_builddir)/Modules/ld_so_aix \$(CC) -bI:\$(abs_builddir)/Modules/python.exp"
- 		LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
- 		;;
- 	BeOS*)

diff --git a/dev-lang/python/files/python-2.7-issue18851.patch b/dev-lang/python/files/python-2.7-issue18851.patch
deleted file mode 100644
index 35c69ae22e..0000000000
--- a/dev-lang/python/files/python-2.7-issue18851.patch
+++ /dev/null
@@ -1,287 +0,0 @@
-# HG changeset patch
-# User Antoine Pitrou <solipsis@pitrou.net>
-# Date 1377898693 -7200
-# Node ID 43749cb6bdbd0fdab70f76cd171c3c02a3f600dd
-# Parent  ba54011aa295004ad87438211fe3bb1568dd69ab
-Issue #18851: Avoid a double close of subprocess pipes when the child process fails starting.
-
-diff --git a/Lib/subprocess.py b/Lib/subprocess.py
---- a/Lib/subprocess.py
-+++ b/Lib/subprocess.py
-@@ -698,12 +698,12 @@ class Popen(object):
- 
-         (p2cread, p2cwrite,
-          c2pread, c2pwrite,
--         errread, errwrite) = self._get_handles(stdin, stdout, stderr)
-+         errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
- 
-         try:
-             self._execute_child(args, executable, preexec_fn, close_fds,
-                                 cwd, env, universal_newlines,
--                                startupinfo, creationflags, shell,
-+                                startupinfo, creationflags, shell, to_close,
-                                 p2cread, p2cwrite,
-                                 c2pread, c2pwrite,
-                                 errread, errwrite)
-@@ -711,18 +711,12 @@ class Popen(object):
-             # Preserve original exception in case os.close raises.
-             exc_type, exc_value, exc_trace = sys.exc_info()
- 
--            to_close = []
--            # Only close the pipes we created.
--            if stdin == PIPE:
--                to_close.extend((p2cread, p2cwrite))
--            if stdout == PIPE:
--                to_close.extend((c2pread, c2pwrite))
--            if stderr == PIPE:
--                to_close.extend((errread, errwrite))
--
-             for fd in to_close:
-                 try:
--                    os.close(fd)
-+                    if mswindows:
-+                        fd.Close()
-+                    else:
-+                        os.close(fd)
-                 except EnvironmentError:
-                     pass
- 
-@@ -816,8 +810,9 @@ class Popen(object):
-             """Construct and return tuple with IO objects:
-             p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
-             """
-+            to_close = set()
-             if stdin is None and stdout is None and stderr is None:
--                return (None, None, None, None, None, None)
-+                return (None, None, None, None, None, None), to_close
- 
-             p2cread, p2cwrite = None, None
-             c2pread, c2pwrite = None, None
-@@ -835,6 +830,10 @@ class Popen(object):
-                 # Assuming file-like object
-                 p2cread = msvcrt.get_osfhandle(stdin.fileno())
-             p2cread = self._make_inheritable(p2cread)
-+            # We just duplicated the handle, it has to be closed at the end
-+            to_close.add(p2cread)
-+            if stdin == PIPE:
-+                to_close.add(p2cwrite)
- 
-             if stdout is None:
-                 c2pwrite = _subprocess.GetStdHandle(_subprocess.STD_OUTPUT_HANDLE)
-@@ -848,6 +847,10 @@ class Popen(object):
-                 # Assuming file-like object
-                 c2pwrite = msvcrt.get_osfhandle(stdout.fileno())
-             c2pwrite = self._make_inheritable(c2pwrite)
-+            # We just duplicated the handle, it has to be closed at the end
-+            to_close.add(c2pwrite)
-+            if stdout == PIPE:
-+                to_close.add(c2pread)
- 
-             if stderr is None:
-                 errwrite = _subprocess.GetStdHandle(_subprocess.STD_ERROR_HANDLE)
-@@ -863,10 +866,14 @@ class Popen(object):
-                 # Assuming file-like object
-                 errwrite = msvcrt.get_osfhandle(stderr.fileno())
-             errwrite = self._make_inheritable(errwrite)
-+            # We just duplicated the handle, it has to be closed at the end
-+            to_close.add(errwrite)
-+            if stderr == PIPE:
-+                to_close.add(errread)
- 
-             return (p2cread, p2cwrite,
-                     c2pread, c2pwrite,
--                    errread, errwrite)
-+                    errread, errwrite), to_close
- 
- 
-         def _make_inheritable(self, handle):
-@@ -895,7 +902,7 @@ class Popen(object):
- 
-         def _execute_child(self, args, executable, preexec_fn, close_fds,
-                            cwd, env, universal_newlines,
--                           startupinfo, creationflags, shell,
-+                           startupinfo, creationflags, shell, to_close,
-                            p2cread, p2cwrite,
-                            c2pread, c2pwrite,
-                            errread, errwrite):
-@@ -934,6 +941,10 @@ class Popen(object):
-                     # kill children.
-                     creationflags |= _subprocess.CREATE_NEW_CONSOLE
- 
-+            def _close_in_parent(fd):
-+                fd.Close()
-+                to_close.remove(fd)
-+
-             # Start the process
-             try:
-                 hp, ht, pid, tid = _subprocess.CreateProcess(executable, args,
-@@ -958,11 +969,11 @@ class Popen(object):
-                 # pipe will not close when the child process exits and the
-                 # ReadFile will hang.
-                 if p2cread is not None:
--                    p2cread.Close()
-+                    _close_in_parent(p2cread)
-                 if c2pwrite is not None:
--                    c2pwrite.Close()
-+                    _close_in_parent(c2pwrite)
-                 if errwrite is not None:
--                    errwrite.Close()
-+                    _close_in_parent(errwrite)
- 
-             # Retain the process handle, but close the thread handle
-             self._child_created = True
-@@ -1088,6 +1099,7 @@ class Popen(object):
-             """Construct and return tuple with IO objects:
-             p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
-             """
-+            to_close = set()
-             p2cread, p2cwrite = None, None
-             c2pread, c2pwrite = None, None
-             errread, errwrite = None, None
-@@ -1096,6 +1108,7 @@ class Popen(object):
-                 pass
-             elif stdin == PIPE:
-                 p2cread, p2cwrite = self.pipe_cloexec()
-+                to_close.update((p2cread, p2cwrite))
-             elif isinstance(stdin, int):
-                 p2cread = stdin
-             else:
-@@ -1106,6 +1119,7 @@ class Popen(object):
-                 pass
-             elif stdout == PIPE:
-                 c2pread, c2pwrite = self.pipe_cloexec()
-+                to_close.update((c2pread, c2pwrite))
-             elif isinstance(stdout, int):
-                 c2pwrite = stdout
-             else:
-@@ -1116,6 +1130,7 @@ class Popen(object):
-                 pass
-             elif stderr == PIPE:
-                 errread, errwrite = self.pipe_cloexec()
-+                to_close.update((errread, errwrite))
-             elif stderr == STDOUT:
-                 errwrite = c2pwrite
-             elif isinstance(stderr, int):
-@@ -1126,7 +1141,7 @@ class Popen(object):
- 
-             return (p2cread, p2cwrite,
-                     c2pread, c2pwrite,
--                    errread, errwrite)
-+                    errread, errwrite), to_close
- 
- 
-         def _set_cloexec_flag(self, fd, cloexec=True):
-@@ -1170,7 +1185,7 @@ class Popen(object):
- 
-         def _execute_child(self, args, executable, preexec_fn, close_fds,
-                            cwd, env, universal_newlines,
--                           startupinfo, creationflags, shell,
-+                           startupinfo, creationflags, shell, to_close,
-                            p2cread, p2cwrite,
-                            c2pread, c2pwrite,
-                            errread, errwrite):
-@@ -1189,6 +1204,10 @@ class Popen(object):
-             if executable is None:
-                 executable = args[0]
- 
-+            def _close_in_parent(fd):
-+                os.close(fd)
-+                to_close.remove(fd)
-+
-             # For transferring possible exec failure from child to parent
-             # The first char specifies the exception type: 0 means
-             # OSError, 1 means some other error.
-@@ -1283,17 +1302,17 @@ class Popen(object):
-                     # be sure the FD is closed no matter what
-                     os.close(errpipe_write)
- 
--                if p2cread is not None and p2cwrite is not None:
--                    os.close(p2cread)
--                if c2pwrite is not None and c2pread is not None:
--                    os.close(c2pwrite)
--                if errwrite is not None and errread is not None:
--                    os.close(errwrite)
--
-                 # Wait for exec to fail or succeed; possibly raising exception
-                 # Exception limited to 1M
-                 data = _eintr_retry_call(os.read, errpipe_read, 1048576)
-             finally:
-+                if p2cread is not None and p2cwrite is not None:
-+                    _close_in_parent(p2cread)
-+                if c2pwrite is not None and c2pread is not None:
-+                    _close_in_parent(c2pwrite)
-+                if errwrite is not None and errread is not None:
-+                    _close_in_parent(errwrite)
-+
-                 # be sure the FD is closed no matter what
-                 os.close(errpipe_read)
- 
-diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
---- a/Lib/test/test_subprocess.py
-+++ b/Lib/test/test_subprocess.py
-@@ -14,6 +14,10 @@ try:
-     import resource
- except ImportError:
-     resource = None
-+try:
-+    import threading
-+except ImportError:
-+    threading = None
- 
- mswindows = (sys.platform == "win32")
- 
-@@ -629,6 +633,36 @@ class ProcessTestCase(BaseTestCase):
-             if c.exception.errno not in (errno.ENOENT, errno.EACCES):
-                 raise c.exception
- 
-+    @unittest.skipIf(threading is None, "threading required")
-+    def test_double_close_on_error(self):
-+        # Issue #18851
-+        fds = []
-+        def open_fds():
-+            for i in range(20):
-+                fds.extend(os.pipe())
-+                time.sleep(0.001)
-+        t = threading.Thread(target=open_fds)
-+        t.start()
-+        try:
-+            with self.assertRaises(EnvironmentError):
-+                subprocess.Popen(['nonexisting_i_hope'],
-+                                 stdin=subprocess.PIPE,
-+                                 stdout=subprocess.PIPE,
-+                                 stderr=subprocess.PIPE)
-+        finally:
-+            t.join()
-+            exc = None
-+            for fd in fds:
-+                # If a double close occurred, some of those fds will
-+                # already have been closed by mistake, and os.close()
-+                # here will raise.
-+                try:
-+                    os.close(fd)
-+                except OSError as e:
-+                    exc = e
-+            if exc is not None:
-+                raise exc
-+
-     def test_handles_closed_on_exception(self):
-         # If CreateProcess exits with an error, ensure the
-         # duplicate output handles are released
-@@ -783,7 +817,7 @@ class POSIXProcessTestCase(BaseTestCase)
- 
-         def _execute_child(
-                 self, args, executable, preexec_fn, close_fds, cwd, env,
--                universal_newlines, startupinfo, creationflags, shell,
-+                universal_newlines, startupinfo, creationflags, shell, to_close,
-                 p2cread, p2cwrite,
-                 c2pread, c2pwrite,
-                 errread, errwrite):
-@@ -791,7 +825,7 @@ class POSIXProcessTestCase(BaseTestCase)
-                 subprocess.Popen._execute_child(
-                         self, args, executable, preexec_fn, close_fds,
-                         cwd, env, universal_newlines,
--                        startupinfo, creationflags, shell,
-+                        startupinfo, creationflags, shell, to_close,
-                         p2cread, p2cwrite,
-                         c2pread, c2pwrite,
-                         errread, errwrite)

diff --git a/dev-lang/python/files/python-2.7-libffi-pkgconfig.patch b/dev-lang/python/files/python-2.7-libffi-pkgconfig.patch
deleted file mode 100644
index eef3613257..0000000000
--- a/dev-lang/python/files/python-2.7-libffi-pkgconfig.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -u -r Python-2.7.5-orig//configure.ac Python-2.7.5/configure.ac
---- Python-2.7.5-orig//configure.ac	2014-03-06 04:35:31.000000000 +0100
-+++ Python-2.7.5/configure.ac	2014-03-06 04:58:10.000000000 +0100
-@@ -2300,10 +2300,13 @@
- 
- if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
-     LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
-+    LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
- else
-     LIBFFI_INCLUDEDIR=""
-+    LIBFFI_LIB=""
- fi
- AC_SUBST(LIBFFI_INCLUDEDIR)
-+AC_SUBST(LIBFFI_LIB)
- 
- AC_MSG_RESULT($with_system_ffi)
- 
-diff -u -r Python-2.7.5-orig//Makefile.pre.in Python-2.7.5/Makefile.pre.in
---- Python-2.7.5-orig//Makefile.pre.in	2014-03-06 04:35:31.000000000 +0100
-+++ Python-2.7.5/Makefile.pre.in	2014-03-06 05:03:59.000000000 +0100
-@@ -224,6 +224,7 @@
- 
- 
- LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
-+LIBFFI_LIB=	@LIBFFI_LIB@
- 
- ##########################################################################
- # Parser
-diff -u -r Python-2.7.5-orig//setup.py Python-2.7.5/setup.py
---- Python-2.7.5-orig//setup.py	2014-03-06 04:35:31.000000000 +0100
-+++ Python-2.7.5/setup.py	2014-03-06 04:56:15.000000000 +0100
-@@ -1893,8 +1893,10 @@
-                     break
-                 if line.startswith('#define LIBFFI_H'):
-                     break
--        ffi_lib = None
--        if ffi_inc is not None:
-+        ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
-+        if not ffi_lib or ffi_lib == '':
-+            ffi_lib = None
-+        if ffi_inc is not None and ffi_lib is None:
-             for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
-                 if (self.compiler.find_library_file(lib_dirs, lib_name)):
-                     ffi_lib = lib_name

diff --git a/dev-lang/python/files/python-2.7-libressl-compatibility.patch b/dev-lang/python/files/python-2.7-libressl-compatibility.patch
deleted file mode 100644
index c9e7a8458e..0000000000
--- a/dev-lang/python/files/python-2.7-libressl-compatibility.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-# From https://github.com/python/cpython/pull/6215
-
-# LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
-# LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
-# LibreSSL < 2.7.
-
-# Documentation updates and fixes for failing tests will be provided in
-# another patch set.
-
-# Signed-off-by: Christian Heimes christian@python.org.
-# (cherry picked from commit 4ca0739)
-
-#Co-authored-by: Christian Heimes christian@python.org
-
---- a/Modules/_ssl.c	2017-09-16 17:38:35.000000000 +0000
-+++ b/Modules/_ssl.c	2018-04-13 15:55:10.919424126 +0000
-@@ -97,6 +102,12 @@
- 
- #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #  define OPENSSL_VERSION_1_1 1
-+#  define PY_OPENSSL_1_1_API 1
-+#endif
-+
-+/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
-+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
-+#  define PY_OPENSSL_1_1_API 1
- #endif
- 
- /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
-@@ -118,24 +129,44 @@
- #endif
- 
- /* ALPN added in OpenSSL 1.0.2 */
--#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined(OPENSSL_NO_TLSEXT)
--# define HAVE_ALPN
-+#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
-+# define HAVE_ALPN 1
-+#else
-+# define HAVE_ALPN 0
-+#endif
-+
-+/* We cannot rely on OPENSSL_NO_NEXTPROTONEG because LibreSSL 2.6.1 dropped
-+ * NPN support but did not set OPENSSL_NO_NEXTPROTONEG for compatibility
-+ * reasons. The check for TLSEXT_TYPE_next_proto_neg works with
-+ * OpenSSL 1.0.1+ and LibreSSL.
-+ * OpenSSL 1.1.1-pre1 dropped NPN but still has TLSEXT_TYPE_next_proto_neg.
-+ */
-+#ifdef OPENSSL_NO_NEXTPROTONEG
-+# define HAVE_NPN 0
-+#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
-+# define HAVE_NPN 0
-+#elif defined(TLSEXT_TYPE_next_proto_neg)
-+# define HAVE_NPN 1
-+#else
-+# define HAVE_NPN 0
- #endif
- 
- #ifndef INVALID_SOCKET /* MS defines this */
- #define INVALID_SOCKET (-1)
- #endif
- 
--#ifdef OPENSSL_VERSION_1_1
--/* OpenSSL 1.1.0+ */
--#ifndef OPENSSL_NO_SSL2
--#define OPENSSL_NO_SSL2
--#endif
--#else /* OpenSSL < 1.1.0 */
--#if defined(WITH_THREAD)
-+/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
-+#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
- #define HAVE_OPENSSL_CRYPTO_LOCK
- #endif
- 
-+#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
-+#define OPENSSL_NO_SSL2
-+#endif
-+
-+#ifndef PY_OPENSSL_1_1_API
-+/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
-+
- #define TLS_method SSLv23_method
- 
- static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
-@@ -178,7 +209,7 @@
- {
-     return store->param;
- }
--#endif /* OpenSSL < 1.1.0 or LibreSSL */
-+#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
- 
- 
- enum py_ssl_error {

diff --git a/dev-lang/python/files/python-2.7.10-semaphore-pid.patch b/dev-lang/python/files/python-2.7.10-semaphore-pid.patch
deleted file mode 100644
index 97fcbd0c49..0000000000
--- a/dev-lang/python/files/python-2.7.10-semaphore-pid.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Fix for semaphores in pid namespaces
-
-http://bugs.python.org/issue24303
-
---- a/Modules/_multiprocessing/semaphore.c
-+++ b/Modules/_multiprocessing/semaphore.c
-@@ -7,6 +7,7 @@
-  */
- 
- #include "multiprocessing.h"
-+#include <time.h>
- 
- enum { RECURSIVE_MUTEX, SEMAPHORE };
- 
-@@ -419,7 +420,7 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
- {
-     char buffer[256];
-     SEM_HANDLE handle = SEM_FAILED;
--    int kind, maxvalue, value;
-+    int kind, maxvalue, value, try;
-     PyObject *result;
-     static char *kwlist[] = {"kind", "value", "maxvalue", NULL};
-     static int counter = 0;
-@@ -433,10 +434,24 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-         return NULL;
-     }
- 
--    PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d", (long)getpid(), counter++);
-+    /* With pid namespaces, we may have multiple processes with the same pid.
-+     * Instead of relying on the pid to be unique, we use the microseconds time
-+     * to attempt to a unique filename. */
-+    for (try = 0; try < 100; ++try) {
-+        struct timespec tv;
-+        long arbitrary = clock_gettime(CLOCK_REALTIME, &tv) ? 0 : tv.tv_nsec;
-+        PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d-%ld",
-+                      (long)getpid(),
-+                      counter++,
-+                      arbitrary);
-+        SEM_CLEAR_ERROR();
-+        handle = SEM_CREATE(buffer, value, maxvalue);
-+        if (handle != SEM_FAILED)
-+            break;
-+        else if (errno != EEXIST)
-+            goto failure;
-+    }
- 
--    SEM_CLEAR_ERROR();
--    handle = SEM_CREATE(buffer, value, maxvalue);
-     /* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */
-     if (handle == SEM_FAILED || SEM_GET_LAST_ERROR() != 0)
-         goto failure;

diff --git a/dev-lang/python/files/python-2.7.10-semaphore-urandom.patch b/dev-lang/python/files/python-2.7.10-semaphore-urandom.patch
deleted file mode 100644
index fa3b83046b..0000000000
--- a/dev-lang/python/files/python-2.7.10-semaphore-urandom.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Fix for semaphores in pid namespaces
-
-http://bugs.python.org/issue24303
-
-diff -r 5576c8240963 Modules/_multiprocessing/semaphore.c
---- a/Modules/_multiprocessing/semaphore.c	Wed Apr 15 19:30:38 2015 +0100
-+++ b/Modules/_multiprocessing/semaphore.c	Thu Jun 11 07:08:36 2015 +0100
-@@ -429,7 +429,7 @@
-     int kind, maxvalue, value;
-     PyObject *result;
-     static char *kwlist[] = {"kind", "value", "maxvalue", NULL};
--    static int counter = 0;
-+    int try = 0;
- 
-     if (!PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwlist,
-                                      &kind, &value, &maxvalue))
-@@ -440,10 +440,18 @@
-         return NULL;
-     }
- 
--    PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d", (long)getpid(), counter++);
-+    /* Create a semaphore with a unique name. The bytes returned by
-+     * _PyOS_URandom() are treated as unsigned long to ensure that the filename
-+     * is valid (no special characters). */
-+    do {
-+        unsigned long suffix;
-+        _PyOS_URandom((char *)&suffix, sizeof(suffix));
-+        PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%lu", (long)getpid(),
-+                      suffix);
-+        SEM_CLEAR_ERROR();
-+        handle = SEM_CREATE(buffer, value, maxvalue);
-+    } while ((handle == SEM_FAILED) && (errno == EEXIST) && (++try < 100));
- 
--    SEM_CLEAR_ERROR();
--    handle = SEM_CREATE(buffer, value, maxvalue);
-     /* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */
-     if (handle == SEM_FAILED || SEM_GET_LAST_ERROR() != 0)
-         goto failure;

diff --git a/dev-lang/python/files/python-2.7.5-library-path.patch b/dev-lang/python/files/python-2.7.5-library-path.patch
deleted file mode 100644
index 6f435750a2..0000000000
--- a/dev-lang/python/files/python-2.7.5-library-path.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-# HG changeset patch
-# User Ned Deily <nad@acm.org>
-# Date 1368666045 25200
-# Node ID cd577c3288860b0deb459443ca5c489dc0f99ef6
-# Parent  149340b3004acfcb68e5ed36b1e96b7463c756c7
-Issue #17990: Only modify include and library search paths when cross-compiling.
-
-diff --git a/setup.py b/setup.py
---- a/setup.py
-+++ b/setup.py
-@@ -437,9 +437,11 @@ class PyBuildExt(build_ext):
- 
-     def detect_modules(self):
-         # Ensure that /usr/local is always used
--        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
--        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
--        self.add_gcc_paths()
-+        if not cross_compiling:
-+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-+        if cross_compiling:
-+            self.add_gcc_paths()
-         self.add_multiarch_paths()
- 
-         # Add paths specified in the environment variables LDFLAGS and

diff --git a/dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch b/dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch
deleted file mode 100644
index a905839a25..0000000000
--- a/dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=476426
-http://bugs.python.org/issue17998
-diff -r d91da96a55bf Modules/_sre.c
---- a/Modules/_sre.c	Thu May 16 22:47:47 2013 +0100
-+++ b/Modules/_sre.c	Fri May 17 21:02:48 2013 +0300
-@@ -1028,7 +1028,7 @@
-             TRACE(("|%p|%p|REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr,
-                    ctx->pattern[1], ctx->pattern[2]));
- 
--            if (ctx->pattern[1] > end - ctx->ptr)
-+            if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr)
-                 RETURN_FAILURE; /* cannot match */
- 
-             state->ptr = ctx->ptr;
-@@ -1111,7 +1111,7 @@
-             TRACE(("|%p|%p|MIN_REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr,
-                    ctx->pattern[1], ctx->pattern[2]));
- 
--            if (ctx->pattern[1] > end - ctx->ptr)
-+            if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr)
-                 RETURN_FAILURE; /* cannot match */
- 
-             state->ptr = ctx->ptr;

diff --git a/dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch b/dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch
deleted file mode 100644
index 37e786bd3a..0000000000
--- a/dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -r 40fb60df4755 Modules/socketmodule.c
---- a/Modules/socketmodule.c	Sun Jan 12 12:11:47 2014 +0200
-+++ b/Modules/socketmodule.c	Mon Jan 13 16:36:35 2014 -0800
-@@ -2744,6 +2744,13 @@
-         recvlen = buflen;
-     }
- 
-+    /* Check if the buffer is large enough */
-+    if (buflen < recvlen) {
-+        PyErr_SetString(PyExc_ValueError,
-+                        "buffer too small for requested bytes");
-+        goto error;
-+    }
-+
-     readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);
-     if (readlen < 0) {
-         /* Return an error */

diff --git a/dev-lang/python/files/python-3.2-CVE-2013-2099.patch b/dev-lang/python/files/python-3.2-CVE-2013-2099.patch
deleted file mode 100644
index 9055a03dfc..0000000000
--- a/dev-lang/python/files/python-3.2-CVE-2013-2099.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-# HG changeset patch
-# User Antoine Pitrou <solipsis@pitrou.net>
-# Date 1368892602 -7200
-#      Sat May 18 17:56:42 2013 +0200
-# Branch 3.2
-# Node ID b9b521efeba385af0142988899a55de1c1c805c7
-# Parent  6255b40c6a6127933d8ea7a2b9de200f5a0e6154
-Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of service using certificates with many wildcards (CVE-2013-2099).
-
-diff --git a/Lib/ssl.py b/Lib/ssl.py
---- a/Lib/ssl.py
-+++ b/Lib/ssl.py
-@@ -108,9 +108,16 @@
-     pass
- 
- 
--def _dnsname_to_pat(dn):
-+def _dnsname_to_pat(dn, max_wildcards=1):
-     pats = []
-     for frag in dn.split(r'.'):
-+        if frag.count('*') > max_wildcards:
-+            # Issue #17980: avoid denials of service by refusing more
-+            # than one wildcard per fragment.  A survery of established
-+            # policy among SSL implementations showed it to be a
-+            # reasonable choice.
-+            raise CertificateError(
-+                "too many wildcards in certificate DNS name: " + repr(dn))
-         if frag == '*':
-             # When '*' is a fragment by itself, it matches a non-empty dotless
-             # fragment.
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -326,6 +326,17 @@
-         self.assertRaises(ValueError, ssl.match_hostname, None, 'example.com')
-         self.assertRaises(ValueError, ssl.match_hostname, {}, 'example.com')
- 
-+        # Issue #17980: avoid denials of service by refusing more than one
-+        # wildcard per fragment.
-+        cert = {'subject': ((('commonName', 'a*b.com'),),)}
-+        ok(cert, 'axxb.com')
-+        cert = {'subject': ((('commonName', 'a*b.co*'),),)}
-+        ok(cert, 'axxb.com')
-+        cert = {'subject': ((('commonName', 'a*b*.com'),),)}
-+        with self.assertRaises(ssl.CertificateError) as cm:
-+            ssl.match_hostname(cert, 'axxbxxc.com')
-+        self.assertIn("too many wildcards", str(cm.exception))
-+
-     def test_server_side(self):
-         # server_hostname doesn't work for server sockets
-         ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)

diff --git a/dev-lang/python/files/python-3.2-CVE-2014-1912.patch b/dev-lang/python/files/python-3.2-CVE-2014-1912.patch
deleted file mode 100644
index 0e095074a2..0000000000
--- a/dev-lang/python/files/python-3.2-CVE-2014-1912.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-# HG changeset patch
-# User Benjamin Peterson <benjamin@python.org>
-# Date 1389671978 18000
-# Node ID 9c56217e5c793685eeaf0ee224848c402bdf1e4c
-# Parent  2b5cd6d4d149dea6c6941b7e07ada248b29fc9f6
-complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
-
-diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
---- a/Lib/test/test_socket.py
-+++ b/Lib/test/test_socket.py
-@@ -1968,6 +1968,14 @@ class BufferIOTest(SocketConnectedTest):
- 
-     _testRecvFromIntoMemoryview = _testRecvFromIntoArray
- 
-+    def testRecvFromIntoSmallBuffer(self):
-+        # See issue #20246.
-+        buf = bytearray(8)
-+        self.assertRaises(ValueError, self.cli_conn.recvfrom_into, buf, 1024)
-+
-+    def _testRecvFromIntoSmallBuffer(self):
-+        self.serv_conn.send(MSG*2048)
-+
- 
- TIPC_STYPE = 2000
- TIPC_LOWER = 200
-diff --git a/Misc/ACKS b/Misc/ACKS
---- a/Misc/ACKS
-+++ b/Misc/ACKS
-@@ -1020,6 +1020,7 @@ Eric V. Smith
- Christopher Smith
- Gregory P. Smith
- Roy Smith
-+Ryan Smith-Roberts
- Rafal Smotrzyk
- Dirk Soede
- Paul Sokolovsky
-diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
---- a/Modules/socketmodule.c
-+++ b/Modules/socketmodule.c
-@@ -2598,6 +2598,11 @@ sock_recvfrom_into(PySocketSockObject *s
-     if (recvlen == 0) {
-         /* If nbytes was not specified, use the buffer's length */
-         recvlen = buflen;
-+    } else if (recvlen > buflen) {
-+        PyBuffer_Release(&pbuf);
-+        PyErr_SetString(PyExc_ValueError,
-+                        "nbytes is greater than the length of the buffer");
-+        return NULL;
-     }
- 
-     readlen = sock_recvfrom_guts(s, buf, recvlen, flags, &addr);

diff --git a/dev-lang/python/files/python-3.2-CVE-2014-4616.patch b/dev-lang/python/files/python-3.2-CVE-2014-4616.patch
deleted file mode 100644
index 5b0a397487..0000000000
--- a/dev-lang/python/files/python-3.2-CVE-2014-4616.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-# HG changeset patch
-# User Benjamin Peterson <benjamin@python.org>
-# Date 1397441438 14400
-# Node ID 50c07ed1743da9cd4540d83de0c30bd17aeb41b0
-# Parent  218e28a935ab4494d05215c243e2129625a71893
-in scan_once, prevent the reading of arbitrary memory when passed a negative index
-
-Bug reported by Guido Vranken.
-
-Index: Python-3.2.5/Lib/json/tests/test_decode.py
-===================================================================
---- Python-3.2.5.orig/Lib/test/json_tests/test_decode.py	2014-06-26 18:40:10.825269130 +0200
-+++ Python-3.2.5/Lib/test/json_tests/test_decode.py	2014-06-26 18:40:21.962323035 +0200
-@@ -60,5 +60,9 @@
-         msg = 'escape'
-         self.assertRaisesRegexp(ValueError, msg, self.loads, s)
- 
-+    def test_negative_index(self):
-+        d = self.json.JSONDecoder()
-+        self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
-+
- class TestPyDecode(TestDecode, PyTest): pass
- class TestCDecode(TestDecode, CTest): pass
-Index: Python-3.2.5/Modules/_json.c
-===================================================================
---- a/Modules/_json.c
-+++ b/Modules/_json.c
-@@ -930,7 +930,10 @@ scan_once_unicode(PyScannerObject *s, Py
-     PyObject *res;
-     Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr);
-     Py_ssize_t length = PyUnicode_GET_SIZE(pystr);
--    if (idx >= length) {
-+    if (idx < 0)
-+        /* Compatibility with Python version. */
-+        idx += length;
-+    if (idx < 0 || idx >= length) {
-         PyErr_SetNone(PyExc_StopIteration);
-         return NULL;
-     }

diff --git a/dev-lang/python/files/python-3.2-issue16248.patch b/dev-lang/python/files/python-3.2-issue16248.patch
deleted file mode 100644
index d0e80cae72..0000000000
--- a/dev-lang/python/files/python-3.2-issue16248.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-# HG changeset patch
-# User Georg Brandl <georg@python.org>
-# Date 1379142489 -7200
-# Node ID c18c18774e240377d47638fb23e8276c1ac2e606
-# Parent  b9b521efeba385af0142988899a55de1c1c805c7
-Fix tkinter regression introduced by the security fix in #16248.
-
-diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
---- a/Lib/tkinter/__init__.py
-+++ b/Lib/tkinter/__init__.py
-@@ -1722,7 +1722,7 @@ class Tk(Misc, Wm):
-         # ensure that self.tk is always _something_.
-         self.tk = None
-         if baseName is None:
--            import sys, os
-+            import os
-             baseName = os.path.basename(sys.argv[0])
-             baseName, ext = os.path.splitext(baseName)
-             if ext not in ('.py', '.pyc', '.pyo'):

diff --git a/dev-lang/python/files/python-3.2-issue17919.patch b/dev-lang/python/files/python-3.2-issue17919.patch
deleted file mode 100644
index a0a2cedde0..0000000000
--- a/dev-lang/python/files/python-3.2-issue17919.patch
+++ /dev/null
@@ -1,74 +0,0 @@
---- Modules/selectmodule.c.orig	2013-11-11 17:19:26.900910431 +0100
-+++ Modules/selectmodule.c	2013-11-11 17:22:56.819926607 +0100
-@@ -343,7 +343,8 @@
-         assert(i < self->ufd_len);
-         /* Never overflow */
-         self->ufds[i].fd = (int)PyLong_AsLong(key);
--        self->ufds[i].events = (short)PyLong_AsLong(value);
-+        /* Why does a bitfield need to be signed at all? */
-+        self->ufds[i].events = (short)PyLong_AsUnsignedLong(value);
-         i++;
-     }
-     assert(i == self->ufd_len);
-@@ -363,10 +364,10 @@
- {
-     PyObject *o, *key, *value;
-     int fd;
--    short events = POLLIN | POLLPRI | POLLOUT;
-+    unsigned short events = POLLIN | POLLPRI | POLLOUT;
-     int err;
- 
--    if (!PyArg_ParseTuple(args, "O|h:register", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "O|H:register", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -378,7 +379,7 @@
-     key = PyLong_FromLong(fd);
-     if (key == NULL)
-         return NULL;
--    value = PyLong_FromLong(events);
-+    value = PyLong_FromUnsignedLong(events);
-     if (value == NULL) {
-         Py_DECREF(key);
-         return NULL;
-@@ -406,10 +407,11 @@
- poll_modify(pollObject *self, PyObject *args)
- {
-     PyObject *o, *key, *value;
--    int fd, events;
-+    int fd;
-+    unsigned short events;
-     int err;
- 
--    if (!PyArg_ParseTuple(args, "Oi:modify", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "OH:modify", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -426,7 +428,7 @@
-         Py_DECREF(key);
-         return NULL;
-     }
--    value = PyLong_FromLong(events);
-+    value = PyLong_FromUnsignedLong(events);
-     if (value == NULL) {
-         Py_DECREF(key);
-         return NULL;
-@@ -550,11 +552,12 @@
-             }
-             PyTuple_SET_ITEM(value, 0, num);
- 
--            /* The &0xffff is a workaround for AIX.  'revents'
--               is a 16-bit short, and IBM assigned POLLNVAL
-+            /* The 'unsigned' cast is necessary for AIX. 'revents'
-+               is a 16-bit signed short, but IBM assigned POLLNVAL
-                to be 0x8000, so the conversion to int results
--               in a negative number. See SF bug #923315. */
--            num = PyLong_FromLong(self->ufds[i].revents & 0xffff);
-+               in a negative number. See issue17919 and issue923315.
-+               Why does a bitfield need to be signed at all? */
-+            num = PyLong_FromUnsignedLong((unsigned short)self->ufds[i].revents);
-             if (num == NULL) {
-                 Py_DECREF(value);
-                 goto error;

diff --git a/dev-lang/python/files/python-3.2-issue18235.patch b/dev-lang/python/files/python-3.2-issue18235.patch
deleted file mode 100644
index fc8e5cb969..0000000000
--- a/dev-lang/python/files/python-3.2-issue18235.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Issue #18235: _sysconfigdata.py wrong on AIX installations
-
---- Lib/sysconfig.py
-+++ Lib/sysconfig.py
-@@ -351,7 +351,7 @@
-     # -- these paths are relative to the Python source, but when installed
-     # the scripts are in another directory.
-     if _PYTHON_BUILD:
--        vars['LDSHARED'] = vars['BLDSHARED']
-+        vars['BLDSHARED'] = vars['LDSHARED']
- 
- def _init_non_posix(vars):
-     """Initialize the module as appropriate for NT"""
---- Makefile.pre.in
-+++ Makefile.pre.in
-@@ -1147,7 +1147,7 @@
- 		$(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix	\
- 				$(DESTDIR)$(LIBPL)/makexp_aix;		\
- 		echo "$(LIBPL)/makexp_aix";			\
--		$(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix	\
-+		$(INSTALL_SCRIPT) $(abs_builddir)/Modules/ld_so_aix	\
- 				$(DESTDIR)$(LIBPL)/ld_so_aix;		\
- 		echo "$(LIBPL)/ld_so_aix";			\
- 		echo; echo "See Misc/AIX-NOTES for details.";	\
---- Modules/ld_so_aix.in
-+++ Modules/ld_so_aix.in
-@@ -70,6 +70,7 @@
- fi
- 
- makexp=`dirname $0`/makexp_aix
-+test -x "${makexp}" || makexp="@abs_srcdir@/makexp_aix"
- 
- # Check for existence of compiler.
- CC=$1; shift
---- configure.ac
-+++ configure.ac
-@@ -1754,7 +1754,7 @@
- then
- 	case $ac_sys_system/$ac_sys_release in
- 	AIX*)
--		BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
-+		BLDSHARED="\$(abs_builddir)/Modules/ld_so_aix \$(CC) -bI:\$(abs_builddir)/Modules/python.exp"
- 		LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
- 		;;
- 	IRIX/5*) LDSHARED="ld -shared";;

diff --git a/dev-lang/python/files/python-3.2-issue19521.patch b/dev-lang/python/files/python-3.2-issue19521.patch
deleted file mode 100644
index c31a25ed44..0000000000
--- a/dev-lang/python/files/python-3.2-issue19521.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-Issue #19521: parallel build race condition on AIX since python-3.2
-
---- configure.ac
-+++ configure.ac
-@@ -641,21 +641,12 @@
- # If CXX is set, and if it is needed to link a main function that was
- # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
- # python might then depend on the C++ runtime
--# This is altered for AIX in order to build the export list before 
--# linking.
- AC_SUBST(LINKCC)
- AC_MSG_CHECKING(LINKCC)
- if test -z "$LINKCC"
- then
- 	LINKCC='$(PURIFY) $(MAINCC)'
- 	case $ac_sys_system in
--	AIX*)
--	   exp_extra="\"\""
--	   if test $ac_sys_release -ge 5 -o \
--		   $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
--	       exp_extra="."
--	   fi
--	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
- 	QNX*)
- 	   # qcc must be used because the other compilers do not
- 	   # support -N.
-@@ -664,6 +655,20 @@
- fi
- AC_MSG_RESULT($LINKCC)
- 
-+# EXPORTSYMS holds the list of exported symbols for AIX.
-+AC_SUBST(EXPORTSYMS)
-+AC_MSG_CHECKING(EXPORTSYMS)
-+case $ac_sys_system in
-+AIX*)
-+	if test -z "$EXPORTSYMS"; then
-+		EXPORTSYMS="Modules/python.exp"
-+	fi
-+	;;
-+*)
-+	EXPORTSYMS= ;;
-+esac
-+AC_MSG_RESULT($EXPORTSYMS)
-+
- # GNULD is set to "yes" if the GNU linker is used.  If this goes wrong
- # make sure we default having it set to "no": this is used by
- # distutils.unixccompiler to know if it should add --enable-new-dtags
---- Makefile.pre.in
-+++ Makefile.pre.in
-@@ -132,6 +132,8 @@
- BLDSHARED=	@BLDSHARED@ $(PY_LDFLAGS)
- LDCXXSHARED=	@LDCXXSHARED@
- DESTSHARED=	$(BINLIBDEST)/lib-dynload
-+# list of exported symbols for AIX
-+EXPORTSYMS=	@EXPORTSYMS@
- 
- # Executable suffix (.exe on Windows and Mac OS X)
- EXE=		@EXEEXT@
-@@ -439,7 +441,7 @@
- 
- 
- # Build the interpreter
--$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
-+$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
- 	$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
- 
- platform: $(BUILDPYTHON)
-@@ -509,6 +511,10 @@
- libpython$(VERSION).sl: $(LIBRARY_OBJS)
- 	$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
- 
-+# list of exported symbols for AIX
-+Modules/python.exp: $(LIBRARY)
-+	$(srcdir)/Modules/makexp_aix $@ . $?
-+
- # Copy up the gdb python hooks into a position where they can be automatically
- # loaded by gdb during Lib/test/test_gdb.py
- #
-@@ -580,7 +586,7 @@
- 		echo "-----------------------------------------------"; \
- 	fi
- 
--Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
-+Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
- 	$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
- 
- ############################################################################

diff --git a/dev-lang/python/files/python-3.2-issue19529.patch b/dev-lang/python/files/python-3.2-issue19529.patch
deleted file mode 100644
index 595d979b1f..0000000000
--- a/dev-lang/python/files/python-3.2-issue19529.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Issue #19529: Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX
-
---- Objects/unicodeobject.c
-+++ Objects/unicodeobject.c
-@@ -1267,7 +1267,7 @@
-     Py_ssize_t nchar;
- 
-     u = PyUnicode_AS_UNICODE(unicode);
--    uend = u + PyUnicode_GET_SIZE(u);
-+    uend = u + PyUnicode_GET_SIZE(unicode);
-     if (w != NULL) {
-         worig = w;
-         wend = w + size;
-

diff --git a/dev-lang/python/files/python-3.2-libffi-pkgconfig.patch b/dev-lang/python/files/python-3.2-libffi-pkgconfig.patch
deleted file mode 100644
index 45cb213d43..0000000000
--- a/dev-lang/python/files/python-3.2-libffi-pkgconfig.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -u -r Python-3.3.3-orig//configure.ac Python-3.3.3/configure.ac
---- Python-3.3.3-orig//configure.ac	2014-03-06 05:25:46.000000000 +0100
-+++ Python-3.3.3/configure.ac	2014-03-06 05:26:27.000000000 +0100
-@@ -2247,10 +2247,13 @@
- 
- if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
-     LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
-+    LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
- else
-     LIBFFI_INCLUDEDIR=""
-+    LIBFFI_LIB=""
- fi
- AC_SUBST(LIBFFI_INCLUDEDIR)
-+AC_SUBST(LIBFFI_LIB)
- 
- AC_MSG_RESULT($with_system_ffi)
- 
-diff -u -r Python-3.3.3-orig//Makefile.pre.in Python-3.3.3/Makefile.pre.in
---- Python-3.3.3-orig//Makefile.pre.in	2014-03-06 05:25:46.000000000 +0100
-+++ Python-3.3.3/Makefile.pre.in	2014-03-06 05:26:42.000000000 +0100
-@@ -252,6 +252,7 @@
- 
- 
- LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
-+LIBFFI_LIB=	@LIBFFI_LIB@
- 
- ##########################################################################
- # Parser
-diff -u -r Python-3.3.3-orig//setup.py Python-3.3.3/setup.py
---- Python-3.3.3-orig//setup.py	2014-03-06 05:25:46.000000000 +0100
-+++ Python-3.3.3/setup.py	2014-03-06 05:27:05.000000000 +0100
-@@ -1763,8 +1763,10 @@
-                         break
-                     if line.startswith('#define LIBFFI_H'):
-                         break
--        ffi_lib = None
--        if ffi_inc is not None:
-+        ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
-+        if not ffi_lib or ffi_lib == '':
-+            ffi_lib = None
-+        if ffi_inc is not None and ffi_lib is None:
-             for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
-                 if (self.compiler.find_library_file(lib_dirs, lib_name)):
-                     ffi_lib = lib_name

diff --git a/dev-lang/python/files/python-3.3-CVE-2013-2099.patch b/dev-lang/python/files/python-3.3-CVE-2013-2099.patch
deleted file mode 100644
index 44b9acede4..0000000000
--- a/dev-lang/python/files/python-3.3-CVE-2013-2099.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-# HG changeset patch
-# User Antoine Pitrou <solipsis@pitrou.net>
-# Date 1368892602 -7200
-#      Sat May 18 17:56:42 2013 +0200
-# Branch 3.3
-# Node ID c627638753e2d25a98950585b259104a025937a9
-# Parent  9682241dc8fcb4b1aef083bd30860efa070c3d6d
-Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of service using certificates with many wildcards (CVE-2013-2099).
-
-diff --git a/Lib/ssl.py b/Lib/ssl.py
---- a/Lib/ssl.py
-+++ b/Lib/ssl.py
-@@ -129,9 +129,16 @@
-     pass
- 
- 
--def _dnsname_to_pat(dn):
-+def _dnsname_to_pat(dn, max_wildcards=1):
-     pats = []
-     for frag in dn.split(r'.'):
-+        if frag.count('*') > max_wildcards:
-+            # Issue #17980: avoid denials of service by refusing more
-+            # than one wildcard per fragment.  A survery of established
-+            # policy among SSL implementations showed it to be a
-+            # reasonable choice.
-+            raise CertificateError(
-+                "too many wildcards in certificate DNS name: " + repr(dn))
-         if frag == '*':
-             # When '*' is a fragment by itself, it matches a non-empty dotless
-             # fragment.
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -349,6 +349,17 @@
-         self.assertRaises(ValueError, ssl.match_hostname, None, 'example.com')
-         self.assertRaises(ValueError, ssl.match_hostname, {}, 'example.com')
- 
-+        # Issue #17980: avoid denials of service by refusing more than one
-+        # wildcard per fragment.
-+        cert = {'subject': ((('commonName', 'a*b.com'),),)}
-+        ok(cert, 'axxb.com')
-+        cert = {'subject': ((('commonName', 'a*b.co*'),),)}
-+        ok(cert, 'axxb.com')
-+        cert = {'subject': ((('commonName', 'a*b*.com'),),)}
-+        with self.assertRaises(ssl.CertificateError) as cm:
-+            ssl.match_hostname(cert, 'axxbxxc.com')
-+        self.assertIn("too many wildcards", str(cm.exception))
-+
-     def test_server_side(self):
-         # server_hostname doesn't work for server sockets
-         ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)

diff --git a/dev-lang/python/files/python-3.3-issue17919.patch b/dev-lang/python/files/python-3.3-issue17919.patch
deleted file mode 100644
index 5dd60ea055..0000000000
--- a/dev-lang/python/files/python-3.3-issue17919.patch
+++ /dev/null
@@ -1,112 +0,0 @@
---- Modules/selectmodule.c.orig	2013-11-11 17:24:34.835918627 +0100
-+++ Modules/selectmodule.c	2013-11-11 17:28:20.897906748 +0100
-@@ -360,7 +360,8 @@
-         assert(i < self->ufd_len);
-         /* Never overflow */
-         self->ufds[i].fd = (int)PyLong_AsLong(key);
--        self->ufds[i].events = (short)PyLong_AsLong(value);
-+        /* Why does a bitfield need to be signed at all? */
-+        self->ufds[i].events = (short)PyLong_AsUnsignedLong(value);
-         i++;
-     }
-     assert(i == self->ufd_len);
-@@ -380,10 +381,10 @@
- {
-     PyObject *o, *key, *value;
-     int fd;
--    short events = POLLIN | POLLPRI | POLLOUT;
-+    unsigned short events = POLLIN | POLLPRI | POLLOUT;
-     int err;
- 
--    if (!PyArg_ParseTuple(args, "O|h:register", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "O|H:register", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -395,7 +396,7 @@
-     key = PyLong_FromLong(fd);
-     if (key == NULL)
-         return NULL;
--    value = PyLong_FromLong(events);
-+    value = PyLong_FromUnsignedLong(events);
-     if (value == NULL) {
-         Py_DECREF(key);
-         return NULL;
-@@ -423,10 +424,11 @@
- poll_modify(pollObject *self, PyObject *args)
- {
-     PyObject *o, *key, *value;
--    int fd, events;
-+    int fd;
-+    unsigned short events;
-     int err;
- 
--    if (!PyArg_ParseTuple(args, "Oi:modify", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "OH:modify", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -443,7 +445,7 @@
-         Py_DECREF(key);
-         return NULL;
-     }
--    value = PyLong_FromLong(events);
-+    value = PyLong_FromUnsignedLong(events);
-     if (value == NULL) {
-         Py_DECREF(key);
-         return NULL;
-@@ -567,11 +569,12 @@
-             }
-             PyTuple_SET_ITEM(value, 0, num);
- 
--            /* The &0xffff is a workaround for AIX.  'revents'
--               is a 16-bit short, and IBM assigned POLLNVAL
-+            /* The 'unsigned' cast is necessary for AIX. 'revents'
-+               is a 16-bit signed short, but IBM assigned POLLNVAL
-                to be 0x8000, so the conversion to int results
--               in a negative number. See SF bug #923315. */
--            num = PyLong_FromLong(self->ufds[i].revents & 0xffff);
-+               in a negative number. See issue17919 and issue923315.
-+               Why does a bitfield need to be signed at all? */
-+            num = PyLong_FromUnsignedLong((unsigned short)self->ufds[i].revents);
-             if (num == NULL) {
-                 Py_DECREF(value);
-                 goto error;
-@@ -714,9 +717,10 @@
- internal_devpoll_register(devpollObject *self, PyObject *args, int remove)
- {
-     PyObject *o;
--    int fd, events = POLLIN | POLLPRI | POLLOUT;
-+    int fd;
-+    unsigned short events = POLLIN | POLLPRI | POLLOUT;
- 
--    if (!PyArg_ParseTuple(args, "O|i:register", &o, &events)) {
-+    if (!PyArg_ParseTuple(args, "O|H:register", &o, &events)) {
-         return NULL;
-     }
- 
-@@ -734,7 +738,8 @@
-     }
- 
-     self->fds[self->n_fds].fd = fd;
--    self->fds[self->n_fds].events = events;
-+    /* Why does a bitfield need to be signed? */
-+    self->fds[self->n_fds].events = (short)events;
- 
-     if (++self->n_fds == self->max_n_fds) {
-         if (devpoll_flush(self))
-@@ -862,7 +867,13 @@
-     else {
-         for (i = 0; i < poll_result; i++) {
-             num1 = PyLong_FromLong(self->fds[i].fd);
--            num2 = PyLong_FromLong(self->fds[i].revents);
-+            /* The 'unsigned' cast may become necessary for AIX when it
-+               starts to provide /dev/poll (maybe never). 'revents'
-+               is a 16-bit signed short, but IBM assigned POLLNVAL
-+               to be 0x8000, so the conversion to int results
-+               in a negative number. See issue17919 and issue923315.
-+               Why does a bitfield need to be signed at all? */
-+            num2 = PyLong_FromUnsignedLong((unsigned short)self->fds[i].revents);
-             if ((num1 == NULL) || (num2 == NULL)) {
-                 Py_XDECREF(num1);
-                 Py_XDECREF(num2);

diff --git a/dev-lang/python/files/python-3.3-issue18235.patch b/dev-lang/python/files/python-3.3-issue18235.patch
deleted file mode 100644
index 1296508145..0000000000
--- a/dev-lang/python/files/python-3.3-issue18235.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-second part of
-Issue #18235: _sysconfigdata.py wrong on AIX installations
-
---- Makefile.pre.in
-+++ Makefile.pre.in
-@@ -1147,7 +1147,7 @@
- 		$(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix	\
- 				$(DESTDIR)$(LIBPL)/makexp_aix;		\
- 		echo "$(LIBPL)/makexp_aix";			\
--		$(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix	\
-+		$(INSTALL_SCRIPT) $(abs_builddir)/Modules/ld_so_aix	\
- 				$(DESTDIR)$(LIBPL)/ld_so_aix;		\
- 		echo "$(LIBPL)/ld_so_aix";			\
- 		echo; echo "See Misc/AIX-NOTES for details.";	\
---- Modules/ld_so_aix.in
-+++ Modules/ld_so_aix.in
-@@ -70,6 +70,7 @@
- fi
- 
- makexp=`dirname $0`/makexp_aix
-+test -x "${makexp}" || makexp="@abs_srcdir@/makexp_aix"
- 
- # Check for existence of compiler.
- CC=$1; shift
---- configure.ac
-+++ configure.ac
-@@ -1754,7 +1754,7 @@
- then
- 	case $ac_sys_system/$ac_sys_release in
- 	AIX*)
--		BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
-+		BLDSHARED="\$(abs_builddir)/Modules/ld_so_aix \$(CC) -bI:\$(abs_builddir)/Modules/python.exp"
- 		LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
- 		;;
- 	IRIX/5*) LDSHARED="ld -shared";;

diff --git a/dev-lang/python/files/python-3.3-issue21811.patch b/dev-lang/python/files/python-3.3-issue21811.patch
deleted file mode 100644
index 24ce42a6c5..0000000000
--- a/dev-lang/python/files/python-3.3-issue21811.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-Modified for Gentoo to apply to patched sources
-
-# HG changeset patch
-# User Ned Deily <nad@acm.org>
-# Date 1403729193 25200
-# Node ID 7346ba9340975a850a83cdac932423f4fb536d0f
-# Parent  3583b2bedbe7410c0f0179105d7f036a515a06ee# Parent  69ae7e4939f2fbd315b0585a197fb2be854052cc
-Issue #21811: Anticipated fixes to 3.x configure for OS X 10.10 Yosemite.
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -1982,15 +1982,14 @@
- 		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
- 		# This allows an extension to be used in any Python
- 
--		if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
-+		dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
-+				sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
-+		dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
-+				sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
-+		if test ${dep_target_major} -eq 10 && \
-+		   test ${dep_target_minor} -le 2
- 		then
--			if test "${enable_universalsdk}"; then
--				LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
--			fi
--			LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
--			LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
--			BLDSHARED="$LDSHARED"
--		else
-+			# building for OS X 10.0 through 10.2
- 			LDSHARED='$(CC) -bundle'
- 			LDCXXSHARED='$(CXX) -bundle'
- 			if test "$enable_framework" ; then
-@@ -2004,6 +2003,11 @@
- 				LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
- 				LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
- 			fi
-+		else
-+			# building for OS X 10.3 and later
-+			LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
-+			LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
-+			BLDSHARED="$LDSHARED"
- 		fi
- 		;;
- 	Linux*|GNU*|QNX*)

diff --git a/dev-lang/python/files/python-3.4-gcc-5.patch b/dev-lang/python/files/python-3.4-gcc-5.patch
deleted file mode 100644
index 80afbd1c47..0000000000
--- a/dev-lang/python/files/python-3.4-gcc-5.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-changeset:   94583:689092296ad3
-branch:      3.4
-parent:      94579:645f3d750be1
-user:        Victor Stinner <victor.stinner@gmail.com>
-date:        Wed Feb 11 14:23:35 2015 +0100
-summary:     Issue #23433: Fix faulthandler._stack_overflow()
-
-diff -r 645f3d750be1 -r 689092296ad3 Modules/faulthandler.c
---- a/Modules/faulthandler.c	Tue Feb 10 14:49:32 2015 +0100
-+++ b/Modules/faulthandler.c	Wed Feb 11 14:23:35 2015 +0100
-@@ -911,12 +911,12 @@
- }
- 
- #if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION)
--static void*
--stack_overflow(void *min_sp, void *max_sp, size_t *depth)
-+static Py_uintptr_t
-+stack_overflow(Py_uintptr_t min_sp, Py_uintptr_t max_sp, size_t *depth)
- {
-     /* allocate 4096 bytes on the stack at each call */
-     unsigned char buffer[4096];
--    void *sp = &buffer;
-+    Py_uintptr_t sp = (Py_uintptr_t)&buffer;
-     *depth += 1;
-     if (sp < min_sp || max_sp < sp)
-         return sp;
-@@ -929,7 +929,8 @@
- faulthandler_stack_overflow(PyObject *self)
- {
-     size_t depth, size;
--    char *sp = (char *)&depth, *stop;
-+    Py_uintptr_t sp = (Py_uintptr_t)&depth;
-+    Py_uintptr_t stop;
- 
-     depth = 0;
-     stop = stack_overflow(sp - STACK_OVERFLOW_MAX_SIZE,
-

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
deleted file mode 100644
index 8bfad11427..0000000000
--- a/dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 7a016ffbd4..0000000000
--- a/dev-lang/python/files/python-3.4.5-cross.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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
deleted file mode 100644
index 8af8c30c76..0000000000
--- a/dev-lang/python/files/python-3.5-distutils-OO-build.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-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
-

diff --git a/dev-lang/python/files/python-3.5.4-libffi-pkgconfig.patch b/dev-lang/python/files/python-3.5.4-libffi-pkgconfig.patch
deleted file mode 100644
index 0edd83b6ae..0000000000
--- a/dev-lang/python/files/python-3.5.4-libffi-pkgconfig.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -u -r Python-3.3.3-orig//configure.ac Python-3.3.3/configure.ac
---- Python-3.3.3-orig//configure.ac	2014-03-06 05:25:46.000000000 +0100
-+++ Python-3.3.3/configure.ac	2014-03-06 05:26:27.000000000 +0100
-@@ -2247,10 +2247,13 @@
- 
- if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
-     LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
-+    LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
- else
-     LIBFFI_INCLUDEDIR=""
-+    LIBFFI_LIB=""
- fi
- AC_SUBST(LIBFFI_INCLUDEDIR)
-+AC_SUBST(LIBFFI_LIB)
- 
- AC_MSG_RESULT($with_system_ffi)
- 
-diff -u -r Python-3.3.3-orig//Makefile.pre.in Python-3.3.3/Makefile.pre.in
---- Python-3.3.3-orig//Makefile.pre.in	2014-03-06 05:25:46.000000000 +0100
-+++ Python-3.3.3/Makefile.pre.in	2014-03-06 05:26:42.000000000 +0100
-@@ -252,6 +252,7 @@
- 
- 
- LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
-+LIBFFI_LIB=	@LIBFFI_LIB@
- 
- ##########################################################################
- # Parser
-diff -u -r Python-3.3.3-orig//setup.py Python-3.3.3/setup.py
---- Python-3.3.3-orig//setup.py	2014-03-06 05:25:46.000000000 +0100
-+++ Python-3.3.3/setup.py	2014-03-06 05:27:05.000000000 +0100
-@@ -1763,8 +1763,10 @@
-                     ffi_inc = None
-                     print('Header file {} does not define LIBFFI_H or '
-                           'ffi_wrapper_h'.format(ffi_h))
--        ffi_lib = None
--        if ffi_inc is not None:
-+        ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
-+        if not ffi_lib or ffi_lib == '':
-+            ffi_lib = None
-+        if ffi_inc is not None and ffi_lib is None:
-             for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
-                 if (self.compiler.find_library_file(lib_dirs, lib_name)):
-                     ffi_lib = lib_name

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
deleted file mode 100644
index c418f40b7d..0000000000
--- a/dev-lang/python/files/python-3.5.5-hash-unaligned.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-The hash implementation casts the input pointer to uint64_t* and directly reads
-from this, which may cause unaligned accesses. Use memcpy() instead so this code
-will not crash with SIGBUS on sparc.
-
---- a/Python/pyhash.c	2017-11-29 10:21:20.283094068 +0100
-+++ b/Python/pyhash.c	2017-11-29 10:24:26.733087813 +0100
-@@ -372,7 +372,7 @@ siphash24(const void *src, Py_ssize_t sr
-     PY_UINT64_T k0 = _le64toh(_Py_HashSecret.siphash.k0);
-     PY_UINT64_T k1 = _le64toh(_Py_HashSecret.siphash.k1);
-     PY_UINT64_T b = (PY_UINT64_T)src_sz << 56;
--    const PY_UINT64_T *in = (PY_UINT64_T*)src;
-+    const PY_UINT8_T *in = (PY_UINT8_T*)src;
- 
-     PY_UINT64_T v0 = k0 ^ 0x736f6d6570736575ULL;
-     PY_UINT64_T v1 = k1 ^ 0x646f72616e646f6dULL;
-@@ -381,12 +381,14 @@ siphash24(const void *src, Py_ssize_t sr
- 
-     PY_UINT64_T t;
-     PY_UINT8_T *pt;
--    PY_UINT8_T *m;
-+    const PY_UINT8_T *m;
- 
-     while (src_sz >= 8) {
--        PY_UINT64_T mi = _le64toh(*in);
--        in += 1;
--        src_sz -= 8;
-+        PY_UINT64_T mi;
-+        memcpy(&mi, in, sizeof(mi));
-+        mi = _le64toh(mi);
-+        in += sizeof(mi);
-+        src_sz -= sizeof(mi);
-         v3 ^= mi;
-         DOUBLE_ROUND(v0,v1,v2,v3);
-         v0 ^= mi;
-@@ -394,7 +396,7 @@ siphash24(const void *src, Py_ssize_t sr
- 
-     t = 0;
-     pt = (PY_UINT8_T *)&t;
--    m = (PY_UINT8_T *)in;
-+    m = in;
-     switch (src_sz) {
-         case 7: pt[6] = m[6];
-         case 6: pt[5] = m[5];

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
deleted file mode 100644
index 67d57d0c13..0000000000
--- a/dev-lang/python/files/python-3.5.5-libressl-compatibility.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-# From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001
-# From: Christian Heimes <christian@python.org>
-# Date: Sat, 24 Mar 2018 18:38:14 +0100
-# Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0
-# (GH-6210) (GH-6214)
-#
-# LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
-# LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
-# LibreSSL < 2.7.
-
-# Documentation updates and fixes for failing tests will be provided in
-# another patch set.
-
-# Signed-off-by: Christian Heimes <christian@python.org>.
-# (cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
-
-# Co-authored-by: Christian Heimes <christian@python.org>
-# Patch modified by Aaron Bauman <bman@gentoo.org> for 3.5.5
-
---- a/Modules/_ssl.c	2018-04-13 18:33:17.397649561 -0400
-+++ b/Modules/_ssl.c	2018-04-13 18:40:22.319852014 -0400
-@@ -101,6 +101,12 @@
- 
- #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #  define OPENSSL_VERSION_1_1 1
-+#  define PY_OPENSSL_1_1_API 1
-+#endif
-+
-+/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
-+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
-+#  define PY_OPENSSL_1_1_API 1
- #endif
- 
- /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
-@@ -129,16 +135,18 @@
- #define INVALID_SOCKET (-1)
- #endif
- 
--#ifdef OPENSSL_VERSION_1_1
--/* OpenSSL 1.1.0+ */
--#ifndef OPENSSL_NO_SSL2
--#define OPENSSL_NO_SSL2
--#endif
--#else /* OpenSSL < 1.1.0 */
--#if defined(WITH_THREAD)
-+/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
-+#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
- #define HAVE_OPENSSL_CRYPTO_LOCK
- #endif
- 
-+#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
-+#define OPENSSL_NO_SSL2
-+#endif
-+
-+#ifndef PY_OPENSSL_1_1_API
-+/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
-+
- #define TLS_method SSLv23_method
- 
- static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
-@@ -187,7 +195,7 @@
- {
-     return store->param;
- }
--#endif /* OpenSSL < 1.1.0 or LibreSSL */
-+#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
- 
- 
- enum py_ssl_error {

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
deleted file mode 100644
index d096887cbf..0000000000
--- a/dev-lang/python/files/python-3.6.5-hash-unaligned.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-The hash implementation casts the input pointer to uint64_t* and directly reads
-from this, which may cause unaligned accesses. Use memcpy() instead so this code
-will not crash with SIGBUS on sparc.
-
---- a/Python/pyhash.c	2017-11-29 10:21:20.283094068 +0100
-+++ b/Python/pyhash.c	2017-11-29 10:24:26.733087813 +0100
-@@ -369,7 +369,7 @@
-     uint64_t k0 = _le64toh(_Py_HashSecret.siphash.k0);
-     uint64_t k1 = _le64toh(_Py_HashSecret.siphash.k1);
-     uint64_t b = (uint64_t)src_sz << 56;
--    const uint64_t *in = (uint64_t*)src;
-+    const uint8_t *in = (uint8_t*)src;
- 
-     uint64_t v0 = k0 ^ 0x736f6d6570736575ULL;
-     uint64_t v1 = k1 ^ 0x646f72616e646f6dULL;
-@@ -378,11 +378,13 @@
- 
-     uint64_t t;
-     uint8_t *pt;
--    uint8_t *m;
-+    const uint8_t *m;
- 
-     while (src_sz >= 8) {
--        uint64_t mi = _le64toh(*in);
--        in += 1;
--        src_sz -= 8;
-+        uint64_t mi;
-+        memcpy(&mi, in, sizeof(mi));
-+        mi = _le64toh(mi);
-+        in += sizeof(mi);
-+        src_sz -= sizeof(mi);
-         v3 ^= mi;
-         DOUBLE_ROUND(v0,v1,v2,v3);
-@@ -391,7 +393,7 @@
- 
-     t = 0;
-     pt = (uint8_t *)&t;
--    m = (uint8_t *)in;
-+    m = in;
-     switch (src_sz) {
-         case 7: pt[6] = m[6]; /* fall through */
-         case 6: pt[5] = m[5]; /* fall through */

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
deleted file mode 100644
index 2f9e6a2bef..0000000000
--- a/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Sat, 24 Mar 2018 18:38:14 +0100
-Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0
- (GH-6210) (GH-6214)
-
-LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
-LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
-LibreSSL < 2.7.
-
-Documentation updates and fixes for failing tests will be provided in
-another patch set.
-
-Signed-off-by: Christian Heimes <christian@python.org>.
-(cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
-
-Co-authored-by: Christian Heimes <christian@python.org>
----
- Lib/test/test_ssl.py                          |  1 +
- .../2018-03-24-15-08-24.bpo-33127.olJmHv.rst  |  1 +
- Modules/_ssl.c                                | 24 ++++++++++++-------
- Tools/ssl/multissltests.py                    |  3 ++-
- 4 files changed, 20 insertions(+), 9 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
-
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index 8dd3b41450..9785a59a7e 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -1687,6 +1687,7 @@ class SimpleBackgroundTests(unittest.TestCase):
-         self.assertEqual(len(ctx.get_ca_certs()), 1)
- 
-     @needs_sni
-+    @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"), "needs TLS 1.2")
-     def test_context_setget(self):
-         # Check that the context of a connected socket can be replaced.
-         ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
-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
-new file mode 100644
-index 0000000000..635aabbde0
---- /dev/null
-+++ b/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
-@@ -0,0 +1 @@
-+The ssl module now compiles with LibreSSL 2.7.1.
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index c54e43c2b4..5e007da858 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -106,6 +106,12 @@ struct py_ssl_library_code {
- 
- #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #  define OPENSSL_VERSION_1_1 1
-+#  define PY_OPENSSL_1_1_API 1
-+#endif
-+
-+/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
-+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
-+#  define PY_OPENSSL_1_1_API 1
- #endif
- 
- /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
-@@ -152,16 +158,18 @@ struct py_ssl_library_code {
- #define INVALID_SOCKET (-1)
- #endif
- 
--#ifdef OPENSSL_VERSION_1_1
--/* OpenSSL 1.1.0+ */
--#ifndef OPENSSL_NO_SSL2
--#define OPENSSL_NO_SSL2
--#endif
--#else /* OpenSSL < 1.1.0 */
--#if defined(WITH_THREAD)
-+/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
-+#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
- #define HAVE_OPENSSL_CRYPTO_LOCK
- #endif
- 
-+#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
-+#define OPENSSL_NO_SSL2
-+#endif
-+
-+#ifndef PY_OPENSSL_1_1_API
-+/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
-+
- #define TLS_method SSLv23_method
- #define TLS_client_method SSLv23_client_method
- #define TLS_server_method SSLv23_server_method
-@@ -227,7 +235,7 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s)
-     return s->tlsext_tick_lifetime_hint;
- }
- 
--#endif /* OpenSSL < 1.1.0 or LibreSSL */
-+#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
- 
- 
- enum py_ssl_error {
-diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
-index ce5bbd8530..ba4529ae06 100755
---- a/Tools/ssl/multissltests.py
-+++ b/Tools/ssl/multissltests.py
-@@ -57,8 +57,9 @@ LIBRESSL_OLD_VERSIONS = [
- ]
- 
- LIBRESSL_RECENT_VERSIONS = [
--    "2.5.3",
-     "2.5.5",
-+    "2.6.4",
-+    "2.7.1",
- ]
- 
- # store files in ../multissl
--- 
-2.17.0
-

diff --git a/dev-lang/python/python-3.8.5.ebuild b/dev-lang/python/python-3.8.5.ebuild
index 9f83f7cd5c..32c823df81 100644
--- a/dev-lang/python/python-3.8.5.ebuild
+++ b/dev-lang/python/python-3.8.5.ebuild
@@ -107,7 +107,6 @@ src_prepare() {
 		sed -i \
 			-e 's/KQUEUE/KQUEUE_DISABLED/' \
 			configure.ac configure || die
-		eapply "${FILESDIR}"/${PN}-3.8.5-darwin9.patch
 	fi
 
 	# side-effect of disabling scproxy (see below), make sure we don't

diff --git a/dev-lang/python/python-3.6.8.ebuild b/dev-lang/python/python-3.8.6.ebuild
similarity index 65%
rename from dev-lang/python/python-3.6.8.ebuild
rename to dev-lang/python/python-3.8.6.ebuild
index 13121eec6d..2ee3d275cd 100644
--- a/dev-lang/python/python-3.6.8.ebuild
+++ b/dev-lang/python/python-3.8.6.ebuild
@@ -1,31 +1,28 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="6"
+EAPI="7"
 WANT_LIBTOOL="none"
 
-inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs epatch
+inherit autotools flag-o-matic multiprocessing pax-utils \
+	python-utils-r1 toolchain-funcs
 
 MY_P="Python-${PV}"
-PATCHSET_VERSION="3.6.8"
-PREFIX_PATCHREV="${PV}-gentoo-patches-r0"
-CYGWINPORTS_GITREV="f11d606e98b00f5b143cba92bfee8b7f5ba779b0"
+PYVER=$(ver_cut 1-2)
+PATCHSET="python-gentoo-patches-${PV}"
+PREFIX_PATCHSET="python-prefix-gentoo-${PV}-patches-r0"
 
 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
 HOMEPAGE="https://www.python.org/"
 SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
-	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
-	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PREFIX_PATCHREV}.tar.xz"
-
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-SRC_URI+=" elibc_Cygwin? (
-	https://github.com/cygwinports/python36/archive/${CYGWINPORTS_GITREV}.zip
-	-> python36-cygwinports-${CYGWINPORTS_GITREV}.zip )"
+	https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
+	https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz"
+S="${WORKDIR}/${MY_P}"
 
 LICENSE="PSF-2"
-SLOT="3.6/3.6m"
+SLOT="${PYVER}"
 KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="aqua bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
+IUSE="aqua bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml"
 RESTRICT="!test? ( test )"
 
 # Do not add a dependency on dev-lang/python to this ebuild.
@@ -33,27 +30,28 @@ RESTRICT="!test? ( test )"
 # run the bootstrap code on your dev box and include the results in the
 # patchset. See bug 447752.
 
-RDEPEND="app-arch/bzip2:0=
-	app-arch/xz-utils:0=
-	>=sys-libs/zlib-1.1.3:0=
-	virtual/libffi:=
+RDEPEND="app-arch/bzip2:=
+	app-arch/xz-utils:=
+	dev-libs/libffi:=
+	kernel_linux? ( sys-apps/util-linux:= )
+	>=sys-libs/zlib-1.1.3:=
+	virtual/libcrypt:=
 	virtual/libintl
-	gdbm? ( sys-libs/gdbm:0=[berkdb] )
-	ncurses? ( >=sys-libs/ncurses-5.2:0= )
-	readline? ( >=sys-libs/readline-4.1:0= )
+	gdbm? ( sys-libs/gdbm:=[berkdb] )
+	ncurses? ( >=sys-libs/ncurses-5.2:= )
+	readline? ( >=sys-libs/readline-4.1:= )
 	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
 	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
+		!libressl? ( dev-libs/openssl:= )
+		libressl? ( dev-libs/libressl:= )
 	)
 	tk? (
-		>=dev-lang/tcl-8.0:0=
-		>=dev-lang/tk-8.0:0=[-aqua]
-		dev-tcltk/blt:0=
+		>=dev-lang/tcl-8.0:=
+		>=dev-lang/tk-8.0:=
+		dev-tcltk/blt:=
 		dev-tcltk/tix
 	)
-	xml? ( >=dev-libs/expat-2.1:0= )
-	!!<sys-apps/sandbox-2.6-r1"
+	xml? ( >=dev-libs/expat-2.1:= )"
 # bluetooth requires headers from bluez
 DEPEND="${RDEPEND}
 	bluetooth? ( net-wireless/bluez )
@@ -63,40 +61,20 @@ DEPEND="${RDEPEND}
 RDEPEND+=" !build? ( app-misc/mime-types )"
 PDEPEND=">=app-eselect/eselect-python-20140125-r1"
 
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
-
-S="${WORKDIR}/${MY_P}"
-PYVER=${SLOT%/*}
-
 src_prepare() {
 	# Ensure that internal copies of expat, libffi and zlib are not used.
-	rm -fr Modules/expat
-	rm -fr Modules/_ctypes/libffi*
-	rm -fr Modules/zlib
+	rm -fr Modules/expat || die
+	rm -fr Modules/_ctypes/libffi* || die
+	rm -fr Modules/zlib || die
 
 	local PATCHES=(
-		"${WORKDIR}/patches"
+		"${WORKDIR}/${PATCHSET}"
+		# Prefix' round of patches
+		"${WORKDIR}"/${PREFIX_PATCHSET}
 	)
 
 	default
 
-	# Prefix' round of patches
-	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
-		epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV}
-
-	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
-	    local p d="${WORKDIR}/python36-${CYGWINPORTS_GITREV}"
-	    for p in $(
-			sed -ne '/PATCH_URI="/,/"/{s/.*="//;s/".*$//;p}' \
-			< "${d}/python3.cygport"
-	    ); do
-			# dropped by 01_all_prefix-no-patch-invention.patch
-			[[ ${p} == *-tkinter-* ]] && continue
-		    epatch "${d}/${p}"
-	    done
-	fi
-
 	# we provide a fully working readline also on Darwin, so don't force
 	# usage of less functional libedit
 	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
@@ -105,17 +83,14 @@ src_prepare() {
 	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
 
 	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
-		Lib/distutils/command/install.py \
-		Lib/distutils/sysconfig.py \
-		Lib/site.py \
-		Lib/sysconfig.py \
-		Lib/test/test_site.py \
-		Makefile.pre.in \
-		Modules/Setup.dist \
-		Modules/getpath.c \
-		configure.ac \
 		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
 
+	# force correct number of jobs
+	# https://bugs.gentoo.org/737660
+	local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+	sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
+	sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
+
 	# workaround a development build env problem and muck around
 	# framework install to get the best of both worlds (non-standard)
 	sed -i \
@@ -141,6 +116,11 @@ src_prepare() {
 			configure.ac configure || die
 	fi
 
+	# side-effect of disabling scproxy (see below), make sure we don't
+	# try to use it on Darwin either
+	sed -i -e '/sys.platform/s/darwin/disabled-darwin/' \
+		Lib/urllib/request.py || die
+
 	eautoreconf
 }
 
@@ -148,13 +128,14 @@ src_configure() {
 	local disable
 	# disable automagic bluetooth headers detection
 	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
-	use gdbm     || disable+=" gdbm"
-	use ncurses  || disable+=" _curses _curses_panel"
-	use readline || disable+=" readline"
-	use sqlite   || disable+=" _sqlite3"
-	use ssl      || export PYTHON_DISABLE_SSL="1"
-	use tk       || disable+=" _tkinter"
-	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+	use gdbm      || disable+=" gdbm"
+	use ncurses   || disable+=" _curses _curses_panel"
+	use readline  || disable+=" readline"
+	use sqlite    || disable+=" _sqlite3"
+	use ssl       || export PYTHON_DISABLE_SSL="1"
+	use tk        || disable+=" _tkinter"
+	use xml       || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+	[[ ${CHOST} == *-darwin* ]] && disable+=" _scproxy"  # header issue
 	export PYTHON_DISABLE_MODULES="${disable}"
 
 	if ! use xml; then
@@ -179,6 +160,11 @@ src_configure() {
 		use hardened && replace-flags -O3 -O2
 	fi
 
+	# https://bugs.gentoo.org/700012
+	if is-flagq -flto || is-flagq '-flto=*'; then
+		append-cflags $(test-flags-CC -ffat-lto-objects)
+	fi
+
 	# Export CC so even AIX will use gcc instead of xlc_r.
 	# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
 	tc-export CC CXX
@@ -188,9 +174,9 @@ src_configure() {
 	# Please query BSD team before removing this!
 	append-ldflags "-L."
 
-	# make sure setup.py considers Prefix' paths before system ones
-	use prefix && append-cppflags -I"${EPREFIX}"/usr/include
-	use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
+	# Fix implicit declarations on cross and prefix builds. Bug #674070.
+	use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
+	use prefix && append-ldflags -L"${ESYSROOT}"/lib -L"${ESYSROOT}"/usr/lib
 
 	local dbmliborder
 	if use gdbm; then
@@ -205,11 +191,16 @@ src_configure() {
 	fi
 
 	local myeconfargs=(
-		$(use aqua && echo --config-cache) \
-		$(use_with !elibc_Cygwin fpectl)
+		# glibc-2.30 removes it; since we can't cleanly force-rebuild
+		# Python on glibc upgrade, remove it proactively to give
+		# a chance for users rebuilding python before glibc
+		# except on non-glibc systems this breaks the build, so be
+		# conservative!
+		$(use elibc_glibc && echo ac_cv_header_stropts_h=no)
+
+		$(use aqua && echo --config-cache)
 		--enable-shared
 		$(use_enable ipv6)
-		$(use_with threads)
 		--infodir='${prefix}/share/info'
 		--mandir='${prefix}/share/man'
 		--with-computed-gotos
@@ -222,12 +213,6 @@ src_configure() {
 	)
 
 	OPT="" econf "${myeconfargs[@]}"
-
-	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
-		eerror "configure has detected that the sem_open function is broken."
-		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
-		die "Broken sem_open function (bug 496328)"
-	fi
 }
 
 src_compile() {
@@ -261,7 +246,6 @@ src_test() {
 
 	# bug 660358
 	local -x COLUMNS=80
-
 	local -x PYTHONDONTWRITEBYTECODE=
 
 	emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
@@ -277,7 +261,7 @@ src_test() {
 	done
 
 	elog "If you would like to run them, you may:"
-	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
+	elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
 	elog "and run the tests separately."
 
 	if [[ ${result} -ne 0 ]]; then
@@ -286,7 +270,7 @@ src_test() {
 }
 
 src_install() {
-	local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
+	local libdir=${ED}/usr/lib/python${PYVER}
 
 	emake DESTDIR="${D}" altinstall
 
@@ -308,25 +292,22 @@ src_install() {
 			"${ED}${fwdir}"/Python || die
 	fi
 
+	# Remove static library
+	rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
+
 	sed \
 		-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
 		-e "s/\(PY_LDFLAGS=\).*/\1/" \
 		-i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
 
 	# Fix collisions between different slots of Python.
-	rm -f "${ED}usr/$(get_libdir)/libpython3.so"
-
-	if use elibc_Cygwin; then
-		# We may recreate symlinks, but without any .exe extension.  Cygwin
-		# can resolv either without it, so just drop .exe from shebangs:
-		sed -i -e '1s/\.exe//' "$ED"/usr/bin/* || die
-	fi
+	rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die
 
 	# Cheap hack to get version with ABIFLAGS
-	local abiver=$(cd "${ED}usr/include"; echo python*)
+	local abiver=$(cd "${ED}/usr/include"; echo python*)
 	if [[ ${abiver} != python${PYVER} ]]; then
 		# Replace python3.X with a symlink to python3.Xm
-		rm "${ED}usr/bin/python${PYVER}" || die
+		rm "${ED}/usr/bin/python${PYVER}" || die
 		dosym "${abiver}" "/usr/bin/python${PYVER}"
 		# Create python3.X-config symlink
 		dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
@@ -337,23 +318,22 @@ src_install() {
 	# python seems to get rebuilt in src_install (bug 569908)
 	# Work around it for now.
 	if has_version dev-libs/libffi[pax_kernel]; then
-		pax-mark E "${ED}usr/bin/${abiver}"
+		pax-mark E "${ED}/usr/bin/${abiver}"
 	else
-		pax-mark m "${ED}usr/bin/${abiver}"
+		pax-mark m "${ED}/usr/bin/${abiver}"
 	fi
 
 	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
-	use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
+	use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
 
-	use threads || rm -r "${libdir}/multiprocessing" || die
 	use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
 
-	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
+	dodoc Misc/{ACKS,HISTORY,NEWS}
 
 	if use examples; then
-		insinto /usr/share/doc/${PF}/examples
-		find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
-		doins -r "${S}"/Tools
+		docinto examples
+		find Tools -name __pycache__ -exec rm -fr {} + || die
+		dodoc -r Tools
 	fi
 	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
 	if use aqua ; then
@@ -371,53 +351,49 @@ src_install() {
 	sed \
 		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
 		-e "s:@PYDOC@:pydoc${PYVER}:" \
-		-i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
-
-	# for python-exec
-	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
+		-i "${ED}/etc/conf.d/pydoc-${PYVER}" \
+		"${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
 
+	local -x EPYTHON=python${PYVER}
 	# if not using a cross-compiler, use the fresh binary
 	if ! tc-is-cross-compiler; then
 		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
 		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
 		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
 	else
-		vars=( PYTHON "${vars[@]}" )
+		local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
 	fi
 
-	python_export "python${PYVER}" "${vars[@]}"
 	echo "EPYTHON='${EPYTHON}'" > epython.py || die
 	python_domodule epython.py
 
 	# python-exec wrapping support
 	local pymajor=${PYVER%.*}
-	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+	local scriptdir=${D}$(python_get_scriptdir)
+	mkdir -p "${scriptdir}" || die
 	# python and pythonX
 	ln -s "../../../bin/${abiver}" \
-		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
-	ln -s "python${pymajor}" \
-		"${D}${PYTHON_SCRIPTDIR}/python" || die
+		"${scriptdir}/python${pymajor}" || die
+	ln -s "python${pymajor}" "${scriptdir}/python" || die
 	# python-config and pythonX-config
 	# note: we need to create a wrapper rather than symlinking it due
 	# to some random dirname(argv[0]) magic performed by python-config
-	cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
+	cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
 		#!/bin/sh
 		exec "${abiver}-config" "\${@}"
 	EOF
-	chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+	chmod +x "${scriptdir}/python${pymajor}-config" || die
 	ln -s "python${pymajor}-config" \
-		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
-	# 2to3, pydoc, pyvenv
+		"${scriptdir}/python-config" || die
+	# 2to3, pydoc
 	ln -s "../../../bin/2to3-${PYVER}" \
-		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
+		"${scriptdir}/2to3" || die
 	ln -s "../../../bin/pydoc${PYVER}" \
-		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
-	ln -s "../../../bin/pyvenv-${PYVER}" \
-		"${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
+		"${scriptdir}/pydoc" || die
 	# idle
 	if use tk; then
 		ln -s "../../../bin/idle${PYVER}" \
-			"${D}${PYTHON_SCRIPTDIR}/idle" || die
+			"${scriptdir}/idle" || die
 	fi
 }
 
@@ -428,11 +404,14 @@ pkg_preinst() {
 }
 
 eselect_python_update() {
-	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+	if [[ -z "$(eselect python show)" || \
+			! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
 		eselect python update
 	fi
 
-	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+	if [[ -z "$(eselect python show --python${PV%%.*})" || \
+			! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]
+	then
 		eselect python update --python${PV%%.*}
 	fi
 }


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2022-04-10  7:37 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2022-04-10  7:37 UTC (permalink / raw
  To: gentoo-commits

commit:     c2569fb9d45b3d5b8544cadbeafbd1dd07780b60
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 10 07:37:18 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Apr 10 07:37:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=c2569fb9

dev-lang/python-3.10.4: version bump, drop 2.7

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-lang/python/Manifest                           |   8 +-
 .../python-2.7.10-cross-compile-warn-test.patch    |  24 -
 .../python/files/python-2.7.10-system-libffi.patch |  36 --
 .../files/python-2.7.14-libffi-pkgconfig.patch     |  44 --
 .../files/python-2.7.5-nonfatal-compileall.patch   |  18 -
 .../files/python-2.7.9-ncurses-pkg-config.patch    |  13 -
 dev-lang/python/files/python-3.4-pyfpe-dll.patch   |  24 -
 dev-lang/python/metadata.xml                       |   8 +-
 dev-lang/python/python-2.7.16.ebuild               | 612 ---------------------
 dev-lang/python/python-3.10.4.ebuild               | 480 ++++++++++++++++
 10 files changed, 489 insertions(+), 778 deletions(-)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index c5e846887a..f18ad79618 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,12 +1,12 @@
-DIST Python-2.7.16.tar.xz 12752104 BLAKE2B 7d6b5b853f9974d44e04dd35ecdffaab87511e183b4b01dd4f8f4ee109c4b4ab208f045708f69717be9d3a706aa078b71438ed482c062c0b89c12730eae074ae SHA512 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
+DIST Python-3.10.4.tar.xz 19342692 BLAKE2B c430ad9bed71729fda29433af0614b6c0110a85e23f4cb5cff3a9b501febe99b20094367a5428f256fb3aeef97f34d439ef677fc8ae4d596d52da7976b65ebb5 SHA512 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113
+DIST Python-3.10.4.tar.xz.asc 833 BLAKE2B 289f2e96bfc2b60c4ae94b1591779d604f203890c4f5db2ee16e305bf03c6ddb9c8d6da4471a06b5943e12888f37ca572ea30876e9a80382a26814f66b41b7bf SHA512 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d
 DIST Python-3.8.8.tar.xz 18271736 BLAKE2B af0ff1acd919b365a58278e82678324ff884cc8120bcaf12e0e3afb1bd978e6469e256335df131935f51ff481fb83dda04e4b6f1cd1746611f9ec944db73d692 SHA512 64181db5aa48281284a3230436ebfb8cb91b645a9dec956fd48c0048334498477073fc4e14d6b426d0ef7fbcdcfd5d59cbf01a504e6c9014dc9529494b9309fb
 DIST Python-3.8.8.tar.xz.asc 833 BLAKE2B a11188f9f68c518259de1a4e271bf56409d7356a7eb3dd8cbea7bbb0b5bc1b43f9aeb85bda4add65bbae906bef65cb20a30bcc77da04c0d383cd5b527821fd85 SHA512 0e6f11a310c1796dd056d9a4b63b5e03aa8dbd290088966e04a590a78c00003887dbfd7a7029a6cf8c5626ecd6ca91c1c16433bb0a41bf1225b02b8db8541b95
 DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1
 DIST Python-3.9.6.tar.xz.asc 833 BLAKE2B 41901bfb80a901f2f14e86769e6d08ded8f75656d347201345183162e180e61442da871a1067572a54da579551166a19bf5436e51581bb10cb78afc4d28773fc SHA512 0673c8833f302c829bfde97453c52744f6aa99b4a72520f4cc384d4aa9d6ffd28a1407ceafb0a1ec4462b3aa74b656bf39c67872c4e6a131429ea58c47ad0ecc
-DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd
+DIST python-gentoo-patches-3.10.4.tar.xz 8592 BLAKE2B 67fba3e1fedb17430e5cd93da995b4acaf714db512031b5a2f775a25f793f007941561663cfa413d645ccddc2e22d65d250a40fa166cafda8805488d877ff57d SHA512 3ed2b8ff8f1eb8febe7dcd4b5d13d6d54468be1d525f8f1118977d3bbc78f690a597b09383939d023b03380a306e4bff1693382e29ff562312d803305b1709b2
 DIST python-gentoo-patches-3.8.8_p1.tar.xz 15456 BLAKE2B 7d9f55f951f97ef7e08d0245dddd21f5b8d126735c1c392ba6326ad1c18023b477f62e9b6663d8e5b6f0362e442137d0b6ed3ea13b279cca6734d36dbe6e654f SHA512 7fff74d03a0c4cd4b5c977761179c2b9a0ed472847ee9544f54331cef7549557ac4d6b78e676058bd2b01c96ca59d84f04c55beca8ddc45f16b11ce349210eea
 DIST python-gentoo-patches-3.9.6_p1.tar.xz 12764 BLAKE2B 927718f1aadb5d5ef67e647a639a10bffdd48474bf01e50bd37ef1242bce57606b7b54c4823c1da3585ee76e737028163e38e9b4e19037585cc53f925e1c5fa7 SHA512 f06fb55786bd942e72e3225ee9ce218724aeee29f301279743588749007e991851a8f29db5b5dfd85435e3d763c00942947909a6fc60581bd0f3e8a6e913bff8
-DIST python-prefix-2.7.16-gentoo-patches-r0.tar.xz 14636 BLAKE2B 54320f5197bb7adeca1e7c97447253e6535a11f380b6d66bc2ce46fa671fe23697aced8fd5619633a00e3ea19ae9dbc3ffe2981173d83dcab6b447d514555c43 SHA512 5380d9b92eb81603ec4d60ff9c940a3a061c06bd6f593d5837e600da5d4417b529d20d98d758aa95cef18fac10bdb5c33f90fa943deb15fdaf048492cf286581
+DIST python-prefix-gentoo-3.10.4-patches-r0.tar.xz 6772 BLAKE2B b807ae02242926d99c3823b73ce33193926d55891d54b5d214b4bdf24d2213b4d7b248030146a01698ceadd255affffef8937d84fc11e6d587ffcc91286e81b2 SHA512 a8f16d12b785a4b9ca884e4235cb298e4155273534a7957e517a679f0c2d4b35dcca08e445bed3fe2a80e3a6441f04004eae955a362eb1091ac1f9e2b9a5448f
 DIST python-prefix-gentoo-3.8.7-patches-r2.tar.xz 8312 BLAKE2B 268f3cff62dc51d4f91994c3f6b05cea0e29edb1ccf39476ba52485fb94c3cad72b54ed5cd941c227bdad004a7ae0069d60ee6bbde5a30d16115263d0dc2a5c3 SHA512 e43ce1e9e851bebce968ee025f765fc9a558c8edc4ee2d51616043183fd12301ab3d5c7f92915238e53b5cf92f6c00617ab0fcf9859d4cebe0966271e6f64725
 DIST python-prefix-gentoo-3.9.6_p1-patches-r0.tar.xz 6984 BLAKE2B 8b032d3000fd2dfcb8e099ac071c1a911ba2a0e30343788f7191043800f9d0088307cd7007b2b3f6cc7d2f315fc22bbac5990fed81f0dd8d60dca0314bd59b88 SHA512 76c56895c99ee203bd266f475766d2572659939abaf478932e7c9c65ddc52cb5e012e23c9455dd0a4bf0281a07c70e23a2fea8337c693b8a4ac8abb534e21982
-DIST python2-cygwinports-7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd16650cb5fc4a2c54fdac0228326f25cfba4fcd098ac9d689312d3e0dde6fca57f720d5235361d6462461cf018325c23fda9139e0f1683055aff SHA512 cabc21d2d7379daf1f4bafe7ab00b70e5b4f707d3102496b96ff0dfdced26347097ad771c69e0b9488b7c54b1ef36f9bc019bee72f1ffcbb55dcd0e71095edfe

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
deleted file mode 100644
index 38433de925..0000000000
--- a/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-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
deleted file mode 100644
index 0b49b794bd..0000000000
--- a/dev-lang/python/files/python-2.7.10-system-libffi.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-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.14-libffi-pkgconfig.patch b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
deleted file mode 100644
index 85abb1b56b..0000000000
--- a/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -u -r Python-2.7.5-orig//configure.ac Python-2.7.5/configure.ac
---- Python-2.7.5-orig//configure.ac	2014-03-06 04:35:31.000000000 +0100
-+++ Python-2.7.5/configure.ac	2014-03-06 04:58:10.000000000 +0100
-@@ -2300,10 +2300,13 @@
- 
- if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
-     LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
-+    LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
- else
-     LIBFFI_INCLUDEDIR=""
-+    LIBFFI_LIB=""
- fi
- AC_SUBST(LIBFFI_INCLUDEDIR)
-+AC_SUBST(LIBFFI_LIB)
- 
- AC_MSG_RESULT($with_system_ffi)
- 
-diff -u -r Python-2.7.5-orig//Makefile.pre.in Python-2.7.5/Makefile.pre.in
---- Python-2.7.5-orig//Makefile.pre.in	2014-03-06 04:35:31.000000000 +0100
-+++ Python-2.7.5/Makefile.pre.in	2014-03-06 05:03:59.000000000 +0100
-@@ -224,6 +224,7 @@
- 
- 
- LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
-+LIBFFI_LIB=	@LIBFFI_LIB@
- 
- ##########################################################################
- # Parser
-diff -u -r Python-2.7.5-orig//setup.py Python-2.7.5/setup.py
---- Python-2.7.5-orig//setup.py	2014-03-06 04:35:31.000000000 +0100
-+++ Python-2.7.5/setup.py	2014-03-06 04:56:15.000000000 +0100
-@@ -1893,8 +1893,10 @@
-                     ffi_inc = None
-                     print('Header file {} does not define LIBFFI_H or '
-                           'ffi_wrapper_h'.format(ffi_h))
--        ffi_lib = None
--        if ffi_inc is not None:
-+        ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
-+        if not ffi_lib or ffi_lib == '':
-+            ffi_lib = None
-+        if ffi_inc is not None and ffi_lib is None:
-             for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
-                 if (self.compiler.find_library_file(lib_dirs, lib_name)):
-                     ffi_lib = lib_name

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
deleted file mode 100644
index a762dfb108..0000000000
--- a/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-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
deleted file mode 100644
index 38ce6f78b9..0000000000
--- a/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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-pyfpe-dll.patch b/dev-lang/python/files/python-3.4-pyfpe-dll.patch
deleted file mode 100644
index 401529d830..0000000000
--- a/dev-lang/python/files/python-3.4-pyfpe-dll.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- Python-3.4.3/Include/pyfpe.h
-+++ Python-3.4.3/Include/pyfpe.h
-@@ -129,9 +129,9 @@
- #include <signal.h>
- #include <setjmp.h>
- #include <math.h>
--extern jmp_buf PyFPE_jbuf;
--extern int PyFPE_counter;
--extern double PyFPE_dummy(void *);
-+PyAPI_DATA(jmp_buf) PyFPE_jbuf;
-+PyAPI_DATA(int) PyFPE_counter;
-+PyAPI_FUNC(double) PyFPE_dummy(void *);
- 
- #define PyFPE_START_PROTECT(err_string, leave_stmt) \
- if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \
---- Python-3.4.3/Python/pyfpe.c
-+++ Python-3.4.3/Python/pyfpe.c
-@@ -1,5 +1,4 @@
--#include "pyconfig.h"
--#include "pyfpe.h"
-+#include "Python.h"
- /* 
-  * The signal handler for SIGFPE is actually declared in an external
-  * module fpectl, or as preferred by the user.  These variable

diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml
index 6a4ebd8b87..54c2aa9734 100644
--- a/dev-lang/python/metadata.xml
+++ b/dev-lang/python/metadata.xml
@@ -1,13 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 <maintainer type="project">
 	<email>python@gentoo.org</email>
 	<name>Python</name>
 </maintainer>
 <use>
-	<flag name="threads">Enable threading support. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING)</flag>
-	<flag name="wide-unicode">Enable wide Unicode implementation which uses 4-byte Unicode characters. Switching of this USE flag changes ABI of Python and requires reinstallation of many Python modules. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING)</flag>
+	<flag name="bluetooth">Build Bluetooth protocol support in socket module</flag>
+	<flag name="libedit">Link readline extension against <pkg>dev-libs/libedit</pkg> instead of <pkg>sys-libs/readline</pkg>.</flag>
+	<flag name="pgo">Optimize the build using Profile Guided Optimization (PGO)</flag>
+	<flag name="lto">Optimize the build using Link Time Optimization (LTO)</flag>
 	<flag name="wininst">Install Windows executables required to create an executable installer for MS Windows.</flag>
 </use>
 </pkgmetadata>

diff --git a/dev-lang/python/python-2.7.16.ebuild b/dev-lang/python/python-2.7.16.ebuild
deleted file mode 100644
index 155e466d96..0000000000
--- a/dev-lang/python/python-2.7.16.ebuild
+++ /dev/null
@@ -1,612 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-WANT_LIBTOOL="none"
-
-inherit autotools eutils flag-o-matic pax-utils python-utils-r1 toolchain-funcs
-
-MY_P="Python-${PV}"
-PATCHSET_VERSION="2.7.16"
-PREFIX_PATCHREV="r0"
-CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
-
-DESCRIPTION="An interpreted, interactive, object-oriented programming language"
-HOMEPAGE="https://www.python.org/"
-SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
-	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
-	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
-
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-SRC_URI+=" elibc_Cygwin? (
-	https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip
-	-> python2-cygwinports-${CYGWINPORTS_GITREV}.zip )"
-
-LICENSE="PSF-2"
-SLOT="2.7"
-KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="aqua -berkdb bluetooth build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
-
-# Do not add a dependency on dev-lang/python to this ebuild.
-# If you need to apply a patch which requires python for bootstrapping, please
-# run the bootstrap code on your dev box and include the results in the
-# patchset. See bug 447752.
-
-RDEPEND="app-arch/bzip2:0=
-	>=sys-libs/zlib-1.1.3:0=
-	virtual/libffi
-	virtual/libintl
-	berkdb? ( || (
-		sys-libs/db:5.3
-		sys-libs/db:5.1
-		sys-libs/db:4.8
-		sys-libs/db:4.7
-		sys-libs/db:4.6
-		sys-libs/db:4.5
-		sys-libs/db:4.4
-		sys-libs/db:4.3
-		sys-libs/db:4.2
-	) )
-	gdbm? ( sys-libs/gdbm:0=[berkdb] )
-	ncurses? ( >=sys-libs/ncurses-5.2:0= )
-	readline? ( >=sys-libs/readline-4.1:0= )
-	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
-	ssl? ( dev-libs/openssl:0= )
-	tk? (
-		>=dev-lang/tcl-8.0:0=
-		>=dev-lang/tk-8.0:0=[-aqua]
-		dev-tcltk/blt:0=
-		dev-tcltk/tix
-	)
-	xml? ( >=dev-libs/expat-2.1 )
-	!!<sys-apps/portage-2.1.9"
-# bluetooth requires headers from bluez
-DEPEND="${RDEPEND}
-	bluetooth? ( net-wireless/bluez )
-	virtual/pkgconfig
-	>=sys-devel/autoconf-2.65
-	!sys-devel/gcc[libffi(-)]"
-RDEPEND+=" !build? ( app-misc/mime-types )
-	doc? ( dev-python/python-docs:${SLOT} )"
-PDEPEND=">=app-eselect/eselect-python-20140125-r1"
-
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
-	if use berkdb; then
-		ewarn "'bsddb' module is out-of-date and no longer maintained inside"
-		ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
-		ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
-		ewarn "is provided by dev-python/bsddb3."
-	else
-		if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
-			ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
-			ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
-			ewarn "You might need to migrate your databases."
-		fi
-	fi
-}
-
-src_prepare() {
-	# Ensure that internal copies of expat, libffi and zlib are not used.
-	rm -r Modules/expat || die
-	rm -r Modules/_ctypes/libffi* || die
-	rm -r Modules/zlib || die
-
-	if tc-is-cross-compiler; then
-		rm "${WORKDIR}/patches/0006-Regenerate-platform-specific-modules.patch" || die
-	fi
-
-	local PATCHES=(
-		"${WORKDIR}/patches"
-		# Fix for cross-compiling.
-		"${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
-		"${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
-		"${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
-		"${FILESDIR}/python-2.7.10-system-libffi.patch"
-	)
-
-	default
-
-	# Prefix' round of patches
-	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
-		epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
-	epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
-	# Make sure python doesn't use the host libffi.
-	use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
-
-	if use aqua ; then
-		# make sure we don't get a framework reference here
-		sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
-			-e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
-			Makefile.pre.in || die
-		# Python upstream refuses to listen to configure arguments
-		sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \
-			configure.ac configure || die
-		# we handle creation of symlinks in src_install
-		sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die
-		# build the Python framework without DESTDIR in install_name
-		sed -i -e '/-install_name/s/$(DESTDIR)//' Makefile.pre.in || die
-	fi
-	# don't try to do fancy things on Darwin
-	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
-	# fix header standards conflicts on Solaris
-	if [[ ${CHOST} == *-solaris* ]] ; then
-		# GCC5 switched the default from gnu89 to gnu11, a standards
-		# conflict arises from that, which can be solved by upgrading
-		# _XOPEN_SOURCE from 500 to 600, but since it is compiler
-		# version specific, just force the old standard onto the
-		# compiler.  Python 3 properly detects this.
-		CC="$(tc-getCC) -std=gnu89"
-	fi
-
-	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
-	    local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
-	    for p in $(
-		    eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
-		    echo ${PATCH_URI}
-	    ); do
-			# dropped by 01_all_prefix-no-patch-invention.patch
-			[[ ${p} == *-tkinter-* ]] && continue
-		    epatch "${d}/${p}"
-	    done
-	fi
-
-	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
-		Lib/distutils/command/install.py \
-		Lib/distutils/sysconfig.py \
-		Lib/site.py \
-		Lib/sysconfig.py \
-		Lib/test/test_site.py \
-		Makefile.pre.in \
-		Modules/Setup.dist \
-		Modules/getpath.c \
-		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
-
-	eautoreconf
-}
-
-src_configure() {
-		# dbm module can be linked against berkdb or gdbm.
-		# Defaults to gdbm when both are enabled, #204343.
-		local disable
-		use berkdb   || use gdbm || disable+=" dbm"
-		use berkdb   || disable+=" _bsddb"
-		# disable automagic bluetooth headers detection
-		use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
-		use gdbm     || disable+=" gdbm"
-		use ncurses  || disable+=" _curses _curses_panel"
-		use readline || disable+=" readline"
-		use sqlite   || disable+=" _sqlite3"
-		use ssl      || export PYTHON_DISABLE_SSL="1"
-		use tk       || disable+=" _tkinter"
-		use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
-		[[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
-		[[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs"
-		export PYTHON_DISABLE_MODULES="${disable}"
-
-		if ! use xml; then
-			ewarn "You have configured Python without XML support."
-			ewarn "This is NOT a recommended configuration as you"
-			ewarn "may face problems parsing any XML documents."
-		fi
-
-	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
-		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
-	fi
-
-	if [[ "$(gcc-major-version)" -ge 4 ]]; then
-		append-flags -fwrapv
-	fi
-
-	filter-flags -malign-double
-
-	# https://bugs.gentoo.org/show_bug.cgi?id=50309
-	if is-flagq -O3; then
-		is-flagq -fstack-protector-all && replace-flags -O3 -O2
-		use hardened && replace-flags -O3 -O2
-	fi
-
-	if tc-is-cross-compiler; then
-		# Force some tests that try to poke fs paths.
-		export ac_cv_file__dev_ptc=no
-		export ac_cv_file__dev_ptmx=yes
-	fi
-
-	# http://bugs.gentoo.org/show_bug.cgi?id=302137
-	if [[ ${CHOST} == powerpc-*-darwin* ]] && \
-		( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \
-		[[ ${CHOST} == powerpc64-*-darwin* ]];
-	then
-		replace-flags -O2 -O3
-		replace-flags -Os -O3  # comment #14
-	fi
-
-	# Export CC so even AIX will use gcc instead of xlc_r.
-	# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
-	tc-export CC CXX
-	# The configure script fails to use pkg-config correctly.
-	# http://bugs.python.org/issue15506
-	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
-
-	# Set LDFLAGS so we link modules with -lpython2.7 correctly.
-	# Needed on FreeBSD unless Python 2.7 is already installed.
-	# Please query BSD team before removing this!
-	# On AIX this is not needed, but would record '.' as runpath.
-	append-ldflags "-L."
-
-	if use prefix ; then
-		# for Python's setup.py not to do false assumptions (only looking in
-		# host paths) we need to make explicit where Prefix stuff is
-		append-cppflags -I"${EPREFIX}"/usr/include
-		append-ldflags -L"${EPREFIX}"/$(get_libdir)
-		append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
-		# fix compilation on some Linux hosts, #381163, #473520
-		if use elibc_glibc ; then
-			for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
-				[[ -d ${hostlibdir} ]] || continue
-				append-ldflags -L${hostlibdir}
-			done
-		fi
-		# Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that
-		# local include paths - set in $(CPPFLAGS) - are searched first.
-		sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
-	fi
-
-	local dbmliborder
-	if use gdbm; then
-		dbmliborder+="${dbmliborder:+:}gdbm"
-	fi
-	if use berkdb; then
-		dbmliborder+="${dbmliborder:+:}bdb"
-	fi
-
-	# we need this to get pythonw, the GUI version of python
-	# --enable-framework and --enable-shared are mutually exclusive:
-	# http://bugs.python.org/issue5809
-	local myshared=
-	use aqua \
-		&& myshared="--enable-framework=${EPREFIX}/usr/lib" \
-		|| myshared="--enable-shared"
-
-	# note: for a framework build we need to use ucs2 because macOS
-	# uses that internally too:
-	# http://bugs.python.org/issue763708
-	local myeconfargs=(
-		--with-fpectl
-		${myshared}
-		$(use_enable ipv6)
-		$(use_with threads)
-		$( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
-		--infodir='${prefix}/share/info'
-		--mandir='${prefix}/share/man'
-		--with-computed-gotos
-		--with-dbmliborder="${dbmliborder}"
-		--with-libc=
-		--enable-loadable-sqlite-extensions
-		--with-system-expat
-		--with-system-ffi
-		--without-ensurepip
-	)
-
-	# we need to build in a separate dir to avoid problems due to
-	# case-insensitivity on Darwin
-	BUILD_DIR="${WORKDIR}/${CHOST}"
-	mkdir -p "${BUILD_DIR}" || die
-	cd "${BUILD_DIR}" || die
-
-	ECONF_SOURCE="${S}" OPT= econf "${myeconfargs[@]}"
-
-	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
-		eerror "configure has detected that the sem_open function is broken."
-		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
-		die "Broken sem_open function (bug 496328)"
-	fi
-}
-
-src_compile() {
-	# Avoid invoking pgen for cross-compiles.
-	touch Include/graminit.h Python/graminit.c
-
-	cd "${BUILD_DIR}" || die
-	emake
-
-	# Work around bug 329499. See also bug 413751 and 457194.
-	if has_version dev-libs/libffi[pax_kernel]; then
-		pax-mark E python
-	else
-		pax-mark m python
-	fi
-}
-
-src_test() {
-	# Tests will not work when cross compiling.
-	if tc-is-cross-compiler; then
-		elog "Disabling tests due to crosscompiling."
-		return
-	fi
-
-	cd "${BUILD_DIR}" || die
-
-	# Skip failing tests.
-	local skipped_tests="distutils gdb"
-
-	for test in ${skipped_tests}; do
-		mv "${S}"/Lib/test/test_${test}.py "${T}"
-	done
-
-	# bug 660358
-	local -x COLUMNS=80
-
-	# Daylight saving time problem
-	# https://bugs.python.org/issue22067
-	# https://bugs.gentoo.org/610628
-	local -x TZ=UTC
-
-	# Rerun failed tests in verbose mode (regrtest -w).
-	emake test EXTRATESTOPTS="-w" < /dev/tty
-	local result="$?"
-
-	for test in ${skipped_tests}; do
-		mv "${T}/test_${test}.py" "${S}"/Lib/test
-	done
-
-	elog "The following tests have been skipped:"
-	for test in ${skipped_tests}; do
-		elog "test_${test}.py"
-	done
-
-	elog "If you would like to run them, you may:"
-	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
-	elog "and run the tests separately."
-
-	if [[ "${result}" -ne 0 ]]; then
-		die "emake test failed"
-	fi
-}
-
-src_install() {
-	local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
-
-	cd "${BUILD_DIR}" || die
-	if use aqua ; then
-		local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework
-
-		# do not make multiple targets in parallel when there are broken
-		# sharedmods (during bootstrap), would build them twice in parallel.
-
-		# Python_Launcher is kind of a wrapper, and we should fix it for
-		# Prefix (it uses /usr/bin/pythonw) so useless
-		# IDLE doesn't run, no idea, but definitely not used
-		sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
-			Mac/Makefile || die
-
-		# let the makefiles do their thing
-		emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
-		rmdir "${ED}"/Applications/Python* || die
-		rmdir "${ED}"/Applications || die
-
-		# avoid framework incompatibility, degrade to a normal UNIX lib
-		mkdir -p "${ED}"/usr/$(get_libdir)
-		cp "${D}${fwdir}"/Versions/${SLOT}/Python \
-			"${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
-		chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
-		install_name_tool \
-			-id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
-			"${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
-		chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
-		cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
-
-		# rebuild python executable to be the non-pythonw (python wrapper)
-		# version so we don't get framework crap
-		rm "${ED}"/usr/bin/python${SLOT}  # drop existing symlink, bug #390861
-		$(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
-			-o "${ED}"/usr/bin/python${SLOT} \
-			Modules/python.o || die
-
-		# don't install the "Current" symlink, will always conflict
-		rm "${D}${fwdir}"/Versions/Current || die
-		# update whatever points to it, eselect-python sets them
-		rm "${D}${fwdir}"/{Headers,Python,Resources} || die
-
-		# remove unversioned files (that are not made versioned below)
-		pushd "${ED}"/usr/bin > /dev/null
-		rm -f python python-config python${SLOT}-config
-		# python${SLOT} was created above
-		for f in pythonw smtpd${SLOT}.py pydoc idle ; do
-			rm -f ${f} ${f}${SLOT}
-		done
-		# pythonw needs to remain in the framework (that's the whole
-		# reason we go through this framework hassle)
-		ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
-		# copy the scripts to we can fix their shebangs
-		for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
-			# for some reason sometimes they already exist, bug #347321
-			rm -f ${f}
-			cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
-			sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
-				${f} || die
-		done
-		# "fix" to have below collision fix not to bail
-		mv pydoc${SLOT} pydoc || die
-		mv idle${SLOT} idle || die
-		popd > /dev/null
-
-		# basically we don't like the framework stuff at all, so just move
-		# stuff around or add some symlinks to make our life easier
-		mkdir -p "${ED}"/usr
-		mv "${D}${fwdir}"/Versions/${SLOT}/share \
-			"${ED}"/usr/ || die "can't move share"
-		# get includes just UNIX style
-		mkdir -p "${ED}"/usr/include
-		mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
-			"${ED}"/usr/include/ || die "can't move include"
-		pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
-		ln -s ../../../../../include/python${SLOT} || die
-		popd > /dev/null
-		rm -f "${ED}"/usr/share/man/man1/python{,2}.1
-
-		# same for libs
-		# NOTE: can't symlink the entire dir, because a real dir already exists
-		# on upgrade (site-packages), however since we h4x0rzed python to
-		# actually look into the UNIX-style dir, we just switch them around.
-		mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
-		mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
-			"${ED}"/usr/$(get_libdir)/python${SLOT}/ \
-			|| die "can't move python${SLOT}"
-		rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
-		pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
-		ln -s ../../../../python${SLOT} || die
-		popd > /dev/null
-
-		# fix up Makefile
-		sed -i \
-			-e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
-			-e '/^LDFLAGS=/s/=.*$/=/' \
-			-e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
-			-e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
-			-e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
-			-e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
-			-e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
-			-e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
-			"${libdir}"/config/Makefile || die
-		# and sysconfigdata likewise
-		sed -i \
-			-e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
-			-e "/'LDFLAGS'/s/:.*$/:'',/" \
-			-e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
-			-e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
-			-e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
-			-e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
-			-e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
-			-e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
-			"${libdir}"/_sysconfigdata.py || die
-
-		# add missing version.plist file
-		mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
-		cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>BuildVersion</key>
-	<string>1</string>
-	<key>CFBundleShortVersionString</key>
-	<string>${PV}</string>
-	<key>CFBundleVersion</key>
-	<string>${PV}</string>
-	<key>ProjectName</key>
-	<string>Python</string>
-	<key>SourceVersion</key>
-	<string>${PV}</string>
-</dict>
-</plist>
-EOF
-	else
-		emake DESTDIR="${D}" altinstall
-	fi
-
-	sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
-
-	# Fix collisions between different slots of Python.
-	mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
-	mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
-	mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
-	rm -f "${ED}usr/bin/smtpd.py"
-
-	# http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
-	# These #defines cause problems when building c99 compliant python modules
-	# http://bugs.python.org/issue1759169
-	[[ ${CHOST} == *-solaris* ]] && sed -i -e \
-		's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
-		"${ED}"/usr/include/python${SLOT}/pyconfig.h
-
-	use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
-	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
-	use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
-	use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
-
-	use threads || rm -r "${libdir}/multiprocessing" || die
-	use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
-
-	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
-
-	if use examples; then
-		insinto /usr/share/doc/${PF}/examples
-		doins -r "${S}"/Tools
-	fi
-	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
-	local libname
-	if use aqua ; then
-		# we do framework, so the emake trick below returns a pathname
-		# since that won't work here, use a (cheap) trick instead
-		libname=libpython${SLOT}
-	else
-		libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
-			emake --no-print-directory -s -f - 2>/dev/null)
-	fi
-	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
-
-	newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
-	newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
-	sed \
-		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
-		-e "s:@PYDOC@:pydoc${SLOT}:" \
-		-i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
-
-	# for python-exec
-	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
-
-	# if not using a cross-compiler, use the fresh binary
-	if ! tc-is-cross-compiler; then
-		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
-		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
-		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
-		local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}"
-	else
-		vars=( PYTHON "${vars[@]}" )
-	fi
-
-	python_export "python${SLOT}" "${vars[@]}"
-	echo "EPYTHON='${EPYTHON}'" > epython.py || die
-	python_domodule epython.py
-
-	# python-exec wrapping support
-	local pymajor=${SLOT%.*}
-	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
-	# python and pythonX
-	ln -s "../../../bin/python${SLOT}" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
-	ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
-	# python-config and pythonX-config
-	ln -s "../../../bin/python${SLOT}-config" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
-	ln -s "python${pymajor}-config" "${D}${PYTHON_SCRIPTDIR}/python-config" || die
-	# 2to3, pydoc, pyvenv
-	ln -s "../../../bin/2to3-${SLOT}" "${D}${PYTHON_SCRIPTDIR}/2to3" || die
-	ln -s "../../../bin/pydoc${SLOT}" "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
-	# idle
-	if use tk; then
-		ln -s "../../../bin/idle${SLOT}" "${D}${PYTHON_SCRIPTDIR}/idle" || die
-	fi
-}
-
-eselect_python_update() {
-	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
-		eselect python update
-	fi
-
-	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
-		eselect python update --python${PV%%.*}
-	fi
-}
-
-pkg_postinst() {
-	eselect_python_update
-}
-
-pkg_postrm() {
-	eselect_python_update
-}

diff --git a/dev-lang/python/python-3.10.4.ebuild b/dev-lang/python/python-3.10.4.ebuild
new file mode 100644
index 0000000000..8e49381d8b
--- /dev/null
+++ b/dev-lang/python/python-3.10.4.ebuild
@@ -0,0 +1,480 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+WANT_LIBTOOL="none"
+
+inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
+	python-utils-r1 toolchain-funcs verify-sig
+
+MY_PV=${PV/_rc/rc}
+MY_P="Python-${MY_PV%_p*}"
+PYVER=$(ver_cut 1-2)
+PATCHSET="python-gentoo-patches-${MY_PV}"
+PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV}-patches-r0"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="
+	https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz
+	https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
+	https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz
+	verify-sig? (
+		https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc
+	)
+"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="PSF-2"
+SLOT="${PYVER}"
+KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="aqua bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
+RESTRICT="!test? ( test )"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="
+	app-arch/bzip2:=
+	app-arch/xz-utils:=
+	dev-lang/python-exec[python_targets_python3_10(-)]
+	dev-libs/libffi:=
+	kernel_linux? ( sys-apps/util-linux:= )
+	>=sys-libs/zlib-1.1.3:=
+	virtual/libcrypt:=
+	virtual/libintl
+	gdbm? ( sys-libs/gdbm:=[berkdb] )
+	ncurses? ( >=sys-libs/ncurses-5.2:= )
+	readline? (
+		!libedit? ( >=sys-libs/readline-4.1:= )
+		libedit? ( dev-libs/libedit:= )
+	)
+	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+	ssl? ( >=dev-libs/openssl-1.1.1:= )
+	tk? (
+		>=dev-lang/tcl-8.0:=
+		>=dev-lang/tk-8.0:=
+		dev-tcltk/blt:=
+		dev-tcltk/tix
+	)
+	xml? ( >=dev-libs/expat-2.1:= )
+	!!<sys-apps/sandbox-2.21
+"
+# bluetooth requires headers from bluez
+DEPEND="
+	${RDEPEND}
+	bluetooth? ( net-wireless/bluez )
+	test? ( app-arch/xz-utils[extra-filters(+)] )
+"
+# autoconf-archive needed to eautoreconf
+BDEPEND="
+	sys-devel/autoconf-archive
+	virtual/awk
+	virtual/pkgconfig
+	verify-sig? ( sec-keys/openpgp-keys-python )
+	!sys-devel/gcc[libffi(-)]
+"
+RDEPEND+="
+	build? ( app-misc/mime-types )
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
+
+# large file tests involve a 2.5G file being copied (duplicated)
+CHECKREQS_DISK_BUILD=5500M
+
+pkg_pretend() {
+	use test && check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+	use test && check-reqs_pkg_setup
+}
+
+src_unpack() {
+	if use verify-sig; then
+		verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
+	fi
+	default
+}
+
+src_prepare() {
+	# Ensure that internal copies of expat, libffi and zlib are not used.
+	rm -fr Modules/expat || die
+	rm -fr Modules/_ctypes/libffi* || die
+	rm -fr Modules/zlib || die
+
+	local PATCHES=(
+		"${WORKDIR}/${PATCHSET}"
+		# Prefix' round of patches
+		"${WORKDIR}"/${PREFIX_PATCHSET}
+	)
+
+	default
+
+	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+	# force correct number of jobs
+	# https://bugs.gentoo.org/737660
+	local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+	sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
+	sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
+
+	# workaround a problem on ppc-macos with >=GCC-8 where dtoa gets
+	# miscompiled when optimisation is being used
+	if [[ ${CHOST} == powerpc*-darwin* ]] && \
+		tc-is-gcc && [[ $(gcc-major-version) -ge 8 ]] ;
+	then
+		sed -i \
+			-e '/^CFLAGS_ALIASING=/s/$/ -fno-tree-ter/' Makefile.pre.in || die
+	fi
+
+	# Darwin 9's kqueue seems to act up (at least at this stage), so
+	# make Python's selectors resort to poll() or select()
+	if [[ ${CHOST} == powerpc*-darwin9 ]] ; then
+		sed -i \
+			-e 's/KQUEUE/KQUEUE_DISABLED/' \
+			configure.ac configure || die
+	fi
+
+	if [[ ${CHOST} == *-darwin19 ]] ; then
+		# HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH is set because
+		# _dyld_shared_cache_contains_path could be found, yet it cannot
+		# be resolved when dlopen()ing, so simply pretend it doesn't
+		# exist here
+		sed -i \
+			-e 's/_dyld_shared_cache_contains_path/disabled&/' \
+			configure.ac configure || die
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	local disable
+	# disable automagic bluetooth headers detection
+	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+	use gdbm      || disable+=" gdbm"
+	use ncurses   || disable+=" _curses _curses_panel"
+	use readline  || disable+=" readline"
+	use sqlite    || disable+=" _sqlite3"
+	use ssl       || export PYTHON_DISABLE_SSL="1"
+	use tk        || disable+=" _tkinter"
+	use xml       || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+	export PYTHON_DISABLE_MODULES="${disable}"
+
+	if ! use xml; then
+		ewarn "You have configured Python without XML support."
+		ewarn "This is NOT a recommended configuration as you"
+		ewarn "may face problems parsing any XML documents."
+	fi
+
+	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+	fi
+
+	if [[ "$(gcc-major-version)" -ge 4 ]]; then
+		append-flags -fwrapv
+	fi
+
+	filter-flags -malign-double
+
+	# https://bugs.gentoo.org/show_bug.cgi?id=50309
+	if is-flagq -O3; then
+		is-flagq -fstack-protector-all && replace-flags -O3 -O2
+		use hardened && replace-flags -O3 -O2
+	fi
+
+	# https://bugs.gentoo.org/700012
+	if is-flagq -flto || is-flagq '-flto=*'; then
+		append-cflags $(test-flags-CC -ffat-lto-objects)
+	fi
+
+	# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
+	tc-export CXX
+
+	# Fix implicit declarations on cross and prefix builds. Bug #674070.
+	use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
+	use prefix && append-ldflags -L"${ESYSROOT}"/lib -L"${ESYSROOT}"/usr/lib
+
+	local dbmliborder
+	if use gdbm; then
+		dbmliborder+="${dbmliborder:+:}gdbm"
+	fi
+
+	if use pgo; then
+		local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+		export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
+
+		# All of these seem to occasionally hang for PGO inconsistently
+		# They'll even hang here but be fine in src_test sometimes.
+		# bug #828535 (and related: bug #788022)
+		PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
+
+		if has_version "app-arch/rpm" ; then
+			# Avoid sandbox failure (attempts to write to /var/lib/rpm)
+			PROFILE_TASK+=" -x test_distutils"
+		fi
+	fi
+
+	if use aqua ; then
+		ECONF_SOURCE="${S}" OPT="" \
+		econf \
+			--enable-framework="${EPREFIX}" \
+			--config-cache
+	fi
+
+	# flock on 32-bits sparc Solaris is broken
+	[[ ${CHOST} == sparc-*-solaris* ]] && \
+		export ac_cv_flock_decl=no
+
+	local myeconfargs=(
+		# glibc-2.30 removes it; since we can't cleanly force-rebuild
+		# Python on glibc upgrade, remove it proactively to give
+		# a chance for users rebuilding python before glibc
+		# except on non-glibc systems this breaks the build, so be
+		# conservative!
+		$(use elibc_glibc && echo ac_cv_header_stropts_h=no)
+
+		$(use aqua && echo --config-cache)
+		--enable-shared
+		--without-static-libpython
+		--enable-ipv6
+		--infodir='${prefix}/share/info'
+		--mandir='${prefix}/share/man'
+		--with-computed-gotos
+		--with-dbmliborder="${dbmliborder}"
+		--with-libc=
+		--enable-loadable-sqlite-extensions
+		--without-ensurepip
+		--with-system-expat
+		--with-system-ffi
+
+		$(use_with lto)
+		$(use_enable pgo optimizations)
+		$(use_with readline readline "$(usex libedit editline readline)")
+	)
+
+	# disable implicit optimization/debugging flags
+	local -x OPT=
+	# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
+	# propagated to sysconfig for built extensions
+	local -x CFLAGS_NODIST=${CFLAGS}
+	local -x LDFLAGS_NODIST=${LDFLAGS}
+	local -x CFLAGS= LDFLAGS=
+
+	econf "${myeconfargs[@]}"
+
+	if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+		eerror "configure has detected that the sem_open function is broken."
+		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+		die "Broken sem_open function (bug 496328)"
+	fi
+}
+
+src_compile() {
+	# Ensure sed works as expected
+	# https://bugs.gentoo.org/594768
+	local -x LC_ALL=C
+	# Prevent using distutils bundled by setuptools.
+	# https://bugs.gentoo.org/823728
+	export SETUPTOOLS_USE_DISTUTILS=stdlib
+
+	# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
+	# end up writing bytecode & violating sandbox.
+	# bug #831897
+	local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
+
+	if use pgo ; then
+		# bug 660358
+		local -x COLUMNS=80
+		local -x PYTHONDONTWRITEBYTECODE=
+
+		addpredict /usr/lib/python3.10/site-packages
+	fi
+
+	# also need to clear the flags explicitly here or they end up
+	# in _sysconfigdata*
+	emake CPPFLAGS= CFLAGS= LDFLAGS=
+
+	# Restore saved value from above.
+	local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE}
+
+	# Work around bug 329499. See also bug 413751 and 457194.
+	if has_version dev-libs/libffi[pax-kernel]; then
+		pax-mark E python
+	else
+		pax-mark m python
+	fi
+}
+
+src_test() {
+	# Tests will not work when cross compiling.
+	if tc-is-cross-compiler; then
+		elog "Disabling tests due to crosscompiling."
+		return
+	fi
+
+	# Skip failing tests.
+	local skipped_tests="gdb"
+
+	if use sparc ; then
+		# bug #788022
+		skipped_tests+=" multiprocessing_fork"
+		skipped_tests+=" multiprocessing_forkserver"
+	fi
+
+	for test in ${skipped_tests}; do
+		mv "${S}"/Lib/test/test_${test}.py "${T}"
+	done
+
+	# bug 660358
+	local -x COLUMNS=80
+	local -x PYTHONDONTWRITEBYTECODE=
+	# workaround https://bugs.gentoo.org/775416
+	addwrite /usr/lib/python3.10/site-packages
+
+	local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+
+	emake test EXTRATESTOPTS="-u-network -j${jobs}" \
+		CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
+	local result=$?
+
+	for test in ${skipped_tests}; do
+		mv "${T}/test_${test}.py" "${S}"/Lib/test
+	done
+
+	elog "The following tests have been skipped:"
+	for test in ${skipped_tests}; do
+		elog "test_${test}.py"
+	done
+
+	elog "If you would like to run them, you may:"
+	elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
+	elog "and run the tests separately."
+
+	if [[ ${result} -ne 0 ]]; then
+		die "emake test failed"
+	fi
+}
+
+src_install() {
+	local libdir=${ED}/usr/lib/python${PYVER}
+
+	emake DESTDIR="${D}" altinstall
+
+	if use aqua ; then
+		# avoid config.status to be triggered
+		find Mac -name "Makefile" -exec touch \{\} + || die
+
+		# Python_Launcher is kind of a wrapper, and we should fix it for
+		# Prefix (it uses /usr/bin/pythonw) so useless
+		# IDLE doesn't run, no idea, but definitely not used
+		emake DESTDIR="${D}" -C Mac install_Python || die
+		rmdir "${ED}"/Applications/Python* || die
+		rmdir "${ED}"/Applications || die
+
+		local fwdir=/Frameworks/Python.framework/Versions/${PYVER}
+		ln -s "${EPREFIX}"/usr/include/python${PYVER} \
+			"${ED}${fwdir}"/Headers || die
+		ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
+			"${ED}${fwdir}"/Python || die
+	fi
+
+	# Fix collisions between different slots of Python.
+	rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die
+
+	# Cheap hack to get version with ABIFLAGS
+	local abiver=$(cd "${ED}/usr/include"; echo python*)
+	if [[ ${abiver} != python${PYVER} ]]; then
+		# Replace python3.X with a symlink to python3.Xm
+		rm "${ED}/usr/bin/python${PYVER}" || die
+		dosym "${abiver}" "/usr/bin/python${PYVER}"
+		# Create python3.X-config symlink
+		dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
+		# Create python-3.5m.pc symlink
+		dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
+	fi
+
+	# python seems to get rebuilt in src_install (bug 569908)
+	# Work around it for now.
+	if has_version dev-libs/libffi[pax-kernel]; then
+		pax-mark E "${ED}/usr/bin/${abiver}"
+	else
+		pax-mark m "${ED}/usr/bin/${abiver}"
+	fi
+
+	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
+	use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
+
+	dodoc Misc/{ACKS,HISTORY,NEWS}
+
+	if use examples; then
+		docinto examples
+		find Tools -name __pycache__ -exec rm -fr {} + || die
+		dodoc -r Tools
+	fi
+	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+	if use aqua ; then
+		# we do framework, so the emake trick below returns a pathname
+		# since that won't work here, use a (cheap) trick instead
+		local libname=libpython${PYVER}
+	else
+		local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+			emake --no-print-directory -s -f - 2>/dev/null)
+	fi
+	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+	newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
+	newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+	sed \
+		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+		-e "s:@PYDOC@:pydoc${PYVER}:" \
+		-i "${ED}/etc/conf.d/pydoc-${PYVER}" \
+		"${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+	local -x EPYTHON=python${PYVER}
+	# if not using a cross-compiler, use the fresh binary
+	if ! tc-is-cross-compiler; then
+		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
+	else
+		local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
+	fi
+
+	echo "EPYTHON='${EPYTHON}'" > epython.py || die
+	python_domodule epython.py
+
+	# python-exec wrapping support
+	local pymajor=${PYVER%.*}
+	local scriptdir=${D}$(python_get_scriptdir)
+	mkdir -p "${scriptdir}" || die
+	# python and pythonX
+	ln -s "../../../bin/${abiver}" \
+		"${scriptdir}/python${pymajor}" || die
+	ln -s "python${pymajor}" "${scriptdir}/python" || die
+	# python-config and pythonX-config
+	# note: we need to create a wrapper rather than symlinking it due
+	# to some random dirname(argv[0]) magic performed by python-config
+	cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
+		#!/bin/sh
+		exec "${abiver}-config" "\${@}"
+	EOF
+	chmod +x "${scriptdir}/python${pymajor}-config" || die
+	ln -s "python${pymajor}-config" \
+		"${scriptdir}/python-config" || die
+	# 2to3, pydoc
+	ln -s "../../../bin/2to3-${PYVER}" \
+		"${scriptdir}/2to3" || die
+	ln -s "../../../bin/pydoc${PYVER}" \
+		"${scriptdir}/pydoc" || die
+	# idle
+	if use tk; then
+		ln -s "../../../bin/idle${PYVER}" \
+			"${scriptdir}/idle" || die
+	fi
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2018-05-03 13:05 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2018-05-03 13:05 UTC (permalink / raw
  To: gentoo-commits

commit:     4f2fcfa4b0c76edea07e6736bf45fc081319c867
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu May  3 13:05:22 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu May  3 13:05:22 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4f2fcfa4

dev-lang/python: add missing patches for 3.6

Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6

 dev-lang/python/Manifest                           |   2 +-
 dev-lang/python/files/3.6.5-disable-nis.patch      |  11 ++
 .../python/files/python-3.6.5-hash-unaligned.patch |  42 ++++++++
 .../python-3.6.5-libressl-compatibility.patch      | 114 +++++++++++++++++++++
 dev-lang/python/python-3.6.5-r1.ebuild             |   3 +-
 5 files changed, 169 insertions(+), 3 deletions(-)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index a69a27b9fa..3ed1a4ef38 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -12,4 +12,4 @@ DIST python-gentoo-patches-3.6.4.tar.xz 12888 BLAKE2B 7cf49ae22df53e855f2e99df51
 DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 BLAKE2B 75422fc7390f559d9864f6e22a0b85982ccbdb07d5f2507db8e528285e56d1f11d4bc0b21a0b78d5340eafd562220d2f1b9d0a78b1f7c811c5689a426a81f9f3 SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8
 DIST python-prefix-3.4.8-gentoo-patches-r0.tar.xz 12928 BLAKE2B d270f27485a70b4186c0d509836f66e6ae8218270cbb0a473b4579de7a8d9fa16eb2387d0441979aa62fc88e54a52f863c58d91b3df64dd6a40ad4bc4236cbb2 SHA512 84554d2b320922d7ac6e20012f847a81d6501693a4d9f2146faa8764fca4fbc5e3bf1c0f352853f1ab34ed905ab13097f2e82285ada54c9b4e219e72b39804c2
 DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 BLAKE2B ab0cbc5430e9588f71cfd7b001a07f9a77097262f17e1f980e3945e39855e1c9437117bf4eb2d424dadf701d37d025e09627d7efdbb9f8867714039f62f261a7 SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5
-DIST python-prefix-3.6.3-gentoo-patches-r0.tar.xz 12676 BLAKE2B 5221ae00d16db401d5674947923451d850978d930d9449d9b4f6ae6d117c26971e2f384c5a698b7acc8d62e6a6b673f4ec870da3788f87372593a5ac4897a227 SHA512 9d1673bc7b327be6b7e95491940eeeaa40db9e94f2183f4605a9a5a7fd2e187017164e9b2ef31f3bc8d694e467de6843706d3341b4ce24d4d8717513c246b62f
+DIST python-prefix-3.6.5-gentoo-patches-r0.tar.xz 12728 BLAKE2B 8193b5eb59aaa923be299e1a68c62a2341be6d2367eb34a8e03436248a0c180012ba60e738ded7ca7f58849cde070b364761922518a5cdc425602172291aa2b0 SHA512 3bb1a97885112fb853b9ad061f21ba1f661e397d5585d932ddebe3107267be512799f966aef92e599ce2c97a4d51ec48bb214aa999b370b8d5a594e6f92182b6

diff --git a/dev-lang/python/files/3.6.5-disable-nis.patch b/dev-lang/python/files/3.6.5-disable-nis.patch
new file mode 100644
index 0000000000..3937c6fe79
--- /dev/null
+++ b/dev-lang/python/files/3.6.5-disable-nis.patch
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -1364,7 +1364,7 @@ class PyBuildExt(build_ext):
+         else:
+             missing.extend(['resource', 'termios'])
+ 
+-        nis = self._detect_nis(inc_dirs, lib_dirs)
++        nis = None
+         if nis is not None:
+             exts.append(nis)
+         else:

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
new file mode 100644
index 0000000000..d096887cbf
--- /dev/null
+++ b/dev-lang/python/files/python-3.6.5-hash-unaligned.patch
@@ -0,0 +1,42 @@
+The hash implementation casts the input pointer to uint64_t* and directly reads
+from this, which may cause unaligned accesses. Use memcpy() instead so this code
+will not crash with SIGBUS on sparc.
+
+--- a/Python/pyhash.c	2017-11-29 10:21:20.283094068 +0100
++++ b/Python/pyhash.c	2017-11-29 10:24:26.733087813 +0100
+@@ -369,7 +369,7 @@
+     uint64_t k0 = _le64toh(_Py_HashSecret.siphash.k0);
+     uint64_t k1 = _le64toh(_Py_HashSecret.siphash.k1);
+     uint64_t b = (uint64_t)src_sz << 56;
+-    const uint64_t *in = (uint64_t*)src;
++    const uint8_t *in = (uint8_t*)src;
+ 
+     uint64_t v0 = k0 ^ 0x736f6d6570736575ULL;
+     uint64_t v1 = k1 ^ 0x646f72616e646f6dULL;
+@@ -378,11 +378,13 @@
+ 
+     uint64_t t;
+     uint8_t *pt;
+-    uint8_t *m;
++    const uint8_t *m;
+ 
+     while (src_sz >= 8) {
+-        uint64_t mi = _le64toh(*in);
+-        in += 1;
+-        src_sz -= 8;
++        uint64_t mi;
++        memcpy(&mi, in, sizeof(mi));
++        mi = _le64toh(mi);
++        in += sizeof(mi);
++        src_sz -= sizeof(mi);
+         v3 ^= mi;
+         DOUBLE_ROUND(v0,v1,v2,v3);
+@@ -391,7 +393,7 @@
+ 
+     t = 0;
+     pt = (uint8_t *)&t;
+-    m = (uint8_t *)in;
++    m = in;
+     switch (src_sz) {
+         case 7: pt[6] = m[6]; /* fall through */
+         case 6: pt[5] = m[5]; /* fall through */

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
new file mode 100644
index 0000000000..2f9e6a2bef
--- /dev/null
+++ b/dev-lang/python/files/python-3.6.5-libressl-compatibility.patch
@@ -0,0 +1,114 @@
+From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001
+From: Christian Heimes <christian@python.org>
+Date: Sat, 24 Mar 2018 18:38:14 +0100
+Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0
+ (GH-6210) (GH-6214)
+
+LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
+LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
+LibreSSL < 2.7.
+
+Documentation updates and fixes for failing tests will be provided in
+another patch set.
+
+Signed-off-by: Christian Heimes <christian@python.org>.
+(cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
+
+Co-authored-by: Christian Heimes <christian@python.org>
+---
+ Lib/test/test_ssl.py                          |  1 +
+ .../2018-03-24-15-08-24.bpo-33127.olJmHv.rst  |  1 +
+ Modules/_ssl.c                                | 24 ++++++++++++-------
+ Tools/ssl/multissltests.py                    |  3 ++-
+ 4 files changed, 20 insertions(+), 9 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
+
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
+index 8dd3b41450..9785a59a7e 100644
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -1687,6 +1687,7 @@ class SimpleBackgroundTests(unittest.TestCase):
+         self.assertEqual(len(ctx.get_ca_certs()), 1)
+ 
+     @needs_sni
++    @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"), "needs TLS 1.2")
+     def test_context_setget(self):
+         # Check that the context of a connected socket can be replaced.
+         ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
+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
+new file mode 100644
+index 0000000000..635aabbde0
+--- /dev/null
++++ b/Misc/NEWS.d/next/Library/2018-03-24-15-08-24.bpo-33127.olJmHv.rst
+@@ -0,0 +1 @@
++The ssl module now compiles with LibreSSL 2.7.1.
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+index c54e43c2b4..5e007da858 100644
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -106,6 +106,12 @@ struct py_ssl_library_code {
+ 
+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+ #  define OPENSSL_VERSION_1_1 1
++#  define PY_OPENSSL_1_1_API 1
++#endif
++
++/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
++#  define PY_OPENSSL_1_1_API 1
+ #endif
+ 
+ /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
+@@ -152,16 +158,18 @@ struct py_ssl_library_code {
+ #define INVALID_SOCKET (-1)
+ #endif
+ 
+-#ifdef OPENSSL_VERSION_1_1
+-/* OpenSSL 1.1.0+ */
+-#ifndef OPENSSL_NO_SSL2
+-#define OPENSSL_NO_SSL2
+-#endif
+-#else /* OpenSSL < 1.1.0 */
+-#if defined(WITH_THREAD)
++/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
++#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
+ #define HAVE_OPENSSL_CRYPTO_LOCK
+ #endif
+ 
++#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
++#define OPENSSL_NO_SSL2
++#endif
++
++#ifndef PY_OPENSSL_1_1_API
++/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
++
+ #define TLS_method SSLv23_method
+ #define TLS_client_method SSLv23_client_method
+ #define TLS_server_method SSLv23_server_method
+@@ -227,7 +235,7 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s)
+     return s->tlsext_tick_lifetime_hint;
+ }
+ 
+-#endif /* OpenSSL < 1.1.0 or LibreSSL */
++#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
+ 
+ 
+ enum py_ssl_error {
+diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
+index ce5bbd8530..ba4529ae06 100755
+--- a/Tools/ssl/multissltests.py
++++ b/Tools/ssl/multissltests.py
+@@ -57,8 +57,9 @@ LIBRESSL_OLD_VERSIONS = [
+ ]
+ 
+ LIBRESSL_RECENT_VERSIONS = [
+-    "2.5.3",
+     "2.5.5",
++    "2.6.4",
++    "2.7.1",
+ ]
+ 
+ # store files in ../multissl
+-- 
+2.17.0
+

diff --git a/dev-lang/python/python-3.6.5-r1.ebuild b/dev-lang/python/python-3.6.5-r1.ebuild
index b23636b07f..bc82204e5a 100644
--- a/dev-lang/python/python-3.6.5-r1.ebuild
+++ b/dev-lang/python/python-3.6.5-r1.ebuild
@@ -8,7 +8,7 @@ inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs epatch
 
 MY_P="Python-${PV}"
 PATCHSET_VERSION="3.6.4"
-PREFIX_PATCHREV="3.6.3-gentoo-patches-r0"
+PREFIX_PATCHREV="3.6.5-gentoo-patches-r0"
 
 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
 HOMEPAGE="https://www.python.org/"
@@ -77,7 +77,6 @@ src_prepare() {
 	default
 
 	# Prefix' round of patches
-	# http://prefix.gentooexperimental.org:8000/python-patches-3_3
 	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
 		epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV}
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2018-05-03 12:05 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2018-05-03 12:05 UTC (permalink / raw
  To: gentoo-commits

commit:     7b01068518698b9292df9171df071f3bfbfa6500
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu May  3 11:47:49 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu May  3 11:47:49 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7b010685

dev-lang/python: bump/sync 3.5

Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6

 dev-lang/python/Manifest                           |   1 +
 .../python-3.5.5-libressl-compatibility.patch      |  69 ++++
 dev-lang/python/python-3.5.5-r1.ebuild             | 442 +++++++++++++++++++++
 3 files changed, 512 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index b4faac8990..00c4315df3 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -4,6 +4,7 @@ DIST Python-2.7.14.tar.xz 12576112 BLAKE2B e03c4134cfdd88678acc26f383130a598ce4d
 DIST Python-3.4.5.tar.xz 14516820 BLAKE2B f9ddabd2df2241089d07756d3a8ba1c70096bee60d7cdef84041edbb20c488c3a573762441a4b7f543dbc0ce403ce84ff7d02e7d25699917bd014ab96deead85 SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c
 DIST Python-3.4.8.tar.xz 14576444 BLAKE2B 262b82fbc0e4852216d2edf05f9e9194bc93be7b14a2d6ef56789b808cff274e58b2fa7134955464fd05ab36181b5861aeca31e2e05b27f0f58ac66d145bd56b SHA512 478552c72efe606cb1993024b81839c51d01f1c949564c007ab2b76016f110e1f7bd418e5de3f4f93b466ce7dbe6583d3c150830d1f28f75e0809625b568a7ec
 DIST Python-3.5.4.tar.xz 15332320 BLAKE2B 1fc3ba4eb1ed949062961c13fd1f9851c7f9cbeb4916c06a0389349ee2d4872b2b1c2d30138822e6329b6a715f35a66df704b7a04aa4adeb95b685b8d6e45d61 SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff
+DIST Python-3.5.5.tar.xz 15351440 BLAKE2B 217cb7f51e04d57983ce053ff4276d056e17c8223b6f3d87b69f556453fe2ae3d4dc2c1a6b9c2c6aad033cea9b40cd32264d8208cc81a1ec34ff252379bf95b8 SHA512 c9056baee6a2d1fe7f14b1f310db95b78e8972766d086f8ae10954f38f8182956171580bde01ddadebe897f2545a6fbe47669ca3e4887026ac1fae5ee9197f22
 DIST Python-3.6.3.tar.xz 16974296 BLAKE2B 8220fc0c2eaa315d3972085b0f531f169adb6cfad57023ad2c115603b5a484573ea3540eb3216edd0f4514256c8edb07469cf38d17727d69cdc15cdf1f601623 SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b
 DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 BLAKE2B 0048e48ddaaa4bef08451354fde95a123042880f26dddc9267c7f9a90fd8abb40955e26ee8c9dfc5a1165556bb3e11585b27288e635d42a4000dd3d7654c41ad SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1
 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 BLAKE2B 7fb3cc7dcd987debd5aa263d8e26b21aad439d8e3177c06c3683406a53bbda9652175673b09b6300f6a5b62148190cd8a75c9b65a5de04d770866733fcc0ebcb SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8

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
new file mode 100644
index 0000000000..67d57d0c13
--- /dev/null
+++ b/dev-lang/python/files/python-3.5.5-libressl-compatibility.patch
@@ -0,0 +1,69 @@
+# From 8d89a385b71a2e4cce0fba0cfc8d91b63485edc5 Mon Sep 17 00:00:00 2001
+# From: Christian Heimes <christian@python.org>
+# Date: Sat, 24 Mar 2018 18:38:14 +0100
+# Subject: [PATCH] [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0
+# (GH-6210) (GH-6214)
+#
+# LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
+# LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
+# LibreSSL < 2.7.
+
+# Documentation updates and fixes for failing tests will be provided in
+# another patch set.
+
+# Signed-off-by: Christian Heimes <christian@python.org>.
+# (cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
+
+# Co-authored-by: Christian Heimes <christian@python.org>
+# Patch modified by Aaron Bauman <bman@gentoo.org> for 3.5.5
+
+--- a/Modules/_ssl.c	2018-04-13 18:33:17.397649561 -0400
++++ b/Modules/_ssl.c	2018-04-13 18:40:22.319852014 -0400
+@@ -101,6 +101,12 @@
+ 
+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+ #  define OPENSSL_VERSION_1_1 1
++#  define PY_OPENSSL_1_1_API 1
++#endif
++
++/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
++#  define PY_OPENSSL_1_1_API 1
+ #endif
+ 
+ /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
+@@ -129,16 +135,18 @@
+ #define INVALID_SOCKET (-1)
+ #endif
+ 
+-#ifdef OPENSSL_VERSION_1_1
+-/* OpenSSL 1.1.0+ */
+-#ifndef OPENSSL_NO_SSL2
+-#define OPENSSL_NO_SSL2
+-#endif
+-#else /* OpenSSL < 1.1.0 */
+-#if defined(WITH_THREAD)
++/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
++#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
+ #define HAVE_OPENSSL_CRYPTO_LOCK
+ #endif
+ 
++#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
++#define OPENSSL_NO_SSL2
++#endif
++
++#ifndef PY_OPENSSL_1_1_API
++/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
++
+ #define TLS_method SSLv23_method
+ 
+ static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
+@@ -187,7 +195,7 @@
+ {
+     return store->param;
+ }
+-#endif /* OpenSSL < 1.1.0 or LibreSSL */
++#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
+ 
+ 
+ enum py_ssl_error {

diff --git a/dev-lang/python/python-3.5.5-r1.ebuild b/dev-lang/python/python-3.5.5-r1.ebuild
new file mode 100644
index 0000000000..c9e5669455
--- /dev/null
+++ b/dev-lang/python/python-3.5.5-r1.ebuild
@@ -0,0 +1,442 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+
+MY_P="Python-${PV/_/}"
+PATCHSET_VERSION="3.5.4-0"
+PREFIX_PATCHREV="3.5.4-gentoo-patches-r0"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
+	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
+	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PREFIX_PATCHREV}.tar.xz"
+
+LICENSE="PSF-2"
+SLOT="3.5/3.5m"
+KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="aqua bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
+RESTRICT="!test? ( test )"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="app-arch/bzip2:0=
+	app-arch/xz-utils:0=
+	>=sys-libs/zlib-1.1.3:0=
+	virtual/libffi
+	virtual/libintl
+	gdbm? ( sys-libs/gdbm:0=[berkdb] )
+	ncurses? ( >=sys-libs/ncurses-5.2:0= )
+	readline? ( >=sys-libs/readline-4.1:0= )
+	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	tk? (
+		>=dev-lang/tcl-8.0:0=
+		>=dev-lang/tk-8.0:0=[-aqua]
+		dev-tcltk/blt:0=
+		dev-tcltk/tix
+	)
+	xml? ( >=dev-libs/expat-2.1:0= )
+	!!<sys-apps/sandbox-2.6-r1"
+# bluetooth requires headers from bluez
+DEPEND="${RDEPEND}
+	bluetooth? ( net-wireless/bluez )
+	virtual/pkgconfig
+	!sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )"
+PDEPEND=">=app-eselect/eselect-python-20140125-r1"
+
+S="${WORKDIR}/${MY_P}"
+
+PYVER=${SLOT%/*}
+
+src_prepare() {
+	# Ensure that internal copies of expat, libffi and zlib are not used.
+	rm -fr Modules/expat
+	rm -fr Modules/_ctypes/libffi*
+	rm -fr Modules/zlib
+
+	if tc-is-cross-compiler; then
+		# Invokes BUILDPYTHON, which is built for the host arch
+		local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
+	fi
+
+	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+	epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
+	epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
+	epatch "${FILESDIR}/3.6-disable-nis.patch"
+	epatch "${FILESDIR}/python-3.5.5-libressl-compatibility.patch"
+	epatch "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
+
+	epatch_user
+
+	# Prefix' round of patches
+	# http://prefix.gentooexperimental.org:8000/python-patches-3_3
+	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+		epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV}
+
+	# https://forums.developer.apple.com/thread/9233, bug #572726
+	sed -i -e '/$(RUNSHARED) .\/regen/s/^/export RUNSHARED=$(RUNSHARED); /' \
+		Makefile.pre.in || die
+	sed -i -e '/python$EXE/s/^/env ${RUNSHARED} /' \
+		Lib/plat-darwin/regen || die
+
+	# we provide a fully working readline also on Darwin, so don't force
+	# usage of less functional libedit
+	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
+
+	# We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR.
+	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
+
+	# Make sure python doesn't use the host libffi.
+	use prefix && epatch "${FILESDIR}/python-3.5.4-libffi-pkgconfig.patch"
+
+	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+		configure.ac \
+		Lib/distutils/command/install.py \
+		Lib/distutils/sysconfig.py \
+		Lib/site.py \
+		Lib/sysconfig.py \
+		Lib/test/test_site.py \
+		Makefile.pre.in \
+		Modules/getpath.c \
+		Modules/Setup.dist \
+		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+	# workaround a development build env problem and muck around
+	# framework install to get the best of both worlds (non-standard)
+	sed -i \
+		-e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
+		-e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
+		configure.ac configure || die
+	sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
+
+	# Disable ABI flags.
+	sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
+
+	eautoreconf
+}
+
+src_configure() {
+	local disable
+	# disable automagic bluetooth headers detection
+	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+	use gdbm     || disable+=" gdbm"
+	use ncurses  || disable+=" _curses _curses_panel"
+	use readline || disable+=" readline"
+	use sqlite   || disable+=" _sqlite3"
+	use ssl      || export PYTHON_DISABLE_SSL="1"
+	use tk       || disable+=" _tkinter"
+	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+	export PYTHON_DISABLE_MODULES="${disable}"
+
+	if ! use xml; then
+		ewarn "You have configured Python without XML support."
+		ewarn "This is NOT a recommended configuration as you"
+		ewarn "may face problems parsing any XML documents."
+	fi
+
+	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+	fi
+
+	if [[ "$(gcc-major-version)" -ge 4 ]]; then
+		append-flags -fwrapv
+	fi
+
+	filter-flags -malign-double
+
+	# https://bugs.gentoo.org/show_bug.cgi?id=50309
+	if is-flagq -O3; then
+		is-flagq -fstack-protector-all && replace-flags -O3 -O2
+		use hardened && replace-flags -O3 -O2
+	fi
+
+	# Export CC so even AIX will use gcc instead of xlc_r.
+	# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
+	tc-export CC CXX
+
+	# The configure script fails to use pkg-config correctly.
+	# http://bugs.python.org/issue15506
+	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+	# Set LDFLAGS so we link modules with -lpython3.2 correctly.
+	# Needed on FreeBSD unless Python 3.2 is already installed.
+	# Please query BSD team before removing this!
+	append-ldflags "-L."
+
+	# make sure setup.py considers Prefix' paths before system ones
+	use prefix && append-cppflags -I"${EPREFIX}"/usr/include
+	use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
+
+	local dbmliborder
+	if use gdbm; then
+		dbmliborder+="${dbmliborder:+:}gdbm"
+	fi
+
+	BUILD_DIR="${WORKDIR}/${CHOST}"
+	mkdir -p "${BUILD_DIR}" || die
+	cd "${BUILD_DIR}" || die
+
+	if use aqua ; then
+		ECONF_SOURCE="${S}" OPT="" \
+		econf \
+			--enable-framework="${EPREFIX}"/usr/lib \
+			--config-cache
+	fi
+
+	# pymalloc #452720
+	local myeconfargs=(
+		$(use aqua && echo --config-cache) \
+		--with-fpectl
+		--enable-shared
+		$(use_enable ipv6)
+		$(use_with threads)
+		--infodir='${prefix}/share/info'
+		--mandir='${prefix}/share/man'
+		--with-computed-gotos
+		--with-dbmliborder="${dbmliborder}"
+		--with-libc=
+		--enable-loadable-sqlite-extensions
+		--without-ensurepip
+		--with-system-expat
+		--with-system-ffi
+		--without-pymalloc
+	)
+
+	ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
+
+	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+		eerror "configure has detected that the sem_open function is broken."
+		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+		die "Broken sem_open function (bug 496328)"
+	fi
+}
+
+src_compile() {
+	# Ensure sed works as expected
+	# https://bugs.gentoo.org/594768
+	local -x LC_ALL=C
+
+	cd "${BUILD_DIR}" || die
+
+	emake CPPFLAGS= CFLAGS= LDFLAGS=
+
+	# Work around bug 329499. See also bug 413751 and 457194.
+	if has_version dev-libs/libffi[pax_kernel]; then
+		pax-mark E python
+	else
+		pax-mark m python
+	fi
+}
+
+src_test() {
+	# Tests will not work when cross compiling.
+	if tc-is-cross-compiler; then
+		elog "Disabling tests due to crosscompiling."
+		return
+	fi
+
+	cd "${BUILD_DIR}" || die
+
+	# Skip failing tests.
+	local skipped_tests="gdb"
+
+	for test in ${skipped_tests}; do
+		mv "${S}"/Lib/test/test_${test}.py "${T}"
+	done
+
+	local -x PYTHONDONTWRITEBYTECODE=
+	emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
+	local result=$?
+
+	for test in ${skipped_tests}; do
+		mv "${T}/test_${test}.py" "${S}"/Lib/test
+	done
+
+	elog "The following tests have been skipped:"
+	for test in ${skipped_tests}; do
+		elog "test_${test}.py"
+	done
+
+	elog "If you would like to run them, you may:"
+	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
+	elog "and run the tests separately."
+
+	if [[ ${result} -ne 0 ]]; then
+		die "emake test failed"
+	fi
+}
+
+src_install() {
+	local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
+
+	cd "${BUILD_DIR}" || die
+
+	emake DESTDIR="${D}" altinstall
+
+	if use aqua ; then
+		# avoid config.status to be triggered
+		find Mac -name "Makefile" -exec touch \{\} + || die
+
+		# Python_Launcher is kind of a wrapper, and we should fix it for
+		# Prefix (it uses /usr/bin/pythonw) so useless
+		# IDLE doesn't run, no idea, but definitely not used
+		emake DESTDIR="${D}" -C Mac install_Python || die
+		rmdir "${ED}"/Applications/Python* || die
+		rmdir "${ED}"/Applications || die
+
+		local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER}
+		ln -s "${EPREFIX}"/usr/include/python${PYVER} \
+			"${ED}${fwdir}"/Headers || die
+		ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
+			"${ED}${fwdir}"/Python || die
+	fi
+
+	sed \
+		-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
+		-e "s/\(PY_LDFLAGS=\).*/\1/" \
+		-i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
+
+	# Fix collisions between different slots of Python.
+	rm -f "${ED}usr/$(get_libdir)/libpython3.so"
+
+	# Cheap hack to get version with ABIFLAGS
+	local abiver=$(cd "${ED}usr/include"; echo python*)
+	if [[ ${abiver} != python${PYVER} ]]; then
+		# Replace python3.X with a symlink to python3.Xm
+		rm "${ED}usr/bin/python${PYVER}" || die
+		dosym "${abiver}" "/usr/bin/python${PYVER}"
+		# Create python3.X-config symlink
+		dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
+		# Create python-3.5m.pc symlink
+		dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
+	fi
+
+	# python seems to get rebuilt in src_install (bug 569908)
+	# Work around it for now.
+	if has_version dev-libs/libffi[pax_kernel]; then
+		pax-mark E "${ED}usr/bin/${abiver}"
+	else
+		pax-mark m "${ED}usr/bin/${abiver}"
+	fi
+
+	use elibc_uclibc && rm -fr "${libdir}/test"
+	use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
+	use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
+
+	use threads || rm -fr "${libdir}/multiprocessing"
+	use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
+
+	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
+
+	if use examples; then
+		insinto /usr/share/doc/${PF}/examples
+		find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
+		doins -r "${S}"/Tools
+	fi
+	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+	if use aqua ; then
+		# we do framework, so the emake trick below returns a pathname
+		# since that won't work here, use a (cheap) trick instead
+		local libname=libpython${PYVER}
+	else
+		local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+			emake --no-print-directory -s -f - 2>/dev/null)
+	fi
+	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+	newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
+	newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+	sed \
+		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+		-e "s:@PYDOC@:pydoc${PYVER}:" \
+		-i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+	# for python-exec
+	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
+
+	# if not using a cross-compiler, use the fresh binary
+	if ! tc-is-cross-compiler; then
+		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
+	else
+		vars=( PYTHON "${vars[@]}" )
+	fi
+
+	python_export "python${PYVER}" "${vars[@]}"
+	echo "EPYTHON='${EPYTHON}'" > epython.py || die
+	python_domodule epython.py
+
+	# python-exec wrapping support
+	local pymajor=${PYVER%.*}
+	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+	# python and pythonX
+	ln -s "../../../bin/${abiver}" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+	ln -s "python${pymajor}" \
+		"${D}${PYTHON_SCRIPTDIR}/python" || die
+	# python-config and pythonX-config
+	# note: we need to create a wrapper rather than symlinking it due
+	# to some random dirname(argv[0]) magic performed by python-config
+	cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
+		#!/bin/sh
+		exec "${abiver}-config" "\${@}"
+	EOF
+	chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+	ln -s "python${pymajor}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
+	# 2to3, pydoc, pyvenv
+	ln -s "../../../bin/2to3-${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
+	ln -s "../../../bin/pydoc${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+	ln -s "../../../bin/pyvenv-${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
+	# idle
+	if use tk; then
+		ln -s "../../../bin/idle${PYVER}" \
+			"${D}${PYTHON_SCRIPTDIR}/idle" || die
+	fi
+}
+
+pkg_preinst() {
+	if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
+		python_updater_warning="1"
+	fi
+}
+
+eselect_python_update() {
+	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+		eselect python update
+	fi
+
+	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+		eselect python update --python${PV%%.*}
+	fi
+}
+
+pkg_postinst() {
+	eselect_python_update
+
+	if [[ "${python_updater_warning}" == "1" ]]; then
+		ewarn "You have just upgraded from an older version of Python."
+		ewarn
+		ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
+	fi
+}
+
+pkg_postrm() {
+	eselect_python_update
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2018-05-03 10:39 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2018-05-03 10:39 UTC (permalink / raw
  To: gentoo-commits

commit:     86500c00c3e1ad35d5cf8b619310d7243deb80d5
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu May  3 09:20:56 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu May  3 09:20:56 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=86500c00

dev-lang/python: sync python 2.7

Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6

 dev-lang/python/Manifest                           |   3 -
 dev-lang/python/files/2.7-disable-nis.patch        |  21 +
 .../files/python-2.7-libressl-compatibility.patch  |  92 +++
 ...ython-2.7.12.ebuild => python-2.7.14-r2.ebuild} |  82 +--
 dev-lang/python/python-2.7.14.ebuild               | 637 ---------------------
 5 files changed, 160 insertions(+), 675 deletions(-)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 67805c47ab..274b181cfb 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,16 +1,13 @@
 DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd16650cb5fc4a2c54fdac0228326f25cfba4fcd098ac9d689312d3e0dde6fca57f720d5235361d6462461cf018325c23fda9139e0f1683055aff SHA512 cabc21d2d7379daf1f4bafe7ab00b70e5b4f707d3102496b96ff0dfdced26347097ad771c69e0b9488b7c54b1ef36f9bc019bee72f1ffcbb55dcd0e71095edfe
 DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 BLAKE2B 3dd91f83e5886cb9ba5c1fd9f3da38ab521db70645fa187752cd784919d523d9bf59b61223ea1a455b6d9002ba88dac5bd834c8e943b121db84e30bbb0f65204 SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62
-DIST Python-2.7.12.tar.xz 12390820 BLAKE2B 97446bca10005277cf1a92ce7fc9e847d5df93f656a6a3b66e9f064d1c2ba35d5a8b420aaa64b92247d6a3fcd3852876450faebc466c7a8e841fd0c2e62fd306 SHA512 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f
 DIST Python-2.7.14.tar.xz 12576112 BLAKE2B e03c4134cfdd88678acc26f383130a598ce4de908ab6bb9ee00e9235de3e0fcb9e653fec86f39db64fb895ef797d33736524655c5b94fab2cde2544b966b2cfb SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9
 DIST Python-3.4.5.tar.xz 14516820 BLAKE2B f9ddabd2df2241089d07756d3a8ba1c70096bee60d7cdef84041edbb20c488c3a573762441a4b7f543dbc0ce403ce84ff7d02e7d25699917bd014ab96deead85 SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c
 DIST Python-3.5.4.tar.xz 15332320 BLAKE2B 1fc3ba4eb1ed949062961c13fd1f9851c7f9cbeb4916c06a0389349ee2d4872b2b1c2d30138822e6329b6a715f35a66df704b7a04aa4adeb95b685b8d6e45d61 SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff
 DIST Python-3.6.3.tar.xz 16974296 BLAKE2B 8220fc0c2eaa315d3972085b0f531f169adb6cfad57023ad2c115603b5a484573ea3540eb3216edd0f4514256c8edb07469cf38d17727d69cdc15cdf1f601623 SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b
-DIST python-gentoo-patches-2.7.12-0.tar.xz 13576 BLAKE2B 6ae9fc3e8d3e7dca2e8f5fa6ec9709be9e41982bcd8ca71764766c1a21e596c42d389afd65379c65c469dbbe53918cfa5a23ec7ca7e825f35bc462ff3110f949 SHA512 8bf530fca15c47fa5d9bc958e433b35943a12c98e4172806a45aa60dc85ec92f8ab6ffcd90f752dc5bf8ffc711414894c15820c4b6ef72dbcedc2808119fb1f6
 DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 BLAKE2B 0048e48ddaaa4bef08451354fde95a123042880f26dddc9267c7f9a90fd8abb40955e26ee8c9dfc5a1165556bb3e11585b27288e635d42a4000dd3d7654c41ad SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1
 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 BLAKE2B 7fb3cc7dcd987debd5aa263d8e26b21aad439d8e3177c06c3683406a53bbda9652175673b09b6300f6a5b62148190cd8a75c9b65a5de04d770866733fcc0ebcb SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8
 DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed10748348484d314183c3de3ec950d5ca5ce7048bb322c470f3f5bff2d63eb7f2ed99c0fe75c621df050273d9d118681b28926061d SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec
 DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 BLAKE2B 3075754627617ac2ceee879eaf1a0e6564505655cdbdff380233a09df701a6188d64fe1f6a8c642b1fb05ef3c460a07042b6a362d655cd02717d6d9ba47983a1 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3
-DIST python-prefix-2.7.12-gentoo-patches-r0.tar.xz 17380 BLAKE2B 566c47624d054cd251ea4350bf57735ad63057a6ef7968dbe572a02156a03c080303ba2aa6c26e10077070507317b22eb7665595aaf903b4ffd4a45104fbfa31 SHA512 ef17c8e8083da0ed0e6a63c96f59cc1243b0376fc6d4d7fcecb165e557403c54ae87625ed6dfe4d7d73693f8220ec98ef8a3f16124d8022dbac6a3a9d5514d9c
 DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 BLAKE2B 75422fc7390f559d9864f6e22a0b85982ccbdb07d5f2507db8e528285e56d1f11d4bc0b21a0b78d5340eafd562220d2f1b9d0a78b1f7c811c5689a426a81f9f3 SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8
 DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 BLAKE2B 228cea390cd16f68579896ccec06025446d6378ee164090a7f8ab8174d28e73e35b0e311b95ab78be7a54b21eefce7c01238e3cb31fae1f49a1706476c5abda5 SHA512 e32556c63e48d8dacd86218945147d1bbbc5777a6bb3441373827da47771a8eb387f26885acd35343cc598c719c9feec63007144fc1fdd1aca253a2ec1a19825
 DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 BLAKE2B ab0cbc5430e9588f71cfd7b001a07f9a77097262f17e1f980e3945e39855e1c9437117bf4eb2d424dadf701d37d025e09627d7efdbb9f8867714039f62f261a7 SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5

diff --git a/dev-lang/python/files/2.7-disable-nis.patch b/dev-lang/python/files/2.7-disable-nis.patch
new file mode 100644
index 0000000000..5a6cb3e403
--- /dev/null
+++ b/dev-lang/python/files/2.7-disable-nis.patch
@@ -0,0 +1,21 @@
+--- a/setup.py
++++ b/setup.py
+@@ -1346,17 +1346,7 @@ class PyBuildExt(build_ext):
+             else:
+                 missing.append('resource')
+ 
+-            # Sun yellow pages. Some systems have the functions in libc.
+-            if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and
+-                find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
+-                if (self.compiler.find_library_file(lib_dirs, 'nsl')):
+-                    libs = ['nsl']
+-                else:
+-                    libs = []
+-                exts.append( Extension('nis', ['nismodule.c'],
+-                                       libraries = libs) )
+-            else:
+-                missing.append('nis')
++            missing.append('nis')
+         else:
+             missing.extend(['nis', 'resource', 'termios'])
+ 

diff --git a/dev-lang/python/files/python-2.7-libressl-compatibility.patch b/dev-lang/python/files/python-2.7-libressl-compatibility.patch
new file mode 100644
index 0000000000..c9e7a8458e
--- /dev/null
+++ b/dev-lang/python/files/python-2.7-libressl-compatibility.patch
@@ -0,0 +1,92 @@
+# From https://github.com/python/cpython/pull/6215
+
+# LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
+# LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
+# LibreSSL < 2.7.
+
+# Documentation updates and fixes for failing tests will be provided in
+# another patch set.
+
+# Signed-off-by: Christian Heimes christian@python.org.
+# (cherry picked from commit 4ca0739)
+
+#Co-authored-by: Christian Heimes christian@python.org
+
+--- a/Modules/_ssl.c	2017-09-16 17:38:35.000000000 +0000
++++ b/Modules/_ssl.c	2018-04-13 15:55:10.919424126 +0000
+@@ -97,6 +102,12 @@
+ 
+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+ #  define OPENSSL_VERSION_1_1 1
++#  define PY_OPENSSL_1_1_API 1
++#endif
++
++/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
++#  define PY_OPENSSL_1_1_API 1
+ #endif
+ 
+ /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
+@@ -118,24 +129,44 @@
+ #endif
+ 
+ /* ALPN added in OpenSSL 1.0.2 */
+-#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined(OPENSSL_NO_TLSEXT)
+-# define HAVE_ALPN
++#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
++# define HAVE_ALPN 1
++#else
++# define HAVE_ALPN 0
++#endif
++
++/* We cannot rely on OPENSSL_NO_NEXTPROTONEG because LibreSSL 2.6.1 dropped
++ * NPN support but did not set OPENSSL_NO_NEXTPROTONEG for compatibility
++ * reasons. The check for TLSEXT_TYPE_next_proto_neg works with
++ * OpenSSL 1.0.1+ and LibreSSL.
++ * OpenSSL 1.1.1-pre1 dropped NPN but still has TLSEXT_TYPE_next_proto_neg.
++ */
++#ifdef OPENSSL_NO_NEXTPROTONEG
++# define HAVE_NPN 0
++#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
++# define HAVE_NPN 0
++#elif defined(TLSEXT_TYPE_next_proto_neg)
++# define HAVE_NPN 1
++#else
++# define HAVE_NPN 0
+ #endif
+ 
+ #ifndef INVALID_SOCKET /* MS defines this */
+ #define INVALID_SOCKET (-1)
+ #endif
+ 
+-#ifdef OPENSSL_VERSION_1_1
+-/* OpenSSL 1.1.0+ */
+-#ifndef OPENSSL_NO_SSL2
+-#define OPENSSL_NO_SSL2
+-#endif
+-#else /* OpenSSL < 1.1.0 */
+-#if defined(WITH_THREAD)
++/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */
++#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD)
+ #define HAVE_OPENSSL_CRYPTO_LOCK
+ #endif
+ 
++#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
++#define OPENSSL_NO_SSL2
++#endif
++
++#ifndef PY_OPENSSL_1_1_API
++/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
++
+ #define TLS_method SSLv23_method
+ 
+ static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
+@@ -178,7 +209,7 @@
+ {
+     return store->param;
+ }
+-#endif /* OpenSSL < 1.1.0 or LibreSSL */
++#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */
+ 
+ 
+ enum py_ssl_error {

diff --git a/dev-lang/python/python-2.7.12.ebuild b/dev-lang/python/python-2.7.14-r2.ebuild
similarity index 93%
rename from dev-lang/python/python-2.7.12.ebuild
rename to dev-lang/python/python-2.7.14-r2.ebuild
index f038c4b118..494beb6780 100644
--- a/dev-lang/python/python-2.7.12.ebuild
+++ b/dev-lang/python/python-2.7.14-r2.ebuild
@@ -1,6 +1,5 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 EAPI="5"
 WANT_LIBTOOL="none"
@@ -8,12 +7,12 @@ WANT_LIBTOOL="none"
 inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
 
 MY_P="Python-${PV}"
-PATCHSET_VERSION="2.7.12-0"
+PATCHSET_VERSION="2.7.14-0"
 PREFIX_PATCHREV="r0"
 CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
 
 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
-HOMEPAGE="http://www.python.org/"
+HOMEPAGE="https://www.python.org/"
 SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
 	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
 	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
@@ -24,7 +23,7 @@ SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGW
 LICENSE="PSF-2"
 SLOT="2.7"
 KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
+IUSE="aqua -berkdb bluetooth build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
 
 # Do not add a dependency on dev-lang/python to this ebuild.
 # If you need to apply a patch which requires python for bootstrapping, please
@@ -49,14 +48,12 @@ RDEPEND="app-arch/bzip2:0=
 		sys-libs/db:4.2
 	) )
 	gdbm? ( sys-libs/gdbm:0=[berkdb] )
-	ncurses? (
-		>=sys-libs/ncurses-5.2:0=
-		readline? ( >=sys-libs/readline-4.1:0= )
-	)
+	ncurses? ( >=sys-libs/ncurses-5.2:0= )
+	readline? ( >=sys-libs/readline-4.1:0= )
 	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
 	ssl? (
 		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:= )
+		libressl? ( dev-libs/libressl:0= )
 	)
 	tk? (
 		>=dev-lang/tcl-8.0:0=
@@ -66,7 +63,9 @@ RDEPEND="app-arch/bzip2:0=
 	)
 	xml? ( >=dev-libs/expat-2.1 )
 	!!<sys-apps/portage-2.1.9"
+# bluetooth requires headers from bluez
 DEPEND="${RDEPEND}
+	bluetooth? ( net-wireless/bluez )
 	virtual/pkgconfig
 	>=sys-devel/autoconf-2.65
 	!sys-devel/gcc[libffi(-)]"
@@ -74,6 +73,9 @@ RDEPEND+=" !build? ( app-misc/mime-types )
 	doc? ( dev-python/python-docs:${SLOT} )"
 PDEPEND=">=app-eselect/eselect-python-20140125-r1"
 
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
+
 S="${WORKDIR}/${MY_P}"
 
 pkg_setup() {
@@ -111,6 +113,9 @@ src_prepare() {
 	# http://prefix.gentooexperimental.org:8000/python-patches-2_7
 	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
 		epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
+	epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
+	# Make sure python doesn't use the host libffi.
+	use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
 
 	if use aqua ; then
 		# make sure we don't get a framework reference here
@@ -137,16 +142,6 @@ src_prepare() {
 		CC="$(tc-getCC) -std=gnu89"
 	fi
 
-	# Fix for cross-compiling.
-	epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
-	epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
-	epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
-	epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
-	epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
-
-	# Make sure python doesn't use the host libffi.
-	use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch"
-
 	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
 	    local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
 	    for p in $(
@@ -159,6 +154,15 @@ src_prepare() {
 	    done
 	fi
 
+	# Fix for cross-compiling.
+	epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
+	epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
+	epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
+	epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
+	epatch "${FILESDIR}/2.7-disable-nis.patch"
+	epatch "${FILESDIR}/python-2.7-libressl-compatibility.patch"
+
+
 	epatch_user
 
 	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
@@ -181,6 +185,8 @@ src_configure() {
 		local disable
 		use berkdb   || use gdbm || disable+=" dbm"
 		use berkdb   || disable+=" _bsddb"
+		# disable automagic bluetooth headers detection
+		use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
 		use gdbm     || disable+=" gdbm"
 		use ncurses  || disable+=" _curses _curses_panel"
 		use readline || disable+=" readline"
@@ -229,6 +235,13 @@ src_configure() {
 		replace-flags -Os -O3  # comment #14
 	fi
 
+	# Export CC so even AIX will use gcc instead of xlc_r.
+	# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
+	tc-export CC CXX
+	# The configure script fails to use pkg-config correctly.
+	# http://bugs.python.org/issue15506
+	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
 	# Set LDFLAGS so we link modules with -lpython2.7 correctly.
 	# Needed on FreeBSD unless Python 2.7 is already installed.
 	# Please query BSD team before removing this!
@@ -242,8 +255,8 @@ src_configure() {
 		append-cppflags -I"${EPREFIX}"/usr/include
 		append-ldflags -L"${EPREFIX}"/$(get_libdir)
 		append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
-		# fix compilation on some 64-bits Linux hosts, #381163, #473520
-		if use amd64-linux ; then
+		# fix compilation on some Linux hosts, #381163, #473520
+		if use elibc_glibc ; then
 			for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
 				[[ -d ${hostlibdir} ]] || continue
 				append-ldflags -L${hostlibdir}
@@ -254,13 +267,6 @@ src_configure() {
 		sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
 	fi
 
-	# Export CC so even AIX will use gcc instead of xlc_r.
-	# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
-	tc-export CC CXX
-	# The configure script fails to use pkg-config correctly.
-	# http://bugs.python.org/issue15506
-	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
-
 	local dbmliborder
 	if use gdbm; then
 		dbmliborder+="${dbmliborder:+:}gdbm"
@@ -342,6 +348,11 @@ src_test() {
 		mv "${S}"/Lib/test/test_${test}.py "${T}"
 	done
 
+	# Daylight saving time problem
+	# https://bugs.python.org/issue22067
+	# https://bugs.gentoo.org/610628
+	local -x TZ=UTC
+
 	# Rerun failed tests in verbose mode (regrtest -w).
 	emake test EXTRATESTOPTS="-w" < /dev/tty
 	local result="$?"
@@ -536,10 +547,10 @@ EOF
 		's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
 		 "${ED}"/usr/include/python${SLOT}/pyconfig.h
 
-		use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
-		use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
-		use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
-		use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
+	use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
+	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
+	use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
+	use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
 
 	use threads || rm -r "${libdir}/multiprocessing" || die
 	use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
@@ -575,8 +586,9 @@ EOF
 	# if not using a cross-compiler, use the fresh binary
 	if ! tc-is-cross-compiler; then
 		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
-		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
-		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}.
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
+		local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}"
 	else
 		vars=( PYTHON "${vars[@]}" )
 	fi

diff --git a/dev-lang/python/python-2.7.14.ebuild b/dev-lang/python/python-2.7.14.ebuild
deleted file mode 100644
index 2650b651f0..0000000000
--- a/dev-lang/python/python-2.7.14.ebuild
+++ /dev/null
@@ -1,637 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-WANT_LIBTOOL="none"
-
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
-
-MY_P="Python-${PV}"
-PATCHSET_VERSION="2.7.14-0"
-PREFIX_PATCHREV="r0"
-CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
-
-DESCRIPTION="An interpreted, interactive, object-oriented programming language"
-HOMEPAGE="https://www.python.org/"
-SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
-	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
-	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
-
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )"
-
-LICENSE="PSF-2"
-SLOT="2.7"
-KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
-
-# Do not add a dependency on dev-lang/python to this ebuild.
-# If you need to apply a patch which requires python for bootstrapping, please
-# run the bootstrap code on your dev box and include the results in the
-# patchset. See bug 447752.
-
-RDEPEND="app-arch/bzip2:0=
-	>=sys-libs/zlib-1.1.3:0=
-	!m68k-mint? ( virtual/libffi )
-	virtual/libintl
-	berkdb? ( || (
-		sys-libs/db:5.3
-		sys-libs/db:5.2
-		sys-libs/db:5.1
-		sys-libs/db:5.0
-		sys-libs/db:4.8
-		sys-libs/db:4.7
-		sys-libs/db:4.6
-		sys-libs/db:4.5
-		sys-libs/db:4.4
-		sys-libs/db:4.3
-		sys-libs/db:4.2
-	) )
-	gdbm? ( sys-libs/gdbm:0=[berkdb] )
-	ncurses? (
-		>=sys-libs/ncurses-5.2:0=
-		readline? ( >=sys-libs/readline-4.1:0= )
-	)
-	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:= )
-	)
-	tk? (
-		>=dev-lang/tcl-8.0:0=
-		>=dev-lang/tk-8.0:0=[-aqua]
-		dev-tcltk/blt:0=
-		dev-tcltk/tix
-	)
-	xml? ( >=dev-libs/expat-2.1 )
-	!!<sys-apps/portage-2.1.9"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	>=sys-devel/autoconf-2.65
-	!sys-devel/gcc[libffi(-)]"
-RDEPEND+=" !build? ( app-misc/mime-types )
-	doc? ( dev-python/python-docs:${SLOT} )"
-PDEPEND=">=app-eselect/eselect-python-20140125-r1"
-
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
-	if use berkdb; then
-		ewarn "'bsddb' module is out-of-date and no longer maintained inside"
-		ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
-		ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
-		ewarn "is provided by dev-python/bsddb3."
-	else
-		if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
-			ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
-			ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
-			ewarn "You might need to migrate your databases."
-		fi
-	fi
-}
-
-src_prepare() {
-	# Ensure that internal copies of expat, libffi and zlib are not used.
-	rm -r Modules/expat || die
-	rm -r Modules/_ctypes/libffi* || die
-	rm -r Modules/zlib || die
-
-	if tc-is-cross-compiler; then
-		local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
-	fi
-
-	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
-
-	# if building a patched source-tar, comment the rm's above, and uncomment
-	# this line:
-	#local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch"
-
-	# Prefix' round of patches
-	# http://prefix.gentooexperimental.org:8000/python-patches-2_7
-	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
-		epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
-
-	if use aqua ; then
-		# make sure we don't get a framework reference here
-		sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
-			-e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
-			Makefile.pre.in || die
-		# Python upstream refuses to listen to configure arguments
-		sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \
-			configure.ac configure || die
-		# we handle creation of symlinks in src_install
-		sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die
-	fi
-	# don't try to do fancy things on Darwin
-	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
-	# On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
-	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
-	# fix header standards conflicts on Solaris
-	if [[ ${CHOST} == *-solaris* ]] ; then
-		# GCC5 switched the default from gnu89 to gnu11, a standards
-		# conflict arises from that, which can be solved by upgrading
-		# _XOPEN_SOURCE from 500 to 600, but since it is compiler
-		# version specific, just force the old standard onto the
-		# compiler.  Python 3 properly detects this.
-		CC="$(tc-getCC) -std=gnu89"
-	fi
-
-	# Fix for cross-compiling.
-	epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
-	epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
-	epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
-	epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
-	epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
-
-	# Make sure python doesn't use the host libffi.
-	use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
-
-	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
-	    local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
-	    for p in $(
-		    eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
-		    echo ${PATCH_URI}
-	    ); do
-			# dropped by 01_all_prefix-no-patch-invention.patch
-			[[ ${p} == *-tkinter-* ]] && continue
-		    epatch "${d}/${p}"
-	    done
-	fi
-
-	epatch_user
-
-	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
-		Lib/distutils/command/install.py \
-		Lib/distutils/sysconfig.py \
-		Lib/site.py \
-		Lib/sysconfig.py \
-		Lib/test/test_site.py \
-		Makefile.pre.in \
-		Modules/Setup.dist \
-		Modules/getpath.c \
-		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
-
-	eautoreconf
-}
-
-src_configure() {
-	# dbm module can be linked against berkdb or gdbm.
-	# Defaults to gdbm when both are enabled, #204343.
-	local disable
-	use berkdb   || use gdbm || disable+=" dbm"
-	use berkdb   || disable+=" _bsddb"
-	use gdbm     || disable+=" gdbm"
-	use ncurses  || disable+=" _curses _curses_panel"
-	use readline || disable+=" readline"
-	use sqlite   || disable+=" _sqlite3"
-	use ssl      || export PYTHON_DISABLE_SSL="1"
-	use tk       || disable+=" _tkinter"
-	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
-	[[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
-	[[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs"
-	export PYTHON_DISABLE_MODULES="${disable}"
-
-	if ! use xml; then
-		ewarn "You have configured Python without XML support."
-		ewarn "This is NOT a recommended configuration as you"
-		ewarn "may face problems parsing any XML documents."
-	fi
-
-	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
-		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
-	fi
-
-	if [[ "$(gcc-major-version)" -ge 4 ]]; then
-		append-flags -fwrapv
-	fi
-
-	filter-flags -malign-double
-
-	# https://bugs.gentoo.org/show_bug.cgi?id=50309
-	if is-flagq -O3; then
-		is-flagq -fstack-protector-all && replace-flags -O3 -O2
-		use hardened && replace-flags -O3 -O2
-	fi
-
-	if tc-is-cross-compiler; then
-		# Force some tests that try to poke fs paths.
-		export ac_cv_file__dev_ptc=no
-		export ac_cv_file__dev_ptmx=yes
-	fi
-
-	# http://bugs.gentoo.org/show_bug.cgi?id=302137
-	if [[ ${CHOST} == powerpc-*-darwin* ]] && \
-		( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \
-		[[ ${CHOST} == powerpc64-*-darwin* ]];
-	then
-		replace-flags -O2 -O3
-		replace-flags -Os -O3  # comment #14
-	fi
-
-	# Set LDFLAGS so we link modules with -lpython2.7 correctly.
-	# Needed on FreeBSD unless Python 2.7 is already installed.
-	# Please query BSD team before removing this!
-	# On AIX this is not needed, but would record '.' as runpath.
-	[[ ${CHOST} == *-aix* ]] ||
-	append-ldflags "-L."
-
-	if use prefix ; then
-		# for Python's setup.py not to do false assumptions (only looking in
-		# host paths) we need to make explicit where Prefix stuff is
-		append-cppflags -I"${EPREFIX}"/usr/include
-		append-ldflags -L"${EPREFIX}"/$(get_libdir)
-		append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
-		# fix compilation on some Linux hosts, #381163, #473520
-		if use elibc_glibc ; then
-			for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
-				[[ -d ${hostlibdir} ]] || continue
-				append-ldflags -L${hostlibdir}
-			done
-		fi
-		# Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that
-		# local include paths - set in $(CPPFLAGS) - are searched first.
-		sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
-	fi
-
-	# Export CC so even AIX will use gcc instead of xlc_r.
-	# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
-	tc-export CC CXX
-	# The configure script fails to use pkg-config correctly.
-	# http://bugs.python.org/issue15506
-	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
-
-	local dbmliborder
-	if use gdbm; then
-		dbmliborder+="${dbmliborder:+:}gdbm"
-	fi
-	if use berkdb; then
-		dbmliborder+="${dbmliborder:+:}bdb"
-	fi
-
-	[[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
-
-	# we need this to get pythonw, the GUI version of python
-	# --enable-framework and --enable-shared are mutually exclusive:
-	# http://bugs.python.org/issue5809
-	local myshared=
-	use aqua \
-		&& myshared="--enable-framework=${EPREFIX}/usr/lib" \
-		|| myshared="--enable-shared"
-
-	BUILD_DIR="${WORKDIR}/${CHOST}"
-	mkdir -p "${BUILD_DIR}" || die
-	cd "${BUILD_DIR}" || die
-
-	# note: for a framework build we need to use ucs2 because macOS
-	# uses that internally too:
-	# http://bugs.python.org/issue763708
-	# HAS_HG to avoid finding obsolete hg of the host
-	ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \
-	econf \
-		--with-fpectl \
-		${myshared} \
-		$(use_enable ipv6) \
-		$(use_with threads) \
-		$( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
-		--infodir='${prefix}/share/info' \
-		--mandir='${prefix}/share/man' \
-		--with-computed-gotos \
-		--with-dbmliborder="${dbmliborder}" \
-		--with-libc="" \
-		--enable-loadable-sqlite-extensions \
-		--with-system-expat \
-		--with-system-ffi \
-		--without-ensurepip
-
-	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
-		eerror "configure has detected that the sem_open function is broken."
-		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
-		die "Broken sem_open function (bug 496328)"
-	fi
-}
-
-src_compile() {
-	# Avoid invoking pgen for cross-compiles.
-	touch Include/graminit.h Python/graminit.c
-
-	cd "${BUILD_DIR}" || die
-	emake
-
-	# Work around bug 329499. See also bug 413751 and 457194.
-	if has_version dev-libs/libffi[pax_kernel]; then
-		pax-mark E python
-	else
-		pax-mark m python
-	fi
-}
-
-src_test() {
-	# Tests will not work when cross compiling.
-	if tc-is-cross-compiler; then
-		elog "Disabling tests due to crosscompiling."
-		return
-	fi
-
-	cd "${BUILD_DIR}" || die
-
-	# Skip failing tests.
-	local skipped_tests="distutils gdb"
-
-	for test in ${skipped_tests}; do
-		mv "${S}"/Lib/test/test_${test}.py "${T}"
-	done
-
-	# Daylight saving time problem
-	# https://bugs.python.org/issue22067
-	# https://bugs.gentoo.org/610628
-	local -x TZ=UTC
-
-	# Rerun failed tests in verbose mode (regrtest -w).
-	emake test EXTRATESTOPTS="-w" < /dev/tty
-	local result="$?"
-
-	for test in ${skipped_tests}; do
-		mv "${T}/test_${test}.py" "${S}"/Lib/test
-	done
-
-	elog "The following tests have been skipped:"
-	for test in ${skipped_tests}; do
-		elog "test_${test}.py"
-	done
-
-	elog "If you would like to run them, you may:"
-	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
-	elog "and run the tests separately."
-
-	if [[ "${result}" -ne 0 ]]; then
-		die "emake test failed"
-	fi
-}
-
-src_install() {
-	local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
-
-	cd "${BUILD_DIR}" || die
-	[[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/
-	if use aqua ; then
-		local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework
-
-		# do not make multiple targets in parallel when there are broken
-		# sharedmods (during bootstrap), would build them twice in parallel.
-
-		# Python_Launcher is kind of a wrapper, and we should fix it for
-		# Prefix (it uses /usr/bin/pythonw) so useless
-		# IDLE doesn't run, no idea, but definitely not used
-		sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
-			Mac/Makefile || die
-
-		# let the makefiles do their thing
-		emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
-		rmdir "${ED}"/Applications/Python* || die
-		rmdir "${ED}"/Applications || die
-
-		# avoid framework incompatability, degrade to a normal UNIX lib
-		mkdir -p "${ED}"/usr/$(get_libdir)
-		cp "${D}${fwdir}"/Versions/${SLOT}/Python \
-			"${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
-		chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
-		install_name_tool \
-			-id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
-			"${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
-		chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
-		cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
-
-		# rebuild python executable to be the non-pythonw (python wrapper)
-		# version so we don't get framework crap
-		rm "${ED}"/usr/bin/python${SLOT}  # drop existing symlink, bug #390861
-		$(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
-			-o "${ED}"/usr/bin/python${SLOT} \
-			Modules/python.o || die
-
-		# don't install the "Current" symlink, will always conflict
-		rm "${D}${fwdir}"/Versions/Current || die
-		# update whatever points to it, eselect-python sets them
-		rm "${D}${fwdir}"/{Headers,Python,Resources} || die
-
-		# remove unversioned files (that are not made versioned below)
-		pushd "${ED}"/usr/bin > /dev/null
-		rm -f python python-config python${SLOT}-config
-		# python${SLOT} was created above
-		for f in pythonw smtpd${SLOT}.py pydoc idle ; do
-			rm -f ${f} ${f}${SLOT}
-		done
-		# pythonw needs to remain in the framework (that's the whole
-		# reason we go through this framework hassle)
-		ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
-		# copy the scripts to we can fix their shebangs
-		for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
-			# for some reason sometimes they already exist, bug #347321
-			rm -f ${f}
-			cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
-			sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
-				${f} || die
-		done
-		# "fix" to have below collision fix not to bail
-		mv pydoc${SLOT} pydoc || die
-		mv idle${SLOT} idle || die
-		popd > /dev/null
-
-		# basically we don't like the framework stuff at all, so just move
-		# stuff around or add some symlinks to make our life easier
-		mkdir -p "${ED}"/usr
-		mv "${D}${fwdir}"/Versions/${SLOT}/share \
-			"${ED}"/usr/ || die "can't move share"
-		# get includes just UNIX style
-		mkdir -p "${ED}"/usr/include
-		mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
-			"${ED}"/usr/include/ || die "can't move include"
-		pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
-		ln -s ../../../../../include/python${SLOT} || die
-		popd > /dev/null
-		rm -f "${ED}"/usr/share/man/man1/python{,2}.1
-
-		# same for libs
-		# NOTE: can't symlink the entire dir, because a real dir already exists
-		# on upgrade (site-packages), however since we h4x0rzed python to
-		# actually look into the UNIX-style dir, we just switch them around.
-		mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
-		mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
-			"${ED}"/usr/$(get_libdir)/python${SLOT}/ \
-			|| die "can't move python${SLOT}"
-		rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
-		pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
-		ln -s ../../../../python${SLOT} || die
-		popd > /dev/null
-
-		# fix up Makefile
-		sed -i \
-			-e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
-			-e '/^LDFLAGS=/s/=.*$/=/' \
-			-e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
-			-e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
-			-e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
-			-e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
-			-e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
-			-e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
-			"${libdir}"/config/Makefile || die
-		# and sysconfigdata likewise
-		sed -i \
-			-e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
-			-e "/'LDFLAGS'/s/:.*$/:'',/" \
-			-e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
-			-e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
-			-e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
-			-e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
-			-e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
-			-e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
-			"${libdir}"/_sysconfigdata.py || die
-
-		# add missing version.plist file
-		mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
-		cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>BuildVersion</key>
-	<string>1</string>
-	<key>CFBundleShortVersionString</key>
-	<string>${PV}</string>
-	<key>CFBundleVersion</key>
-	<string>${PV}</string>
-	<key>ProjectName</key>
-	<string>Python</string>
-	<key>SourceVersion</key>
-	<string>${PV}</string>
-</dict>
-</plist>
-EOF
-	else
-		emake DESTDIR="${D}" altinstall
-	fi
-
-	sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
-	if [[ ${CHOST} == *-aix* ]]; then
-		# fix upstream bugs with quite large proposed diffs still to be sorted out:
-		# http://bugs.python.org/issue13493
-		# http://bugs.python.org/issue14150
-		# http://bugs.python.org/issue15590
-		# http://bugs.python.org/issue16189
-		sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \
-			-i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed"
-		sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \
-			-e 's| -bI:| -Wl,-bI:|g' \
-			-e '/LINKFORSHARED/s|-bE:|-bI:|g' \
-			-e '/LINKFORSHARED/s| -lld||g' \
-			-i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed"
-	fi
-
-	# Fix collisions between different slots of Python.
-	mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
-	mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
-	mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
-	rm -f "${ED}usr/bin/smtpd.py"
-
-	# http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
-	# These #defines cause problems when building c99 compliant python modules
-	# http://bugs.python.org/issue1759169
-	[[ ${CHOST} == *-solaris* ]] && sed -i -e \
-		's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
-		 "${ED}"/usr/include/python${SLOT}/pyconfig.h
-
-		use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
-		use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
-		use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
-		use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
-
-	use threads || rm -r "${libdir}/multiprocessing" || die
-	use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
-
-	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
-
-	if use examples; then
-		insinto /usr/share/doc/${PF}/examples
-		doins -r "${S}"/Tools
-	fi
-	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
-	local libname
-	if use aqua ; then
-		# we do framework, so the emake trick below returns a pathname
-		# since that won't work here, use a (cheap) trick instead
-		libname=libpython${SLOT}
-	else
-		libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
-			emake --no-print-directory -s -f - 2>/dev/null)
-	fi
-	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
-
-	newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
-	newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
-	sed \
-		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
-		-e "s:@PYDOC@:pydoc${SLOT}:" \
-		-i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
-
-	# for python-exec
-	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
-
-	# if not using a cross-compiler, use the fresh binary
-	if ! tc-is-cross-compiler; then
-		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
-		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
-		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}.
-		local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}"
-	else
-		vars=( PYTHON "${vars[@]}" )
-	fi
-
-	python_export "python${SLOT}" "${vars[@]}"
-	echo "EPYTHON='${EPYTHON}'" > epython.py || die
-	python_domodule epython.py
-
-	# python-exec wrapping support
-	local pymajor=${SLOT%.*}
-	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
-	# python and pythonX
-	ln -s "../../../bin/python${SLOT}" \
-		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
-	ln -s "python${pymajor}" \
-		"${D}${PYTHON_SCRIPTDIR}/python" || die
-	# python-config and pythonX-config
-	ln -s "../../../bin/python${SLOT}-config" \
-		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
-	ln -s "python${pymajor}-config" \
-		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
-	# 2to3, pydoc, pyvenv
-	ln -s "../../../bin/2to3-${SLOT}" \
-		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
-	ln -s "../../../bin/pydoc${SLOT}" \
-		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
-	# idle
-	if use tk; then
-		ln -s "../../../bin/idle${SLOT}" \
-			"${D}${PYTHON_SCRIPTDIR}/idle" || die
-	fi
-}
-
-eselect_python_update() {
-	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
-		eselect python update
-	fi
-
-	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
-		eselect python update --python${PV%%.*}
-	fi
-}
-
-pkg_postinst() {
-	eselect_python_update
-}
-
-pkg_postrm() {
-	eselect_python_update
-}


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2018-05-03 10:39 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2018-05-03 10:39 UTC (permalink / raw
  To: gentoo-commits

commit:     75ef481b8914d32e491659fd40eeb7d5605024fa
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu May  3 10:39:17 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu May  3 10:39:17 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=75ef481b

dev-lang/python: sync/bump 3.4

Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6

 dev-lang/python/Manifest                           |   3 +
 dev-lang/python/files/3.4-getentropy-linux.patch   |  40 ++
 dev-lang/python/files/3.6-disable-nis.patch        |  21 +
 .../python/files/python-3.5.5-hash-unaligned.patch |  43 ++
 dev-lang/python/python-3.4.8-r1.ebuild             | 455 +++++++++++++++++++++
 5 files changed, 562 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 274b181cfb..b4faac8990 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -2,13 +2,16 @@ DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd1665
 DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 BLAKE2B 3dd91f83e5886cb9ba5c1fd9f3da38ab521db70645fa187752cd784919d523d9bf59b61223ea1a455b6d9002ba88dac5bd834c8e943b121db84e30bbb0f65204 SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62
 DIST Python-2.7.14.tar.xz 12576112 BLAKE2B e03c4134cfdd88678acc26f383130a598ce4de908ab6bb9ee00e9235de3e0fcb9e653fec86f39db64fb895ef797d33736524655c5b94fab2cde2544b966b2cfb SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9
 DIST Python-3.4.5.tar.xz 14516820 BLAKE2B f9ddabd2df2241089d07756d3a8ba1c70096bee60d7cdef84041edbb20c488c3a573762441a4b7f543dbc0ce403ce84ff7d02e7d25699917bd014ab96deead85 SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c
+DIST Python-3.4.8.tar.xz 14576444 BLAKE2B 262b82fbc0e4852216d2edf05f9e9194bc93be7b14a2d6ef56789b808cff274e58b2fa7134955464fd05ab36181b5861aeca31e2e05b27f0f58ac66d145bd56b SHA512 478552c72efe606cb1993024b81839c51d01f1c949564c007ab2b76016f110e1f7bd418e5de3f4f93b466ce7dbe6583d3c150830d1f28f75e0809625b568a7ec
 DIST Python-3.5.4.tar.xz 15332320 BLAKE2B 1fc3ba4eb1ed949062961c13fd1f9851c7f9cbeb4916c06a0389349ee2d4872b2b1c2d30138822e6329b6a715f35a66df704b7a04aa4adeb95b685b8d6e45d61 SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff
 DIST Python-3.6.3.tar.xz 16974296 BLAKE2B 8220fc0c2eaa315d3972085b0f531f169adb6cfad57023ad2c115603b5a484573ea3540eb3216edd0f4514256c8edb07469cf38d17727d69cdc15cdf1f601623 SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b
 DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 BLAKE2B 0048e48ddaaa4bef08451354fde95a123042880f26dddc9267c7f9a90fd8abb40955e26ee8c9dfc5a1165556bb3e11585b27288e635d42a4000dd3d7654c41ad SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1
 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 BLAKE2B 7fb3cc7dcd987debd5aa263d8e26b21aad439d8e3177c06c3683406a53bbda9652175673b09b6300f6a5b62148190cd8a75c9b65a5de04d770866733fcc0ebcb SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8
+DIST python-gentoo-patches-3.4.6-0.tar.xz 11728 BLAKE2B 2a636f5500f4c7d354f421133f086cba9a25c30d5feaaa2dc25c9c588125d7c9097baecaa11f31548fa598b5dc137ca310ad86222510c0a955fa632a6d0a4b06 SHA512 41c22dc8f1db8800fc0b97eed2b27bf1873e5de1369bd4aecf7a7a91e609a78e45a4b56fc89d575317f33a7704c0c1cad1494e8a993415a198f256e8338f49ab
 DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed10748348484d314183c3de3ec950d5ca5ce7048bb322c470f3f5bff2d63eb7f2ed99c0fe75c621df050273d9d118681b28926061d SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec
 DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 BLAKE2B 3075754627617ac2ceee879eaf1a0e6564505655cdbdff380233a09df701a6188d64fe1f6a8c642b1fb05ef3c460a07042b6a362d655cd02717d6d9ba47983a1 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3
 DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 BLAKE2B 75422fc7390f559d9864f6e22a0b85982ccbdb07d5f2507db8e528285e56d1f11d4bc0b21a0b78d5340eafd562220d2f1b9d0a78b1f7c811c5689a426a81f9f3 SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8
 DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 BLAKE2B 228cea390cd16f68579896ccec06025446d6378ee164090a7f8ab8174d28e73e35b0e311b95ab78be7a54b21eefce7c01238e3cb31fae1f49a1706476c5abda5 SHA512 e32556c63e48d8dacd86218945147d1bbbc5777a6bb3441373827da47771a8eb387f26885acd35343cc598c719c9feec63007144fc1fdd1aca253a2ec1a19825
+DIST python-prefix-3.4.8-gentoo-patches-r0.tar.xz 12928 BLAKE2B d270f27485a70b4186c0d509836f66e6ae8218270cbb0a473b4579de7a8d9fa16eb2387d0441979aa62fc88e54a52f863c58d91b3df64dd6a40ad4bc4236cbb2 SHA512 84554d2b320922d7ac6e20012f847a81d6501693a4d9f2146faa8764fca4fbc5e3bf1c0f352853f1ab34ed905ab13097f2e82285ada54c9b4e219e72b39804c2
 DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 BLAKE2B ab0cbc5430e9588f71cfd7b001a07f9a77097262f17e1f980e3945e39855e1c9437117bf4eb2d424dadf701d37d025e09627d7efdbb9f8867714039f62f261a7 SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5
 DIST python-prefix-3.6.3-gentoo-patches-r0.tar.xz 12676 BLAKE2B 5221ae00d16db401d5674947923451d850978d930d9449d9b4f6ae6d117c26971e2f384c5a698b7acc8d62e6a6b673f4ec870da3788f87372593a5ac4897a227 SHA512 9d1673bc7b327be6b7e95491940eeeaa40db9e94f2183f4605a9a5a7fd2e187017164e9b2ef31f3bc8d694e467de6843706d3341b4ce24d4d8717513c246b62f

diff --git a/dev-lang/python/files/3.4-getentropy-linux.patch b/dev-lang/python/files/3.4-getentropy-linux.patch
new file mode 100644
index 0000000000..9f12389bb2
--- /dev/null
+++ b/dev-lang/python/files/3.4-getentropy-linux.patch
@@ -0,0 +1,40 @@
+From 5635d44079e1bbd9c495951ede8d078e7b8d67d5 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <victor.stinner@gmail.com>
+Date: Mon, 9 Jan 2017 11:10:41 +0100
+Subject: [PATCH] Don't use getentropy() on Linux
+
+Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but
+read from /dev/urandom to get random bytes, for example in os.urandom().  On
+Linux, getentropy() is implemented which getrandom() is blocking mode, whereas
+os.urandom() should not block.
+---
+ Python/random.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/Python/random.c b/Python/random.c
+index af3d0bd0d5..dc6400d3b8 100644
+--- a/Python/random.c
++++ b/Python/random.c
+@@ -67,9 +67,16 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
+     return 0;
+ }
+ 
+-/* Issue #25003: Don' use getentropy() on Solaris (available since
+- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
+-#elif defined(HAVE_GETENTROPY) && !defined(sun)
++/* Issue #25003: Don't use getentropy() on Solaris (available since
++   Solaris 11.3), it is blocking whereas os.urandom() should not block.
++
++   Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
++   implements it with the getrandom() syscall which can fail with ENOSYS,
++   and this error is not supported in py_getentropy() and getrandom() is called
++   with flags=0 which blocks until system urandom is initialized, which is not
++   the desired behaviour to seed the Python hash secret nor for os.urandom():
++   see the PEP 524 which was only implemented in Python 3.6. */
++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
+ #define PY_GETENTROPY 1
+ 
+ /* Fill buffer with size pseudo-random bytes generated by getentropy().
+-- 
+2.15.0.rc2
+

diff --git a/dev-lang/python/files/3.6-disable-nis.patch b/dev-lang/python/files/3.6-disable-nis.patch
new file mode 100644
index 0000000000..4e81847b50
--- /dev/null
+++ b/dev-lang/python/files/3.6-disable-nis.patch
@@ -0,0 +1,21 @@
+--- a/setup.py
++++ b/setup.py
+@@ -1332,17 +1332,7 @@ class PyBuildExt(build_ext):
+             # Jeremy Hylton's rlimit interface
+             exts.append( Extension('resource', ['resource.c']) )
+ 
+-            # Sun yellow pages. Some systems have the functions in libc.
+-            if (host_platform not in ['cygwin', 'qnx6'] and
+-                find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
+-                if (self.compiler.find_library_file(lib_dirs, 'nsl')):
+-                    libs = ['nsl']
+-                else:
+-                    libs = []
+-                exts.append( Extension('nis', ['nismodule.c'],
+-                                       libraries = libs) )
+-            else:
+-                missing.append('nis')
++            missing.append('nis')
+         else:
+             missing.extend(['nis', 'resource', 'termios'])
+ 

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
new file mode 100644
index 0000000000..c418f40b7d
--- /dev/null
+++ b/dev-lang/python/files/python-3.5.5-hash-unaligned.patch
@@ -0,0 +1,43 @@
+The hash implementation casts the input pointer to uint64_t* and directly reads
+from this, which may cause unaligned accesses. Use memcpy() instead so this code
+will not crash with SIGBUS on sparc.
+
+--- a/Python/pyhash.c	2017-11-29 10:21:20.283094068 +0100
++++ b/Python/pyhash.c	2017-11-29 10:24:26.733087813 +0100
+@@ -372,7 +372,7 @@ siphash24(const void *src, Py_ssize_t sr
+     PY_UINT64_T k0 = _le64toh(_Py_HashSecret.siphash.k0);
+     PY_UINT64_T k1 = _le64toh(_Py_HashSecret.siphash.k1);
+     PY_UINT64_T b = (PY_UINT64_T)src_sz << 56;
+-    const PY_UINT64_T *in = (PY_UINT64_T*)src;
++    const PY_UINT8_T *in = (PY_UINT8_T*)src;
+ 
+     PY_UINT64_T v0 = k0 ^ 0x736f6d6570736575ULL;
+     PY_UINT64_T v1 = k1 ^ 0x646f72616e646f6dULL;
+@@ -381,12 +381,14 @@ siphash24(const void *src, Py_ssize_t sr
+ 
+     PY_UINT64_T t;
+     PY_UINT8_T *pt;
+-    PY_UINT8_T *m;
++    const PY_UINT8_T *m;
+ 
+     while (src_sz >= 8) {
+-        PY_UINT64_T mi = _le64toh(*in);
+-        in += 1;
+-        src_sz -= 8;
++        PY_UINT64_T mi;
++        memcpy(&mi, in, sizeof(mi));
++        mi = _le64toh(mi);
++        in += sizeof(mi);
++        src_sz -= sizeof(mi);
+         v3 ^= mi;
+         DOUBLE_ROUND(v0,v1,v2,v3);
+         v0 ^= mi;
+@@ -394,7 +396,7 @@ siphash24(const void *src, Py_ssize_t sr
+ 
+     t = 0;
+     pt = (PY_UINT8_T *)&t;
+-    m = (PY_UINT8_T *)in;
++    m = in;
+     switch (src_sz) {
+         case 7: pt[6] = m[6];
+         case 6: pt[5] = m[5];

diff --git a/dev-lang/python/python-3.4.8-r1.ebuild b/dev-lang/python/python-3.4.8-r1.ebuild
new file mode 100644
index 0000000000..1a724e53a4
--- /dev/null
+++ b/dev-lang/python/python-3.4.8-r1.ebuild
@@ -0,0 +1,455 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
+
+MY_P="Python-${PV/_/}"
+PATCHSET_VERSION="3.4.6-0"
+PREFIX_PATCHREV="r0"
+CYGWINPORTS_GITREV="8ee84829be03c2a1aa74f0f095c994c1f43f4688"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
+	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
+	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
+
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python3/archive/${CYGWINPORTS_GITREV}.zip )"
+
+LICENSE="PSF-2"
+SLOT="3.4/3.4m"
+KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="aqua bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk wininst +xml"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="app-arch/bzip2:0=
+	app-arch/xz-utils:0=
+	>=sys-libs/zlib-1.1.3:0=
+	virtual/libffi
+	virtual/libintl
+	gdbm? ( sys-libs/gdbm:0=[berkdb] )
+	ncurses? (
+		>=sys-libs/ncurses-5.2:0=
+		readline? ( >=sys-libs/readline-4.1:0= )
+	)
+	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:= )
+	)
+	tk? (
+		>=dev-lang/tcl-8.0:0=
+		>=dev-lang/tk-8.0:0=[-aqua]
+		dev-tcltk/blt:0=
+		dev-tcltk/tix
+	)
+	xml? ( >=dev-libs/expat-2.1:0= )
+	!!<sys-apps/sandbox-2.6-r1"
+# bluetooth requires headers from bluez
+DEPEND="${RDEPEND}
+	bluetooth? ( net-wireless/bluez )
+	virtual/pkgconfig
+	>=sys-devel/autoconf-2.65
+	!sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )"
+PDEPEND=">=app-eselect/eselect-python-20140125-r1"
+
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
+
+S="${WORKDIR}/${MY_P}"
+
+PYVER=${SLOT%/*}
+
+src_prepare() {
+	# Ensure that internal copies of expat, libffi and zlib are not used.
+	rm -fr Modules/expat
+	rm -fr Modules/_ctypes/libffi*
+	rm -fr Modules/zlib
+
+	if tc-is-cross-compiler; then
+		# Invokes BUILDPYTHON, which is built for the host arch
+		local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
+	fi
+
+	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+	epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
+	epatch "${FILESDIR}/${PN}-3.4.5-cross.patch"
+	epatch "${FILESDIR}/3.4-getentropy-linux.patch"
+	epatch "${FILESDIR}/3.6-disable-nis.patch"
+	epatch "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
+
+	# Prefix' round of patches
+	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+		epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
+
+	# https://forums.developer.apple.com/thread/9233, bug #572726
+	sed -i -e '/$(RUNSHARED) .\/regen/s/^/export RUNSHARED=$(RUNSHARED); /' \
+		Makefile.pre.in || die
+	sed -i -e '/python$EXE/s/^/env ${RUNSHARED} /' \
+		Lib/plat-darwin/regen || die
+
+	# we provide a fully working readline also on Darwin, so don't force
+	# usage of less functional libedit
+	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
+
+	# We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR.
+	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
+
+	# Make sure python doesn't use the host libffi.
+	use prefix && epatch "${FILESDIR}/python-3.2-libffi-pkgconfig.patch"
+
+	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
+	    local p d="${WORKDIR}/python3-${CYGWINPORTS_GITREV}"
+	    for p in $(
+		    eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python3.cygport)"
+		    echo ${PATCH_URI}
+	    ); do
+			# dropped by 01_all_prefix-no-patch-invention.patch
+			[[ ${p} == *-tkinter-* ]] && continue
+		    epatch "${d}/${p}"
+	    done
+	fi
+
+	epatch_user
+
+	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+		configure.ac \
+		Lib/distutils/command/install.py \
+		Lib/distutils/sysconfig.py \
+		Lib/site.py \
+		Lib/sysconfig.py \
+		Lib/test/test_site.py \
+		Makefile.pre.in \
+		Modules/Setup.dist \
+		Modules/getpath.c \
+		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+	# workaround a development build env problem and muck around
+	# framework install to get the best of both worlds (non-standard)
+	sed -i \
+		-e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
+		-e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
+		configure.ac configure || die
+	sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
+
+	# Disable ABI flags.
+	sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
+
+	eautoreconf
+}
+
+src_configure() {
+	local disable
+	# disable automagic bluetooth headers detection
+	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+	use gdbm     || disable+=" gdbm"
+	use ncurses  || disable+=" _curses _curses_panel"
+	use readline || disable+=" readline"
+	use sqlite   || disable+=" _sqlite3"
+	use ssl      || export PYTHON_DISABLE_SSL="1"
+	use tk       || disable+=" _tkinter"
+	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+	export PYTHON_DISABLE_MODULES="${disable}"
+
+	if ! use xml; then
+		ewarn "You have configured Python without XML support."
+		ewarn "This is NOT a recommended configuration as you"
+		ewarn "may face problems parsing any XML documents."
+	fi
+
+	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+	fi
+
+	if [[ "$(gcc-major-version)" -ge 4 ]]; then
+		append-flags -fwrapv
+	fi
+
+	filter-flags -malign-double
+
+	# https://bugs.gentoo.org/show_bug.cgi?id=50309
+	if is-flagq -O3; then
+		is-flagq -fstack-protector-all && replace-flags -O3 -O2
+		use hardened && replace-flags -O3 -O2
+	fi
+
+	# Export CC so even AIX will use gcc instead of xlc_r.
+	# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
+	tc-export CC CXX
+
+	# The configure script fails to use pkg-config correctly.
+	# http://bugs.python.org/issue15506
+	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+	# Set LDFLAGS so we link modules with -lpython3.2 correctly.
+	# Needed on FreeBSD unless Python 3.2 is already installed.
+	# Please query BSD team before removing this!
+	append-ldflags "-L."
+
+	# make sure setup.py considers Prefix' paths before system ones
+	use prefix && append-cppflags -I"${EPREFIX}"/usr/include
+	use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
+
+	local dbmliborder
+	if use gdbm; then
+		dbmliborder+="${dbmliborder:+:}gdbm"
+	fi
+
+	BUILD_DIR="${WORKDIR}/${CHOST}"
+	mkdir -p "${BUILD_DIR}" || die
+	cd "${BUILD_DIR}" || die
+
+	if use aqua ; then
+		ECONF_SOURCE="${S}" OPT="" \
+		econf \
+			--enable-framework="${EPREFIX}"/usr/lib \
+			--config-cache
+	fi
+
+	# pymalloc #452720
+	ECONF_SOURCE="${S}" OPT="" \
+	econf \
+		$(use aqua && echo --config-cache) \
+		--with-fpectl \
+		--enable-shared \
+		$(use_enable ipv6) \
+		$(use_with threads) \
+		--infodir='${prefix}/share/info' \
+		--mandir='${prefix}/share/man' \
+		--with-computed-gotos \
+		--with-dbmliborder="${dbmliborder}" \
+		--with-libc="" \
+		--enable-loadable-sqlite-extensions \
+		--with-system-expat \
+		--with-system-ffi \
+		--without-ensurepip \
+		--without-pymalloc
+
+	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+		eerror "configure has detected that the sem_open function is broken."
+		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+		die "Broken sem_open function (bug 496328)"
+	fi
+}
+
+src_compile() {
+	# Ensure sed works as expected
+	# https://bugs.gentoo.org/594768
+	local -x LC_ALL=C
+
+	# Avoid invoking pgen for cross-compiles.
+	touch Include/graminit.h Python/graminit.c || die
+
+	cd "${BUILD_DIR}" || die
+
+	emake CPPFLAGS= CFLAGS= LDFLAGS=
+
+	# Work around bug 329499. See also bug 413751 and 457194.
+	if has_version dev-libs/libffi[pax_kernel]; then
+		pax-mark E python
+	else
+		pax-mark m python
+	fi
+}
+
+src_test() {
+	# Tests will not work when cross compiling.
+	if tc-is-cross-compiler; then
+		elog "Disabling tests due to crosscompiling."
+		return
+	fi
+
+	cd "${BUILD_DIR}" || die
+
+	# Skip failing tests.
+	local skipped_tests="gdb"
+
+	for test in ${skipped_tests}; do
+		mv "${S}"/Lib/test/test_${test}.py "${T}"
+	done
+
+	local -x PYTHONDONTWRITEBYTECODE=
+	emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
+	local result=$?
+
+	for test in ${skipped_tests}; do
+		mv "${T}/test_${test}.py" "${S}"/Lib/test
+	done
+
+	elog "The following tests have been skipped:"
+	for test in ${skipped_tests}; do
+		elog "test_${test}.py"
+	done
+
+	elog "If you would like to run them, you may:"
+	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
+	elog "and run the tests separately."
+
+	if [[ ${result} -ne 0 ]]; then
+		die "emake test failed"
+	fi
+}
+
+src_install() {
+	local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
+
+	cd "${BUILD_DIR}" || die
+
+	emake DESTDIR="${D}" altinstall
+
+	if use aqua ; then
+		# avoid config.status to be triggered
+		find Mac -name "Makefile" -exec touch \{\} + || die
+
+		# Python_Launcher is kind of a wrapper, and we should fix it for
+		# Prefix (it uses /usr/bin/pythonw) so useless
+		# IDLE doesn't run, no idea, but definitely not used
+		emake DESTDIR="${D}" -C Mac install_Python || die
+		rmdir "${ED}"/Applications/Python* || die
+		rmdir "${ED}"/Applications || die
+
+		local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER}
+		ln -s "${EPREFIX}"/usr/include/python${PYVER} \
+			"${ED}${fwdir}"/Headers || die
+		ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
+			"${ED}${fwdir}"/Python || die
+	fi
+
+	sed \
+		-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
+		-e "s/\(PY_LDFLAGS=\).*/\1/" \
+		-i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
+
+	# Fix collisions between different slots of Python.
+	rm -f "${ED}usr/$(get_libdir)/libpython3.so"
+
+	# Cheap hack to get version with ABIFLAGS
+	local abiver=$(cd "${ED}usr/include"; echo python*)
+	if [[ ${abiver} != python${PYVER} ]]; then
+		# Replace python3.X with a symlink to python3.Xm
+		rm "${ED}usr/bin/python${PYVER}" || die
+		dosym "${abiver}" "/usr/bin/python${PYVER}"
+		# Create python3.X-config symlink
+		dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
+		# Create python-3.5m.pc symlink
+		dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
+	fi
+
+	use elibc_uclibc && rm -fr "${libdir}/test"
+	use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
+	use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
+
+	use threads || rm -fr "${libdir}/multiprocessing"
+	use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
+
+	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
+
+	if use examples; then
+		insinto /usr/share/doc/${PF}/examples
+		find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
+		doins -r "${S}"/Tools
+	fi
+	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+	if use aqua ; then
+		# we do framework, so the emake trick below returns a pathname
+		# since that won't work here, use a (cheap) trick instead
+		local libname=libpython${PYVER}
+	else
+		local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+			emake --no-print-directory -s -f - 2>/dev/null)
+	fi
+	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+	newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
+	newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+	sed \
+		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+		-e "s:@PYDOC@:pydoc${PYVER}:" \
+		-i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+	# for python-exec
+	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
+
+	# if not using a cross-compiler, use the fresh binary
+	if ! tc-is-cross-compiler; then
+		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
+	else
+		vars=( PYTHON "${vars[@]}" )
+	fi
+
+	python_export "python${PYVER}" "${vars[@]}"
+	echo "EPYTHON='${EPYTHON}'" > epython.py || die
+	python_domodule epython.py
+
+	# python-exec wrapping support
+	local pymajor=${PYVER%.*}
+	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+	# python and pythonX
+	ln -s "../../../bin/${abiver}" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+	ln -s "python${pymajor}" \
+		"${D}${PYTHON_SCRIPTDIR}/python" || die
+	# python-config and pythonX-config
+	# note: we need to create a wrapper rather than symlinking it due
+	# to some random dirname(argv[0]) magic performed by python-config
+	cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
+		#!/bin/sh
+		exec "${abiver}-config" "\${@}"
+	EOF
+	chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+	ln -s "python${pymajor}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
+	# 2to3, pydoc, pyvenv
+	ln -s "../../../bin/2to3-${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
+	ln -s "../../../bin/pydoc${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+	ln -s "../../../bin/pyvenv-${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
+	# idle
+	if use tk; then
+		ln -s "../../../bin/idle${PYVER}" \
+			"${D}${PYTHON_SCRIPTDIR}/idle" || die
+	fi
+}
+
+pkg_preinst() {
+	if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
+		python_updater_warning="1"
+	fi
+}
+
+eselect_python_update() {
+	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+		eselect python update
+	fi
+
+	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+		eselect python update --python${PV%%.*}
+	fi
+}
+
+pkg_postinst() {
+	eselect_python_update
+
+	if [[ "${python_updater_warning}" == "1" ]]; then
+		ewarn "You have just upgraded from an older version of Python."
+		ewarn
+		ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
+	fi
+}
+
+pkg_postrm() {
+	eselect_python_update
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2017-10-31  9:29 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2017-10-31  9:29 UTC (permalink / raw
  To: gentoo-commits

commit:     3b75d209b07832976303df1bfa6c91e1a7ce688a
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 31 09:29:13 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Oct 31 09:29:13 2017 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=3b75d209

dev-lang/python: version bump to 2.7.14 with updated MiNT patch, bug #593586

Package-Manager: Portage-2.3.13-prefix, Repoman-2.3.4

 dev-lang/python/Manifest                           |   3 +
 .../files/python-2.7.14-libffi-pkgconfig.patch     |  44 ++
 dev-lang/python/python-2.7.14.ebuild               | 632 +++++++++++++++++++++
 3 files changed, 679 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 221586ae58..6e6da0bcad 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -2,6 +2,7 @@ DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 SHA256 f813f6f9437cb15282
 DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 SHA256 811b6fe82630a04a44a6d16074af76964e7e4005136ba479647eb741639099da SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62 WHIRLPOOL 73eba606051ed1232de22965f0879cd2dc3895d2d280a3e355581be788adf1af20e96c7eb725af2e71df1d022e6b208ab2ffe70515693536d6464f033224cd14
 DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46 SHA512 72166763a2fe6aab45ecf378f55a1efc7322d1742c4638bae84f4ed4b9fb4c01f2a0293733c64426ae2c70df24d95ff2b1e2a4f3c2715de00d8f320d4d939ea0 WHIRLPOOL 7ebcff7a2fe775a21a3847dee10369b73aaea8685eb63b4bc33dab0f562b8fb984c398cb34e8158cf1e24f106002829649540aad30a5ec7f4de0018ce7449f69
 DIST Python-2.7.12.tar.xz 12390820 SHA256 d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978 SHA512 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f WHIRLPOOL fe4224f4c3dc8dc5c49005051da0069922c86f39880a0072c09fac422e1913d924ac695e22be11603a961329dd8c17b1cf7696b31b62ef93398e42745a6446d6
+DIST Python-2.7.14.tar.xz 12576112 SHA256 71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66 SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 WHIRLPOOL c604d747daa874de926abb8ec142a7824f2706b79fd828aa189895ba0e7d4df044b9be58d49ab70a245e9e7abd5da4340abe54fa0ff9eab32a4dee7db7ee9d29
 DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3
 DIST Python-3.4.5.tar.xz 14516820 SHA256 ee64b1c8a47461009abf25252332d29a4e587cb4f0c1c96aa793a3732e9d898a SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c WHIRLPOOL 43e0aed0177d46148964447b4fb24475c4c736afb2ba84ec393fbf55db3da3f192308f9c8f236deaa7a608dac56946ee7755970fadaa82bf406c910a05f36883
 DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f
@@ -10,6 +11,7 @@ DIST Python-3.5.4.tar.xz 15332320 SHA256 94d93bfabb3b109f8a10365a325f920f9ec98c6
 DIST Python-3.6.3.tar.xz 16974296 SHA256 cda7d967c9a4bfa52337cdf551bcc5cff026b6ac50a8834e568ce4a794ca81da SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b WHIRLPOOL cdd04d265568d577e97ce921bef63e78c493f05426adcc8bc2bb1e5dbf02e35c3a4361ff467b7021e917e5056cd12d75cb038e5977093649881f8c2c5aabcc28
 DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77
 DIST python-gentoo-patches-2.7.12-0.tar.xz 13576 SHA256 cd842eec7202df57c153adc1fbb81e70b26ef651f8e9346e065d8577b93f343b SHA512 8bf530fca15c47fa5d9bc958e433b35943a12c98e4172806a45aa60dc85ec92f8ab6ffcd90f752dc5bf8ffc711414894c15820c4b6ef72dbcedc2808119fb1f6 WHIRLPOOL 54b8ca6a4371d460dadccfdffcc096c12930d58714eef95117a658d7a1337ea89c45c69553b5b993017211faaa0f8d670e09a8452e53c0fb176be3e908524ee6
+DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 SHA256 3567feeb8f0c66161efaea1922bbfe4e71f6051533ef5f54a74b6ccf9e0359b6 SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1 WHIRLPOOL ab77023ac66def132d1dce72f98add3108fd7be303ef5b167a2374df3a94949c75f089dcfdd84ed05a5eb813d6c22cfecd0de03b5819817a20b04f30030f5f6d
 DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1
 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 SHA256 84ee7630670a1dac4bbbc55fabf5f99b5b29007de4f140ad956e93d2e7aba8fa SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8 WHIRLPOOL f0248faa0b4ce5679e37381bba90f8a4d361a49db792787bffc06a54a4bc82fea4d53255120f10e6dbf51b99e12417fc1b469be9624e73508fa3a212a38e7352
 DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc
@@ -18,6 +20,7 @@ DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 SHA256 30c9dbcd5c11ed025b9d8dd20
 DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 SHA256 56729f9848557c52361c71404e5583368f6a0e93b5b6c2e643b59cb079e253d9 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3 WHIRLPOOL 90d1f12bee812f350ca0330a97290ce0d5c5fa9ccd816441944f042ef561d9023f4b79239f6d559f38a486fea458e48bf11d33d5bd6fa605875b686a2a845bd1
 DIST python-prefix-2.7.11-gentoo-patches-r1.tar.xz 17268 SHA256 ecebc430e475030fdbfcd940f314f80ebcb8c6e01a6b2498478bb8f37e525484 SHA512 22218128ff83856dd042ecd6aab3615282ab29c4420e6cce4a0bba8b6508e3f5649c27cdf50cf342fffd3c87ea29f8b7d32d28b9b1f4dc200771b52ee41f27e5 WHIRLPOOL 2a942b39e56955df5b24f50d68a39ca78152e10f13ccc856340cd4651eb87847097ec3ff79efde81c2130b12f2885764194fb8d51c05278f4acc550bcd4ba032
 DIST python-prefix-2.7.12-gentoo-patches-r0.tar.xz 17380 SHA256 c488011046a678eaf2febe3d02726a0efbd2f8378a0c5b896b03bcbed5b5f00a SHA512 ef17c8e8083da0ed0e6a63c96f59cc1243b0376fc6d4d7fcecb165e557403c54ae87625ed6dfe4d7d73693f8220ec98ef8a3f16124d8022dbac6a3a9d5514d9c WHIRLPOOL 7e427be36a8d558193058d7112f704993474eff7bb554b6f2f0d9cfe085c653a9cf0522a33249a92e813fad667a53439c9f70d74bcde0df9f78824bfbbfaae46
+DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 SHA256 1d57b53df4f2d3be36cbdcd046f6682ca2287ea87b6a5ce4a4704c3aaf1909af SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8 WHIRLPOOL 42a85d862e958c3bbb6a9121dac90c8370b88fdb0053292947cbe205eb4a841737025f038ea8df94c54cd0c48463466a2d545ca4767c7cc3a08f45349f8cc1fd
 DIST python-prefix-3.4.3-gentoo-patches-r1.tar.xz 12896 SHA256 39da669913d8627a74e6d9a7e1ee6eae3e184d7525097090d4b05a71b0a79100 SHA512 dd1082ef9605fdcb84bcc769318be6934c889a5b6134971fb121b3be8301cb9519fb687841a359c65e0614d05a8c27eab4b3dbfe94ed8dbbf2fc64f82206a6d9 WHIRLPOOL 884f0e9e5e177543c74f3c3e87629113db6c53c556f55bf7310de79f101fa825472d886eea216cea471e981dc4fd6743622e1c7472b5ffe04eda4c6790d73c62
 DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 SHA256 ab0b1f138c8bd22b2be862923e219d68513d98e77d32260b9625d19be08b1bf3 SHA512 e32556c63e48d8dacd86218945147d1bbbc5777a6bb3441373827da47771a8eb387f26885acd35343cc598c719c9feec63007144fc1fdd1aca253a2ec1a19825 WHIRLPOOL fda061e683462252bf777ea43d84958fb07ca0144be3f87cc42e4e2baa4f69cb0ed3075b55445398f88c514d28c8c310c6b5b312883a4949c8745161aaf3d786
 DIST python-prefix-3.5.1-gentoo-patches-r2.tar.xz 12680 SHA256 73b1166eded9867b473c90171b613d32bbe8f72e523c74b1563a9c25c555e13b SHA512 82b08b8cf7f3620c4c2a6a6c3ed5ec8c3318c6f43e4bcc4950c7aeb56ec755e0e47d46f068843f5b04159583994c8620dab14827278a199789a3867532cc6e0c WHIRLPOOL ac4ea106ca744d6e154e14a53ae2e8eeb119207069ead95d0ef19657a58e1d31ed1933de6315ab61ce532c11d1ae4a999c73d34121028a0a246b7dd2b1ac857a

diff --git a/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
new file mode 100644
index 0000000000..85abb1b56b
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
@@ -0,0 +1,44 @@
+diff -u -r Python-2.7.5-orig//configure.ac Python-2.7.5/configure.ac
+--- Python-2.7.5-orig//configure.ac	2014-03-06 04:35:31.000000000 +0100
++++ Python-2.7.5/configure.ac	2014-03-06 04:58:10.000000000 +0100
+@@ -2300,10 +2300,13 @@
+ 
+ if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
+     LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
++    LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
+ else
+     LIBFFI_INCLUDEDIR=""
++    LIBFFI_LIB=""
+ fi
+ AC_SUBST(LIBFFI_INCLUDEDIR)
++AC_SUBST(LIBFFI_LIB)
+ 
+ AC_MSG_RESULT($with_system_ffi)
+ 
+diff -u -r Python-2.7.5-orig//Makefile.pre.in Python-2.7.5/Makefile.pre.in
+--- Python-2.7.5-orig//Makefile.pre.in	2014-03-06 04:35:31.000000000 +0100
++++ Python-2.7.5/Makefile.pre.in	2014-03-06 05:03:59.000000000 +0100
+@@ -224,6 +224,7 @@
+ 
+ 
+ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
++LIBFFI_LIB=	@LIBFFI_LIB@
+ 
+ ##########################################################################
+ # Parser
+diff -u -r Python-2.7.5-orig//setup.py Python-2.7.5/setup.py
+--- Python-2.7.5-orig//setup.py	2014-03-06 04:35:31.000000000 +0100
++++ Python-2.7.5/setup.py	2014-03-06 04:56:15.000000000 +0100
+@@ -1893,8 +1893,10 @@
+                     ffi_inc = None
+                     print('Header file {} does not define LIBFFI_H or '
+                           'ffi_wrapper_h'.format(ffi_h))
+-        ffi_lib = None
+-        if ffi_inc is not None:
++        ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
++        if not ffi_lib or ffi_lib == '':
++            ffi_lib = None
++        if ffi_inc is not None and ffi_lib is None:
+             for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
+                 if (self.compiler.find_library_file(lib_dirs, lib_name)):
+                     ffi_lib = lib_name

diff --git a/dev-lang/python/python-2.7.14.ebuild b/dev-lang/python/python-2.7.14.ebuild
new file mode 100644
index 0000000000..a97995fb67
--- /dev/null
+++ b/dev-lang/python/python-2.7.14.ebuild
@@ -0,0 +1,632 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
+
+MY_P="Python-${PV}"
+PATCHSET_VERSION="2.7.14-0"
+PREFIX_PATCHREV="r0"
+CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
+	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
+	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
+
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )"
+
+LICENSE="PSF-2"
+SLOT="2.7"
+KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="app-arch/bzip2:0=
+	>=sys-libs/zlib-1.1.3:0=
+	!m68k-mint? ( virtual/libffi )
+	virtual/libintl
+	berkdb? ( || (
+		sys-libs/db:5.3
+		sys-libs/db:5.2
+		sys-libs/db:5.1
+		sys-libs/db:5.0
+		sys-libs/db:4.8
+		sys-libs/db:4.7
+		sys-libs/db:4.6
+		sys-libs/db:4.5
+		sys-libs/db:4.4
+		sys-libs/db:4.3
+		sys-libs/db:4.2
+	) )
+	gdbm? ( sys-libs/gdbm:0=[berkdb] )
+	ncurses? (
+		>=sys-libs/ncurses-5.2:0=
+		readline? ( >=sys-libs/readline-4.1:0= )
+	)
+	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:= )
+	)
+	tk? (
+		>=dev-lang/tcl-8.0:0=
+		>=dev-lang/tk-8.0:0=[-aqua]
+		dev-tcltk/blt:0=
+		dev-tcltk/tix
+	)
+	xml? ( >=dev-libs/expat-2.1 )
+	!!<sys-apps/portage-2.1.9"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	>=sys-devel/autoconf-2.65
+	!sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )
+	doc? ( dev-python/python-docs:${SLOT} )"
+PDEPEND=">=app-eselect/eselect-python-20140125-r1"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+	if use berkdb; then
+		ewarn "'bsddb' module is out-of-date and no longer maintained inside"
+		ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
+		ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
+		ewarn "is provided by dev-python/bsddb3."
+	else
+		if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
+			ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
+			ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
+			ewarn "You might need to migrate your databases."
+		fi
+	fi
+}
+
+src_prepare() {
+	# Ensure that internal copies of expat, libffi and zlib are not used.
+	rm -r Modules/expat || die
+	rm -r Modules/_ctypes/libffi* || die
+	rm -r Modules/zlib || die
+
+	if tc-is-cross-compiler; then
+		local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
+	fi
+
+	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+
+	# if building a patched source-tar, comment the rm's above, and uncomment
+	# this line:
+	#local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch"
+
+	# Prefix' round of patches
+	# http://prefix.gentooexperimental.org:8000/python-patches-2_7
+	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+		epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
+
+	if use aqua ; then
+		# make sure we don't get a framework reference here
+		sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
+			-e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
+			Makefile.pre.in || die
+		# Python upstream refuses to listen to configure arguments
+		sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \
+			configure.ac configure || die
+		# we handle creation of symlinks in src_install
+		sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die
+	fi
+	# don't try to do fancy things on Darwin
+	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
+	# On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
+	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
+	# fix header standards conflicts on Solaris
+	if [[ ${CHOST} == *-solaris* ]] ; then
+		# GCC5 switched the default from gnu89 to gnu11, a standards
+		# conflict arises from that, which can be solved by upgrading
+		# _XOPEN_SOURCE from 500 to 600, but since it is compiler
+		# version specific, just force the old standard onto the
+		# compiler.  Python 3 properly detects this.
+		CC="$(tc-getCC) -std=gnu89"
+	fi
+
+	# Fix for cross-compiling.
+	epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
+	epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
+	epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
+	epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
+	epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
+
+	# Make sure python doesn't use the host libffi.
+	use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
+
+	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
+	    local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
+	    for p in $(
+		    eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
+		    echo ${PATCH_URI}
+	    ); do
+			# dropped by 01_all_prefix-no-patch-invention.patch
+			[[ ${p} == *-tkinter-* ]] && continue
+		    epatch "${d}/${p}"
+	    done
+	fi
+
+	epatch_user
+
+	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+		Lib/distutils/command/install.py \
+		Lib/distutils/sysconfig.py \
+		Lib/site.py \
+		Lib/sysconfig.py \
+		Lib/test/test_site.py \
+		Makefile.pre.in \
+		Modules/Setup.dist \
+		Modules/getpath.c \
+		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+	eautoreconf
+}
+
+src_configure() {
+		# dbm module can be linked against berkdb or gdbm.
+		# Defaults to gdbm when both are enabled, #204343.
+		local disable
+		use berkdb   || use gdbm || disable+=" dbm"
+		use berkdb   || disable+=" _bsddb"
+		use gdbm     || disable+=" gdbm"
+		use ncurses  || disable+=" _curses _curses_panel"
+		use readline || disable+=" readline"
+		use sqlite   || disable+=" _sqlite3"
+		use ssl      || export PYTHON_DISABLE_SSL="1"
+		use tk       || disable+=" _tkinter"
+		use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+		[[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
+		[[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs"
+		export PYTHON_DISABLE_MODULES="${disable}"
+
+		if ! use xml; then
+			ewarn "You have configured Python without XML support."
+			ewarn "This is NOT a recommended configuration as you"
+			ewarn "may face problems parsing any XML documents."
+		fi
+
+	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+	fi
+
+	if [[ "$(gcc-major-version)" -ge 4 ]]; then
+		append-flags -fwrapv
+	fi
+
+	filter-flags -malign-double
+
+	# https://bugs.gentoo.org/show_bug.cgi?id=50309
+	if is-flagq -O3; then
+		is-flagq -fstack-protector-all && replace-flags -O3 -O2
+		use hardened && replace-flags -O3 -O2
+	fi
+
+	if tc-is-cross-compiler; then
+		# Force some tests that try to poke fs paths.
+		export ac_cv_file__dev_ptc=no
+		export ac_cv_file__dev_ptmx=yes
+	fi
+
+	# http://bugs.gentoo.org/show_bug.cgi?id=302137
+	if [[ ${CHOST} == powerpc-*-darwin* ]] && \
+		( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \
+		[[ ${CHOST} == powerpc64-*-darwin* ]];
+	then
+		replace-flags -O2 -O3
+		replace-flags -Os -O3  # comment #14
+	fi
+
+
+	if use prefix ; then
+		# for Python's setup.py not to do false assumptions (only looking in
+		# host paths) we need to make explicit where Prefix stuff is
+		append-cppflags -I"${EPREFIX}"/usr/include
+		append-ldflags -L"${EPREFIX}"/$(get_libdir)
+		append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
+		# fix compilation on some 64-bits Linux hosts, #381163, #473520
+		for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
+			[[ -d ${hostlibdir} ]] || continue
+			append-ldflags -L${hostlibdir}
+		done
+		# Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that
+		# local include paths - set in $(CPPFLAGS) - are searched first.
+		sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
+	fi
+
+	# Export CC so even AIX will use gcc instead of xlc_r.
+	# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
+	tc-export CC CXX
+	# The configure script fails to use pkg-config correctly.
+	# http://bugs.python.org/issue15506
+	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+	# Set LDFLAGS so we link modules with -lpython2.7 correctly.
+	# Needed on FreeBSD unless Python 2.7 is already installed.
+	# Please query BSD team before removing this!
+	# On AIX this is not needed, but would record '.' as runpath.
+	[[ ${CHOST} == *-aix* ]] ||
+	append-ldflags "-L."
+
+	local dbmliborder
+	if use gdbm; then
+		dbmliborder+="${dbmliborder:+:}gdbm"
+	fi
+	if use berkdb; then
+		dbmliborder+="${dbmliborder:+:}bdb"
+	fi
+
+	[[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
+
+	# we need this to get pythonw, the GUI version of python
+	# --enable-framework and --enable-shared are mutually exclusive:
+	# http://bugs.python.org/issue5809
+	local myshared=
+	use aqua \
+		&& myshared="--enable-framework=${EPREFIX}/usr/lib" \
+		|| myshared="--enable-shared"
+
+	BUILD_DIR="${WORKDIR}/${CHOST}"
+	mkdir -p "${BUILD_DIR}" || die
+	cd "${BUILD_DIR}" || die
+
+	# note: for a framework build we need to use ucs2 because macOS
+	# uses that internally too:
+	# http://bugs.python.org/issue763708
+	# HAS_HG to avoid finding obsolete hg of the host
+	ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \
+	econf \
+		--with-fpectl \
+		${myshared} \
+		$(use_enable ipv6) \
+		$(use_with threads) \
+		$( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
+		--infodir='${prefix}/share/info' \
+		--mandir='${prefix}/share/man' \
+		--with-computed-gotos \
+		--with-dbmliborder="${dbmliborder}" \
+		--with-libc="" \
+		--enable-loadable-sqlite-extensions \
+		--with-system-expat \
+		--with-system-ffi \
+		--without-ensurepip
+
+	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+		eerror "configure has detected that the sem_open function is broken."
+		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+		die "Broken sem_open function (bug 496328)"
+	fi
+}
+
+src_compile() {
+	# Avoid invoking pgen for cross-compiles.
+	touch Include/graminit.h Python/graminit.c
+
+	cd "${BUILD_DIR}" || die
+	emake
+
+	# Work around bug 329499. See also bug 413751 and 457194.
+	if has_version dev-libs/libffi[pax_kernel]; then
+		pax-mark E python
+	else
+		pax-mark m python
+	fi
+}
+
+src_test() {
+	# Tests will not work when cross compiling.
+	if tc-is-cross-compiler; then
+		elog "Disabling tests due to crosscompiling."
+		return
+	fi
+
+	cd "${BUILD_DIR}" || die
+
+	# Skip failing tests.
+	local skipped_tests="distutils gdb"
+
+	for test in ${skipped_tests}; do
+		mv "${S}"/Lib/test/test_${test}.py "${T}"
+	done
+
+	# Daylight saving time problem
+	# https://bugs.python.org/issue22067
+	# https://bugs.gentoo.org/610628
+	local -x TZ=UTC
+
+	# Rerun failed tests in verbose mode (regrtest -w).
+	emake test EXTRATESTOPTS="-w" < /dev/tty
+	local result="$?"
+
+	for test in ${skipped_tests}; do
+		mv "${T}/test_${test}.py" "${S}"/Lib/test
+	done
+
+	elog "The following tests have been skipped:"
+	for test in ${skipped_tests}; do
+		elog "test_${test}.py"
+	done
+
+	elog "If you would like to run them, you may:"
+	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
+	elog "and run the tests separately."
+
+	if [[ "${result}" -ne 0 ]]; then
+		die "emake test failed"
+	fi
+}
+
+src_install() {
+	local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+
+	cd "${BUILD_DIR}" || die
+	[[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/
+	if use aqua ; then
+		local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework
+
+		# do not make multiple targets in parallel when there are broken
+		# sharedmods (during bootstrap), would build them twice in parallel.
+
+		# Python_Launcher is kind of a wrapper, and we should fix it for
+		# Prefix (it uses /usr/bin/pythonw) so useless
+		# IDLE doesn't run, no idea, but definitely not used
+		sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
+			Mac/Makefile || die
+
+		# let the makefiles do their thing
+		emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
+		rmdir "${ED}"/Applications/Python* || die
+		rmdir "${ED}"/Applications || die
+
+		# avoid framework incompatability, degrade to a normal UNIX lib
+		mkdir -p "${ED}"/usr/$(get_libdir)
+		cp "${D}${fwdir}"/Versions/${SLOT}/Python \
+			"${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
+		chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
+		install_name_tool \
+			-id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
+			"${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
+		chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
+		cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
+
+		# rebuild python executable to be the non-pythonw (python wrapper)
+		# version so we don't get framework crap
+		rm "${ED}"/usr/bin/python${SLOT}  # drop existing symlink, bug #390861
+		$(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
+			-o "${ED}"/usr/bin/python${SLOT} \
+			Modules/python.o || die
+
+		# don't install the "Current" symlink, will always conflict
+		rm "${D}${fwdir}"/Versions/Current || die
+		# update whatever points to it, eselect-python sets them
+		rm "${D}${fwdir}"/{Headers,Python,Resources} || die
+
+		# remove unversioned files (that are not made versioned below)
+		pushd "${ED}"/usr/bin > /dev/null
+		rm -f python python-config python${SLOT}-config
+		# python${SLOT} was created above
+		for f in pythonw smtpd${SLOT}.py pydoc idle ; do
+			rm -f ${f} ${f}${SLOT}
+		done
+		# pythonw needs to remain in the framework (that's the whole
+		# reason we go through this framework hassle)
+		ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
+		# copy the scripts to we can fix their shebangs
+		for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
+			# for some reason sometimes they already exist, bug #347321
+			rm -f ${f}
+			cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
+			sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
+				${f} || die
+		done
+		# "fix" to have below collision fix not to bail
+		mv pydoc${SLOT} pydoc || die
+		mv idle${SLOT} idle || die
+		popd > /dev/null
+
+		# basically we don't like the framework stuff at all, so just move
+		# stuff around or add some symlinks to make our life easier
+		mkdir -p "${ED}"/usr
+		mv "${D}${fwdir}"/Versions/${SLOT}/share \
+			"${ED}"/usr/ || die "can't move share"
+		# get includes just UNIX style
+		mkdir -p "${ED}"/usr/include
+		mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
+			"${ED}"/usr/include/ || die "can't move include"
+		pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
+		ln -s ../../../../../include/python${SLOT} || die
+		popd > /dev/null
+		rm -f "${ED}"/usr/share/man/man1/python{,2}.1
+
+		# same for libs
+		# NOTE: can't symlink the entire dir, because a real dir already exists
+		# on upgrade (site-packages), however since we h4x0rzed python to
+		# actually look into the UNIX-style dir, we just switch them around.
+		mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
+		mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
+			"${ED}"/usr/$(get_libdir)/python${SLOT}/ \
+			|| die "can't move python${SLOT}"
+		rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
+		pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
+		ln -s ../../../../python${SLOT} || die
+		popd > /dev/null
+
+		# fix up Makefile
+		sed -i \
+			-e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
+			-e '/^LDFLAGS=/s/=.*$/=/' \
+			-e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
+			-e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
+			-e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
+			-e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
+			-e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
+			-e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
+			"${libdir}"/config/Makefile || die
+		# and sysconfigdata likewise
+		sed -i \
+			-e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
+			-e "/'LDFLAGS'/s/:.*$/:'',/" \
+			-e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
+			-e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
+			-e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
+			-e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
+			-e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
+			-e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
+			"${libdir}"/_sysconfigdata.py || die
+
+		# add missing version.plist file
+		mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
+		cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
+"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildVersion</key>
+	<string>1</string>
+	<key>CFBundleShortVersionString</key>
+	<string>${PV}</string>
+	<key>CFBundleVersion</key>
+	<string>${PV}</string>
+	<key>ProjectName</key>
+	<string>Python</string>
+	<key>SourceVersion</key>
+	<string>${PV}</string>
+</dict>
+</plist>
+EOF
+	else
+		emake DESTDIR="${D}" altinstall
+	fi
+
+	sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
+	if [[ ${CHOST} == *-aix* ]]; then
+		# fix upstream bugs with quite large proposed diffs still to be sorted out:
+		# http://bugs.python.org/issue13493
+		# http://bugs.python.org/issue14150
+		# http://bugs.python.org/issue15590
+		# http://bugs.python.org/issue16189
+		sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \
+			-i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed"
+		sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \
+			-e 's| -bI:| -Wl,-bI:|g' \
+			-e '/LINKFORSHARED/s|-bE:|-bI:|g' \
+			-e '/LINKFORSHARED/s| -lld||g' \
+			-i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed"
+	fi
+
+	# Fix collisions between different slots of Python.
+	mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
+	mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
+	mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
+	rm -f "${ED}usr/bin/smtpd.py"
+
+	# http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
+	# These #defines cause problems when building c99 compliant python modules
+	# http://bugs.python.org/issue1759169
+	[[ ${CHOST} == *-solaris* ]] && sed -i -e \
+		's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
+		 "${ED}"/usr/include/python${SLOT}/pyconfig.h
+
+		use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
+		use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
+		use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
+		use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
+
+	use threads || rm -r "${libdir}/multiprocessing" || die
+	use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
+
+	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
+
+	if use examples; then
+		insinto /usr/share/doc/${PF}/examples
+		doins -r "${S}"/Tools
+	fi
+	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+	local libname
+	if use aqua ; then
+		# we do framework, so the emake trick below returns a pathname
+		# since that won't work here, use a (cheap) trick instead
+		libname=libpython${SLOT}
+	else
+		libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+			emake --no-print-directory -s -f - 2>/dev/null)
+	fi
+	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+	newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+	newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
+	sed \
+		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
+		-e "s:@PYDOC@:pydoc${SLOT}:" \
+		-i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
+
+	# for python-exec
+	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
+
+	# if not using a cross-compiler, use the fresh binary
+	if ! tc-is-cross-compiler; then
+		local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}.
+	else
+		vars=( PYTHON "${vars[@]}" )
+	fi
+
+	python_export "python${SLOT}" "${vars[@]}"
+	echo "EPYTHON='${EPYTHON}'" > epython.py || die
+	python_domodule epython.py
+
+	# python-exec wrapping support
+	local pymajor=${SLOT%.*}
+	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+	# python and pythonX
+	ln -s "../../../bin/python${SLOT}" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+	ln -s "python${pymajor}" \
+		"${D}${PYTHON_SCRIPTDIR}/python" || die
+	# python-config and pythonX-config
+	ln -s "../../../bin/python${SLOT}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+	ln -s "python${pymajor}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
+	# 2to3, pydoc, pyvenv
+	ln -s "../../../bin/2to3-${SLOT}" \
+		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
+	ln -s "../../../bin/pydoc${SLOT}" \
+		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+	# idle
+	if use tk; then
+		ln -s "../../../bin/idle${SLOT}" \
+			"${D}${PYTHON_SCRIPTDIR}/idle" || die
+	fi
+}
+
+eselect_python_update() {
+	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+		eselect python update
+	fi
+
+	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+		eselect python update --python${PV%%.*}
+	fi
+}
+
+pkg_postinst() {
+	eselect_python_update
+}
+
+pkg_postrm() {
+	eselect_python_update
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2016-05-12 13:41 Michael Haubenwallner
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Haubenwallner @ 2016-05-12 13:41 UTC (permalink / raw
  To: gentoo-commits

commit:     c7ca0121e267a0935393ca8e754d64da3563bb22
Author:     Michael Haubenwallner <michael.haubenwallner <AT> ssi-schaefer <DOT> com>
AuthorDate: Wed May 11 10:43:03 2016 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Thu May 12 13:10:25 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=c7ca0121

python 2.7/3.4: Cygwin port, using cygwinports patches

 dev-lang/python/Manifest                         |  2 ++
 dev-lang/python/files/python-3.4-pyfpe-dll.patch | 24 ++++++++++++++++++++++++
 dev-lang/python/python-2.7.11.ebuild             | 20 +++++++++++++++++---
 dev-lang/python/python-3.4.3-r5.ebuild           | 17 +++++++++++++++++
 4 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index f9b8bd9..9366723 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -19,3 +19,5 @@ DIST python-prefix-3.2.5-gentoo-patches-r0.tar.bz2 9594 SHA256 350924a35c352915d
 DIST python-prefix-3.3.3-gentoo-patches-r2.tar.bz2 13776 SHA256 7e90671d26b60b874748efc95171f7bed149637b1d4aa34752d12fdac06d2d85 SHA512 9859d5367ae1d655572236ffdeb49ac58ae4cf48a556428a9cfb80ac21552d0d8b1c89461f31e6a8dbfdfbc9ced01f510400963571d810e79156f2a3f753fffd WHIRLPOOL b5d45333fea0610e0efba2f0d113337d9004459ec733691406518709ff4c191060d868ead7a0db0e65f89e953d03fb164c5cd1dcc128a5c0e5af93fa7fc0ffd4
 DIST python-prefix-3.4.3-gentoo-patches-r0.tar.xz 12808 SHA256 bb51649f6a586640463dd742170ff2fdb8c906128a97b1c0bb2b9cad0fe82d56 SHA512 714e5cfa03cfd290a821dea641b91c4358a25bb1bcb47050b1cf321f0defa7e060a4cdd967bc356701642230b51f3c74476af96ff58a6f933301171e12ccfac8 WHIRLPOOL f7ff0e0bebbeee221a18d5078f12c77922c7621e00f19254e72f68767647a7d2ff9312366b62023a7d4283def2d7f509572ad657bbb2c132355ee637c5697b0c
 DIST python-prefix-3.5.1-gentoo-patches-r1.tar.xz 12684 SHA256 a15318c069a7cb463a58ac4d8754a94a5bac081c922f07ca6e1fc6b9b9efa44a SHA512 a0086af9f361098ee7e51e260f9444c93a24c86898fe0fad8b08ad3d7f179c29bb97baa545f19fd8451d4668aa4d3894fe3769c1bf7a10f8342ded806bfd620d WHIRLPOOL 7136d338feefe6d1b7d4ad7dabe9371066f254a3405f2f737d84c69c3a79f0926e2f338e131c7d90199a8948eae95087d454a930c17a7e2f3c360eb0defce4bf
+DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 SHA256 811b6fe82630a04a44a6d16074af76964e7e4005136ba479647eb741639099da SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62
+DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9173 SHA256 39e2c7367357110d4bc89a5ba515cd0f419a22e45f0ffda73db6b676ac28b718 SHA512 b1c654c852baf7891b834124607115cfaf3f1b8b7a58a9c3e8e46dd5b2f608d05d27e8a6222cc98ed83634bcfdcbbddcb888070d079cc8438db7e52320f113f9

diff --git a/dev-lang/python/files/python-3.4-pyfpe-dll.patch b/dev-lang/python/files/python-3.4-pyfpe-dll.patch
new file mode 100644
index 0000000..401529d
--- /dev/null
+++ b/dev-lang/python/files/python-3.4-pyfpe-dll.patch
@@ -0,0 +1,24 @@
+--- Python-3.4.3/Include/pyfpe.h
++++ Python-3.4.3/Include/pyfpe.h
+@@ -129,9 +129,9 @@
+ #include <signal.h>
+ #include <setjmp.h>
+ #include <math.h>
+-extern jmp_buf PyFPE_jbuf;
+-extern int PyFPE_counter;
+-extern double PyFPE_dummy(void *);
++PyAPI_DATA(jmp_buf) PyFPE_jbuf;
++PyAPI_DATA(int) PyFPE_counter;
++PyAPI_FUNC(double) PyFPE_dummy(void *);
+ 
+ #define PyFPE_START_PROTECT(err_string, leave_stmt) \
+ if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \
+--- Python-3.4.3/Python/pyfpe.c
++++ Python-3.4.3/Python/pyfpe.c
+@@ -1,5 +1,4 @@
+-#include "pyconfig.h"
+-#include "pyfpe.h"
++#include "Python.h"
+ /* 
+  * The signal handler for SIGFPE is actually declared in an external
+  * module fpectl, or as preferred by the user.  These variable

diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild
index c43fd1f..1e491f8 100644
--- a/dev-lang/python/python-2.7.11.ebuild
+++ b/dev-lang/python/python-2.7.11.ebuild
@@ -10,6 +10,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha
 MY_P="Python-${PV}"
 PATCHSET_VERSION="2.7.11-0"
 PREFIX_PATCHREV="r0"
+CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
 
 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
 HOMEPAGE="http://www.python.org/"
@@ -17,6 +18,9 @@ SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
 	https://dev.gentoo.org/~djc/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
 	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
 
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python/archive/${CYGWINPORTS_GITREV}.zip )"
+
 LICENSE="PSF-2"
 SLOT="2.7"
 KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
@@ -128,9 +132,7 @@ src_prepare() {
 	epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
 	epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
 	epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
-
-	# On Cygwin, find_library("c") has to return "cygwin1.dll"
-	epatch "${FILESDIR}/python-2.5.2-cygwin-find_library.patch"
+	epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
 
 	# On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
 	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
@@ -138,6 +140,18 @@ src_prepare() {
 	# Make sure python doesn't use the host libffi.
 	use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch"
 
+	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
+	    local p d="${WORKDIR}/python-${CYGWINPORTS_GITREV}"
+	    for p in $(
+		    eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
+		    echo ${PATCH_URI}
+	    ); do
+			# dropped by 01_all_prefix-no-patch-invention.patch
+			[[ ${p} == *-tkinter-* ]] && continue
+		    epatch "${d}/${p}"
+	    done
+	fi
+
 	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
 		Lib/distutils/command/install.py \
 		Lib/distutils/sysconfig.py \

diff --git a/dev-lang/python/python-3.4.3-r5.ebuild b/dev-lang/python/python-3.4.3-r5.ebuild
index 1ea643d..b2a6a49 100644
--- a/dev-lang/python/python-3.4.3-r5.ebuild
+++ b/dev-lang/python/python-3.4.3-r5.ebuild
@@ -10,6 +10,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha
 MY_P="Python-${PV/_/}"
 PATCHSET_VERSION="3.4.3-0"
 PREFIX_PATCHREV="r0"
+CYGWINPORTS_GITREV="8ee84829be03c2a1aa74f0f095c994c1f43f4688"
 
 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
 HOMEPAGE="http://www.python.org/"
@@ -17,6 +18,9 @@ SRC_URI="http://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
 	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
 	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
 
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python3/archive/${CYGWINPORTS_GITREV}.zip )"
+
 LICENSE="PSF-2"
 SLOT="3.4/3.4m"
 KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
@@ -76,6 +80,7 @@ src_prepare() {
 	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
 	epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
 	epatch "${FILESDIR}/${PN}-3.4-gcc-5.patch" #547626
+	epatch "${FILESDIR}/${PN}-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
 
 	# Prefix' round of patches
 	# http://prefix.gentooexperimental.org:8000/python-patches-3_3
@@ -98,6 +103,18 @@ src_prepare() {
 	# Make sure python doesn't use the host libffi.
 	use prefix && epatch "${FILESDIR}/python-3.2-libffi-pkgconfig.patch"
 
+	if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
+	    local p d="${WORKDIR}/python3-${CYGWINPORTS_GITREV}"
+	    for p in $(
+		    eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python3.cygport)"
+		    echo ${PATCH_URI}
+	    ); do
+			# dropped by 01_all_prefix-no-patch-invention.patch
+			[[ ${p} == *-tkinter-* ]] && continue
+		    epatch "${d}/${p}"
+	    done
+	fi
+
 	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
 		Lib/distutils/command/install.py \
 		Lib/distutils/sysconfig.py \


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2016-04-28 15:07 Michael Haubenwallner
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Haubenwallner @ 2016-04-28 15:07 UTC (permalink / raw
  To: gentoo-commits

commit:     6b8e9c8593f902585590f446a291f492e4d2bf82
Author:     Michael Haubenwallner <michael.haubenwallner <AT> ssi-schaefer <DOT> com>
AuthorDate: Wed Apr 27 13:42:59 2016 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 15:05:43 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6b8e9c85

python-2.7.11: add patch to use dlltool on Cygwin

 .../files/python-2.5.2-cygwin-find_library.patch   | 34 ++++++++++++++++++++++
 dev-lang/python/python-2.7.11.ebuild               |  3 ++
 2 files changed, 37 insertions(+)

diff --git a/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch b/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch
new file mode 100644
index 0000000..381d073
--- /dev/null
+++ b/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch
@@ -0,0 +1,34 @@
+--- origsrc/Python-2.5.2/Lib/ctypes/util.py	2007-09-14 15:05:26.000000000 -0500
++++ src/Python-2.5.2/Lib/ctypes/util.py	2008-11-25 17:54:47.319296200 -0600
+@@ -41,6 +41,20 @@
+                 continue
+         return None
+ 
++elif sys.platform == "cygwin":
++    def find_library(name):
++        for libdir in ['/usr/lib', '/usr/local/lib']:
++            for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]:
++                implib = os.path.join(libdir, libext)
++                if not os.path.exists(implib):
++                    continue
++                cmd = "dlltool -I " + implib + " 2>/dev/null"
++                res = os.popen(cmd).read().replace("\n","")
++                if not res:
++                    continue
++                return res
++        return None
++
+ elif os.name == "posix":
+     # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
+     import re, tempfile, errno
+@@ -157,6 +173,10 @@
+             print cdll.LoadLibrary("libcrypto.dylib")
+             print cdll.LoadLibrary("libSystem.dylib")
+             print cdll.LoadLibrary("System.framework/System")
++        elif sys.platform == "cygwin":
++            print cdll.LoadLibrary("cygbz2-1.dll") 
++            print find_library("crypt")
++            print cdll.LoadLibrary("cygcrypt-0.dll") 
+         else:
+             print cdll.LoadLibrary("libm.so")
+             print cdll.LoadLibrary("libcrypt.so")

diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild
index d974398..4906dc2 100644
--- a/dev-lang/python/python-2.7.11.ebuild
+++ b/dev-lang/python/python-2.7.11.ebuild
@@ -129,6 +129,9 @@ src_prepare() {
 	epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
 	epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
 
+	# On Cygwin, find_library("c") has to return "cygwin1.dll"
+	epatch "${FILESDIR}/python-2.5.2-cygwin-find_library.patch"
+
 	# On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
 	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
@ 2015-12-14 20:36 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2015-12-14 20:36 UTC (permalink / raw
  To: gentoo-commits

commit:     5b7d44080e28464013050e51457ab77b1665acc6
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 14 20:36:27 2015 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Dec 14 20:36:27 2015 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5b7d4408

dev-lang/python: add python-3.5.1, fixes bug #563834

Package-Manager: portage-2.2.20-prefix

 dev-lang/python/Manifest                          |   3 +
 dev-lang/python/files/3.5-secondary-targets.patch |  19 +
 dev-lang/python/python-3.5.1.ebuild               | 412 ++++++++++++++++++++++
 3 files changed, 434 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 2c0f64a..89f33a1 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -4,15 +4,18 @@ DIST Python-2.7.8.tar.xz 10525244 SHA256 edde10a0cb7d14e2735e682882d5b287028d148
 DIST Python-3.2.5.tar.xz 9221624 SHA256 8ccb9645b9779fc4550055b2ebb21a724ab7a63dee45643286eb4f79b2f84116 SHA512 6e71d01695c7b1e74d9781e4ac40a8d1560cae659d5351d392fc685b84316568d93740a99d2ed878dd87d4ce1708d0474cb01c6bad7b3dab610c639f3255b09d WHIRLPOOL d5e5fae5e1d4110861e1e1dac00c9812abbbc37205e8ce3cd268535ab9f66e24038ab4778af8bb834fd472eaa0281730f1f2fabdf6dffc4f6b54ef32c1d75953
 DIST Python-3.3.3.tar.xz 12057744 SHA256 339275b30a1a3fef1589016bf6302c14e870f7a6fd2522bf87a6c2c6d383c685 SHA512 6acd905d2ae70a259de1d502c90ce9cc831b03cd32930d55bdce1f6dd4b2657c4bb8698e46f6558253338046c43ee842befa2d62e35eeb82b82659acbe6ea0aa WHIRLPOOL 680a88bc7ca312a71237350c06573d5ed6138d826613a6a8ad9e953181561966c9a9f64b176226a627175b8bb5d13755bb7cabe20ee9510ced5da14185e092a4
 DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3
+DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f
 DIST python-gentoo-patches-2.7.10-0.tar.xz 12892 SHA256 c9a838bd62ae50cc385da23a837acfd05f2b74e4f086c9c76eb4d3aa5366ef6d SHA512 5f100944635e360691dc0a2b340a906646c4ae9ee558246ddffc56e8b15d389f25f1fbdc1db4cc08e7d29560d04d66b058b3904902899d58ecae8c408ebdf056 WHIRLPOOL f69e9a518bb7ee50c1b262a21e70e1e2443f859ee6d2f4fa84421120dbd054a06ce8dd6cfea8512cbc64bce806322b879c25c561d5eb05e1ba6cc15035b373a9
 DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77
 DIST python-gentoo-patches-2.7.8-0.tar.xz 14016 SHA256 22ca5eab8e1702f220c272c57359f547b753b88d59b53ab95c7985c17f4f90ec SHA512 17020c8a2039cc073c973e213e77dc67ad9ed4ae7f5fafb931933943aa745733309c46e3972bfde85d112cdef6d47aa91868a614db08bb135c29051999c3df4e WHIRLPOOL 96f0e5c7329cc886d979ec782ffd3c63461f49ba112f0d95e5528d7f15048170cd4e52b78cb4100839d509ef28b927bf7a0f1a610fcf4ec562730a284f8c9fc3
 DIST python-gentoo-patches-3.2.5-1.tar.xz 14628 SHA256 0acc5531421781ab7f30e6fc8a502f202b79aa285b4f411eb16ea0a9e6d958c1 SHA512 1abbd53e92466d258802717309e1839ae931b8a4b0a5a27d4d0da748e71cf96ac47c6837bdbae5dd6921a46cee339c178f86ff3108afe95e6a0a42c4f4300791 WHIRLPOOL de003cccb8b311413889713d66b7987f28a1f906cc9642621d1fd2a379ceae4f0f901c137503d808dc3da7295ac611de09781bf8661cdbcd14c1d7c94ba489c2
 DIST python-gentoo-patches-3.3.3-0.tar.xz 12992 SHA256 38b5c604416947fdd7d87ada2ccd3febf7407f00c1e67e6a99be8765f1b25c49 SHA512 d803b287c0f407c68dd766974296239419fb35441f1796081681f28d17b1f6c7e50e0aae807ad147469eb586db8fe486a013a166cb76e08f2b7a9ba39acb1760 WHIRLPOOL 09a9dbd1831c2e7022f4df27b57435dd1df7eace294e8fa069ce5fa5c1719f64ba9bcd8f27d614a8c13ee8605db37c7e75c13fa14885b76ce289667bf2871aaf
 DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1
+DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc
 DIST python-prefix-2.7.10-gentoo-patches.tar.bz2 16922 SHA256 9fe4df587363c439f1f29885b4b2a1238d16861667966b279dc1019cb904efa4 SHA512 a016e1572276dbbe0fc045d723b592b31573f99b60370f0c1506f10fd9a632cc879bdc4a2060c6a5ff411f26179189517ff4c4beb6979a5727e0dc17de935fe2 WHIRLPOOL 73542d16f9f64acb2cb941ce659d981d6d8b8a8cba9ef4f41c4b987665beedb125a6ad4a7badb5eb12092d916e1ab807330a2fcefc7914ae9708569d54faa7b6
 DIST python-prefix-2.7.11-gentoo-patches-r0.tar.xz 17348 SHA256 c02e37fc75fa280cfed86d20df3dc4c8a7ff46f18eb67b268d75209f0c1a2fc6 SHA512 c181953cc30c94935a06f7511b5d641a1b45127a69ccf9e8e22cb31c0da6e54e7e4ccc5c5f4a15889c079d5b1d3c74b94e8da49dc018c807b6b8b0376cb70e76 WHIRLPOOL a8dcda32eadb3c3e1908f5a493b06046190d2f53347edfe3ef859926fe2e741535c9a9ad0ebbe1b0ea011b858f6ee21c04f806469b7249d453e6ae4b7a6cd2b2
 DIST python-prefix-2.7.8-gentoo-patches.tar.bz2 17154 SHA256 6c5f171f15f662c2b88258ebff152224a7003c43e025be860baf99913d00a8b1 SHA512 fe53cf969e70744ed6c66757e507f55eea031fa98e08f1846e3c51b968eb8d91a377c9c47cbc5cd469715c37d71b70dd1dc46fdbb52cab372179acb497a81643 WHIRLPOOL f966f3dc68f7cf171aeef0226a72616d42f13e9b085a772aa7221b1898a74e0b31c74350c7114fc6a39ab739877d5e12be1755357e2821f8b026af61fa99b4b3
 DIST python-prefix-3.2.5-gentoo-patches-r0.tar.bz2 9594 SHA256 350924a35c352915d619aea9077ef26707b2621683cca926de5cb55b5dc429fa SHA512 63eb12cea50a9d3a557071f47f4d8200153c495f7e8f9853508194b56b8e16da956fe0e6b790085f4ecdcc8d5c29a0c50664fee1bd522d52d98a43c2bceb28ea WHIRLPOOL e5335f7df1bf21f5303e90048c15d5cf0d539b269a428a417e8678c74f8ab630691456c6e02476bf223531d12e44f7cfb71f6b631f371c8a0dc454e4e5d3607a
 DIST python-prefix-3.3.3-gentoo-patches-r2.tar.bz2 13776 SHA256 7e90671d26b60b874748efc95171f7bed149637b1d4aa34752d12fdac06d2d85 SHA512 9859d5367ae1d655572236ffdeb49ac58ae4cf48a556428a9cfb80ac21552d0d8b1c89461f31e6a8dbfdfbc9ced01f510400963571d810e79156f2a3f753fffd WHIRLPOOL b5d45333fea0610e0efba2f0d113337d9004459ec733691406518709ff4c191060d868ead7a0db0e65f89e953d03fb164c5cd1dcc128a5c0e5af93fa7fc0ffd4
 DIST python-prefix-3.4.3-gentoo-patches-r0.tar.xz 12808 SHA256 bb51649f6a586640463dd742170ff2fdb8c906128a97b1c0bb2b9cad0fe82d56 SHA512 714e5cfa03cfd290a821dea641b91c4358a25bb1bcb47050b1cf321f0defa7e060a4cdd967bc356701642230b51f3c74476af96ff58a6f933301171e12ccfac8 WHIRLPOOL f7ff0e0bebbeee221a18d5078f12c77922c7621e00f19254e72f68767647a7d2ff9312366b62023a7d4283def2d7f509572ad657bbb2c132355ee637c5697b0c
+DIST python-prefix-3.5.1-gentoo-patches-r0.tar.xz 12724 SHA256 e03203bc1e83ebc112adbcc8d475628caea94099dc2f5f18714e5a6d2a8aa3d9 SHA512 26ab0126188663d8f31355e76ccc7eac933b0a5f59b1d3977985492eec699ea845fffdadce20828ecb5a4a8c48c95bf265c57456bafdea167a4e5881b0f6bbe2 WHIRLPOOL 58a29b1075659c57d6709ca055721810570f91d873138da9cbfaa0fd14a90e04164cf59e9ca1182bbb714b9fe937c81c2856d4b880dbdcf6f599c1d096d3c4d9

diff --git a/dev-lang/python/files/3.5-secondary-targets.patch b/dev-lang/python/files/3.5-secondary-targets.patch
new file mode 100644
index 0000000..eb3b0c7
--- /dev/null
+++ b/dev-lang/python/files/3.5-secondary-targets.patch
@@ -0,0 +1,19 @@
+Mark all targets as "secondary"
+
+This allows make to avoid rebuilding unnecessary intermediate files, which
+is useful when cross-compiling.
+
+See Parser/pgen and Programs/_freeze_importlib in Makefile.pre.in.
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1672,6 +1672,8 @@
+ .PHONY: smelly funny patchcheck touch altmaninstall commoninstall
+ .PHONY: gdbhooks
+ 
++.SECONDARY:
++
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+ # Local Variables:
+ # mode: makefile

diff --git a/dev-lang/python/python-3.5.1.ebuild b/dev-lang/python/python-3.5.1.ebuild
new file mode 100644
index 0000000..471af4c
--- /dev/null
+++ b/dev-lang/python/python-3.5.1.ebuild
@@ -0,0 +1,412 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+
+MY_P="Python-${PV/_/}"
+PATCHSET_VERSION="3.5.1-0"
+PREFIX_PATCHREV="r0"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="http://www.python.org/"
+SRC_URI="http://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
+	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
+	https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
+
+LICENSE="PSF-2"
+SLOT="3.5/3.5m"
+KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="aqua build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk wininst +xml"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="app-arch/bzip2:0=
+	app-arch/xz-utils:0=
+	>=sys-libs/zlib-1.1.3:0=
+	virtual/libffi
+	virtual/libintl
+	gdbm? ( sys-libs/gdbm:0=[berkdb] )
+	ncurses? (
+		>=sys-libs/ncurses-5.2:0=
+		readline? ( >=sys-libs/readline-4.1:0= )
+	)
+	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:= )
+	)
+	tk? (
+		>=dev-lang/tcl-8.0:0=
+		>=dev-lang/tk-8.0:0=[-aqua]
+		dev-tcltk/blt:0=
+		dev-tcltk/tix
+	)
+	xml? ( >=dev-libs/expat-2.1:0= )
+	!!<sys-apps/sandbox-2.6-r1"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	!sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )"
+PDEPEND=">=app-eselect/eselect-python-20151117-r1"
+
+S="${WORKDIR}/${MY_P}"
+
+PYVER=${SLOT%/*}
+
+src_prepare() {
+	# Ensure that internal copies of expat, libffi and zlib are not used.
+	rm -fr Modules/expat
+	rm -fr Modules/_ctypes/libffi*
+	rm -fr Modules/zlib
+
+	if tc-is-cross-compiler; then
+		# Invokes BUILDPYTHON, which is built for the host arch
+		local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
+	fi
+
+	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+	epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
+	epatch "${FILESDIR}/3.5-secondary-targets.patch"
+
+	# Prefix' round of patches
+	# http://prefix.gentooexperimental.org:8000/python-patches-3_3
+	EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+		epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
+
+	# we provide a fully working readline also on Darwin, so don't force
+	# usage of less functional libedit
+	sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
+
+	# We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR.
+	sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
+
+	# Make sure python doesn't use the host libffi.
+	use prefix && epatch "${FILESDIR}/python-3.2-libffi-pkgconfig.patch"
+
+	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+		configure.ac \
+		Lib/distutils/command/install.py \
+		Lib/distutils/sysconfig.py \
+		Lib/site.py \
+		Lib/sysconfig.py \
+		Lib/test/test_site.py \
+		Makefile.pre.in \
+		Modules/getpath.c \
+		Modules/Setup.dist \
+		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+	#sed -i -e 's/\$(GRAMMAR_H): \$(GRAMMAR_INPUT) \$(PGEN)/$(GRAMMAR_H): \$(GRAMMAR_INPUT)/' Makefile.pre.in || die
+
+	# workaround a development build env problem and muck around
+	# framework install to get the best of both worlds (non-standard)
+	sed -i \
+		-e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
+		-e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
+		configure.ac configure || die
+	sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
+
+	# Disable ABI flags.
+	sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
+
+	epatch_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local disable
+	use gdbm     || disable+=" gdbm"
+	use ncurses  || disable+=" _curses _curses_panel"
+	use readline || disable+=" readline"
+	use sqlite   || disable+=" _sqlite3"
+	use ssl      || export PYTHON_DISABLE_SSL="1"
+	use tk       || disable+=" _tkinter"
+	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+	export PYTHON_DISABLE_MODULES="${disable}"
+
+	if ! use xml; then
+		ewarn "You have configured Python without XML support."
+		ewarn "This is NOT a recommended configuration as you"
+		ewarn "may face problems parsing any XML documents."
+	fi
+
+	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+	fi
+
+	if [[ "$(gcc-major-version)" -ge 4 ]]; then
+		append-flags -fwrapv
+	fi
+
+	filter-flags -malign-double
+
+	[[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
+
+	# https://bugs.gentoo.org/show_bug.cgi?id=50309
+	if is-flagq -O3; then
+		is-flagq -fstack-protector-all && replace-flags -O3 -O2
+		use hardened && replace-flags -O3 -O2
+	fi
+
+	# Export CC so even AIX will use gcc instead of xlc_r.
+	# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
+	tc-export CC CXX
+
+	# The configure script fails to use pkg-config correctly.
+	# http://bugs.python.org/issue15506
+	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+	# Set LDFLAGS so we link modules with -lpython3.2 correctly.
+	# Needed on FreeBSD unless Python 3.2 is already installed.
+	# Please query BSD team before removing this!
+	append-ldflags "-L."
+
+	# make sure setup.py considers Prefix' paths before system ones
+	use prefix && append-cppflags -I"${EPREFIX}"/usr/include
+	use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
+
+	local dbmliborder
+	if use gdbm; then
+		dbmliborder+="${dbmliborder:+:}gdbm"
+	fi
+
+	BUILD_DIR="${WORKDIR}/${CHOST}"
+	mkdir -p "${BUILD_DIR}" || die
+	cd "${BUILD_DIR}" || die
+
+	if use aqua ; then
+		ECONF_SOURCE="${S}" OPT="" \
+		econf \
+			--enable-framework="${EPREFIX}"/usr/lib \
+			--config-cache
+	fi
+
+	# pymalloc #452720
+	local myeconfargs=(
+		$(use aqua && echo --config-cache) \
+		--with-fpectl
+		--enable-shared
+		$(use_enable ipv6)
+		$(use_with threads)
+		--infodir='${prefix}/share/info'
+		--mandir='${prefix}/share/man'
+		--with-computed-gotos
+		--with-dbmliborder="${dbmliborder}"
+		--with-libc=
+		--enable-loadable-sqlite-extensions
+		--without-ensurepip
+		--with-system-expat
+		--with-system-ffi
+		--without-pymalloc
+	)
+
+	ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
+
+	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+		eerror "configure has detected that the sem_open function is broken."
+		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+		die "Broken sem_open function (bug 496328)"
+	fi
+}
+
+src_compile() {
+	# Avoid regenerating these for cross-compiles
+	touch Include/graminit.h Python/graminit.c Python/importlib.h Python/importlib_external.h || die
+
+	cd "${BUILD_DIR}" || die
+
+	emake CPPFLAGS= CFLAGS= LDFLAGS=
+
+	# Work around bug 329499. See also bug 413751 and 457194.
+	if has_version dev-libs/libffi[pax_kernel]; then
+		pax-mark E python
+	else
+		pax-mark m python
+	fi
+}
+
+src_test() {
+	# Tests will not work when cross compiling.
+	if tc-is-cross-compiler; then
+		elog "Disabling tests due to crosscompiling."
+		return
+	fi
+
+	cd "${BUILD_DIR}" || die
+
+	# Skip failing tests.
+	local skipped_tests="gdb"
+
+	for test in ${skipped_tests}; do
+		mv "${S}"/Lib/test/test_${test}.py "${T}"
+	done
+
+	local -x PYTHONDONTWRITEBYTECODE=
+	emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
+	local result=$?
+
+	for test in ${skipped_tests}; do
+		mv "${T}/test_${test}.py" "${S}"/Lib/test
+	done
+
+	elog "The following tests have been skipped:"
+	for test in ${skipped_tests}; do
+		elog "test_${test}.py"
+	done
+
+	elog "If you would like to run them, you may:"
+	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
+	elog "and run the tests separately."
+
+	if [[ ${result} -ne 0 ]]; then
+		die "emake test failed"
+	fi
+}
+
+src_install() {
+	local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
+
+	cd "${BUILD_DIR}" || die
+
+	emake DESTDIR="${D}" altinstall
+
+	if use aqua ; then
+		# avoid config.status to be triggered
+		find Mac -name "Makefile" -exec touch \{\} + || die
+
+		emake DESTDIR="${D}" -C Mac \
+			install_Python install_PythonLauncher install_IDLE \
+			|| die
+
+		local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${SLOT}
+		ln -s "${EPREFIX}"/usr/include/python${SLOT} \
+			"${ED}${fwdir}"/Headers || die
+		ln -s "${EPREFIX}"/usr/lib/libpython${SLOT}.dylib \
+			"${ED}${fwdir}"/Python || die
+	fi
+
+	sed \
+		-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
+		-e "s/\(PY_LDFLAGS=\).*/\1/" \
+		-i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
+
+	# Fix collisions between different slots of Python.
+	rm -f "${ED}usr/$(get_libdir)/libpython3.so"
+
+	# Cheap hack to get version with ABIFLAGS
+	local abiver=$(cd "${ED}usr/include"; echo python*)
+	# Replace python3.X with a symlink if appropriate
+	if [[ ${abiver} != python${PYVER} ]]; then
+		rm "${ED}usr/bin/python${PYVER}" || die
+		dosym "${abiver}" "/usr/bin/python${PYVER}"
+	fi
+
+	use elibc_uclibc && rm -fr "${libdir}/test"
+	use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
+	use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
+
+	use threads || rm -fr "${libdir}/multiprocessing"
+	use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
+
+	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
+
+	if use examples; then
+		insinto /usr/share/doc/${PF}/examples
+		find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
+		doins -r "${S}"/Tools
+	fi
+	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+	if use aqua ; then
+		# we do framework, so the emake trick below returns a pathname
+		# since that won't work here, use a (cheap) trick instead
+		local libname=libpython${SLOT}
+	else
+		local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+			emake --no-print-directory -s -f - 2>/dev/null)
+	fi
+	newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+	newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
+	newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+	sed \
+		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+		-e "s:@PYDOC@:pydoc${PYVER}:" \
+		-i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+	# for python-exec
+	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
+
+	# if not using a cross-compiler, use the fresh binary
+	if ! tc-is-cross-compiler; then
+		local -x PYTHON=./python
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
+	else
+		vars=( PYTHON "${vars[@]}" )
+	fi
+
+	python_export "python${PYVER}" "${vars[@]}"
+	echo "EPYTHON='${EPYTHON}'" > epython.py || die
+	python_domodule epython.py
+
+	# python-exec wrapping support
+	local pymajor=${PYVER%.*}
+	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+	# python and pythonX
+	ln -s "../../../bin/${abiver}" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+	ln -s "python${pymajor}" \
+		"${D}${PYTHON_SCRIPTDIR}/python" || die
+	# python-config and pythonX-config
+	ln -s "../../../bin/${abiver}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+	ln -s "python${pymajor}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
+	# 2to3, pydoc, pyvenv
+	ln -s "../../../bin/2to3-${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
+	ln -s "../../../bin/pydoc${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+	ln -s "../../../bin/pyvenv-${PYVER}" \
+		"${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
+
+	# Compatibility link for stuff that calls ${PYTHON}-config
+	# Remove this when all revdeps have been fixed to not do that.
+	dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
+}
+
+pkg_preinst() {
+	if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
+		python_updater_warning="1"
+	fi
+}
+
+eselect_python_update() {
+	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+		eselect python update
+	fi
+
+	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+		eselect python update --python${PV%%.*}
+	fi
+}
+
+pkg_postinst() {
+	eselect_python_update
+
+	if [[ "${python_updater_warning}" == "1" ]]; then
+		ewarn "You have just upgraded from an older version of Python."
+		ewarn
+		ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
+	fi
+}
+
+pkg_postrm() {
+	eselect_python_update
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-04-10  7:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-10 20:46 [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2022-04-10  7:37 Fabian Groffen
2018-05-03 13:05 Fabian Groffen
2018-05-03 12:05 Fabian Groffen
2018-05-03 10:39 Fabian Groffen
2018-05-03 10:39 Fabian Groffen
2017-10-31  9:29 Fabian Groffen
2016-05-12 13:41 Michael Haubenwallner
2016-04-28 15:07 Michael Haubenwallner
2015-12-14 20:36 Fabian Groffen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox