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

commit:     3f14353fde65890cf862c1c73deb64f34bcceeb9
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 12 16:16:43 2015 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Dec 12 16:16:43 2015 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=3f14353f

dev-lang/python: add python-2.7.11

Package-Manager: portage-2.2.20-prefix

 dev-lang/python/Manifest                           |   3 +
 .../python-2.7.10-cross-compile-warn-test.patch    |  24 +
 .../python/files/python-2.7.10-system-libffi.patch |  36 ++
 dev-lang/python/python-2.7.11.ebuild               | 606 +++++++++++++++++++++
 4 files changed, 669 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index a7261fe..57a2f7e 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,12 +1,15 @@
 DIST Python-2.7.10.tar.xz 12250696 SHA256 1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0 SHA512 67615a6defbcda062f15a09f9dd3b9441afd01a8cc3255e5bc45b925378a0ddc38d468b7701176f6cc153ec52a4f21671b433780d9bde343aa9b9c1b2ae29feb WHIRLPOOL 3a9dcfc55b107dc55ad0ae93fb24a11eab7d4d9b4cfbe6b6830a090b6e5f71bb2ac91526b89c6f3e4f2610fa1a2cc4e82b58a83c599aa71f94894c74181b504b
+DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46 SHA512 72166763a2fe6aab45ecf378f55a1efc7322d1742c4638bae84f4ed4b9fb4c01f2a0293733c64426ae2c70df24d95ff2b1e2a4f3c2715de00d8f320d4d939ea0 WHIRLPOOL 7ebcff7a2fe775a21a3847dee10369b73aaea8685eb63b4bc33dab0f562b8fb984c398cb34e8158cf1e24f106002829649540aad30a5ec7f4de0018ce7449f69
 DIST Python-2.7.8.tar.xz 10525244 SHA256 edde10a0cb7d14e2735e682882d5b287028d1485c456758154c19573db68075a SHA512 0a992e34b6b704f028f5178c0404f8ca5fd9a7ab9da1879a20f0c72ffa712dc4925e45eb78e9368d6a17ee618259fc3f078d71766b314a732a1a28e526511a5e WHIRLPOOL 81ee40be85a8713dcc91e64c7faaf7605c43dc28f97b410b88411bbf7d4adbdf48a3e4bfa18c039c1da8695160a98ebb57e144c3198abec2b12398d80ece2971
 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-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-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

