summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2016-07-01 17:48:49 +0200
committerFabian Groffen <grobian@gentoo.org>2016-07-01 17:48:49 +0200
commita69c6d0eb2ff159011fd4303d4a14de0a7338162 (patch)
tree6fd5df6b4035cb6d2a39847272d88324b09333e4
parentdev-lang/python: sync to python-3.5.1-r3 (diff)
downloadprefix-a69c6d0eb2ff159011fd4303d4a14de0a7338162.tar.gz
prefix-a69c6d0eb2ff159011fd4303d4a14de0a7338162.tar.bz2
prefix-a69c6d0eb2ff159011fd4303d4a14de0a7338162.zip
dev-lang/python: remove old, update darwin patches for accepting .so, bug #584614
Package-Manager: portage-2.2.28-prefix
-rw-r--r--dev-lang/python/Manifest18
-rw-r--r--dev-lang/python/python-2.7.10.ebuild598
-rw-r--r--dev-lang/python/python-2.7.11-r2.ebuild2
-rw-r--r--dev-lang/python/python-2.7.11.ebuild629
-rw-r--r--dev-lang/python/python-2.7.8.ebuild584
-rw-r--r--dev-lang/python/python-3.2.5-r6.ebuild409
-rw-r--r--dev-lang/python/python-3.3.3.ebuild408
-rw-r--r--dev-lang/python/python-3.4.3-r5.ebuild2
-rw-r--r--dev-lang/python/python-3.5.1-r3.ebuild2
-rw-r--r--dev-lang/python/python-3.5.1.ebuild422
10 files changed, 6 insertions, 3068 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 5fbfb0cde1..b92d486bdc 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,23 +1,11 @@
DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9173 SHA256 39e2c7367357110d4bc89a5ba515cd0f419a22e45f0ffda73db6b676ac28b718 SHA512 b1c654c852baf7891b834124607115cfaf3f1b8b7a58a9c3e8e46dd5b2f608d05d27e8a6222cc98ed83634bcfdcbbddcb888070d079cc8438db7e52320f113f9
DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 SHA256 811b6fe82630a04a44a6d16074af76964e7e4005136ba479647eb741639099da SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62
-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-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3
DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f
-DIST python-gentoo-patches-2.7.10-0.tar.xz 12892 SHA256 c9a838bd62ae50cc385da23a837acfd05f2b74e4f086c9c76eb4d3aa5366ef6d SHA512 5f100944635e360691dc0a2b340a906646c4ae9ee558246ddffc56e8b15d389f25f1fbdc1db4cc08e7d29560d04d66b058b3904902899d58ecae8c408ebdf056 WHIRLPOOL f69e9a518bb7ee50c1b262a21e70e1e2443f859ee6d2f4fa84421120dbd054a06ce8dd6cfea8512cbc64bce806322b879c25c561d5eb05e1ba6cc15035b373a9
DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77
-DIST python-gentoo-patches-2.7.8-0.tar.xz 14016 SHA256 22ca5eab8e1702f220c272c57359f547b753b88d59b53ab95c7985c17f4f90ec SHA512 17020c8a2039cc073c973e213e77dc67ad9ed4ae7f5fafb931933943aa745733309c46e3972bfde85d112cdef6d47aa91868a614db08bb135c29051999c3df4e WHIRLPOOL 96f0e5c7329cc886d979ec782ffd3c63461f49ba112f0d95e5528d7f15048170cd4e52b78cb4100839d509ef28b927bf7a0f1a610fcf4ec562730a284f8c9fc3
-DIST python-gentoo-patches-3.2.5-1.tar.xz 14628 SHA256 0acc5531421781ab7f30e6fc8a502f202b79aa285b4f411eb16ea0a9e6d958c1 SHA512 1abbd53e92466d258802717309e1839ae931b8a4b0a5a27d4d0da748e71cf96ac47c6837bdbae5dd6921a46cee339c178f86ff3108afe95e6a0a42c4f4300791 WHIRLPOOL de003cccb8b311413889713d66b7987f28a1f906cc9642621d1fd2a379ceae4f0f901c137503d808dc3da7295ac611de09781bf8661cdbcd14c1d7c94ba489c2
-DIST python-gentoo-patches-3.3.3-0.tar.xz 12992 SHA256 38b5c604416947fdd7d87ada2ccd3febf7407f00c1e67e6a99be8765f1b25c49 SHA512 d803b287c0f407c68dd766974296239419fb35441f1796081681f28d17b1f6c7e50e0aae807ad147469eb586db8fe486a013a166cb76e08f2b7a9ba39acb1760 WHIRLPOOL 09a9dbd1831c2e7022f4df27b57435dd1df7eace294e8fa069ce5fa5c1719f64ba9bcd8f27d614a8c13ee8605db37c7e75c13fa14885b76ce289667bf2871aaf
DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1
DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc
-DIST python-prefix-2.7.10-gentoo-patches.tar.bz2 16922 SHA256 9fe4df587363c439f1f29885b4b2a1238d16861667966b279dc1019cb904efa4 SHA512 a016e1572276dbbe0fc045d723b592b31573f99b60370f0c1506f10fd9a632cc879bdc4a2060c6a5ff411f26179189517ff4c4beb6979a5727e0dc17de935fe2 WHIRLPOOL 73542d16f9f64acb2cb941ce659d981d6d8b8a8cba9ef4f41c4b987665beedb125a6ad4a7badb5eb12092d916e1ab807330a2fcefc7914ae9708569d54faa7b6
-DIST python-prefix-2.7.11-gentoo-patches-r0.tar.xz 17348 SHA256 c02e37fc75fa280cfed86d20df3dc4c8a7ff46f18eb67b268d75209f0c1a2fc6 SHA512 c181953cc30c94935a06f7511b5d641a1b45127a69ccf9e8e22cb31c0da6e54e7e4ccc5c5f4a15889c079d5b1d3c74b94e8da49dc018c807b6b8b0376cb70e76 WHIRLPOOL a8dcda32eadb3c3e1908f5a493b06046190d2f53347edfe3ef859926fe2e741535c9a9ad0ebbe1b0ea011b858f6ee21c04f806469b7249d453e6ae4b7a6cd2b2
-DIST python-prefix-2.7.8-gentoo-patches.tar.bz2 17154 SHA256 6c5f171f15f662c2b88258ebff152224a7003c43e025be860baf99913d00a8b1 SHA512 fe53cf969e70744ed6c66757e507f55eea031fa98e08f1846e3c51b968eb8d91a377c9c47cbc5cd469715c37d71b70dd1dc46fdbb52cab372179acb497a81643 WHIRLPOOL f966f3dc68f7cf171aeef0226a72616d42f13e9b085a772aa7221b1898a74e0b31c74350c7114fc6a39ab739877d5e12be1755357e2821f8b026af61fa99b4b3
-DIST python-prefix-3.2.5-gentoo-patches-r0.tar.bz2 9594 SHA256 350924a35c352915d619aea9077ef26707b2621683cca926de5cb55b5dc429fa SHA512 63eb12cea50a9d3a557071f47f4d8200153c495f7e8f9853508194b56b8e16da956fe0e6b790085f4ecdcc8d5c29a0c50664fee1bd522d52d98a43c2bceb28ea WHIRLPOOL e5335f7df1bf21f5303e90048c15d5cf0d539b269a428a417e8678c74f8ab630691456c6e02476bf223531d12e44f7cfb71f6b631f371c8a0dc454e4e5d3607a
-DIST python-prefix-3.3.3-gentoo-patches-r2.tar.bz2 13776 SHA256 7e90671d26b60b874748efc95171f7bed149637b1d4aa34752d12fdac06d2d85 SHA512 9859d5367ae1d655572236ffdeb49ac58ae4cf48a556428a9cfb80ac21552d0d8b1c89461f31e6a8dbfdfbc9ced01f510400963571d810e79156f2a3f753fffd WHIRLPOOL b5d45333fea0610e0efba2f0d113337d9004459ec733691406518709ff4c191060d868ead7a0db0e65f89e953d03fb164c5cd1dcc128a5c0e5af93fa7fc0ffd4
-DIST python-prefix-3.4.3-gentoo-patches-r0.tar.xz 12808 SHA256 bb51649f6a586640463dd742170ff2fdb8c906128a97b1c0bb2b9cad0fe82d56 SHA512 714e5cfa03cfd290a821dea641b91c4358a25bb1bcb47050b1cf321f0defa7e060a4cdd967bc356701642230b51f3c74476af96ff58a6f933301171e12ccfac8 WHIRLPOOL f7ff0e0bebbeee221a18d5078f12c77922c7621e00f19254e72f68767647a7d2ff9312366b62023a7d4283def2d7f509572ad657bbb2c132355ee637c5697b0c
-DIST python-prefix-3.5.1-gentoo-patches-r1.tar.xz 12684 SHA256 a15318c069a7cb463a58ac4d8754a94a5bac081c922f07ca6e1fc6b9b9efa44a SHA512 a0086af9f361098ee7e51e260f9444c93a24c86898fe0fad8b08ad3d7f179c29bb97baa545f19fd8451d4668aa4d3894fe3769c1bf7a10f8342ded806bfd620d WHIRLPOOL 7136d338feefe6d1b7d4ad7dabe9371066f254a3405f2f737d84c69c3a79f0926e2f338e131c7d90199a8948eae95087d454a930c17a7e2f3c360eb0defce4bf
+DIST python-prefix-2.7.11-gentoo-patches-r1.tar.xz 17268 SHA256 ecebc430e475030fdbfcd940f314f80ebcb8c6e01a6b2498478bb8f37e525484 SHA512 22218128ff83856dd042ecd6aab3615282ab29c4420e6cce4a0bba8b6508e3f5649c27cdf50cf342fffd3c87ea29f8b7d32d28b9b1f4dc200771b52ee41f27e5 WHIRLPOOL 2a942b39e56955df5b24f50d68a39ca78152e10f13ccc856340cd4651eb87847097ec3ff79efde81c2130b12f2885764194fb8d51c05278f4acc550bcd4ba032
+DIST python-prefix-3.4.3-gentoo-patches-r1.tar.xz 12896 SHA256 39da669913d8627a74e6d9a7e1ee6eae3e184d7525097090d4b05a71b0a79100 SHA512 dd1082ef9605fdcb84bcc769318be6934c889a5b6134971fb121b3be8301cb9519fb687841a359c65e0614d05a8c27eab4b3dbfe94ed8dbbf2fc64f82206a6d9 WHIRLPOOL 884f0e9e5e177543c74f3c3e87629113db6c53c556f55bf7310de79f101fa825472d886eea216cea471e981dc4fd6743622e1c7472b5ffe04eda4c6790d73c62
+DIST python-prefix-3.5.1-gentoo-patches-r2.tar.xz 12680 SHA256 73b1166eded9867b473c90171b613d32bbe8f72e523c74b1563a9c25c555e13b SHA512 82b08b8cf7f3620c4c2a6a6c3ed5ec8c3318c6f43e4bcc4950c7aeb56ec755e0e47d46f068843f5b04159583994c8620dab14827278a199789a3867532cc6e0c WHIRLPOOL ac4ea106ca744d6e154e14a53ae2e8eeb119207069ead95d0ef19657a58e1d31ed1933de6315ab61ce532c11d1ae4a999c73d34121028a0a246b7dd2b1ac857a
diff --git a/dev-lang/python/python-2.7.10.ebuild b/dev-lang/python/python-2.7.10.ebuild
deleted file mode 100644
index 18fa0f1630..0000000000
--- a/dev-lang/python/python-2.7.10.ebuild
+++ /dev/null
@@ -1,598 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.10.ebuild,v 1.1 2015/05/28 04:10:47 floppym Exp $
-
-EAPI="4"
-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.10-0"
-PREFIX_PATCHREV=""
-
-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
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
- prefix? ( http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2 )"
-
-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 +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
- >=sys-libs/zlib-1.1.3
- !m68k-mint? ( virtual/libffi )
- virtual/libintl
- !build? (
- 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[berkdb] )
- ncurses? (
- >=sys-libs/ncurses-5.2
- readline? ( >=sys-libs/readline-4.1 )
- )
- sqlite? ( >=dev-db/sqlite-3.3.8:3 )
- ssl? ( dev-libs/openssl )
- tk? (
- >=dev-lang/tk-8.0[-aqua]
- dev-tcltk/blt
- 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
- 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]."
- 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
-
- # 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"
-
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
- epatch "${FILESDIR}/python-2.7-issue18235.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"
-#552422 epatch "${FILESDIR}/python-2.7.10-semaphore-pid.patch"
- epatch "${FILESDIR}/python-2.7.10-semaphore-urandom.patch" #552422
-
- epatch "${FILESDIR}"/python-2.7-aix-dlopen-soname.patch # libtool-built modules
-
- # 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() {
- if use build; then
- # Disable extraneous modules with extra dependencies.
- export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
- export PYTHON_DISABLE_SSL="1"
- else
- # 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
- 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
-
- # Don't include libmpc on IRIX - it is only available for 64bit MIPS4
- [[ ${CHOST} == *-irix* ]] && export ac_cv_lib_mpc_usconfig=no
-
- [[ ${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
- use aqua \
- && myconf="${myconf} --enable-framework=${EPREFIX}/usr/lib" \
- || myconf="${myconf} --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 \
- $(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-dbmliborder="${dbmliborder}" \
- --with-libc="" \
- --enable-loadable-sqlite-extensions \
- --with-system-expat \
- --with-system-ffi \
- --without-ensurepip \
- ${myconf}
-
- 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
-
- # Backwards compat with Gentoo divergence.
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
-
- # 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
-
- if use build; then
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
- else
- 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 -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
- use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
- fi
-
- 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
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
-
- # if not using a cross-compiler, use the fresh binary
- if ! tc-is-cross-compiler; then
- local PYTHON=./python
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
- fi
-
- echo "EPYTHON='${EPYTHON}'" > epython.py
- python_domodule epython.py
-}
-
-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
-}
diff --git a/dev-lang/python/python-2.7.11-r2.ebuild b/dev-lang/python/python-2.7.11-r2.ebuild
index 1b54e85d9f..541716df50 100644
--- a/dev-lang/python/python-2.7.11-r2.ebuild
+++ b/dev-lang/python/python-2.7.11-r2.ebuild
@@ -9,7 +9,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha
MY_P="Python-${PV}"
PATCHSET_VERSION="2.7.11-0"
-PREFIX_PATCHREV="r0"
+PREFIX_PATCHREV="r1"
CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
DESCRIPTION="An interpreted, interactive, object-oriented programming language"
diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild
deleted file mode 100644
index 1e491f8a4f..0000000000
--- a/dev-lang/python/python-2.7.11.ebuild
+++ /dev/null
@@ -1,629 +0,0 @@
-# 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"
-CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
-
-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"
-
-[[ -n ${CYGWINPORTS_GITREV} ]] &&
-SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python/archive/${CYGWINPORTS_GITREV}.zip )"
-
-LICENSE="PSF-2"
-SLOT="2.7"
-KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-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"
- epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
-
- # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
-
- # Make sure python doesn't use the host libffi.
- use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch"
-
- if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
- local p d="${WORKDIR}/python-${CYGWINPORTS_GITREV}"
- for p in $(
- eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
- echo ${PATCH_URI}
- ); do
- # dropped by 01_all_prefix-no-patch-invention.patch
- [[ ${p} == *-tkinter-* ]] && continue
- epatch "${d}/${p}"
- done
- fi
-
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
- Lib/distutils/command/install.py \
- Lib/distutils/sysconfig.py \
- 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
-
- # Set LDFLAGS so we link modules with -lpython2.7 correctly.
- # Needed on FreeBSD unless Python 2.7 is already installed.
- # Please query BSD team before removing this!
- # On AIX this is not needed, but would record '.' as runpath.
- [[ ${CHOST} == *-aix* ]] ||
- append-ldflags "-L."
-
- if use prefix ; then
- # for Python's setup.py not to do false assumptions (only looking in
- # host paths) we need to make explicit where Prefix stuff is
- append-cppflags -I"${EPREFIX}"/usr/include
- append-ldflags -L"${EPREFIX}"/$(get_libdir)
- append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
- # fix compilation on some 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)
-
- 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.
-
- # Python_Launcher is kind of a wrapper, and we should fix it for
- # Prefix (it uses /usr/bin/pythonw) so useless
- # IDLE doesn't run, no idea, but definitely not used
- sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
- Mac/Makefile || die
-
- # let the makefiles do their thing
- emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
- rmdir "${ED}"/Applications/Python* || die
- rmdir "${ED}"/Applications || die
-
- # avoid framework incompatability, degrade to a normal UNIX lib
- mkdir -p "${ED}"/usr/$(get_libdir)
- cp "${D}${fwdir}"/Versions/${SLOT}/Python \
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
- chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
- install_name_tool \
- -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
- chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
- cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
-
- # rebuild python executable to be the non-pythonw (python wrapper)
- # version so we don't get framework crap
- rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861
- $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
- -o "${ED}"/usr/bin/python${SLOT} \
- Modules/python.o || die
-
- # don't install the "Current" symlink, will always conflict
- rm "${D}${fwdir}"/Versions/Current || die
- # update whatever points to it, eselect-python sets them
- rm "${D}${fwdir}"/{Headers,Python,Resources} || die
-
- # remove unversioned files (that are not made versioned below)
- pushd "${ED}"/usr/bin > /dev/null
- rm -f python python-config python${SLOT}-config
- # python${SLOT} was created above
- for f in pythonw smtpd${SLOT}.py pydoc idle ; do
- rm -f ${f} ${f}${SLOT}
- done
- # pythonw needs to remain in the framework (that's the whole
- # reason we go through this framework hassle)
- ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
- # copy the scripts to we can fix their shebangs
- for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
- # for some reason sometimes they already exist, bug #347321
- rm -f ${f}
- cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
- sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
- ${f} || die
- done
- # "fix" to have below collision fix not to bail
- mv pydoc${SLOT} pydoc || die
- mv idle${SLOT} idle || die
- popd > /dev/null
-
- # basically we don't like the framework stuff at all, so just move
- # stuff around or add some symlinks to make our life easier
- mkdir -p "${ED}"/usr
- mv "${D}${fwdir}"/Versions/${SLOT}/share \
- "${ED}"/usr/ || die "can't move share"
- # get includes just UNIX style
- mkdir -p "${ED}"/usr/include
- mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
- "${ED}"/usr/include/ || die "can't move include"
- pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
- ln -s ../../../../../include/python${SLOT} || die
- popd > /dev/null
- rm -f "${ED}"/usr/share/man/man1/python{,2}.1
-
- # same for libs
- # NOTE: can't symlink the entire dir, because a real dir already exists
- # on upgrade (site-packages), however since we h4x0rzed python to
- # actually look into the UNIX-style dir, we just switch them around.
- mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
- mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
- "${ED}"/usr/$(get_libdir)/python${SLOT}/ \
- || die "can't move python${SLOT}"
- rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
- pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
- ln -s ../../../../python${SLOT} || die
- popd > /dev/null
-
- # fix up Makefile
- sed -i \
- -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
- -e '/^LDFLAGS=/s/=.*$/=/' \
- -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
- -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
- -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
- -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
- -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
- -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
- "${libdir}"/config/Makefile || die
- # and sysconfigdata likewise
- sed -i \
- -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
- -e "/'LDFLAGS'/s/:.*$/:'',/" \
- -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
- -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
- -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
- -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
- -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
- -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
- "${libdir}"/_sysconfigdata.py || die
-
- # add missing version.plist file
- mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
- cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>BuildVersion</key>
- <string>1</string>
- <key>CFBundleShortVersionString</key>
- <string>${PV}</string>
- <key>CFBundleVersion</key>
- <string>${PV}</string>
- <key>ProjectName</key>
- <string>Python</string>
- <key>SourceVersion</key>
- <string>${PV}</string>
-</dict>
-</plist>
-EOF
- else
- emake DESTDIR="${D}" altinstall
- fi
-
- sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
- if [[ ${CHOST} == *-aix* ]]; then
- # fix upstream bugs with quite large proposed diffs still to be sorted out:
- # http://bugs.python.org/issue13493
- # http://bugs.python.org/issue14150
- # http://bugs.python.org/issue15590
- # http://bugs.python.org/issue16189
- sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \
- -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed"
- sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \
- -e 's| -bI:| -Wl,-bI:|g' \
- -e '/LINKFORSHARED/s|-bE:|-bI:|g' \
- -e '/LINKFORSHARED/s| -lld||g' \
- -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed"
- fi
-
- # Fix collisions between different slots of Python.
- mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
- mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
- mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
- rm -f "${ED}usr/bin/smtpd.py"
-
- # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
- # These #defines cause problems when building c99 compliant python modules
- # http://bugs.python.org/issue1759169
- [[ ${CHOST} == *-solaris* ]] && sed -i -e \
- 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
- "${ED}"/usr/include/python${SLOT}/pyconfig.h
-
- use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
- use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
- use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
- use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
-
- use threads || rm -r "${libdir}/multiprocessing" || die
- use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
-
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
-
- if use examples; then
- insinto /usr/share/doc/${PF}/examples
- doins -r "${S}"/Tools
- fi
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
- local libname
- if use aqua ; then
- # we do framework, so the emake trick below returns a pathname
- # since that won't work here, use a (cheap) trick instead
- libname=libpython${SLOT}
- else
- libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
- emake --no-print-directory -s -f - 2>/dev/null)
- fi
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
-
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
- newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
- sed \
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
- -e "s:@PYDOC@:pydoc${SLOT}:" \
- -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
-
- # for python-exec
- local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
-
- # if not using a cross-compiler, use the fresh binary
- if ! tc-is-cross-compiler; then
- local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
- local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}.
- else
- vars=( PYTHON "${vars[@]}" )
- fi
-
- python_export "python${SLOT}" "${vars[@]}"
- echo "EPYTHON='${EPYTHON}'" > epython.py || die
- python_domodule epython.py
-
- # python-exec wrapping support
- local pymajor=${SLOT%.*}
- mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
- # python and pythonX
- ln -s "../../../bin/python${SLOT}" \
- "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
- ln -s "python${pymajor}" \
- "${D}${PYTHON_SCRIPTDIR}/python" || die
- # python-config and pythonX-config
- ln -s "../../../bin/python${SLOT}-config" \
- "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
- ln -s "python${pymajor}-config" \
- "${D}${PYTHON_SCRIPTDIR}/python-config" || die
- # 2to3, pydoc, pyvenv
- ln -s "../../../bin/2to3-${SLOT}" \
- "${D}${PYTHON_SCRIPTDIR}/2to3" || die
- ln -s "../../../bin/pydoc${SLOT}" \
- "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
-}
-
-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
-}
diff --git a/dev-lang/python/python-2.7.8.ebuild b/dev-lang/python/python-2.7.8.ebuild
deleted file mode 100644
index fc1429bb14..0000000000
--- a/dev-lang/python/python-2.7.8.ebuild
+++ /dev/null
@@ -1,584 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.8.ebuild,v 1.2 2014/09/22 16:47:38 floppym Exp $
-
-EAPI="4"
-WANT_AUTOMAKE="none"
-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.8-0"
-PREFIX_PATCHREV=""
-
-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
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
- prefix? ( http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2 )"
-
-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 +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
- >=sys-libs/zlib-1.1.3
- !m68k-mint? ( virtual/libffi )
- virtual/libintl
- !build? (
- 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[berkdb] )
- ncurses? (
- >=sys-libs/ncurses-5.2
- readline? ( >=sys-libs/readline-4.1 )
- )
- sqlite? ( >=dev-db/sqlite-3.3.8:3 )
- ssl? ( dev-libs/openssl )
- tk? (
- >=dev-lang/tk-8.0[-aqua]
- dev-tcltk/blt
- 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
- 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]."
- 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
-
- # 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"
-
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
- epatch "${FILESDIR}/python-2.7-issue18235.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-aix-dlopen-soname.patch # libtool-built modules
-
- # 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
-
- eautoconf
- eautoheader
-}
-
-src_configure() {
- if use build; then
- # Disable extraneous modules with extra dependencies.
- export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
- export PYTHON_DISABLE_SSL="1"
- else
- # 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
- 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
-
- # Don't include libmpc on IRIX - it is only available for 64bit MIPS4
- [[ ${CHOST} == *-irix* ]] && export ac_cv_lib_mpc_usconfig=no
-
- [[ ${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
- use aqua \
- && myconf="${myconf} --enable-framework=${EPREFIX}/usr/lib" \
- || myconf="${myconf} --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 \
- $(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-dbmliborder="${dbmliborder}" \
- --with-libc="" \
- --enable-loadable-sqlite-extensions \
- --with-system-expat \
- --with-system-ffi \
- ${myconf}
-
- 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:' \
- "${ED}"/usr/lib/python${SLOT}/config/Makefile || 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
-
- # Backwards compat with Gentoo divergence.
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
-
- # 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
-
- if use build; then
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
- else
- 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 -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
- use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
- fi
-
- 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
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
-
- # if not using a cross-compiler, use the fresh binary
- if ! tc-is-cross-compiler; then
- local PYTHON=./python
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
- fi
-
- echo "EPYTHON='${EPYTHON}'" > epython.py
- python_domodule epython.py
-}
-
-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
-}
diff --git a/dev-lang/python/python-3.2.5-r6.ebuild b/dev-lang/python/python-3.2.5-r6.ebuild
deleted file mode 100644
index 51b64f2c70..0000000000
--- a/dev-lang/python/python-3.2.5-r6.ebuild
+++ /dev/null
@@ -1,409 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.2.5-r6.ebuild,v 1.11 2015/03/31 18:46:33 ulm Exp $
-
-EAPI="4"
-WANT_AUTOMAKE="none"
-WANT_LIBTOOL="none"
-
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
-
-MY_P="Python-${PV}"
-PATCHSET_REVISION="1"
-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
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz
- http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2"
-
-LICENSE="PSF-2"
-SLOT="3.2"
-KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
-
-# Do not add a dependency on dev-lang/python to this ebuild.
-# If you need to apply a patch which requires python for bootstrapping, please
-# run the bootstrap code on your dev box and include the results in the
-# patchset. See bug 447752.
-
-RDEPEND="app-arch/bzip2
- >=sys-libs/zlib-1.1.3
- virtual/libffi
- virtual/libintl
- !build? (
- gdbm? ( sys-libs/gdbm[berkdb] )
- ncurses? (
- >=sys-libs/ncurses-5.2
- readline? ( >=sys-libs/readline-4.1 )
- )
- sqlite? ( >=dev-db/sqlite-3.3.8:3 )
- ssl? ( dev-libs/openssl )
- tk? (
- >=dev-lang/tk-8.0
- dev-tcltk/blt
- dev-tcltk/tix
- )
- xml? ( >=dev-libs/expat-2.1 )
- )"
-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
- app-admin/python-updater"
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
- if [[ "${PV}" =~ ^3\.2(\.[1234])?(_pre)? ]]; then
- rm -f "${EROOT}usr/$(get_libdir)/llibpython3$(get_libname)"
- else
- die "Deprecated code not deleted"
- fi
-}
-
-src_prepare() {
- # Ensure that internal copies of expat, libffi and zlib are not used.
- rm -r Modules/expat
- rm -r Modules/_ctypes/libffi*
- rm -r Modules/zlib
-
- local excluded_patches
- if ! tc-is-cross-compiler; then
- excluded_patches="*_all_crosscompile.patch"
- fi
-
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
- epatch "${WORKDIR}/patches"
-
- epatch "${FILESDIR}/python-3.2-CVE-2013-2099.patch"
- epatch "${FILESDIR}/CVE-2013-4238_py33.patch"
- epatch "${FILESDIR}/python-3.2-issue16248.patch"
- epatch "${FILESDIR}/python-3.2-issue18235.patch"
- epatch "${FILESDIR}/python-3.2-issue19521.patch"
- epatch "${FILESDIR}/python-3.2-issue19529.patch"
- epatch "${FILESDIR}/python-3.2-issue17919.patch"
-
- # Prefix' round of patches
- # http://prefix.gentooexperimental.org:8000/python-patches-3_2
- 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 half-implemented 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@@"
-
- # Disable ABI flags.
- sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
-
- # bug #514686
- epatch "${FILESDIR}/${PN}-3.2-CVE-2014-4616.patch"
- # bug #500518
- epatch "${FILESDIR}/${PN}-3.2-CVE-2014-1912.patch"
-
- epatch_user
-
- rm -f configure # force regeneration
- eautoconf
- eautoheader
-}
-
-src_configure() {
- if use build; then
- # Disable extraneous modules with extra dependencies.
- export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
- export PYTHON_DISABLE_SSL="1"
- else
- 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
- 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
-
- # Run the configure scripts in parallel.
- multijob_init
-
- mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
-
- if tc-is-cross-compiler; then
- (
- multijob_child_init
- cd "${WORKDIR}"/${CBUILD} >/dev/null
- OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
- "${S}"/configure \
- --{build,host}=${CBUILD} \
- || die "cross-configure failed"
- ) &
- multijob_post_fork
-
- # The configure script assumes it's buggy when cross-compiling.
- export ac_cv_buggy_getaddrinfo=no
- export ac_cv_have_long_long_format=yes
- 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."
-
- local dbmliborder
- if use gdbm; then
- dbmliborder+="${dbmliborder:+:}gdbm"
- fi
-
- # pymalloc #452720
- cd "${WORKDIR}"/${CHOST}
- ECONF_SOURCE=${S} OPT="" \
- econf \
- --with-fpectl \
- --enable-shared \
- $(use_enable ipv6) \
- $(use_with threads) \
- $(use_with wide-unicode) \
- --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-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
-
- if tc-is-cross-compiler; then
- # Modify the Makefile.pre so we don't regen for the host/ one.
- # We need to link the host python programs into $PWD and run
- # them from here because the distutils sysconfig module will
- # parse Makefile/etc... from argv[0], and we need it to pick
- # up the target settings, not the host ones.
- sed -i \
- -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
- -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
- -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
- Makefile{.pre,} || die "sed failed"
- fi
-
- multijob_finish
-}
-
-src_compile() {
- if tc-is-cross-compiler; then
- cd "${WORKDIR}"/${CBUILD}
- # Disable as many modules as possible -- but we need a few to install.
- PYTHON_DISABLE_MODULES=$(
- sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
- egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
- ) \
- PTHON_DISABLE_SSL="1" \
- SYSROOT= \
- emake
- # See comment in src_configure about these.
- ln python ../${CHOST}/hostpython || die
- ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
- ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
- fi
-
- cd "${WORKDIR}"/${CHOST}
- 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 "${WORKDIR}"/${CHOST}
-
- # Skip failing tests.
- local skipped_tests="gdb"
-
- for test in ${skipped_tests}; do
- mv "${S}"/Lib/test/test_${test}.py "${T}"
- done
-
- # Rerun failed tests in verbose mode (regrtest -w).
- PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-w" 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${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 "${WORKDIR}"/${CHOST}
- emake DESTDIR="${D}" altinstall
-
- sed \
- -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
- -e "s/\(PY_LDFLAGS=\).*/\1/" \
- -i "${libdir}/config-${SLOT}/Makefile" || die "sed failed"
-
- # Backwards compat with Gentoo divergence.
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
-
- # Fix collisions between different slots of Python.
- rm -f "${ED}usr/$(get_libdir)/libpython3$(get_libname)" || die
-
- if use build; then
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter}
- else
- use elibc_uclibc && rm -fr "${libdir}/test"
- use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
- use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
- fi
-
- 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
- local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
- emake --no-print-directory -s -f - 2>/dev/null)
- 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
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
-
- # if not using a cross-compiler, use the fresh binary
- if ! tc-is-cross-compiler; then
- local PYTHON=./python \
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
- export LD_LIBRARY_PATH
- fi
-
- echo "EPYTHON='${EPYTHON}'" > epython.py
- python_domodule epython.py
-}
-
-pkg_preinst() {
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_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() {
- ewarn "Please note that Python ${PV%.*} is no longer supported in Gentoo."
- ewarn "The interpreter is not well maintained, and may contain security"
- ewarn "vulnerabilities. Gentoo ebuilds will no longer be built with support"
- ewarn "for Python ${PV%.*}."
- ewarn
- ewarn "If you wish to use Python ${PV%.*} for your own purposes (development,"
- ewarn "testing), we suggest establishing a virtualenv for this interpreter,"
- ewarn "and installing the necessary dependencies inside it. However, we also"
- ewarn "strongly discourage using Python ${PV%.*} on production systems."
-}
-
-pkg_postrm() {
- eselect_python_update
-}
diff --git a/dev-lang/python/python-3.3.3.ebuild b/dev-lang/python/python-3.3.3.ebuild
deleted file mode 100644
index 8f989d864a..0000000000
--- a/dev-lang/python/python-3.3.3.ebuild
+++ /dev/null
@@ -1,408 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.3.3.ebuild,v 1.18 2014/03/18 16:43:13 ago Exp $
-
-EAPI="4"
-WANT_AUTOMAKE="none"
-WANT_LIBTOOL="none"
-
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
-
-MY_P="Python-${PV}"
-PATCHSET_REVISION="0"
-PREFIX_PATCHREV="-r2"
-
-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
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz
- mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz
- http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2"
-
-LICENSE="PSF-2"
-SLOT="3.3"
-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 +crypt doc elibc_uclibc examples gdbm hardened ipv6 +ncurses nis +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
- app-arch/xz-utils
- >=sys-libs/zlib-1.1.3
- virtual/libffi
- virtual/libintl
- !build? (
- gdbm? ( sys-libs/gdbm[berkdb] )
- ncurses? (
- >=sys-libs/ncurses-5.2
- readline? ( >=sys-libs/readline-4.1 )
- )
- sqlite? ( >=dev-db/sqlite-3.3.8:3 )
- ssl? ( dev-libs/openssl )
- tk? (
- >=dev-lang/tk-8.0
- dev-tcltk/blt
- )
- xml? ( >=dev-libs/expat-2.1 )
- )
- !!<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 )
- doc? ( dev-python/python-docs:${SLOT} )"
-PDEPEND="app-eselect/eselect-python
- app-admin/python-updater"
-
-S="${WORKDIR}/${MY_P}"
-
-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="05_all_regenerate_platform-specific_modules.patch"
- fi
-
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
- epatch "${FILESDIR}/python-3.2-issue19521.patch"
- epatch "${FILESDIR}/python-3.3-issue17919.patch"
- epatch "${FILESDIR}/python-3.3-issue18235.patch"
-
- # Prefix' round of patches
- # http://prefix.gentooexperimental.org:8000/python-patches-3_3
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}
- epatch "${FILESDIR}/python-3.3-issue21811.patch"
-
- # 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
-
- rm -f configure # force regeneration
- eautoconf
- eautoheader
-}
-
-src_configure() {
- if use build; then
- # Disable extraneous modules with extra dependencies.
- export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
- export PYTHON_DISABLE_SSL="1"
- else
- local disable
- use crypt || disable+=" _crypt"
- use gdbm || disable+=" gdbm"
- use ncurses || disable+=" _curses _curses_panel"
- use nis || disable+=" nis"
- 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
- 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-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() {
- # http://bugs.python.org/issue19966
- touch Include/Python-ast.h Python/Python-ast.c || die
-
- # 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
-
- PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-u -network" FLAGS="" 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${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
-
- 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-${SLOT}/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-${SLOT}/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-${SLOT}/python.exp|" \
- -e 's| -bI:| -Wl,-bI:|g' \
- -e '/LINKFORSHARED/s|-bE:|-bI:|g' \
- -e '/LINKFORSHARED/s| -lld||g' \
- -i "${libdir}"/{_sysconfigdata.py,config-${SLOT}/Makefile} || die "sed failed"
- fi
-
- # Backwards compat with Gentoo divergence.
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
-
- # Fix collisions between different slots of Python.
- rm -f "${ED}usr/$(get_libdir)/libpython3.so"
-
- if use build; then
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter}
- else
- use elibc_uclibc && rm -fr "${libdir}/test"
- use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
- use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
- fi
-
- 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-${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
- python_domodule epython.py
-}
-
-pkg_preinst() {
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_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."
- ewarn
- ewarn "For legacy packages, you should switch active version of Python and run 'python-updater [options]' to rebuild Python modules."
- fi
-}
-
-pkg_postrm() {
- eselect_python_update
-}
diff --git a/dev-lang/python/python-3.4.3-r5.ebuild b/dev-lang/python/python-3.4.3-r5.ebuild
index b2a6a497a7..2857528908 100644
--- a/dev-lang/python/python-3.4.3-r5.ebuild
+++ b/dev-lang/python/python-3.4.3-r5.ebuild
@@ -9,7 +9,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha
MY_P="Python-${PV/_/}"
PATCHSET_VERSION="3.4.3-0"
-PREFIX_PATCHREV="r0"
+PREFIX_PATCHREV="r1"
CYGWINPORTS_GITREV="8ee84829be03c2a1aa74f0f095c994c1f43f4688"
DESCRIPTION="An interpreted, interactive, object-oriented programming language"
diff --git a/dev-lang/python/python-3.5.1-r3.ebuild b/dev-lang/python/python-3.5.1-r3.ebuild
index 5e176fa333..8422585136 100644
--- a/dev-lang/python/python-3.5.1-r3.ebuild
+++ b/dev-lang/python/python-3.5.1-r3.ebuild
@@ -9,7 +9,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha
MY_P="Python-${PV/_/}"
PATCHSET_VERSION="3.5.1-0"
-PREFIX_PATCHREV="r1"
+PREFIX_PATCHREV="r2"
DESCRIPTION="An interpreted, interactive, object-oriented programming language"
HOMEPAGE="http://www.python.org/"
diff --git a/dev-lang/python/python-3.5.1.ebuild b/dev-lang/python/python-3.5.1.ebuild
deleted file mode 100644
index 3e6454f4ba..0000000000
--- a/dev-lang/python/python-3.5.1.ebuild
+++ /dev/null
@@ -1,422 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-WANT_LIBTOOL="none"
-
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
-
-MY_P="Python-${PV/_/}"
-PATCHSET_VERSION="3.5.1-0"
-PREFIX_PATCHREV="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-20151117-r1"
-
-S="${WORKDIR}/${MY_P}"
-
-PYVER=${SLOT%/*}
-
-src_prepare() {
- # Ensure that internal copies of expat, libffi and zlib are not used.
- rm -fr Modules/expat
- rm -fr Modules/_ctypes/libffi*
- rm -fr Modules/zlib
-
- if tc-is-cross-compiler; then
- # Invokes BUILDPYTHON, which is built for the host arch
- local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
- fi
-
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
- epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
- epatch "${FILESDIR}/3.5-secondary-targets.patch"
-
- # Prefix' round of patches
- # http://prefix.gentooexperimental.org:8000/python-patches-3_3
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
-
- # 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@@"
-
- #sed -i -e 's/\$(GRAMMAR_H): \$(GRAMMAR_INPUT) \$(PGEN)/$(GRAMMAR_H): \$(GRAMMAR_INPUT)/' Makefile.pre.in || die
-
- # workaround a development build env problem and muck around
- # framework install to get the best of both worlds (non-standard)
- sed -i \
- -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
- -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
- configure.ac configure || die
- sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
-
- # Disable ABI flags.
- sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
-
- epatch_user
-
- eautoreconf
-}
-
-src_configure() {
- local disable
- use gdbm || disable+=" gdbm"
- use ncurses || disable+=" _curses _curses_panel"
- use readline || disable+=" readline"
- use sqlite || disable+=" _sqlite3"
- use ssl || export PYTHON_DISABLE_SSL="1"
- use tk || disable+=" _tkinter"
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
- export PYTHON_DISABLE_MODULES="${disable}"
-
- if ! use xml; then
- ewarn "You have configured Python without XML support."
- ewarn "This is NOT a recommended configuration as you"
- ewarn "may face problems parsing any XML documents."
- fi
-
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
- fi
-
- if [[ "$(gcc-major-version)" -ge 4 ]]; then
- append-flags -fwrapv
- fi
-
- filter-flags -malign-double
-
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
-
- # https://bugs.gentoo.org/show_bug.cgi?id=50309
- if is-flagq -O3; then
- is-flagq -fstack-protector-all && replace-flags -O3 -O2
- use hardened && replace-flags -O3 -O2
- fi
-
- # Export CC so even AIX will use gcc instead of xlc_r.
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
- tc-export CC CXX
-
- # The configure script fails to use pkg-config correctly.
- # http://bugs.python.org/issue15506
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
-
- # Set LDFLAGS so we link modules with -lpython3.2 correctly.
- # Needed on FreeBSD unless Python 3.2 is already installed.
- # Please query BSD team before removing this!
- append-ldflags "-L."
-
- # make sure setup.py considers Prefix' paths before system ones
- use prefix && append-cppflags -I"${EPREFIX}"/usr/include
- use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
-
- local dbmliborder
- if use gdbm; then
- dbmliborder+="${dbmliborder:+:}gdbm"
- fi
-
- BUILD_DIR="${WORKDIR}/${CHOST}"
- mkdir -p "${BUILD_DIR}" || die
- cd "${BUILD_DIR}" || die
-
- if use aqua ; then
- ECONF_SOURCE="${S}" OPT="" \
- econf \
- --enable-framework="${EPREFIX}"/usr/lib \
- --config-cache
- fi
-
- # pymalloc #452720
- local myeconfargs=(
- $(use aqua && echo --config-cache) \
- --with-fpectl
- --enable-shared
- $(use_enable ipv6)
- $(use_with threads)
- --infodir='${prefix}/share/info'
- --mandir='${prefix}/share/man'
- --with-computed-gotos
- --with-dbmliborder="${dbmliborder}"
- --with-libc=
- --enable-loadable-sqlite-extensions
- --without-ensurepip
- --with-system-expat
- --with-system-ffi
- --without-pymalloc
- )
-
- ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
-
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
- eerror "configure has detected that the sem_open function is broken."
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
- die "Broken sem_open function (bug 496328)"
- fi
-}
-
-src_compile() {
- # Avoid regenerating these for cross-compiles
- touch Include/graminit.h Python/graminit.c Python/importlib.h Python/importlib_external.h || die
-
- cd "${BUILD_DIR}" || die
-
- emake CPPFLAGS= CFLAGS= LDFLAGS=
-
- # Work around bug 329499. See also bug 413751 and 457194.
- if has_version dev-libs/libffi[pax_kernel]; then
- pax-mark E python
- else
- pax-mark m python
- fi
-}
-
-src_test() {
- # Tests will not work when cross compiling.
- if tc-is-cross-compiler; then
- elog "Disabling tests due to crosscompiling."
- return
- fi
-
- cd "${BUILD_DIR}" || die
-
- # Skip failing tests.
- local skipped_tests="gdb"
-
- for test in ${skipped_tests}; do
- mv "${S}"/Lib/test/test_${test}.py "${T}"
- done
-
- local -x PYTHONDONTWRITEBYTECODE=
- emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
- local result=$?
-
- for test in ${skipped_tests}; do
- mv "${T}/test_${test}.py" "${S}"/Lib/test
- done
-
- elog "The following tests have been skipped:"
- for test in ${skipped_tests}; do
- elog "test_${test}.py"
- done
-
- elog "If you would like to run them, you may:"
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
- elog "and run the tests separately."
-
- if [[ ${result} -ne 0 ]]; then
- die "emake test failed"
- fi
-}
-
-src_install() {
- local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
-
- cd "${BUILD_DIR}" || die
-
- emake DESTDIR="${D}" altinstall
-
- if use aqua ; then
- # avoid config.status to be triggered
- find Mac -name "Makefile" -exec touch \{\} + || die
-
- # 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*)
- # 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${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
- 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
-}