diff --git a/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch b/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch
new file mode 100644
index 0000000..38433de
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch
@@ -0,0 +1,24 @@
+https://bugs.python.org/issue25397
+
+improve the cross-compile tests to be more focused
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1339,7 +1339,7 @@ if test "$GCC" = "yes"
+ then
+   AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
+   save_CFLAGS=$CFLAGS
+-  CFLAGS="$CFLAGS -Werror -Wformat"
++  CFLAGS="$CFLAGS -Werror=format"
+   AC_COMPILE_IFELSE([
+     AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
+   ],[
+@@ -4458,7 +4458,7 @@ then
+   [ac_cv_have_long_long_format="cross -- assuming no"
+    if test x$GCC = xyes; then
+     save_CFLAGS=$CFLAGS
+-    CFLAGS="$CFLAGS -Werror -Wformat"
++    CFLAGS="$CFLAGS -Werror=format"
+     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+         #include <stdio.h>
+         #include <stddef.h>

diff --git a/dev-lang/python/files/python-2.7.10-system-libffi.patch b/dev-lang/python/files/python-2.7.10-system-libffi.patch
new file mode 100644
index 0000000..0b49b79
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.10-system-libffi.patch
@@ -0,0 +1,36 @@
+make sure we respect the system libffi setting in our build config.
+the compiler probing is fragile and can break in some situations.
+
+--- a/setup.py
++++ b/setup.py
+@@ -2069,7 +2069,7 @@ class PyBuildExt(build_ext):
+         return True
+ 
+     def detect_ctypes(self, inc_dirs, lib_dirs):
+-        self.use_system_libffi = False
++        self.use_system_libffi = ('--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"))
+         include_dirs = []
+         extra_compile_args = []
+         extra_link_args = []
+@@ -2113,7 +2113,7 @@ class PyBuildExt(build_ext):
+                              sources=['_ctypes/_ctypes_test.c'])
+         self.extensions.extend([ext, ext_test])
+ 
+-        if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
++        if not self.use_system_libffi:
+             return
+ 
+         if host_platform == 'darwin':
+@@ -2141,10 +2141,10 @@ class PyBuildExt(build_ext):
+                     ffi_lib = lib_name
+                     break
+ 
+-        if ffi_inc and ffi_lib:
++        if ffi_inc:
+             ext.include_dirs.extend(ffi_inc)
++        if ffi_lib:
+             ext.libraries.append(ffi_lib)
+-            self.use_system_libffi = True
+ 
+ 
+ class PyBuildInstall(install):

diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild
new file mode 100644
index 0000000..14035f3
--- /dev/null
+++ b/dev-lang/python/python-2.7.11.ebuild
@@ -0,0 +1,606 @@
+# 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 multiprocessing
+
+MY_P="Python-${PV}"
+PATCHSET_VERSION="2.7.11-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}/${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"
+
+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"
+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-20151117-r1
+	app-admin/python-updater"
+
+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
+
+	# 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"
+
+	# 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
+
+	# Make sure python doesn't use the host libffi.
+	use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch"
+
+	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@@"
+
+	epatch_user
+
+	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
+
+	[[ "${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
+
+	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 OSX
+	# 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
+
+	# 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.
+
+		# let the makefiles do their thing
+		emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
+
+		# 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
+		# remove now dead symlinks
+		rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.a
+		rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.dylib
+
+		# 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
+		local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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
+}
+
+pkg_preinst() {
+	if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; 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 "You should switch active version of Python ${PV%%.*} and run"
+		ewarn "'python-updater [options]' to rebuild Python modules."
+	fi
+}
+
+pkg_postrm() {
+	eselect_python_update
+}


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

* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/, dev-lang/python/files/
@ 2015-12-14 19:15 Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2015-12-14 19:15 UTC (permalink / raw
  To: gentoo-commits

commit:     f9b3e3bea3d0b312b0cc141b44ed1c9715768726
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 14 19:13:28 2015 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Dec 14 19:13:28 2015 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f9b3e3be

dev-lang/python: add python-3.4.3-r5

Package-Manager: portage-2.2.20-prefix

 dev-lang/python/Manifest                           |   3 +
 dev-lang/python/files/python-3.4-gcc-5.patch       |  37 ++
 .../files/python-3.4.3-ncurses-pkg-config.patch    |  13 +
 dev-lang/python/python-3.4.3-r5.ebuild             | 409 +++++++++++++++++++++
 4 files changed, 462 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 57a2f7e..2c0f64a 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -3,13 +3,16 @@ DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc2
 DIST Python-2.7.8.tar.xz 10525244 SHA256 edde10a0cb7d14e2735e682882d5b287028d1485c456758154c19573db68075a SHA512 0a992e34b6b704f028f5178c0404f8ca5fd9a7ab9da1879a20f0c72ffa712dc4925e45eb78e9368d6a17ee618259fc3f078d71766b314a732a1a28e526511a5e WHIRLPOOL 81ee40be85a8713dcc91e64c7faaf7605c43dc28f97b410b88411bbf7d4adbdf48a3e4bfa18c039c1da8695160a98ebb57e144c3198abec2b12398d80ece2971
 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-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-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

diff --git a/dev-lang/python/files/python-3.4-gcc-5.patch b/dev-lang/python/files/python-3.4-gcc-5.patch
new file mode 100644
index 0000000..80afbd1
--- /dev/null
+++ b/dev-lang/python/files/python-3.4-gcc-5.patch
@@ -0,0 +1,37 @@
+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
new file mode 100644
index 0000000..8bfad11
--- /dev/null
+++ b/dev-lang/python/files/python-3.4.3-ncurses-pkg-config.patch
@@ -0,0 +1,13 @@
+do not hardcode /usr/include paths
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -4402,7 +4402,7 @@ fi
+ 
+ # first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags ncursesw`"
+ 
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+ 

diff --git a/dev-lang/python/python-3.4.3-r5.ebuild b/dev-lang/python/python-3.4.3-r5.ebuild
new file mode 100644
index 0000000..f86d0ab
--- /dev/null
+++ b/dev-lang/python/python-3.4.3-r5.ebuild
@@ -0,0 +1,409 @@
+# 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 multiprocessing
+
+MY_P="Python-${PV/_/}"
+PATCHSET_VERSION="3.4.3-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.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"
+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/autoconf-2.65
+	!sys-devel/gcc[libffi]"
+RDEPEND+=" !build? ( app-misc/mime-types )"
+PDEPEND=">=app-eselect/eselect-python-20151117-r1
+	app-admin/python-updater"
+
+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-gcc-5.patch" #547626
+
+	# 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" \
+		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"
+
+	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
+	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() {
+	# 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
+
+		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] 5+ messages in thread

* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/, dev-lang/python/files/
@ 2016-07-01 14:31 Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2016-07-01 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     ebbb71da187a11bc28ff9cb0f3c9fee566f50a2e
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  1 14:30:59 2016 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jul  1 14:30:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ebbb71da

dev-lang/python: sync to python-3.5.1-r3

Package-Manager: portage-2.2.28-prefix

 dev-lang/python/files/3.5.1-cross-compile.patch    |  75 ++++
 .../files/python-3.5-distutils-OO-build.patch      |  80 ++++
 dev-lang/python/python-3.5.1-r3.ebuild             | 434 +++++++++++++++++++++
 3 files changed, 589 insertions(+)

diff --git a/dev-lang/python/files/3.5.1-cross-compile.patch b/dev-lang/python/files/3.5.1-cross-compile.patch
new file mode 100644
index 0000000..25a518b
--- /dev/null
+++ b/dev-lang/python/files/3.5.1-cross-compile.patch
@@ -0,0 +1,75 @@
+# 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/python-3.5-distutils-OO-build.patch b/dev-lang/python/files/python-3.5-distutils-OO-build.patch
new file mode 100644
index 0000000..8af8c30
--- /dev/null
+++ b/dev-lang/python/files/python-3.5-distutils-OO-build.patch
@@ -0,0 +1,80 @@
+From 90507018442f9adabb586fd3d0a0206b9c2f2f50 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 5 Jun 2016 08:18:01 +0200
+Subject: [PATCH] distutils: make -OO enable both opt-1 and opt-2 optimization
+
+Bug: http://bugs.python.org/issue27226
+Bug: https://bugs.gentoo.org/585060
+---
+ Lib/distutils/command/build_py.py    |  8 ++++----
+ Lib/distutils/command/install_lib.py | 12 ++++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
+index cf0ca57..838d4e4 100644
+--- a/Lib/distutils/command/build_py.py
++++ b/Lib/distutils/command/build_py.py
+@@ -315,9 +315,9 @@ class build_py (Command):
+                 if self.compile:
+                     outputs.append(importlib.util.cache_from_source(
+                         filename, optimization=''))
+-                if self.optimize > 0:
++                for opt in range(1, self.optimize + 1):
+                     outputs.append(importlib.util.cache_from_source(
+-                        filename, optimization=self.optimize))
++                        filename, optimization=opt))
+ 
+         outputs += [
+             os.path.join(build_dir, filename)
+@@ -387,8 +387,8 @@ class build_py (Command):
+         if self.compile:
+             byte_compile(files, optimize=0,
+                          force=self.force, prefix=prefix, dry_run=self.dry_run)
+-        if self.optimize > 0:
+-            byte_compile(files, optimize=self.optimize,
++        for opt in range(1, self.optimize + 1):
++            byte_compile(files, optimize=opt,
+                          force=self.force, prefix=prefix, dry_run=self.dry_run)
+ 
+ class build_py_2to3(build_py, Mixin2to3):
+diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
+index 6154cf0..049b662 100644
+--- a/Lib/distutils/command/install_lib.py
++++ b/Lib/distutils/command/install_lib.py
+@@ -24,8 +24,8 @@ class install_lib(Command):
+     #   2) compile .pyc only (--compile --no-optimize; default)
+     #   3) compile .pyc and "opt-1" .pyc (--compile --optimize)
+     #   4) compile "opt-1" .pyc only (--no-compile --optimize)
+-    #   5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
+-    #   6) compile "opt-2" .pyc only (--no-compile --optimize-more)
++    #   5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more)
++    #   6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more)
+     #
+     # The UI for this is two options, 'compile' and 'optimize'.
+     # 'compile' is strictly boolean, and only decides whether to
+@@ -132,8 +132,8 @@ class install_lib(Command):
+             byte_compile(files, optimize=0,
+                          force=self.force, prefix=install_root,
+                          dry_run=self.dry_run)
+-        if self.optimize > 0:
+-            byte_compile(files, optimize=self.optimize,
++        for opt in range(1, self.optimize + 1):
++            byte_compile(files, optimize=opt,
+                          force=self.force, prefix=install_root,
+                          verbose=self.verbose, dry_run=self.dry_run)
+ 
+@@ -167,9 +167,9 @@ class install_lib(Command):
+             if self.compile:
+                 bytecode_files.append(importlib.util.cache_from_source(
+                     py_file, optimization=''))
+-            if self.optimize > 0:
++            for opt in range(1, self.optimize + 1):
+                 bytecode_files.append(importlib.util.cache_from_source(
+-                    py_file, optimization=self.optimize))
++                    py_file, optimization=opt))
+ 
+         return bytecode_files
+ 
+-- 
+2.8.3
+

diff --git a/dev-lang/python/python-3.5.1-r3.ebuild b/dev-lang/python/python-3.5.1-r3.ebuild
new file mode 100644
index 0000000..5e176fa
--- /dev/null
+++ b/dev-lang/python/python-3.5.1-r3.ebuild
@@ -0,0 +1,434 @@
+# Copyright 1999-2016 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="r1"
+
+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-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}/3.5.1-cross-compile.patch"
+	epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.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-${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"
+
+	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
+	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() {
+	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}:}.
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_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
+	# 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] 5+ messages in thread

* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/, dev-lang/python/files/
@ 2017-10-29 17:00 Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2017-10-29 17:00 UTC (permalink / raw
  To: gentoo-commits

commit:     e158fb2e33d8109c371faa0eecc2c936f2aee16a
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 29 16:59:43 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Oct 29 16:59:43 2017 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e158fb2e

dev-lang/python: version bump to 3.5.4

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

 dev-lang/python/Manifest                           |   3 +
 .../files/python-3.5.4-libffi-pkgconfig.patch      |  44 +++
 dev-lang/python/python-3.5.4.ebuild                | 436 +++++++++++++++++++++
 3 files changed, 483 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 9796e4495c..d8a1cbde99 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -6,15 +6,18 @@ DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002
 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
 DIST Python-3.5.2.tar.xz 15222676 SHA256 0010f56100b9b74259ebcd5d4b295a32324b58b517403a10d1a2aa7cb22bca40 SHA512 c07c3366f1c81e214241444bb9da6db9d11da32ad66bfa29cdad5a3b2e34e4d870bda6d4ce3c3910b582942e91f1d8c8a1c1a7b9464cc147b83c9e0007012742 WHIRLPOOL cf55d67f362b6a7529d43bb5aa8014c8349be190c6d4dae9d48de1679ab8623087478f41686cdced981cf18bb3d107052732cd437ff31ba5de2cc06b04ec2289
+DIST Python-3.5.4.tar.xz 15332320 SHA256 94d93bfabb3b109f8a10365a325f920f9ec98c6e2380bf228f9700a14054c84c SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff WHIRLPOOL 63bca2b7b6f5da024c30f84d7e4152a37232e3b277fc5ec58ede9a1da57a44e31bb5f2e5ee33874328526f8d7fdd05dc12df5c69fb827394d5b57907671d3dd3
 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-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
 DIST python-gentoo-patches-3.5.2-0.tar.xz 12008 SHA256 eb898fb448bd40f086ae2910e94c608faa932eb377fe40bd34f4390b4c37aac1 SHA512 e2ef1b8f10f9ea849bf52a0be65d48f7cfecf07bdf151cbbd7e3a1c9428a8d96e901650496c4ae7fd0093af8cc90de8df674dc1a4c66ad21916a4ee45a81efc8 WHIRLPOOL 66b99c7c50e3eaca783f773349b3e8a357f706a7da6a66bd2e0a53946bc81d965ac99d8fd4c50ba7e42052aa84508c8aede5eacedbb95f040a48cf1a5de6b6b0
+DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 SHA256 30c9dbcd5c11ed025b9d8dd201da84c5b9f9756f9b6ba77ccaebc6b79a91e320 SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec WHIRLPOOL 2191dc89805c1bc11d125005a5c5dd0e5fe635eb0a3d6698bef8b55f54741edc3b3e2588bb21f5eda517963489c15296cd5fd265c8a548d78be6093698e6b002
 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-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
 DIST python-prefix-3.5.2-gentoo-patches-r0.tar.xz 12652 SHA256 2a1288ef4b50c0dd679e29912cff93cfd168f9d843dc3090751460968cf40d7c SHA512 e214583393aaf6ec603495531fd2c8d3c668c1fc72c4e3226a4daa537ad34e763302d7110b9ca8a58eb77955aad22371f6cf13247c6d06350f56989301faae8b WHIRLPOOL 4fb513181557fe3be4cf3a3fe12cac5b99bfc7365c37df28a8b30e05a2b58ec74d9b2e8e6c9a7ecfca643c3ab477d2b65b27e4a33f929f28f9749611d913b04a
+DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 SHA256 cb62db1caaa01aeab6a9e5264d2873eff1c194f9d6fb8e6e1bce0e515a8611ad SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5 WHIRLPOOL 295187be131a3f89597e68072687bf1f1140757798230cc76cedb964fe810642b4b4c81d190d92fd40927542d8024c9d7ad877224d2c0ab8702d2435b3fd5b6e

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
new file mode 100644
index 0000000000..0edd83b6ae
--- /dev/null
+++ b/dev-lang/python/files/python-3.5.4-libffi-pkgconfig.patch
@@ -0,0 +1,44 @@
+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/python-3.5.4.ebuild b/dev-lang/python/python-3.5.4.ebuild
new file mode 100644
index 0000000000..37d3bc1086
--- /dev/null
+++ b/dev-lang/python/python-3.5.4.ebuild
@@ -0,0 +1,436 @@
+# 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
+
+MY_P="Python-${PV/_/}"
+PATCHSET_VERSION="3.5.4-0"
+PREFIX_PATCHREV="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-${PV}-gentoo-patches-${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 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-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_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-${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-${PV}-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
+	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}:}.
+		local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_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
+	# 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] 5+ messages in thread

* [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/, dev-lang/python/files/
@ 2017-10-29 19:59 Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2017-10-29 19:59 UTC (permalink / raw
  To: gentoo-commits

commit:     0f6956814596cf91cff853a23ad8bef530a2c662
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 29 19:58:08 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Oct 29 19:58:08 2017 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=0f695681

dev-lang/python: bump to 3.6.3

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

 dev-lang/python/Manifest               |   3 +
 dev-lang/python/files/3.6-blake2.patch |  37 +++
 dev-lang/python/python-3.6.3.ebuild    | 407 +++++++++++++++++++++++++++++++++
 3 files changed, 447 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index d8a1cbde99..221586ae58 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -7,6 +7,7 @@ DIST Python-3.4.5.tar.xz 14516820 SHA256 ee64b1c8a47461009abf25252332d29a4e587cb
 DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f
 DIST Python-3.5.2.tar.xz 15222676 SHA256 0010f56100b9b74259ebcd5d4b295a32324b58b517403a10d1a2aa7cb22bca40 SHA512 c07c3366f1c81e214241444bb9da6db9d11da32ad66bfa29cdad5a3b2e34e4d870bda6d4ce3c3910b582942e91f1d8c8a1c1a7b9464cc147b83c9e0007012742 WHIRLPOOL cf55d67f362b6a7529d43bb5aa8014c8349be190c6d4dae9d48de1679ab8623087478f41686cdced981cf18bb3d107052732cd437ff31ba5de2cc06b04ec2289
 DIST Python-3.5.4.tar.xz 15332320 SHA256 94d93bfabb3b109f8a10365a325f920f9ec98c6e2380bf228f9700a14054c84c SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff WHIRLPOOL 63bca2b7b6f5da024c30f84d7e4152a37232e3b277fc5ec58ede9a1da57a44e31bb5f2e5ee33874328526f8d7fdd05dc12df5c69fb827394d5b57907671d3dd3
+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-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1
@@ -14,6 +15,7 @@ DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 SHA256 84ee7630670a1dac4bbbc55fa
 DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc
 DIST python-gentoo-patches-3.5.2-0.tar.xz 12008 SHA256 eb898fb448bd40f086ae2910e94c608faa932eb377fe40bd34f4390b4c37aac1 SHA512 e2ef1b8f10f9ea849bf52a0be65d48f7cfecf07bdf151cbbd7e3a1c9428a8d96e901650496c4ae7fd0093af8cc90de8df674dc1a4c66ad21916a4ee45a81efc8 WHIRLPOOL 66b99c7c50e3eaca783f773349b3e8a357f706a7da6a66bd2e0a53946bc81d965ac99d8fd4c50ba7e42052aa84508c8aede5eacedbb95f040a48cf1a5de6b6b0
 DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 SHA256 30c9dbcd5c11ed025b9d8dd201da84c5b9f9756f9b6ba77ccaebc6b79a91e320 SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec WHIRLPOOL 2191dc89805c1bc11d125005a5c5dd0e5fe635eb0a3d6698bef8b55f54741edc3b3e2588bb21f5eda517963489c15296cd5fd265c8a548d78be6093698e6b002
+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-3.4.3-gentoo-patches-r1.tar.xz 12896 SHA256 39da669913d8627a74e6d9a7e1ee6eae3e184d7525097090d4b05a71b0a79100 SHA512 dd1082ef9605fdcb84bcc769318be6934c889a5b6134971fb121b3be8301cb9519fb687841a359c65e0614d05a8c27eab4b3dbfe94ed8dbbf2fc64f82206a6d9 WHIRLPOOL 884f0e9e5e177543c74f3c3e87629113db6c53c556f55bf7310de79f101fa825472d886eea216cea471e981dc4fd6743622e1c7472b5ffe04eda4c6790d73c62
@@ -21,3 +23,4 @@ DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 SHA256 ab0b1f138c8bd22b2
 DIST python-prefix-3.5.1-gentoo-patches-r2.tar.xz 12680 SHA256 73b1166eded9867b473c90171b613d32bbe8f72e523c74b1563a9c25c555e13b SHA512 82b08b8cf7f3620c4c2a6a6c3ed5ec8c3318c6f43e4bcc4950c7aeb56ec755e0e47d46f068843f5b04159583994c8620dab14827278a199789a3867532cc6e0c WHIRLPOOL ac4ea106ca744d6e154e14a53ae2e8eeb119207069ead95d0ef19657a58e1d31ed1933de6315ab61ce532c11d1ae4a999c73d34121028a0a246b7dd2b1ac857a
 DIST python-prefix-3.5.2-gentoo-patches-r0.tar.xz 12652 SHA256 2a1288ef4b50c0dd679e29912cff93cfd168f9d843dc3090751460968cf40d7c SHA512 e214583393aaf6ec603495531fd2c8d3c668c1fc72c4e3226a4daa537ad34e763302d7110b9ca8a58eb77955aad22371f6cf13247c6d06350f56989301faae8b WHIRLPOOL 4fb513181557fe3be4cf3a3fe12cac5b99bfc7365c37df28a8b30e05a2b58ec74d9b2e8e6c9a7ecfca643c3ab477d2b65b27e4a33f929f28f9749611d913b04a
 DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 SHA256 cb62db1caaa01aeab6a9e5264d2873eff1c194f9d6fb8e6e1bce0e515a8611ad SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5 WHIRLPOOL 295187be131a3f89597e68072687bf1f1140757798230cc76cedb964fe810642b4b4c81d190d92fd40927542d8024c9d7ad877224d2c0ab8702d2435b3fd5b6e
+DIST python-prefix-3.6.3-gentoo-patches-r0.tar.xz 12676 SHA256 8f35037e2a425f455cceca72a658ca49ecb17cebafb57103fa10cbf1c593a414 SHA512 9d1673bc7b327be6b7e95491940eeeaa40db9e94f2183f4605a9a5a7fd2e187017164e9b2ef31f3bc8d694e467de6843706d3341b4ce24d4d8717513c246b62f WHIRLPOOL c829b3d03817c8eb60e328b3567968c5fa874db0d03eeaef28fca7198109e5708e30a61b63c4254b2da84c5020894401909e7819d3f340f5d0fcdaa0ae0eb87b

diff --git a/dev-lang/python/files/3.6-blake2.patch b/dev-lang/python/files/3.6-blake2.patch
new file mode 100644
index 0000000000..48ee585595
--- /dev/null
+++ b/dev-lang/python/files/3.6-blake2.patch
@@ -0,0 +1,37 @@
+From 2e7c906c085a01ea8175a19e1e143257abc8f566 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sun, 30 Jul 2017 11:17:39 -0400
+Subject: [PATCH] blake2: remove commented code
+
+The nested comments cause a build failure.
+
+Bug: https://bugs.gentoo.org/608586
+---
+ Modules/_blake2/impl/blake2s-load-xop.h | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/Modules/_blake2/impl/blake2s-load-xop.h b/Modules/_blake2/impl/blake2s-load-xop.h
+index a3b5d65e2d..7e76c399c6 100644
+--- a/Modules/_blake2/impl/blake2s-load-xop.h
++++ b/Modules/_blake2/impl/blake2s-load-xop.h
+@@ -18,17 +18,6 @@
+ 
+ #define TOB(x) ((x)*4*0x01010101 + 0x03020100) /* ..or not TOB */
+ 
+-/* Basic VPPERM emulation, for testing purposes */
+-/*static __m128i _mm_perm_epi8(const __m128i src1, const __m128i src2, const __m128i sel)
+-{
+-   const __m128i sixteen = _mm_set1_epi8(16);
+-   const __m128i t0 = _mm_shuffle_epi8(src1, sel);
+-   const __m128i s1 = _mm_shuffle_epi8(src2, _mm_sub_epi8(sel, sixteen));
+-   const __m128i mask = _mm_or_si128(_mm_cmpeq_epi8(sel, sixteen),
+-                                     _mm_cmpgt_epi8(sel, sixteen)); /* (>=16) = 0xff : 00 */
+-   return _mm_blendv_epi8(t0, s1, mask);
+-}*/
+-
+ #define LOAD_MSG_0_1(buf) \
+ buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) );
+ 
+-- 
+2.13.3
+

diff --git a/dev-lang/python/python-3.6.3.ebuild b/dev-lang/python/python-3.6.3.ebuild
new file mode 100644
index 0000000000..6cf6bb0a9a
--- /dev/null
+++ b/dev-lang/python/python-3.6.3.ebuild
@@ -0,0 +1,407 @@
+# 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
+
+MY_P="Python-${PV}"
+PATCHSET_VERSION="3.6.2-0"
+PREFIX_PATCHREV="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-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
+
+LICENSE="PSF-2"
+SLOT="3.6/3.6m"
+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 build 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-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
+
+	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+	epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
+	epatch "${FILESDIR}/3.6-blake2.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-${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
+
+	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@@"
+
+	# 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
+	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
+
+	# 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
+
+	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
+	)
+
+	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
+
+	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
+
+	# 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}
+
+	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 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 threads || rm -r "${libdir}/multiprocessing" || die
+	use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
+
+	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
+		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${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] 5+ messages in thread

end of thread, other threads:[~2017-10-29 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-29 17:00 [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/, dev-lang/python/files/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2017-10-29 19:59 Fabian Groffen
2016-07-01 14:31 Fabian Groffen
2015-12-14 19:15 Fabian Groffen
2015-12-12 16:16 Fabian Groffen

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