1 |
commit: a69c6d0eb2ff159011fd4303d4a14de0a7338162 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 1 15:48:49 2016 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 1 15:48:49 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=a69c6d0e |
7 |
|
8 |
dev-lang/python: remove old, update darwin patches for accepting .so, bug #584614 |
9 |
|
10 |
Package-Manager: portage-2.2.28-prefix |
11 |
|
12 |
dev-lang/python/Manifest | 18 +- |
13 |
dev-lang/python/python-2.7.10.ebuild | 598 ------------------------------ |
14 |
dev-lang/python/python-2.7.11-r2.ebuild | 2 +- |
15 |
dev-lang/python/python-2.7.11.ebuild | 629 -------------------------------- |
16 |
dev-lang/python/python-2.7.8.ebuild | 584 ----------------------------- |
17 |
dev-lang/python/python-3.2.5-r6.ebuild | 409 --------------------- |
18 |
dev-lang/python/python-3.3.3.ebuild | 408 --------------------- |
19 |
dev-lang/python/python-3.4.3-r5.ebuild | 2 +- |
20 |
dev-lang/python/python-3.5.1-r3.ebuild | 2 +- |
21 |
dev-lang/python/python-3.5.1.ebuild | 422 --------------------- |
22 |
10 files changed, 6 insertions(+), 3068 deletions(-) |
23 |
|
24 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
25 |
index 5fbfb0c..b92d486 100644 |
26 |
--- a/dev-lang/python/Manifest |
27 |
+++ b/dev-lang/python/Manifest |
28 |
@@ -1,23 +1,11 @@ |
29 |
DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9173 SHA256 39e2c7367357110d4bc89a5ba515cd0f419a22e45f0ffda73db6b676ac28b718 SHA512 b1c654c852baf7891b834124607115cfaf3f1b8b7a58a9c3e8e46dd5b2f608d05d27e8a6222cc98ed83634bcfdcbbddcb888070d079cc8438db7e52320f113f9 |
30 |
DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 SHA256 811b6fe82630a04a44a6d16074af76964e7e4005136ba479647eb741639099da SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62 |
31 |
-DIST Python-2.7.10.tar.xz 12250696 SHA256 1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0 SHA512 67615a6defbcda062f15a09f9dd3b9441afd01a8cc3255e5bc45b925378a0ddc38d468b7701176f6cc153ec52a4f21671b433780d9bde343aa9b9c1b2ae29feb WHIRLPOOL 3a9dcfc55b107dc55ad0ae93fb24a11eab7d4d9b4cfbe6b6830a090b6e5f71bb2ac91526b89c6f3e4f2610fa1a2cc4e82b58a83c599aa71f94894c74181b504b |
32 |
DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46 SHA512 72166763a2fe6aab45ecf378f55a1efc7322d1742c4638bae84f4ed4b9fb4c01f2a0293733c64426ae2c70df24d95ff2b1e2a4f3c2715de00d8f320d4d939ea0 WHIRLPOOL 7ebcff7a2fe775a21a3847dee10369b73aaea8685eb63b4bc33dab0f562b8fb984c398cb34e8158cf1e24f106002829649540aad30a5ec7f4de0018ce7449f69 |
33 |
-DIST Python-2.7.8.tar.xz 10525244 SHA256 edde10a0cb7d14e2735e682882d5b287028d1485c456758154c19573db68075a SHA512 0a992e34b6b704f028f5178c0404f8ca5fd9a7ab9da1879a20f0c72ffa712dc4925e45eb78e9368d6a17ee618259fc3f078d71766b314a732a1a28e526511a5e WHIRLPOOL 81ee40be85a8713dcc91e64c7faaf7605c43dc28f97b410b88411bbf7d4adbdf48a3e4bfa18c039c1da8695160a98ebb57e144c3198abec2b12398d80ece2971 |
34 |
-DIST Python-3.2.5.tar.xz 9221624 SHA256 8ccb9645b9779fc4550055b2ebb21a724ab7a63dee45643286eb4f79b2f84116 SHA512 6e71d01695c7b1e74d9781e4ac40a8d1560cae659d5351d392fc685b84316568d93740a99d2ed878dd87d4ce1708d0474cb01c6bad7b3dab610c639f3255b09d WHIRLPOOL d5e5fae5e1d4110861e1e1dac00c9812abbbc37205e8ce3cd268535ab9f66e24038ab4778af8bb834fd472eaa0281730f1f2fabdf6dffc4f6b54ef32c1d75953 |
35 |
-DIST Python-3.3.3.tar.xz 12057744 SHA256 339275b30a1a3fef1589016bf6302c14e870f7a6fd2522bf87a6c2c6d383c685 SHA512 6acd905d2ae70a259de1d502c90ce9cc831b03cd32930d55bdce1f6dd4b2657c4bb8698e46f6558253338046c43ee842befa2d62e35eeb82b82659acbe6ea0aa WHIRLPOOL 680a88bc7ca312a71237350c06573d5ed6138d826613a6a8ad9e953181561966c9a9f64b176226a627175b8bb5d13755bb7cabe20ee9510ced5da14185e092a4 |
36 |
DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3 |
37 |
DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f |
38 |
-DIST python-gentoo-patches-2.7.10-0.tar.xz 12892 SHA256 c9a838bd62ae50cc385da23a837acfd05f2b74e4f086c9c76eb4d3aa5366ef6d SHA512 5f100944635e360691dc0a2b340a906646c4ae9ee558246ddffc56e8b15d389f25f1fbdc1db4cc08e7d29560d04d66b058b3904902899d58ecae8c408ebdf056 WHIRLPOOL f69e9a518bb7ee50c1b262a21e70e1e2443f859ee6d2f4fa84421120dbd054a06ce8dd6cfea8512cbc64bce806322b879c25c561d5eb05e1ba6cc15035b373a9 |
39 |
DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77 |
40 |
-DIST python-gentoo-patches-2.7.8-0.tar.xz 14016 SHA256 22ca5eab8e1702f220c272c57359f547b753b88d59b53ab95c7985c17f4f90ec SHA512 17020c8a2039cc073c973e213e77dc67ad9ed4ae7f5fafb931933943aa745733309c46e3972bfde85d112cdef6d47aa91868a614db08bb135c29051999c3df4e WHIRLPOOL 96f0e5c7329cc886d979ec782ffd3c63461f49ba112f0d95e5528d7f15048170cd4e52b78cb4100839d509ef28b927bf7a0f1a610fcf4ec562730a284f8c9fc3 |
41 |
-DIST python-gentoo-patches-3.2.5-1.tar.xz 14628 SHA256 0acc5531421781ab7f30e6fc8a502f202b79aa285b4f411eb16ea0a9e6d958c1 SHA512 1abbd53e92466d258802717309e1839ae931b8a4b0a5a27d4d0da748e71cf96ac47c6837bdbae5dd6921a46cee339c178f86ff3108afe95e6a0a42c4f4300791 WHIRLPOOL de003cccb8b311413889713d66b7987f28a1f906cc9642621d1fd2a379ceae4f0f901c137503d808dc3da7295ac611de09781bf8661cdbcd14c1d7c94ba489c2 |
42 |
-DIST python-gentoo-patches-3.3.3-0.tar.xz 12992 SHA256 38b5c604416947fdd7d87ada2ccd3febf7407f00c1e67e6a99be8765f1b25c49 SHA512 d803b287c0f407c68dd766974296239419fb35441f1796081681f28d17b1f6c7e50e0aae807ad147469eb586db8fe486a013a166cb76e08f2b7a9ba39acb1760 WHIRLPOOL 09a9dbd1831c2e7022f4df27b57435dd1df7eace294e8fa069ce5fa5c1719f64ba9bcd8f27d614a8c13ee8605db37c7e75c13fa14885b76ce289667bf2871aaf |
43 |
DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1 |
44 |
DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc |
45 |
-DIST python-prefix-2.7.10-gentoo-patches.tar.bz2 16922 SHA256 9fe4df587363c439f1f29885b4b2a1238d16861667966b279dc1019cb904efa4 SHA512 a016e1572276dbbe0fc045d723b592b31573f99b60370f0c1506f10fd9a632cc879bdc4a2060c6a5ff411f26179189517ff4c4beb6979a5727e0dc17de935fe2 WHIRLPOOL 73542d16f9f64acb2cb941ce659d981d6d8b8a8cba9ef4f41c4b987665beedb125a6ad4a7badb5eb12092d916e1ab807330a2fcefc7914ae9708569d54faa7b6 |
46 |
-DIST python-prefix-2.7.11-gentoo-patches-r0.tar.xz 17348 SHA256 c02e37fc75fa280cfed86d20df3dc4c8a7ff46f18eb67b268d75209f0c1a2fc6 SHA512 c181953cc30c94935a06f7511b5d641a1b45127a69ccf9e8e22cb31c0da6e54e7e4ccc5c5f4a15889c079d5b1d3c74b94e8da49dc018c807b6b8b0376cb70e76 WHIRLPOOL a8dcda32eadb3c3e1908f5a493b06046190d2f53347edfe3ef859926fe2e741535c9a9ad0ebbe1b0ea011b858f6ee21c04f806469b7249d453e6ae4b7a6cd2b2 |
47 |
-DIST python-prefix-2.7.8-gentoo-patches.tar.bz2 17154 SHA256 6c5f171f15f662c2b88258ebff152224a7003c43e025be860baf99913d00a8b1 SHA512 fe53cf969e70744ed6c66757e507f55eea031fa98e08f1846e3c51b968eb8d91a377c9c47cbc5cd469715c37d71b70dd1dc46fdbb52cab372179acb497a81643 WHIRLPOOL f966f3dc68f7cf171aeef0226a72616d42f13e9b085a772aa7221b1898a74e0b31c74350c7114fc6a39ab739877d5e12be1755357e2821f8b026af61fa99b4b3 |
48 |
-DIST python-prefix-3.2.5-gentoo-patches-r0.tar.bz2 9594 SHA256 350924a35c352915d619aea9077ef26707b2621683cca926de5cb55b5dc429fa SHA512 63eb12cea50a9d3a557071f47f4d8200153c495f7e8f9853508194b56b8e16da956fe0e6b790085f4ecdcc8d5c29a0c50664fee1bd522d52d98a43c2bceb28ea WHIRLPOOL e5335f7df1bf21f5303e90048c15d5cf0d539b269a428a417e8678c74f8ab630691456c6e02476bf223531d12e44f7cfb71f6b631f371c8a0dc454e4e5d3607a |
49 |
-DIST python-prefix-3.3.3-gentoo-patches-r2.tar.bz2 13776 SHA256 7e90671d26b60b874748efc95171f7bed149637b1d4aa34752d12fdac06d2d85 SHA512 9859d5367ae1d655572236ffdeb49ac58ae4cf48a556428a9cfb80ac21552d0d8b1c89461f31e6a8dbfdfbc9ced01f510400963571d810e79156f2a3f753fffd WHIRLPOOL b5d45333fea0610e0efba2f0d113337d9004459ec733691406518709ff4c191060d868ead7a0db0e65f89e953d03fb164c5cd1dcc128a5c0e5af93fa7fc0ffd4 |
50 |
-DIST python-prefix-3.4.3-gentoo-patches-r0.tar.xz 12808 SHA256 bb51649f6a586640463dd742170ff2fdb8c906128a97b1c0bb2b9cad0fe82d56 SHA512 714e5cfa03cfd290a821dea641b91c4358a25bb1bcb47050b1cf321f0defa7e060a4cdd967bc356701642230b51f3c74476af96ff58a6f933301171e12ccfac8 WHIRLPOOL f7ff0e0bebbeee221a18d5078f12c77922c7621e00f19254e72f68767647a7d2ff9312366b62023a7d4283def2d7f509572ad657bbb2c132355ee637c5697b0c |
51 |
-DIST python-prefix-3.5.1-gentoo-patches-r1.tar.xz 12684 SHA256 a15318c069a7cb463a58ac4d8754a94a5bac081c922f07ca6e1fc6b9b9efa44a SHA512 a0086af9f361098ee7e51e260f9444c93a24c86898fe0fad8b08ad3d7f179c29bb97baa545f19fd8451d4668aa4d3894fe3769c1bf7a10f8342ded806bfd620d WHIRLPOOL 7136d338feefe6d1b7d4ad7dabe9371066f254a3405f2f737d84c69c3a79f0926e2f338e131c7d90199a8948eae95087d454a930c17a7e2f3c360eb0defce4bf |
52 |
+DIST python-prefix-2.7.11-gentoo-patches-r1.tar.xz 17268 SHA256 ecebc430e475030fdbfcd940f314f80ebcb8c6e01a6b2498478bb8f37e525484 SHA512 22218128ff83856dd042ecd6aab3615282ab29c4420e6cce4a0bba8b6508e3f5649c27cdf50cf342fffd3c87ea29f8b7d32d28b9b1f4dc200771b52ee41f27e5 WHIRLPOOL 2a942b39e56955df5b24f50d68a39ca78152e10f13ccc856340cd4651eb87847097ec3ff79efde81c2130b12f2885764194fb8d51c05278f4acc550bcd4ba032 |
53 |
+DIST python-prefix-3.4.3-gentoo-patches-r1.tar.xz 12896 SHA256 39da669913d8627a74e6d9a7e1ee6eae3e184d7525097090d4b05a71b0a79100 SHA512 dd1082ef9605fdcb84bcc769318be6934c889a5b6134971fb121b3be8301cb9519fb687841a359c65e0614d05a8c27eab4b3dbfe94ed8dbbf2fc64f82206a6d9 WHIRLPOOL 884f0e9e5e177543c74f3c3e87629113db6c53c556f55bf7310de79f101fa825472d886eea216cea471e981dc4fd6743622e1c7472b5ffe04eda4c6790d73c62 |
54 |
+DIST python-prefix-3.5.1-gentoo-patches-r2.tar.xz 12680 SHA256 73b1166eded9867b473c90171b613d32bbe8f72e523c74b1563a9c25c555e13b SHA512 82b08b8cf7f3620c4c2a6a6c3ed5ec8c3318c6f43e4bcc4950c7aeb56ec755e0e47d46f068843f5b04159583994c8620dab14827278a199789a3867532cc6e0c WHIRLPOOL ac4ea106ca744d6e154e14a53ae2e8eeb119207069ead95d0ef19657a58e1d31ed1933de6315ab61ce532c11d1ae4a999c73d34121028a0a246b7dd2b1ac857a |
55 |
|
56 |
diff --git a/dev-lang/python/python-2.7.10.ebuild b/dev-lang/python/python-2.7.10.ebuild |
57 |
deleted file mode 100644 |
58 |
index 18fa0f1..0000000 |
59 |
--- a/dev-lang/python/python-2.7.10.ebuild |
60 |
+++ /dev/null |
61 |
@@ -1,598 +0,0 @@ |
62 |
-# Copyright 1999-2015 Gentoo Foundation |
63 |
-# Distributed under the terms of the GNU General Public License v2 |
64 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.10.ebuild,v 1.1 2015/05/28 04:10:47 floppym Exp $ |
65 |
- |
66 |
-EAPI="4" |
67 |
-WANT_LIBTOOL="none" |
68 |
- |
69 |
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
70 |
- |
71 |
-MY_P="Python-${PV}" |
72 |
-PATCHSET_VERSION="2.7.10-0" |
73 |
-PREFIX_PATCHREV="" |
74 |
- |
75 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
76 |
-HOMEPAGE="http://www.python.org/" |
77 |
-SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
78 |
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz |
79 |
- prefix? ( http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2 )" |
80 |
- |
81 |
-LICENSE="PSF-2" |
82 |
-SLOT="2.7" |
83 |
-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" |
84 |
-IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" |
85 |
- |
86 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
87 |
-# If you need to apply a patch which requires python for bootstrapping, please |
88 |
-# run the bootstrap code on your dev box and include the results in the |
89 |
-# patchset. See bug 447752. |
90 |
- |
91 |
-RDEPEND="app-arch/bzip2 |
92 |
- >=sys-libs/zlib-1.1.3 |
93 |
- !m68k-mint? ( virtual/libffi ) |
94 |
- virtual/libintl |
95 |
- !build? ( |
96 |
- berkdb? ( || ( |
97 |
- sys-libs/db:5.3 |
98 |
- sys-libs/db:5.2 |
99 |
- sys-libs/db:5.1 |
100 |
- sys-libs/db:5.0 |
101 |
- sys-libs/db:4.8 |
102 |
- sys-libs/db:4.7 |
103 |
- sys-libs/db:4.6 |
104 |
- sys-libs/db:4.5 |
105 |
- sys-libs/db:4.4 |
106 |
- sys-libs/db:4.3 |
107 |
- sys-libs/db:4.2 |
108 |
- ) ) |
109 |
- gdbm? ( sys-libs/gdbm[berkdb] ) |
110 |
- ncurses? ( |
111 |
- >=sys-libs/ncurses-5.2 |
112 |
- readline? ( >=sys-libs/readline-4.1 ) |
113 |
- ) |
114 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3 ) |
115 |
- ssl? ( dev-libs/openssl ) |
116 |
- tk? ( |
117 |
- >=dev-lang/tk-8.0[-aqua] |
118 |
- dev-tcltk/blt |
119 |
- dev-tcltk/tix |
120 |
- ) |
121 |
- xml? ( >=dev-libs/expat-2.1 ) |
122 |
- ) |
123 |
- !!<sys-apps/portage-2.1.9" |
124 |
-DEPEND="${RDEPEND} |
125 |
- virtual/pkgconfig |
126 |
- >=sys-devel/autoconf-2.65 |
127 |
- !sys-devel/gcc[libffi]" |
128 |
-RDEPEND+=" !build? ( app-misc/mime-types ) |
129 |
- doc? ( dev-python/python-docs:${SLOT} )" |
130 |
-PDEPEND="app-eselect/eselect-python |
131 |
- app-admin/python-updater" |
132 |
- |
133 |
-S="${WORKDIR}/${MY_P}" |
134 |
- |
135 |
-pkg_setup() { |
136 |
- if use berkdb; then |
137 |
- ewarn "'bsddb' module is out-of-date and no longer maintained inside" |
138 |
- ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" |
139 |
- ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" |
140 |
- ewarn "is provided by dev-python/bsddb3." |
141 |
- else |
142 |
- if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then |
143 |
- ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" |
144 |
- ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." |
145 |
- fi |
146 |
- fi |
147 |
-} |
148 |
- |
149 |
-src_prepare() { |
150 |
- # Ensure that internal copies of expat, libffi and zlib are not used. |
151 |
- rm -r Modules/expat || die |
152 |
- rm -r Modules/_ctypes/libffi* || die |
153 |
- rm -r Modules/zlib || die |
154 |
- |
155 |
- if tc-is-cross-compiler; then |
156 |
- local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" |
157 |
- fi |
158 |
- |
159 |
- # if building a patched source-tar, comment the rm's above, and uncomment |
160 |
- # this line: |
161 |
- #local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch" |
162 |
- |
163 |
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
164 |
- epatch "${FILESDIR}/python-2.7-issue18235.patch" |
165 |
- |
166 |
- # Prefix' round of patches |
167 |
- # http://prefix.gentooexperimental.org:8000/python-patches-2_7 |
168 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
169 |
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV} |
170 |
- |
171 |
- if use aqua ; then |
172 |
- # make sure we don't get a framework reference here |
173 |
- sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ |
174 |
- -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ |
175 |
- Makefile.pre.in || die |
176 |
- # Python upstream refuses to listen to configure arguments |
177 |
- sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \ |
178 |
- configure.ac configure || die |
179 |
- # we handle creation of symlinks in src_install |
180 |
- sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die |
181 |
- fi |
182 |
- # don't try to do fancy things on Darwin |
183 |
- sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
184 |
- |
185 |
- # Fix for cross-compiling. |
186 |
- epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" |
187 |
- epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch" |
188 |
-#552422 epatch "${FILESDIR}/python-2.7.10-semaphore-pid.patch" |
189 |
- epatch "${FILESDIR}/python-2.7.10-semaphore-urandom.patch" #552422 |
190 |
- |
191 |
- epatch "${FILESDIR}"/python-2.7-aix-dlopen-soname.patch # libtool-built modules |
192 |
- |
193 |
- # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR. |
194 |
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
195 |
- |
196 |
- # Make sure python doesn't use the host libffi. |
197 |
- use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch" |
198 |
- |
199 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
200 |
- Lib/distutils/command/install.py \ |
201 |
- Lib/distutils/sysconfig.py \ |
202 |
- Lib/site.py \ |
203 |
- Lib/sysconfig.py \ |
204 |
- Lib/test/test_site.py \ |
205 |
- Makefile.pre.in \ |
206 |
- Modules/Setup.dist \ |
207 |
- Modules/getpath.c \ |
208 |
- setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
209 |
- |
210 |
- epatch_user |
211 |
- |
212 |
- eautoreconf |
213 |
-} |
214 |
- |
215 |
-src_configure() { |
216 |
- if use build; then |
217 |
- # Disable extraneous modules with extra dependencies. |
218 |
- export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" |
219 |
- export PYTHON_DISABLE_SSL="1" |
220 |
- else |
221 |
- # dbm module can be linked against berkdb or gdbm. |
222 |
- # Defaults to gdbm when both are enabled, #204343. |
223 |
- local disable |
224 |
- use berkdb || use gdbm || disable+=" dbm" |
225 |
- use berkdb || disable+=" _bsddb" |
226 |
- use gdbm || disable+=" gdbm" |
227 |
- use ncurses || disable+=" _curses _curses_panel" |
228 |
- use readline || disable+=" readline" |
229 |
- use sqlite || disable+=" _sqlite3" |
230 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
231 |
- use tk || disable+=" _tkinter" |
232 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
233 |
- [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon |
234 |
- [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs" |
235 |
- export PYTHON_DISABLE_MODULES="${disable}" |
236 |
- |
237 |
- if ! use xml; then |
238 |
- ewarn "You have configured Python without XML support." |
239 |
- ewarn "This is NOT a recommended configuration as you" |
240 |
- ewarn "may face problems parsing any XML documents." |
241 |
- fi |
242 |
- fi |
243 |
- |
244 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
245 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
246 |
- fi |
247 |
- |
248 |
- if [[ "$(gcc-major-version)" -ge 4 ]]; then |
249 |
- append-flags -fwrapv |
250 |
- fi |
251 |
- |
252 |
- filter-flags -malign-double |
253 |
- |
254 |
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
255 |
- |
256 |
- # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
257 |
- if is-flagq -O3; then |
258 |
- is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
259 |
- use hardened && replace-flags -O3 -O2 |
260 |
- fi |
261 |
- |
262 |
- if tc-is-cross-compiler; then |
263 |
- # Force some tests that try to poke fs paths. |
264 |
- export ac_cv_file__dev_ptc=no |
265 |
- export ac_cv_file__dev_ptmx=yes |
266 |
- fi |
267 |
- |
268 |
- # http://bugs.gentoo.org/show_bug.cgi?id=302137 |
269 |
- if [[ ${CHOST} == powerpc-*-darwin* ]] && \ |
270 |
- ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \ |
271 |
- [[ ${CHOST} == powerpc64-*-darwin* ]]; |
272 |
- then |
273 |
- replace-flags -O2 -O3 |
274 |
- replace-flags -Os -O3 # comment #14 |
275 |
- fi |
276 |
- |
277 |
- if use prefix ; then |
278 |
- # for Python's setup.py not to do false assumptions (only looking in |
279 |
- # host paths) we need to make explicit where Prefix stuff is |
280 |
- append-cppflags -I"${EPREFIX}"/usr/include |
281 |
- append-ldflags -L"${EPREFIX}"/$(get_libdir) |
282 |
- append-ldflags -L"${EPREFIX}"/usr/$(get_libdir) |
283 |
- # fix compilation on some 64-bits Linux hosts, #381163, #473520 |
284 |
- for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do |
285 |
- [[ -d ${hostlibdir} ]] || continue |
286 |
- append-ldflags -L${hostlibdir} |
287 |
- done |
288 |
- # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that |
289 |
- # local include paths - set in $(CPPFLAGS) - are searched first. |
290 |
- sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die |
291 |
- fi |
292 |
- |
293 |
- # Export CC so even AIX will use gcc instead of xlc_r. |
294 |
- # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. |
295 |
- tc-export CC CXX |
296 |
- # The configure script fails to use pkg-config correctly. |
297 |
- # http://bugs.python.org/issue15506 |
298 |
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
299 |
- |
300 |
- # Set LDFLAGS so we link modules with -lpython2.7 correctly. |
301 |
- # Needed on FreeBSD unless Python 2.7 is already installed. |
302 |
- # Please query BSD team before removing this! |
303 |
- # On AIX this is not needed, but would record '.' as runpath. |
304 |
- [[ ${CHOST} == *-aix* ]] || |
305 |
- append-ldflags "-L." |
306 |
- |
307 |
- local dbmliborder |
308 |
- if use gdbm; then |
309 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
310 |
- fi |
311 |
- if use berkdb; then |
312 |
- dbmliborder+="${dbmliborder:+:}bdb" |
313 |
- fi |
314 |
- |
315 |
- # Don't include libmpc on IRIX - it is only available for 64bit MIPS4 |
316 |
- [[ ${CHOST} == *-irix* ]] && export ac_cv_lib_mpc_usconfig=no |
317 |
- |
318 |
- [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no |
319 |
- |
320 |
- # we need this to get pythonw, the GUI version of python |
321 |
- # --enable-framework and --enable-shared are mutually exclusive: |
322 |
- # http://bugs.python.org/issue5809 |
323 |
- use aqua \ |
324 |
- && myconf="${myconf} --enable-framework=${EPREFIX}/usr/lib" \ |
325 |
- || myconf="${myconf} --enable-shared" |
326 |
- |
327 |
- BUILD_DIR="${WORKDIR}/${CHOST}" |
328 |
- mkdir -p "${BUILD_DIR}" || die |
329 |
- cd "${BUILD_DIR}" || die |
330 |
- |
331 |
- # note: for a framework build we need to use ucs2 because OSX |
332 |
- # uses that internally too: |
333 |
- # http://bugs.python.org/issue763708 |
334 |
- # HAS_HG to avoid finding obsolete hg of the host |
335 |
- ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \ |
336 |
- econf \ |
337 |
- --with-fpectl \ |
338 |
- $(use_enable ipv6) \ |
339 |
- $(use_with threads) \ |
340 |
- $( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ |
341 |
- --infodir='${prefix}/share/info' \ |
342 |
- --mandir='${prefix}/share/man' \ |
343 |
- --with-dbmliborder="${dbmliborder}" \ |
344 |
- --with-libc="" \ |
345 |
- --enable-loadable-sqlite-extensions \ |
346 |
- --with-system-expat \ |
347 |
- --with-system-ffi \ |
348 |
- --without-ensurepip \ |
349 |
- ${myconf} |
350 |
- |
351 |
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
352 |
- eerror "configure has detected that the sem_open function is broken." |
353 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
354 |
- die "Broken sem_open function (bug 496328)" |
355 |
- fi |
356 |
-} |
357 |
- |
358 |
-src_compile() { |
359 |
- # Avoid invoking pgen for cross-compiles. |
360 |
- touch Include/graminit.h Python/graminit.c |
361 |
- |
362 |
- cd "${BUILD_DIR}" || die |
363 |
- emake |
364 |
- |
365 |
- # Work around bug 329499. See also bug 413751 and 457194. |
366 |
- if has_version dev-libs/libffi[pax_kernel]; then |
367 |
- pax-mark E python |
368 |
- else |
369 |
- pax-mark m python |
370 |
- fi |
371 |
-} |
372 |
- |
373 |
-src_test() { |
374 |
- # Tests will not work when cross compiling. |
375 |
- if tc-is-cross-compiler; then |
376 |
- elog "Disabling tests due to crosscompiling." |
377 |
- return |
378 |
- fi |
379 |
- |
380 |
- cd "${BUILD_DIR}" || die |
381 |
- |
382 |
- # Skip failing tests. |
383 |
- local skipped_tests="distutils gdb" |
384 |
- |
385 |
- for test in ${skipped_tests}; do |
386 |
- mv "${S}"/Lib/test/test_${test}.py "${T}" |
387 |
- done |
388 |
- |
389 |
- # Rerun failed tests in verbose mode (regrtest -w). |
390 |
- emake test EXTRATESTOPTS="-w" < /dev/tty |
391 |
- local result="$?" |
392 |
- |
393 |
- for test in ${skipped_tests}; do |
394 |
- mv "${T}/test_${test}.py" "${S}"/Lib/test |
395 |
- done |
396 |
- |
397 |
- elog "The following tests have been skipped:" |
398 |
- for test in ${skipped_tests}; do |
399 |
- elog "test_${test}.py" |
400 |
- done |
401 |
- |
402 |
- elog "If you would like to run them, you may:" |
403 |
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
404 |
- elog "and run the tests separately." |
405 |
- |
406 |
- if [[ "${result}" -ne 0 ]]; then |
407 |
- die "emake test failed" |
408 |
- fi |
409 |
-} |
410 |
- |
411 |
-src_install() { |
412 |
- local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
413 |
- |
414 |
- cd "${BUILD_DIR}" || die |
415 |
- [[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/ |
416 |
- if use aqua ; then |
417 |
- local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework |
418 |
- |
419 |
- # do not make multiple targets in parallel when there are broken |
420 |
- # sharedmods (during bootstrap), would build them twice in parallel. |
421 |
- |
422 |
- # let the makefiles do their thing |
423 |
- emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall |
424 |
- |
425 |
- # avoid framework incompatability, degrade to a normal UNIX lib |
426 |
- mkdir -p "${ED}"/usr/$(get_libdir) |
427 |
- cp "${D}${fwdir}"/Versions/${SLOT}/Python \ |
428 |
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die |
429 |
- chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
430 |
- install_name_tool \ |
431 |
- -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ |
432 |
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
433 |
- chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
434 |
- cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die |
435 |
- |
436 |
- # rebuild python executable to be the non-pythonw (python wrapper) |
437 |
- # version so we don't get framework crap |
438 |
- rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861 |
439 |
- $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ |
440 |
- -o "${ED}"/usr/bin/python${SLOT} \ |
441 |
- Modules/python.o || die |
442 |
- |
443 |
- # don't install the "Current" symlink, will always conflict |
444 |
- rm "${D}${fwdir}"/Versions/Current || die |
445 |
- # update whatever points to it, eselect-python sets them |
446 |
- rm "${D}${fwdir}"/{Headers,Python,Resources} || die |
447 |
- |
448 |
- # remove unversioned files (that are not made versioned below) |
449 |
- pushd "${ED}"/usr/bin > /dev/null |
450 |
- rm -f python python-config python${SLOT}-config |
451 |
- # python${SLOT} was created above |
452 |
- for f in pythonw smtpd${SLOT}.py pydoc idle ; do |
453 |
- rm -f ${f} ${f}${SLOT} |
454 |
- done |
455 |
- # pythonw needs to remain in the framework (that's the whole |
456 |
- # reason we go through this framework hassle) |
457 |
- ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die |
458 |
- # copy the scripts to we can fix their shebangs |
459 |
- for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do |
460 |
- # for some reason sometimes they already exist, bug #347321 |
461 |
- rm -f ${f} |
462 |
- cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die |
463 |
- sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ |
464 |
- ${f} || die |
465 |
- done |
466 |
- # "fix" to have below collision fix not to bail |
467 |
- mv pydoc${SLOT} pydoc || die |
468 |
- mv idle${SLOT} idle || die |
469 |
- popd > /dev/null |
470 |
- |
471 |
- # basically we don't like the framework stuff at all, so just move |
472 |
- # stuff around or add some symlinks to make our life easier |
473 |
- mkdir -p "${ED}"/usr |
474 |
- mv "${D}${fwdir}"/Versions/${SLOT}/share \ |
475 |
- "${ED}"/usr/ || die "can't move share" |
476 |
- # get includes just UNIX style |
477 |
- mkdir -p "${ED}"/usr/include |
478 |
- mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ |
479 |
- "${ED}"/usr/include/ || die "can't move include" |
480 |
- pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null |
481 |
- ln -s ../../../../../include/python${SLOT} || die |
482 |
- popd > /dev/null |
483 |
- rm -f "${ED}"/usr/share/man/man1/python{,2}.1 |
484 |
- |
485 |
- # same for libs |
486 |
- # NOTE: can't symlink the entire dir, because a real dir already exists |
487 |
- # on upgrade (site-packages), however since we h4x0rzed python to |
488 |
- # actually look into the UNIX-style dir, we just switch them around. |
489 |
- mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} |
490 |
- mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ |
491 |
- "${ED}"/usr/$(get_libdir)/python${SLOT}/ \ |
492 |
- || die "can't move python${SLOT}" |
493 |
- rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die |
494 |
- pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null |
495 |
- ln -s ../../../../python${SLOT} || die |
496 |
- popd > /dev/null |
497 |
- # remove now dead symlinks |
498 |
- rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.a |
499 |
- rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.dylib |
500 |
- |
501 |
- # fix up Makefile |
502 |
- sed -i \ |
503 |
- -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ |
504 |
- -e '/^LDFLAGS=/s/=.*$/=/' \ |
505 |
- -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ |
506 |
- -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ |
507 |
- -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ |
508 |
- -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ |
509 |
- -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ |
510 |
- -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ |
511 |
- "${libdir}"/config/Makefile || die |
512 |
- # and sysconfigdata likewise |
513 |
- sed -i \ |
514 |
- -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \ |
515 |
- -e "/'LDFLAGS'/s/:.*$/:'',/" \ |
516 |
- -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \ |
517 |
- -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \ |
518 |
- -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \ |
519 |
- -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \ |
520 |
- -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \ |
521 |
- -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \ |
522 |
- "${libdir}"/_sysconfigdata.py || die |
523 |
- |
524 |
- # add missing version.plist file |
525 |
- mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources |
526 |
- cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF |
527 |
-<?xml version="1.0" encoding="UTF-8"?> |
528 |
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" |
529 |
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
530 |
-<plist version="1.0"> |
531 |
-<dict> |
532 |
- <key>BuildVersion</key> |
533 |
- <string>1</string> |
534 |
- <key>CFBundleShortVersionString</key> |
535 |
- <string>${PV}</string> |
536 |
- <key>CFBundleVersion</key> |
537 |
- <string>${PV}</string> |
538 |
- <key>ProjectName</key> |
539 |
- <string>Python</string> |
540 |
- <key>SourceVersion</key> |
541 |
- <string>${PV}</string> |
542 |
-</dict> |
543 |
-</plist> |
544 |
-EOF |
545 |
- else |
546 |
- emake DESTDIR="${D}" altinstall |
547 |
- fi |
548 |
- |
549 |
- sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" |
550 |
- if [[ ${CHOST} == *-aix* ]]; then |
551 |
- # fix upstream bugs with quite large proposed diffs still to be sorted out: |
552 |
- # http://bugs.python.org/issue13493 |
553 |
- # http://bugs.python.org/issue14150 |
554 |
- # http://bugs.python.org/issue15590 |
555 |
- # http://bugs.python.org/issue16189 |
556 |
- sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \ |
557 |
- -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" |
558 |
- sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \ |
559 |
- -e 's| -bI:| -Wl,-bI:|g' \ |
560 |
- -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ |
561 |
- -e '/LINKFORSHARED/s| -lld||g' \ |
562 |
- -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed" |
563 |
- fi |
564 |
- |
565 |
- # Backwards compat with Gentoo divergence. |
566 |
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT} |
567 |
- |
568 |
- # Fix collisions between different slots of Python. |
569 |
- mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" |
570 |
- mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" |
571 |
- mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" |
572 |
- rm -f "${ED}usr/bin/smtpd.py" |
573 |
- |
574 |
- # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec |
575 |
- # These #defines cause problems when building c99 compliant python modules |
576 |
- # http://bugs.python.org/issue1759169 |
577 |
- [[ ${CHOST} == *-solaris* ]] && sed -i -e \ |
578 |
- 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ |
579 |
- "${ED}"/usr/include/python${SLOT}/pyconfig.h |
580 |
- |
581 |
- if use build; then |
582 |
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test} |
583 |
- else |
584 |
- use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die |
585 |
- use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
586 |
- use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die |
587 |
- use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} |
588 |
- fi |
589 |
- |
590 |
- use threads || rm -r "${libdir}/multiprocessing" || die |
591 |
- use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die |
592 |
- |
593 |
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
594 |
- |
595 |
- if use examples; then |
596 |
- insinto /usr/share/doc/${PF}/examples |
597 |
- doins -r "${S}"/Tools |
598 |
- fi |
599 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
600 |
- local libname |
601 |
- if use aqua ; then |
602 |
- # we do framework, so the emake trick below returns a pathname |
603 |
- # since that won't work here, use a (cheap) trick instead |
604 |
- libname=libpython${SLOT} |
605 |
- else |
606 |
- libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
607 |
- emake --no-print-directory -s -f - 2>/dev/null) |
608 |
- fi |
609 |
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
610 |
- |
611 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
612 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
613 |
- sed \ |
614 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
615 |
- -e "s:@PYDOC@:pydoc${SLOT}:" \ |
616 |
- -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
617 |
- |
618 |
- # for python-exec |
619 |
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR |
620 |
- |
621 |
- # if not using a cross-compiler, use the fresh binary |
622 |
- if ! tc-is-cross-compiler; then |
623 |
- local PYTHON=./python |
624 |
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
625 |
- fi |
626 |
- |
627 |
- echo "EPYTHON='${EPYTHON}'" > epython.py |
628 |
- python_domodule epython.py |
629 |
-} |
630 |
- |
631 |
-pkg_preinst() { |
632 |
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then |
633 |
- python_updater_warning="1" |
634 |
- fi |
635 |
-} |
636 |
- |
637 |
-eselect_python_update() { |
638 |
- if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
639 |
- eselect python update |
640 |
- fi |
641 |
- |
642 |
- if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
643 |
- eselect python update --python${PV%%.*} |
644 |
- fi |
645 |
-} |
646 |
- |
647 |
-pkg_postinst() { |
648 |
- eselect_python_update |
649 |
- |
650 |
- if [[ "${python_updater_warning}" == "1" ]]; then |
651 |
- ewarn "You have just upgraded from an older version of Python." |
652 |
- ewarn "You should switch active version of Python ${PV%%.*} and run" |
653 |
- ewarn "'python-updater [options]' to rebuild Python modules." |
654 |
- fi |
655 |
-} |
656 |
- |
657 |
-pkg_postrm() { |
658 |
- eselect_python_update |
659 |
-} |
660 |
|
661 |
diff --git a/dev-lang/python/python-2.7.11-r2.ebuild b/dev-lang/python/python-2.7.11-r2.ebuild |
662 |
index 1b54e85..541716d 100644 |
663 |
--- a/dev-lang/python/python-2.7.11-r2.ebuild |
664 |
+++ b/dev-lang/python/python-2.7.11-r2.ebuild |
665 |
@@ -9,7 +9,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha |
666 |
|
667 |
MY_P="Python-${PV}" |
668 |
PATCHSET_VERSION="2.7.11-0" |
669 |
-PREFIX_PATCHREV="r0" |
670 |
+PREFIX_PATCHREV="r1" |
671 |
CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629" |
672 |
|
673 |
DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
674 |
|
675 |
diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild |
676 |
deleted file mode 100644 |
677 |
index 1e491f8..0000000 |
678 |
--- a/dev-lang/python/python-2.7.11.ebuild |
679 |
+++ /dev/null |
680 |
@@ -1,629 +0,0 @@ |
681 |
-# Copyright 1999-2015 Gentoo Foundation |
682 |
-# Distributed under the terms of the GNU General Public License v2 |
683 |
-# $Id$ |
684 |
- |
685 |
-EAPI="5" |
686 |
-WANT_LIBTOOL="none" |
687 |
- |
688 |
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
689 |
- |
690 |
-MY_P="Python-${PV}" |
691 |
-PATCHSET_VERSION="2.7.11-0" |
692 |
-PREFIX_PATCHREV="r0" |
693 |
-CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629" |
694 |
- |
695 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
696 |
-HOMEPAGE="http://www.python.org/" |
697 |
-SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
698 |
- https://dev.gentoo.org/~djc/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz |
699 |
- https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" |
700 |
- |
701 |
-[[ -n ${CYGWINPORTS_GITREV} ]] && |
702 |
-SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python/archive/${CYGWINPORTS_GITREV}.zip )" |
703 |
- |
704 |
-LICENSE="PSF-2" |
705 |
-SLOT="2.7" |
706 |
-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" |
707 |
-IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" |
708 |
- |
709 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
710 |
-# If you need to apply a patch which requires python for bootstrapping, please |
711 |
-# run the bootstrap code on your dev box and include the results in the |
712 |
-# patchset. See bug 447752. |
713 |
- |
714 |
-RDEPEND="app-arch/bzip2:0= |
715 |
- >=sys-libs/zlib-1.1.3:0= |
716 |
- !m68k-mint? ( virtual/libffi ) |
717 |
- virtual/libintl |
718 |
- berkdb? ( || ( |
719 |
- sys-libs/db:5.3 |
720 |
- sys-libs/db:5.2 |
721 |
- sys-libs/db:5.1 |
722 |
- sys-libs/db:5.0 |
723 |
- sys-libs/db:4.8 |
724 |
- sys-libs/db:4.7 |
725 |
- sys-libs/db:4.6 |
726 |
- sys-libs/db:4.5 |
727 |
- sys-libs/db:4.4 |
728 |
- sys-libs/db:4.3 |
729 |
- sys-libs/db:4.2 |
730 |
- ) ) |
731 |
- gdbm? ( sys-libs/gdbm:0=[berkdb] ) |
732 |
- ncurses? ( |
733 |
- >=sys-libs/ncurses-5.2:0= |
734 |
- readline? ( >=sys-libs/readline-4.1:0= ) |
735 |
- ) |
736 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
737 |
- ssl? ( |
738 |
- !libressl? ( dev-libs/openssl:0= ) |
739 |
- libressl? ( dev-libs/libressl:= ) |
740 |
- ) |
741 |
- tk? ( |
742 |
- >=dev-lang/tcl-8.0:0= |
743 |
- >=dev-lang/tk-8.0:0=[-aqua] |
744 |
- dev-tcltk/blt:0= |
745 |
- dev-tcltk/tix |
746 |
- ) |
747 |
- xml? ( >=dev-libs/expat-2.1 ) |
748 |
- !!<sys-apps/portage-2.1.9" |
749 |
-DEPEND="${RDEPEND} |
750 |
- virtual/pkgconfig |
751 |
- >=sys-devel/autoconf-2.65 |
752 |
- !sys-devel/gcc[libffi]" |
753 |
-RDEPEND+=" !build? ( app-misc/mime-types ) |
754 |
- doc? ( dev-python/python-docs:${SLOT} )" |
755 |
-PDEPEND=">=app-eselect/eselect-python-20151117-r1 |
756 |
- app-admin/python-updater" |
757 |
- |
758 |
-S="${WORKDIR}/${MY_P}" |
759 |
- |
760 |
-pkg_setup() { |
761 |
- if use berkdb; then |
762 |
- ewarn "'bsddb' module is out-of-date and no longer maintained inside" |
763 |
- ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" |
764 |
- ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" |
765 |
- ewarn "is provided by dev-python/bsddb3." |
766 |
- else |
767 |
- if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then |
768 |
- ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" |
769 |
- ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." |
770 |
- ewarn "You might need to migrate your databases." |
771 |
- fi |
772 |
- fi |
773 |
-} |
774 |
- |
775 |
-src_prepare() { |
776 |
- # Ensure that internal copies of expat, libffi and zlib are not used. |
777 |
- rm -r Modules/expat || die |
778 |
- rm -r Modules/_ctypes/libffi* || die |
779 |
- rm -r Modules/zlib || die |
780 |
- |
781 |
- if tc-is-cross-compiler; then |
782 |
- local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" |
783 |
- fi |
784 |
- |
785 |
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
786 |
- |
787 |
- # if building a patched source-tar, comment the rm's above, and uncomment |
788 |
- # this line: |
789 |
- #local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch" |
790 |
- |
791 |
- # Prefix' round of patches |
792 |
- # http://prefix.gentooexperimental.org:8000/python-patches-2_7 |
793 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
794 |
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV} |
795 |
- |
796 |
- if use aqua ; then |
797 |
- # make sure we don't get a framework reference here |
798 |
- sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ |
799 |
- -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ |
800 |
- Makefile.pre.in || die |
801 |
- # Python upstream refuses to listen to configure arguments |
802 |
- sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \ |
803 |
- configure.ac configure || die |
804 |
- # we handle creation of symlinks in src_install |
805 |
- sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die |
806 |
- fi |
807 |
- # don't try to do fancy things on Darwin |
808 |
- sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
809 |
- |
810 |
- # Fix for cross-compiling. |
811 |
- epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" |
812 |
- epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch" |
813 |
- epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch" |
814 |
- epatch "${FILESDIR}/python-2.7.10-system-libffi.patch" |
815 |
- epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl |
816 |
- |
817 |
- # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR. |
818 |
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
819 |
- |
820 |
- # Make sure python doesn't use the host libffi. |
821 |
- use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch" |
822 |
- |
823 |
- if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then |
824 |
- local p d="${WORKDIR}/python-${CYGWINPORTS_GITREV}" |
825 |
- for p in $( |
826 |
- eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)" |
827 |
- echo ${PATCH_URI} |
828 |
- ); do |
829 |
- # dropped by 01_all_prefix-no-patch-invention.patch |
830 |
- [[ ${p} == *-tkinter-* ]] && continue |
831 |
- epatch "${d}/${p}" |
832 |
- done |
833 |
- fi |
834 |
- |
835 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
836 |
- Lib/distutils/command/install.py \ |
837 |
- Lib/distutils/sysconfig.py \ |
838 |
- Lib/site.py \ |
839 |
- Lib/sysconfig.py \ |
840 |
- Lib/test/test_site.py \ |
841 |
- Makefile.pre.in \ |
842 |
- Modules/Setup.dist \ |
843 |
- Modules/getpath.c \ |
844 |
- setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
845 |
- |
846 |
- epatch_user |
847 |
- |
848 |
- eautoreconf |
849 |
-} |
850 |
- |
851 |
-src_configure() { |
852 |
- # dbm module can be linked against berkdb or gdbm. |
853 |
- # Defaults to gdbm when both are enabled, #204343. |
854 |
- local disable |
855 |
- use berkdb || use gdbm || disable+=" dbm" |
856 |
- use berkdb || disable+=" _bsddb" |
857 |
- use gdbm || disable+=" gdbm" |
858 |
- use ncurses || disable+=" _curses _curses_panel" |
859 |
- use readline || disable+=" readline" |
860 |
- use sqlite || disable+=" _sqlite3" |
861 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
862 |
- use tk || disable+=" _tkinter" |
863 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
864 |
- [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon |
865 |
- [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs" |
866 |
- export PYTHON_DISABLE_MODULES="${disable}" |
867 |
- |
868 |
- if ! use xml; then |
869 |
- ewarn "You have configured Python without XML support." |
870 |
- ewarn "This is NOT a recommended configuration as you" |
871 |
- ewarn "may face problems parsing any XML documents." |
872 |
- fi |
873 |
- |
874 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
875 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
876 |
- fi |
877 |
- |
878 |
- if [[ "$(gcc-major-version)" -ge 4 ]]; then |
879 |
- append-flags -fwrapv |
880 |
- fi |
881 |
- |
882 |
- filter-flags -malign-double |
883 |
- |
884 |
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
885 |
- |
886 |
- # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
887 |
- if is-flagq -O3; then |
888 |
- is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
889 |
- use hardened && replace-flags -O3 -O2 |
890 |
- fi |
891 |
- |
892 |
- if tc-is-cross-compiler; then |
893 |
- # Force some tests that try to poke fs paths. |
894 |
- export ac_cv_file__dev_ptc=no |
895 |
- export ac_cv_file__dev_ptmx=yes |
896 |
- fi |
897 |
- |
898 |
- # http://bugs.gentoo.org/show_bug.cgi?id=302137 |
899 |
- if [[ ${CHOST} == powerpc-*-darwin* ]] && \ |
900 |
- ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \ |
901 |
- [[ ${CHOST} == powerpc64-*-darwin* ]]; |
902 |
- then |
903 |
- replace-flags -O2 -O3 |
904 |
- replace-flags -Os -O3 # comment #14 |
905 |
- fi |
906 |
- |
907 |
- # Set LDFLAGS so we link modules with -lpython2.7 correctly. |
908 |
- # Needed on FreeBSD unless Python 2.7 is already installed. |
909 |
- # Please query BSD team before removing this! |
910 |
- # On AIX this is not needed, but would record '.' as runpath. |
911 |
- [[ ${CHOST} == *-aix* ]] || |
912 |
- append-ldflags "-L." |
913 |
- |
914 |
- if use prefix ; then |
915 |
- # for Python's setup.py not to do false assumptions (only looking in |
916 |
- # host paths) we need to make explicit where Prefix stuff is |
917 |
- append-cppflags -I"${EPREFIX}"/usr/include |
918 |
- append-ldflags -L"${EPREFIX}"/$(get_libdir) |
919 |
- append-ldflags -L"${EPREFIX}"/usr/$(get_libdir) |
920 |
- # fix compilation on some 64-bits Linux hosts, #381163, #473520 |
921 |
- for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do |
922 |
- [[ -d ${hostlibdir} ]] || continue |
923 |
- append-ldflags -L${hostlibdir} |
924 |
- done |
925 |
- # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that |
926 |
- # local include paths - set in $(CPPFLAGS) - are searched first. |
927 |
- sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die |
928 |
- fi |
929 |
- |
930 |
- # Export CC so even AIX will use gcc instead of xlc_r. |
931 |
- # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. |
932 |
- tc-export CC CXX |
933 |
- # The configure script fails to use pkg-config correctly. |
934 |
- # http://bugs.python.org/issue15506 |
935 |
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
936 |
- |
937 |
- local dbmliborder |
938 |
- if use gdbm; then |
939 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
940 |
- fi |
941 |
- if use berkdb; then |
942 |
- dbmliborder+="${dbmliborder:+:}bdb" |
943 |
- fi |
944 |
- |
945 |
- [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no |
946 |
- |
947 |
- # we need this to get pythonw, the GUI version of python |
948 |
- # --enable-framework and --enable-shared are mutually exclusive: |
949 |
- # http://bugs.python.org/issue5809 |
950 |
- local myshared= |
951 |
- use aqua \ |
952 |
- && myshared="--enable-framework=${EPREFIX}/usr/lib" \ |
953 |
- || myshared="--enable-shared" |
954 |
- |
955 |
- BUILD_DIR="${WORKDIR}/${CHOST}" |
956 |
- mkdir -p "${BUILD_DIR}" || die |
957 |
- cd "${BUILD_DIR}" || die |
958 |
- |
959 |
- # note: for a framework build we need to use ucs2 because OSX |
960 |
- # uses that internally too: |
961 |
- # http://bugs.python.org/issue763708 |
962 |
- # HAS_HG to avoid finding obsolete hg of the host |
963 |
- ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \ |
964 |
- econf \ |
965 |
- --with-fpectl \ |
966 |
- ${myshared} \ |
967 |
- $(use_enable ipv6) \ |
968 |
- $(use_with threads) \ |
969 |
- $( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ |
970 |
- --infodir='${prefix}/share/info' \ |
971 |
- --mandir='${prefix}/share/man' \ |
972 |
- --with-computed-gotos \ |
973 |
- --with-dbmliborder="${dbmliborder}" \ |
974 |
- --with-libc="" \ |
975 |
- --enable-loadable-sqlite-extensions \ |
976 |
- --with-system-expat \ |
977 |
- --with-system-ffi \ |
978 |
- --without-ensurepip |
979 |
- |
980 |
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
981 |
- eerror "configure has detected that the sem_open function is broken." |
982 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
983 |
- die "Broken sem_open function (bug 496328)" |
984 |
- fi |
985 |
-} |
986 |
- |
987 |
-src_compile() { |
988 |
- # Avoid invoking pgen for cross-compiles. |
989 |
- touch Include/graminit.h Python/graminit.c |
990 |
- |
991 |
- cd "${BUILD_DIR}" || die |
992 |
- emake |
993 |
- |
994 |
- # Work around bug 329499. See also bug 413751 and 457194. |
995 |
- if has_version dev-libs/libffi[pax_kernel]; then |
996 |
- pax-mark E python |
997 |
- else |
998 |
- pax-mark m python |
999 |
- fi |
1000 |
-} |
1001 |
- |
1002 |
-src_test() { |
1003 |
- # Tests will not work when cross compiling. |
1004 |
- if tc-is-cross-compiler; then |
1005 |
- elog "Disabling tests due to crosscompiling." |
1006 |
- return |
1007 |
- fi |
1008 |
- |
1009 |
- cd "${BUILD_DIR}" || die |
1010 |
- |
1011 |
- # Skip failing tests. |
1012 |
- local skipped_tests="distutils gdb" |
1013 |
- |
1014 |
- for test in ${skipped_tests}; do |
1015 |
- mv "${S}"/Lib/test/test_${test}.py "${T}" |
1016 |
- done |
1017 |
- |
1018 |
- # Rerun failed tests in verbose mode (regrtest -w). |
1019 |
- emake test EXTRATESTOPTS="-w" < /dev/tty |
1020 |
- local result="$?" |
1021 |
- |
1022 |
- for test in ${skipped_tests}; do |
1023 |
- mv "${T}/test_${test}.py" "${S}"/Lib/test |
1024 |
- done |
1025 |
- |
1026 |
- elog "The following tests have been skipped:" |
1027 |
- for test in ${skipped_tests}; do |
1028 |
- elog "test_${test}.py" |
1029 |
- done |
1030 |
- |
1031 |
- elog "If you would like to run them, you may:" |
1032 |
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
1033 |
- elog "and run the tests separately." |
1034 |
- |
1035 |
- if [[ "${result}" -ne 0 ]]; then |
1036 |
- die "emake test failed" |
1037 |
- fi |
1038 |
-} |
1039 |
- |
1040 |
-src_install() { |
1041 |
- local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
1042 |
- |
1043 |
- cd "${BUILD_DIR}" || die |
1044 |
- [[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/ |
1045 |
- if use aqua ; then |
1046 |
- local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework |
1047 |
- |
1048 |
- # do not make multiple targets in parallel when there are broken |
1049 |
- # sharedmods (during bootstrap), would build them twice in parallel. |
1050 |
- |
1051 |
- # Python_Launcher is kind of a wrapper, and we should fix it for |
1052 |
- # Prefix (it uses /usr/bin/pythonw) so useless |
1053 |
- # IDLE doesn't run, no idea, but definitely not used |
1054 |
- sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \ |
1055 |
- Mac/Makefile || die |
1056 |
- |
1057 |
- # let the makefiles do their thing |
1058 |
- emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall |
1059 |
- rmdir "${ED}"/Applications/Python* || die |
1060 |
- rmdir "${ED}"/Applications || die |
1061 |
- |
1062 |
- # avoid framework incompatability, degrade to a normal UNIX lib |
1063 |
- mkdir -p "${ED}"/usr/$(get_libdir) |
1064 |
- cp "${D}${fwdir}"/Versions/${SLOT}/Python \ |
1065 |
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die |
1066 |
- chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
1067 |
- install_name_tool \ |
1068 |
- -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ |
1069 |
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
1070 |
- chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
1071 |
- cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die |
1072 |
- |
1073 |
- # rebuild python executable to be the non-pythonw (python wrapper) |
1074 |
- # version so we don't get framework crap |
1075 |
- rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861 |
1076 |
- $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ |
1077 |
- -o "${ED}"/usr/bin/python${SLOT} \ |
1078 |
- Modules/python.o || die |
1079 |
- |
1080 |
- # don't install the "Current" symlink, will always conflict |
1081 |
- rm "${D}${fwdir}"/Versions/Current || die |
1082 |
- # update whatever points to it, eselect-python sets them |
1083 |
- rm "${D}${fwdir}"/{Headers,Python,Resources} || die |
1084 |
- |
1085 |
- # remove unversioned files (that are not made versioned below) |
1086 |
- pushd "${ED}"/usr/bin > /dev/null |
1087 |
- rm -f python python-config python${SLOT}-config |
1088 |
- # python${SLOT} was created above |
1089 |
- for f in pythonw smtpd${SLOT}.py pydoc idle ; do |
1090 |
- rm -f ${f} ${f}${SLOT} |
1091 |
- done |
1092 |
- # pythonw needs to remain in the framework (that's the whole |
1093 |
- # reason we go through this framework hassle) |
1094 |
- ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die |
1095 |
- # copy the scripts to we can fix their shebangs |
1096 |
- for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do |
1097 |
- # for some reason sometimes they already exist, bug #347321 |
1098 |
- rm -f ${f} |
1099 |
- cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die |
1100 |
- sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ |
1101 |
- ${f} || die |
1102 |
- done |
1103 |
- # "fix" to have below collision fix not to bail |
1104 |
- mv pydoc${SLOT} pydoc || die |
1105 |
- mv idle${SLOT} idle || die |
1106 |
- popd > /dev/null |
1107 |
- |
1108 |
- # basically we don't like the framework stuff at all, so just move |
1109 |
- # stuff around or add some symlinks to make our life easier |
1110 |
- mkdir -p "${ED}"/usr |
1111 |
- mv "${D}${fwdir}"/Versions/${SLOT}/share \ |
1112 |
- "${ED}"/usr/ || die "can't move share" |
1113 |
- # get includes just UNIX style |
1114 |
- mkdir -p "${ED}"/usr/include |
1115 |
- mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ |
1116 |
- "${ED}"/usr/include/ || die "can't move include" |
1117 |
- pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null |
1118 |
- ln -s ../../../../../include/python${SLOT} || die |
1119 |
- popd > /dev/null |
1120 |
- rm -f "${ED}"/usr/share/man/man1/python{,2}.1 |
1121 |
- |
1122 |
- # same for libs |
1123 |
- # NOTE: can't symlink the entire dir, because a real dir already exists |
1124 |
- # on upgrade (site-packages), however since we h4x0rzed python to |
1125 |
- # actually look into the UNIX-style dir, we just switch them around. |
1126 |
- mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} |
1127 |
- mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ |
1128 |
- "${ED}"/usr/$(get_libdir)/python${SLOT}/ \ |
1129 |
- || die "can't move python${SLOT}" |
1130 |
- rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die |
1131 |
- pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null |
1132 |
- ln -s ../../../../python${SLOT} || die |
1133 |
- popd > /dev/null |
1134 |
- |
1135 |
- # fix up Makefile |
1136 |
- sed -i \ |
1137 |
- -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ |
1138 |
- -e '/^LDFLAGS=/s/=.*$/=/' \ |
1139 |
- -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ |
1140 |
- -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ |
1141 |
- -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ |
1142 |
- -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ |
1143 |
- -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ |
1144 |
- -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ |
1145 |
- "${libdir}"/config/Makefile || die |
1146 |
- # and sysconfigdata likewise |
1147 |
- sed -i \ |
1148 |
- -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \ |
1149 |
- -e "/'LDFLAGS'/s/:.*$/:'',/" \ |
1150 |
- -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \ |
1151 |
- -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \ |
1152 |
- -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \ |
1153 |
- -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \ |
1154 |
- -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \ |
1155 |
- -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \ |
1156 |
- "${libdir}"/_sysconfigdata.py || die |
1157 |
- |
1158 |
- # add missing version.plist file |
1159 |
- mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources |
1160 |
- cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF |
1161 |
-<?xml version="1.0" encoding="UTF-8"?> |
1162 |
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" |
1163 |
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
1164 |
-<plist version="1.0"> |
1165 |
-<dict> |
1166 |
- <key>BuildVersion</key> |
1167 |
- <string>1</string> |
1168 |
- <key>CFBundleShortVersionString</key> |
1169 |
- <string>${PV}</string> |
1170 |
- <key>CFBundleVersion</key> |
1171 |
- <string>${PV}</string> |
1172 |
- <key>ProjectName</key> |
1173 |
- <string>Python</string> |
1174 |
- <key>SourceVersion</key> |
1175 |
- <string>${PV}</string> |
1176 |
-</dict> |
1177 |
-</plist> |
1178 |
-EOF |
1179 |
- else |
1180 |
- emake DESTDIR="${D}" altinstall |
1181 |
- fi |
1182 |
- |
1183 |
- sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" |
1184 |
- if [[ ${CHOST} == *-aix* ]]; then |
1185 |
- # fix upstream bugs with quite large proposed diffs still to be sorted out: |
1186 |
- # http://bugs.python.org/issue13493 |
1187 |
- # http://bugs.python.org/issue14150 |
1188 |
- # http://bugs.python.org/issue15590 |
1189 |
- # http://bugs.python.org/issue16189 |
1190 |
- sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \ |
1191 |
- -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" |
1192 |
- sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \ |
1193 |
- -e 's| -bI:| -Wl,-bI:|g' \ |
1194 |
- -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ |
1195 |
- -e '/LINKFORSHARED/s| -lld||g' \ |
1196 |
- -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed" |
1197 |
- fi |
1198 |
- |
1199 |
- # Fix collisions between different slots of Python. |
1200 |
- mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" |
1201 |
- mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" |
1202 |
- mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" |
1203 |
- rm -f "${ED}usr/bin/smtpd.py" |
1204 |
- |
1205 |
- # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec |
1206 |
- # These #defines cause problems when building c99 compliant python modules |
1207 |
- # http://bugs.python.org/issue1759169 |
1208 |
- [[ ${CHOST} == *-solaris* ]] && sed -i -e \ |
1209 |
- 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ |
1210 |
- "${ED}"/usr/include/python${SLOT}/pyconfig.h |
1211 |
- |
1212 |
- use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die |
1213 |
- use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
1214 |
- use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die |
1215 |
- use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} |
1216 |
- |
1217 |
- use threads || rm -r "${libdir}/multiprocessing" || die |
1218 |
- use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die |
1219 |
- |
1220 |
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
1221 |
- |
1222 |
- if use examples; then |
1223 |
- insinto /usr/share/doc/${PF}/examples |
1224 |
- doins -r "${S}"/Tools |
1225 |
- fi |
1226 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
1227 |
- local libname |
1228 |
- if use aqua ; then |
1229 |
- # we do framework, so the emake trick below returns a pathname |
1230 |
- # since that won't work here, use a (cheap) trick instead |
1231 |
- libname=libpython${SLOT} |
1232 |
- else |
1233 |
- libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
1234 |
- emake --no-print-directory -s -f - 2>/dev/null) |
1235 |
- fi |
1236 |
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
1237 |
- |
1238 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
1239 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
1240 |
- sed \ |
1241 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
1242 |
- -e "s:@PYDOC@:pydoc${SLOT}:" \ |
1243 |
- -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
1244 |
- |
1245 |
- # for python-exec |
1246 |
- local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) |
1247 |
- |
1248 |
- # if not using a cross-compiler, use the fresh binary |
1249 |
- if ! tc-is-cross-compiler; then |
1250 |
- local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) |
1251 |
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
1252 |
- local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}. |
1253 |
- else |
1254 |
- vars=( PYTHON "${vars[@]}" ) |
1255 |
- fi |
1256 |
- |
1257 |
- python_export "python${SLOT}" "${vars[@]}" |
1258 |
- echo "EPYTHON='${EPYTHON}'" > epython.py || die |
1259 |
- python_domodule epython.py |
1260 |
- |
1261 |
- # python-exec wrapping support |
1262 |
- local pymajor=${SLOT%.*} |
1263 |
- mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die |
1264 |
- # python and pythonX |
1265 |
- ln -s "../../../bin/python${SLOT}" \ |
1266 |
- "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die |
1267 |
- ln -s "python${pymajor}" \ |
1268 |
- "${D}${PYTHON_SCRIPTDIR}/python" || die |
1269 |
- # python-config and pythonX-config |
1270 |
- ln -s "../../../bin/python${SLOT}-config" \ |
1271 |
- "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die |
1272 |
- ln -s "python${pymajor}-config" \ |
1273 |
- "${D}${PYTHON_SCRIPTDIR}/python-config" || die |
1274 |
- # 2to3, pydoc, pyvenv |
1275 |
- ln -s "../../../bin/2to3-${SLOT}" \ |
1276 |
- "${D}${PYTHON_SCRIPTDIR}/2to3" || die |
1277 |
- ln -s "../../../bin/pydoc${SLOT}" \ |
1278 |
- "${D}${PYTHON_SCRIPTDIR}/pydoc" || die |
1279 |
-} |
1280 |
- |
1281 |
-pkg_preinst() { |
1282 |
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then |
1283 |
- python_updater_warning="1" |
1284 |
- fi |
1285 |
-} |
1286 |
- |
1287 |
-eselect_python_update() { |
1288 |
- if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
1289 |
- eselect python update |
1290 |
- fi |
1291 |
- |
1292 |
- if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
1293 |
- eselect python update --python${PV%%.*} |
1294 |
- fi |
1295 |
-} |
1296 |
- |
1297 |
-pkg_postinst() { |
1298 |
- eselect_python_update |
1299 |
- |
1300 |
- if [[ "${python_updater_warning}" == "1" ]]; then |
1301 |
- ewarn "You have just upgraded from an older version of Python." |
1302 |
- ewarn "You should switch active version of Python ${PV%%.*} and run" |
1303 |
- ewarn "'python-updater [options]' to rebuild Python modules." |
1304 |
- fi |
1305 |
-} |
1306 |
- |
1307 |
-pkg_postrm() { |
1308 |
- eselect_python_update |
1309 |
-} |
1310 |
|
1311 |
diff --git a/dev-lang/python/python-2.7.8.ebuild b/dev-lang/python/python-2.7.8.ebuild |
1312 |
deleted file mode 100644 |
1313 |
index fc1429b..0000000 |
1314 |
--- a/dev-lang/python/python-2.7.8.ebuild |
1315 |
+++ /dev/null |
1316 |
@@ -1,584 +0,0 @@ |
1317 |
-# Copyright 1999-2015 Gentoo Foundation |
1318 |
-# Distributed under the terms of the GNU General Public License v2 |
1319 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.8.ebuild,v 1.2 2014/09/22 16:47:38 floppym Exp $ |
1320 |
- |
1321 |
-EAPI="4" |
1322 |
-WANT_AUTOMAKE="none" |
1323 |
-WANT_LIBTOOL="none" |
1324 |
- |
1325 |
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
1326 |
- |
1327 |
-MY_P="Python-${PV}" |
1328 |
-PATCHSET_VERSION="2.7.8-0" |
1329 |
-PREFIX_PATCHREV="" |
1330 |
- |
1331 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
1332 |
-HOMEPAGE="http://www.python.org/" |
1333 |
-SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
1334 |
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz |
1335 |
- prefix? ( http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2 )" |
1336 |
- |
1337 |
-LICENSE="PSF-2" |
1338 |
-SLOT="2.7" |
1339 |
-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" |
1340 |
-IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" |
1341 |
- |
1342 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
1343 |
-# If you need to apply a patch which requires python for bootstrapping, please |
1344 |
-# run the bootstrap code on your dev box and include the results in the |
1345 |
-# patchset. See bug 447752. |
1346 |
- |
1347 |
-RDEPEND="app-arch/bzip2 |
1348 |
- >=sys-libs/zlib-1.1.3 |
1349 |
- !m68k-mint? ( virtual/libffi ) |
1350 |
- virtual/libintl |
1351 |
- !build? ( |
1352 |
- berkdb? ( || ( |
1353 |
- sys-libs/db:5.3 |
1354 |
- sys-libs/db:5.2 |
1355 |
- sys-libs/db:5.1 |
1356 |
- sys-libs/db:5.0 |
1357 |
- sys-libs/db:4.8 |
1358 |
- sys-libs/db:4.7 |
1359 |
- sys-libs/db:4.6 |
1360 |
- sys-libs/db:4.5 |
1361 |
- sys-libs/db:4.4 |
1362 |
- sys-libs/db:4.3 |
1363 |
- sys-libs/db:4.2 |
1364 |
- ) ) |
1365 |
- gdbm? ( sys-libs/gdbm[berkdb] ) |
1366 |
- ncurses? ( |
1367 |
- >=sys-libs/ncurses-5.2 |
1368 |
- readline? ( >=sys-libs/readline-4.1 ) |
1369 |
- ) |
1370 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3 ) |
1371 |
- ssl? ( dev-libs/openssl ) |
1372 |
- tk? ( |
1373 |
- >=dev-lang/tk-8.0[-aqua] |
1374 |
- dev-tcltk/blt |
1375 |
- dev-tcltk/tix |
1376 |
- ) |
1377 |
- xml? ( >=dev-libs/expat-2.1 ) |
1378 |
- ) |
1379 |
- !!<sys-apps/portage-2.1.9" |
1380 |
-DEPEND="${RDEPEND} |
1381 |
- virtual/pkgconfig |
1382 |
- >=sys-devel/autoconf-2.65 |
1383 |
- !sys-devel/gcc[libffi]" |
1384 |
-RDEPEND+=" !build? ( app-misc/mime-types ) |
1385 |
- doc? ( dev-python/python-docs:${SLOT} )" |
1386 |
-PDEPEND="app-eselect/eselect-python |
1387 |
- app-admin/python-updater" |
1388 |
- |
1389 |
-S="${WORKDIR}/${MY_P}" |
1390 |
- |
1391 |
-pkg_setup() { |
1392 |
- if use berkdb; then |
1393 |
- ewarn "'bsddb' module is out-of-date and no longer maintained inside" |
1394 |
- ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" |
1395 |
- ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" |
1396 |
- ewarn "is provided by dev-python/bsddb3." |
1397 |
- else |
1398 |
- if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then |
1399 |
- ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" |
1400 |
- ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." |
1401 |
- fi |
1402 |
- fi |
1403 |
-} |
1404 |
- |
1405 |
-src_prepare() { |
1406 |
- # Ensure that internal copies of expat, libffi and zlib are not used. |
1407 |
- rm -r Modules/expat || die |
1408 |
- rm -r Modules/_ctypes/libffi* || die |
1409 |
- rm -r Modules/zlib || die |
1410 |
- |
1411 |
- if tc-is-cross-compiler; then |
1412 |
- local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" |
1413 |
- fi |
1414 |
- |
1415 |
- # if building a patched source-tar, comment the rm's above, and uncomment |
1416 |
- # this line: |
1417 |
- #local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch" |
1418 |
- |
1419 |
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
1420 |
- epatch "${FILESDIR}/python-2.7-issue18235.patch" |
1421 |
- |
1422 |
- # Prefix' round of patches |
1423 |
- # http://prefix.gentooexperimental.org:8000/python-patches-2_7 |
1424 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
1425 |
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV} |
1426 |
- |
1427 |
- if use aqua ; then |
1428 |
- # make sure we don't get a framework reference here |
1429 |
- sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ |
1430 |
- -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ |
1431 |
- Makefile.pre.in || die |
1432 |
- # Python upstream refuses to listen to configure arguments |
1433 |
- sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \ |
1434 |
- configure.ac configure || die |
1435 |
- # we handle creation of symlinks in src_install |
1436 |
- sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die |
1437 |
- fi |
1438 |
- # don't try to do fancy things on Darwin |
1439 |
- sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
1440 |
- |
1441 |
- # Fix for cross-compiling. |
1442 |
- epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" |
1443 |
- |
1444 |
- epatch "${FILESDIR}"/python-2.7-aix-dlopen-soname.patch # libtool-built modules |
1445 |
- |
1446 |
- # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR. |
1447 |
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
1448 |
- |
1449 |
- # Make sure python doesn't use the host libffi. |
1450 |
- use prefix && epatch "${FILESDIR}/python-2.7-libffi-pkgconfig.patch" |
1451 |
- |
1452 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
1453 |
- Lib/distutils/command/install.py \ |
1454 |
- Lib/distutils/sysconfig.py \ |
1455 |
- Lib/site.py \ |
1456 |
- Lib/sysconfig.py \ |
1457 |
- Lib/test/test_site.py \ |
1458 |
- Makefile.pre.in \ |
1459 |
- Modules/Setup.dist \ |
1460 |
- Modules/getpath.c \ |
1461 |
- setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
1462 |
- |
1463 |
- epatch_user |
1464 |
- |
1465 |
- eautoconf |
1466 |
- eautoheader |
1467 |
-} |
1468 |
- |
1469 |
-src_configure() { |
1470 |
- if use build; then |
1471 |
- # Disable extraneous modules with extra dependencies. |
1472 |
- export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" |
1473 |
- export PYTHON_DISABLE_SSL="1" |
1474 |
- else |
1475 |
- # dbm module can be linked against berkdb or gdbm. |
1476 |
- # Defaults to gdbm when both are enabled, #204343. |
1477 |
- local disable |
1478 |
- use berkdb || use gdbm || disable+=" dbm" |
1479 |
- use berkdb || disable+=" _bsddb" |
1480 |
- use gdbm || disable+=" gdbm" |
1481 |
- use ncurses || disable+=" _curses _curses_panel" |
1482 |
- use readline || disable+=" readline" |
1483 |
- use sqlite || disable+=" _sqlite3" |
1484 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
1485 |
- use tk || disable+=" _tkinter" |
1486 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
1487 |
- [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon |
1488 |
- [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs" |
1489 |
- export PYTHON_DISABLE_MODULES="${disable}" |
1490 |
- |
1491 |
- if ! use xml; then |
1492 |
- ewarn "You have configured Python without XML support." |
1493 |
- ewarn "This is NOT a recommended configuration as you" |
1494 |
- ewarn "may face problems parsing any XML documents." |
1495 |
- fi |
1496 |
- fi |
1497 |
- |
1498 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
1499 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
1500 |
- fi |
1501 |
- |
1502 |
- if [[ "$(gcc-major-version)" -ge 4 ]]; then |
1503 |
- append-flags -fwrapv |
1504 |
- fi |
1505 |
- |
1506 |
- filter-flags -malign-double |
1507 |
- |
1508 |
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
1509 |
- |
1510 |
- # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
1511 |
- if is-flagq -O3; then |
1512 |
- is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
1513 |
- use hardened && replace-flags -O3 -O2 |
1514 |
- fi |
1515 |
- |
1516 |
- if tc-is-cross-compiler; then |
1517 |
- # Force some tests that try to poke fs paths. |
1518 |
- export ac_cv_file__dev_ptc=no |
1519 |
- export ac_cv_file__dev_ptmx=yes |
1520 |
- fi |
1521 |
- |
1522 |
- # http://bugs.gentoo.org/show_bug.cgi?id=302137 |
1523 |
- if [[ ${CHOST} == powerpc-*-darwin* ]] && \ |
1524 |
- ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \ |
1525 |
- [[ ${CHOST} == powerpc64-*-darwin* ]]; |
1526 |
- then |
1527 |
- replace-flags -O2 -O3 |
1528 |
- replace-flags -Os -O3 # comment #14 |
1529 |
- fi |
1530 |
- |
1531 |
- if use prefix ; then |
1532 |
- # for Python's setup.py not to do false assumptions (only looking in |
1533 |
- # host paths) we need to make explicit where Prefix stuff is |
1534 |
- append-cppflags -I"${EPREFIX}"/usr/include |
1535 |
- append-ldflags -L"${EPREFIX}"/$(get_libdir) |
1536 |
- append-ldflags -L"${EPREFIX}"/usr/$(get_libdir) |
1537 |
- # fix compilation on some 64-bits Linux hosts, #381163, #473520 |
1538 |
- for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do |
1539 |
- [[ -d ${hostlibdir} ]] || continue |
1540 |
- append-ldflags -L${hostlibdir} |
1541 |
- done |
1542 |
- # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that |
1543 |
- # local include paths - set in $(CPPFLAGS) - are searched first. |
1544 |
- sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die |
1545 |
- fi |
1546 |
- |
1547 |
- # Export CC so even AIX will use gcc instead of xlc_r. |
1548 |
- # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. |
1549 |
- tc-export CC CXX |
1550 |
- # The configure script fails to use pkg-config correctly. |
1551 |
- # http://bugs.python.org/issue15506 |
1552 |
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
1553 |
- |
1554 |
- # Set LDFLAGS so we link modules with -lpython2.7 correctly. |
1555 |
- # Needed on FreeBSD unless Python 2.7 is already installed. |
1556 |
- # Please query BSD team before removing this! |
1557 |
- # On AIX this is not needed, but would record '.' as runpath. |
1558 |
- [[ ${CHOST} == *-aix* ]] || |
1559 |
- append-ldflags "-L." |
1560 |
- |
1561 |
- local dbmliborder |
1562 |
- if use gdbm; then |
1563 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
1564 |
- fi |
1565 |
- if use berkdb; then |
1566 |
- dbmliborder+="${dbmliborder:+:}bdb" |
1567 |
- fi |
1568 |
- |
1569 |
- # Don't include libmpc on IRIX - it is only available for 64bit MIPS4 |
1570 |
- [[ ${CHOST} == *-irix* ]] && export ac_cv_lib_mpc_usconfig=no |
1571 |
- |
1572 |
- [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no |
1573 |
- |
1574 |
- # we need this to get pythonw, the GUI version of python |
1575 |
- # --enable-framework and --enable-shared are mutually exclusive: |
1576 |
- # http://bugs.python.org/issue5809 |
1577 |
- use aqua \ |
1578 |
- && myconf="${myconf} --enable-framework=${EPREFIX}/usr/lib" \ |
1579 |
- || myconf="${myconf} --enable-shared" |
1580 |
- |
1581 |
- BUILD_DIR="${WORKDIR}/${CHOST}" |
1582 |
- mkdir -p "${BUILD_DIR}" || die |
1583 |
- cd "${BUILD_DIR}" || die |
1584 |
- |
1585 |
- # note: for a framework build we need to use ucs2 because OSX |
1586 |
- # uses that internally too: |
1587 |
- # http://bugs.python.org/issue763708 |
1588 |
- # HAS_HG to avoid finding obsolete hg of the host |
1589 |
- ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \ |
1590 |
- econf \ |
1591 |
- --with-fpectl \ |
1592 |
- $(use_enable ipv6) \ |
1593 |
- $(use_with threads) \ |
1594 |
- $( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ |
1595 |
- --infodir='${prefix}/share/info' \ |
1596 |
- --mandir='${prefix}/share/man' \ |
1597 |
- --with-dbmliborder="${dbmliborder}" \ |
1598 |
- --with-libc="" \ |
1599 |
- --enable-loadable-sqlite-extensions \ |
1600 |
- --with-system-expat \ |
1601 |
- --with-system-ffi \ |
1602 |
- ${myconf} |
1603 |
- |
1604 |
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
1605 |
- eerror "configure has detected that the sem_open function is broken." |
1606 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
1607 |
- die "Broken sem_open function (bug 496328)" |
1608 |
- fi |
1609 |
-} |
1610 |
- |
1611 |
-src_compile() { |
1612 |
- # Avoid invoking pgen for cross-compiles. |
1613 |
- touch Include/graminit.h Python/graminit.c |
1614 |
- |
1615 |
- cd "${BUILD_DIR}" || die |
1616 |
- emake |
1617 |
- |
1618 |
- # Work around bug 329499. See also bug 413751 and 457194. |
1619 |
- if has_version dev-libs/libffi[pax_kernel]; then |
1620 |
- pax-mark E python |
1621 |
- else |
1622 |
- pax-mark m python |
1623 |
- fi |
1624 |
-} |
1625 |
- |
1626 |
-src_test() { |
1627 |
- # Tests will not work when cross compiling. |
1628 |
- if tc-is-cross-compiler; then |
1629 |
- elog "Disabling tests due to crosscompiling." |
1630 |
- return |
1631 |
- fi |
1632 |
- |
1633 |
- cd "${BUILD_DIR}" || die |
1634 |
- |
1635 |
- # Skip failing tests. |
1636 |
- local skipped_tests="distutils gdb" |
1637 |
- |
1638 |
- for test in ${skipped_tests}; do |
1639 |
- mv "${S}"/Lib/test/test_${test}.py "${T}" |
1640 |
- done |
1641 |
- |
1642 |
- # Rerun failed tests in verbose mode (regrtest -w). |
1643 |
- emake test EXTRATESTOPTS="-w" < /dev/tty |
1644 |
- local result="$?" |
1645 |
- |
1646 |
- for test in ${skipped_tests}; do |
1647 |
- mv "${T}/test_${test}.py" "${S}"/Lib/test |
1648 |
- done |
1649 |
- |
1650 |
- elog "The following tests have been skipped:" |
1651 |
- for test in ${skipped_tests}; do |
1652 |
- elog "test_${test}.py" |
1653 |
- done |
1654 |
- |
1655 |
- elog "If you would like to run them, you may:" |
1656 |
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
1657 |
- elog "and run the tests separately." |
1658 |
- |
1659 |
- if [[ "${result}" -ne 0 ]]; then |
1660 |
- die "emake test failed" |
1661 |
- fi |
1662 |
-} |
1663 |
- |
1664 |
-src_install() { |
1665 |
- local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
1666 |
- |
1667 |
- cd "${BUILD_DIR}" || die |
1668 |
- [[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/ |
1669 |
- if use aqua ; then |
1670 |
- local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework |
1671 |
- |
1672 |
- # do not make multiple targets in parallel when there are broken |
1673 |
- # sharedmods (during bootstrap), would build them twice in parallel. |
1674 |
- |
1675 |
- # let the makefiles do their thing |
1676 |
- emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall |
1677 |
- |
1678 |
- # avoid framework incompatability, degrade to a normal UNIX lib |
1679 |
- mkdir -p "${ED}"/usr/$(get_libdir) |
1680 |
- cp "${D}${fwdir}"/Versions/${SLOT}/Python \ |
1681 |
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die |
1682 |
- chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
1683 |
- install_name_tool \ |
1684 |
- -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ |
1685 |
- "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
1686 |
- chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib |
1687 |
- cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die |
1688 |
- |
1689 |
- # rebuild python executable to be the non-pythonw (python wrapper) |
1690 |
- # version so we don't get framework crap |
1691 |
- rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861 |
1692 |
- $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ |
1693 |
- -o "${ED}"/usr/bin/python${SLOT} \ |
1694 |
- Modules/python.o || die |
1695 |
- |
1696 |
- # don't install the "Current" symlink, will always conflict |
1697 |
- rm "${D}${fwdir}"/Versions/Current || die |
1698 |
- # update whatever points to it, eselect-python sets them |
1699 |
- rm "${D}${fwdir}"/{Headers,Python,Resources} || die |
1700 |
- |
1701 |
- # remove unversioned files (that are not made versioned below) |
1702 |
- pushd "${ED}"/usr/bin > /dev/null |
1703 |
- rm -f python python-config python${SLOT}-config |
1704 |
- # python${SLOT} was created above |
1705 |
- for f in pythonw smtpd${SLOT}.py pydoc idle ; do |
1706 |
- rm -f ${f} ${f}${SLOT} |
1707 |
- done |
1708 |
- # pythonw needs to remain in the framework (that's the whole |
1709 |
- # reason we go through this framework hassle) |
1710 |
- ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die |
1711 |
- # copy the scripts to we can fix their shebangs |
1712 |
- for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do |
1713 |
- # for some reason sometimes they already exist, bug #347321 |
1714 |
- rm -f ${f} |
1715 |
- cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die |
1716 |
- sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ |
1717 |
- ${f} || die |
1718 |
- done |
1719 |
- # "fix" to have below collision fix not to bail |
1720 |
- mv pydoc${SLOT} pydoc || die |
1721 |
- mv idle${SLOT} idle || die |
1722 |
- popd > /dev/null |
1723 |
- |
1724 |
- # basically we don't like the framework stuff at all, so just move |
1725 |
- # stuff around or add some symlinks to make our life easier |
1726 |
- mkdir -p "${ED}"/usr |
1727 |
- mv "${D}${fwdir}"/Versions/${SLOT}/share \ |
1728 |
- "${ED}"/usr/ || die "can't move share" |
1729 |
- # get includes just UNIX style |
1730 |
- mkdir -p "${ED}"/usr/include |
1731 |
- mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ |
1732 |
- "${ED}"/usr/include/ || die "can't move include" |
1733 |
- pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null |
1734 |
- ln -s ../../../../../include/python${SLOT} || die |
1735 |
- popd > /dev/null |
1736 |
- rm -f "${ED}"/usr/share/man/man1/python{,2}.1 |
1737 |
- |
1738 |
- # same for libs |
1739 |
- # NOTE: can't symlink the entire dir, because a real dir already exists |
1740 |
- # on upgrade (site-packages), however since we h4x0rzed python to |
1741 |
- # actually look into the UNIX-style dir, we just switch them around. |
1742 |
- mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} |
1743 |
- mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ |
1744 |
- "${ED}"/usr/$(get_libdir)/python${SLOT}/ || die "can't move python${SLOT}" |
1745 |
- rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die |
1746 |
- pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null |
1747 |
- ln -s ../../../../python${SLOT} || die |
1748 |
- popd > /dev/null |
1749 |
- # remove now dead symlinks |
1750 |
- rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.a |
1751 |
- rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.dylib |
1752 |
- |
1753 |
- # fix up Makefile |
1754 |
- sed -i \ |
1755 |
- -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ |
1756 |
- -e '/^LDFLAGS=/s/=.*$/=/' \ |
1757 |
- -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ |
1758 |
- -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ |
1759 |
- -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ |
1760 |
- -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ |
1761 |
- -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ |
1762 |
- -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ |
1763 |
- "${ED}"/usr/lib/python${SLOT}/config/Makefile || die |
1764 |
- |
1765 |
- # add missing version.plist file |
1766 |
- mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources |
1767 |
- cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF |
1768 |
-<?xml version="1.0" encoding="UTF-8"?> |
1769 |
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" |
1770 |
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
1771 |
-<plist version="1.0"> |
1772 |
-<dict> |
1773 |
- <key>BuildVersion</key> |
1774 |
- <string>1</string> |
1775 |
- <key>CFBundleShortVersionString</key> |
1776 |
- <string>${PV}</string> |
1777 |
- <key>CFBundleVersion</key> |
1778 |
- <string>${PV}</string> |
1779 |
- <key>ProjectName</key> |
1780 |
- <string>Python</string> |
1781 |
- <key>SourceVersion</key> |
1782 |
- <string>${PV}</string> |
1783 |
-</dict> |
1784 |
-</plist> |
1785 |
-EOF |
1786 |
- else |
1787 |
- emake DESTDIR="${D}" altinstall |
1788 |
- fi |
1789 |
- |
1790 |
- sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" |
1791 |
- if [[ ${CHOST} == *-aix* ]]; then |
1792 |
- # fix upstream bugs with quite large proposed diffs still to be sorted out: |
1793 |
- # http://bugs.python.org/issue13493 |
1794 |
- # http://bugs.python.org/issue14150 |
1795 |
- # http://bugs.python.org/issue15590 |
1796 |
- # http://bugs.python.org/issue16189 |
1797 |
- sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \ |
1798 |
- -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" |
1799 |
- sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \ |
1800 |
- -e 's| -bI:| -Wl,-bI:|g' \ |
1801 |
- -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ |
1802 |
- -e '/LINKFORSHARED/s| -lld||g' \ |
1803 |
- -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed" |
1804 |
- fi |
1805 |
- |
1806 |
- # Backwards compat with Gentoo divergence. |
1807 |
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT} |
1808 |
- |
1809 |
- # Fix collisions between different slots of Python. |
1810 |
- mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" |
1811 |
- mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" |
1812 |
- mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" |
1813 |
- rm -f "${ED}usr/bin/smtpd.py" |
1814 |
- |
1815 |
- # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec |
1816 |
- # These #defines cause problems when building c99 compliant python modules |
1817 |
- # http://bugs.python.org/issue1759169 |
1818 |
- [[ ${CHOST} == *-solaris* ]] && sed -i -e \ |
1819 |
- 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ |
1820 |
- "${ED}"/usr/include/python${SLOT}/pyconfig.h |
1821 |
- |
1822 |
- if use build; then |
1823 |
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test} |
1824 |
- else |
1825 |
- use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die |
1826 |
- use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
1827 |
- use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die |
1828 |
- use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} |
1829 |
- fi |
1830 |
- |
1831 |
- use threads || rm -r "${libdir}/multiprocessing" || die |
1832 |
- use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die |
1833 |
- |
1834 |
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
1835 |
- |
1836 |
- if use examples; then |
1837 |
- insinto /usr/share/doc/${PF}/examples |
1838 |
- doins -r "${S}"/Tools |
1839 |
- fi |
1840 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
1841 |
- local libname |
1842 |
- if use aqua ; then |
1843 |
- # we do framework, so the emake trick below returns a pathname |
1844 |
- # since that won't work here, use a (cheap) trick instead |
1845 |
- libname=libpython${SLOT} |
1846 |
- else |
1847 |
- libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
1848 |
- emake --no-print-directory -s -f - 2>/dev/null) |
1849 |
- fi |
1850 |
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
1851 |
- |
1852 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
1853 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
1854 |
- sed \ |
1855 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
1856 |
- -e "s:@PYDOC@:pydoc${SLOT}:" \ |
1857 |
- -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
1858 |
- |
1859 |
- # for python-exec |
1860 |
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR |
1861 |
- |
1862 |
- # if not using a cross-compiler, use the fresh binary |
1863 |
- if ! tc-is-cross-compiler; then |
1864 |
- local PYTHON=./python |
1865 |
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
1866 |
- fi |
1867 |
- |
1868 |
- echo "EPYTHON='${EPYTHON}'" > epython.py |
1869 |
- python_domodule epython.py |
1870 |
-} |
1871 |
- |
1872 |
-pkg_preinst() { |
1873 |
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then |
1874 |
- python_updater_warning="1" |
1875 |
- fi |
1876 |
-} |
1877 |
- |
1878 |
-eselect_python_update() { |
1879 |
- if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
1880 |
- eselect python update |
1881 |
- fi |
1882 |
- |
1883 |
- if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
1884 |
- eselect python update --python${PV%%.*} |
1885 |
- fi |
1886 |
-} |
1887 |
- |
1888 |
-pkg_postinst() { |
1889 |
- eselect_python_update |
1890 |
- |
1891 |
- if [[ "${python_updater_warning}" == "1" ]]; then |
1892 |
- ewarn "You have just upgraded from an older version of Python." |
1893 |
- ewarn "You should switch active version of Python ${PV%%.*} and run" |
1894 |
- ewarn "'python-updater [options]' to rebuild Python modules." |
1895 |
- fi |
1896 |
-} |
1897 |
- |
1898 |
-pkg_postrm() { |
1899 |
- eselect_python_update |
1900 |
-} |
1901 |
|
1902 |
diff --git a/dev-lang/python/python-3.2.5-r6.ebuild b/dev-lang/python/python-3.2.5-r6.ebuild |
1903 |
deleted file mode 100644 |
1904 |
index 51b64f2..0000000 |
1905 |
--- a/dev-lang/python/python-3.2.5-r6.ebuild |
1906 |
+++ /dev/null |
1907 |
@@ -1,409 +0,0 @@ |
1908 |
-# Copyright 1999-2015 Gentoo Foundation |
1909 |
-# Distributed under the terms of the GNU General Public License v2 |
1910 |
-# $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 $ |
1911 |
- |
1912 |
-EAPI="4" |
1913 |
-WANT_AUTOMAKE="none" |
1914 |
-WANT_LIBTOOL="none" |
1915 |
- |
1916 |
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
1917 |
- |
1918 |
-MY_P="Python-${PV}" |
1919 |
-PATCHSET_REVISION="1" |
1920 |
-PREFIX_PATCHREV="-r0" |
1921 |
- |
1922 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
1923 |
-HOMEPAGE="http://www.python.org/" |
1924 |
-SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
1925 |
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz |
1926 |
- http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2" |
1927 |
- |
1928 |
-LICENSE="PSF-2" |
1929 |
-SLOT="3.2" |
1930 |
-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" |
1931 |
-IUSE="build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" |
1932 |
- |
1933 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
1934 |
-# If you need to apply a patch which requires python for bootstrapping, please |
1935 |
-# run the bootstrap code on your dev box and include the results in the |
1936 |
-# patchset. See bug 447752. |
1937 |
- |
1938 |
-RDEPEND="app-arch/bzip2 |
1939 |
- >=sys-libs/zlib-1.1.3 |
1940 |
- virtual/libffi |
1941 |
- virtual/libintl |
1942 |
- !build? ( |
1943 |
- gdbm? ( sys-libs/gdbm[berkdb] ) |
1944 |
- ncurses? ( |
1945 |
- >=sys-libs/ncurses-5.2 |
1946 |
- readline? ( >=sys-libs/readline-4.1 ) |
1947 |
- ) |
1948 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3 ) |
1949 |
- ssl? ( dev-libs/openssl ) |
1950 |
- tk? ( |
1951 |
- >=dev-lang/tk-8.0 |
1952 |
- dev-tcltk/blt |
1953 |
- dev-tcltk/tix |
1954 |
- ) |
1955 |
- xml? ( >=dev-libs/expat-2.1 ) |
1956 |
- )" |
1957 |
-DEPEND="${RDEPEND} |
1958 |
- virtual/pkgconfig |
1959 |
- >=sys-devel/autoconf-2.65 |
1960 |
- !sys-devel/gcc[libffi]" |
1961 |
-RDEPEND+=" !build? ( app-misc/mime-types ) |
1962 |
- doc? ( dev-python/python-docs:${SLOT} )" |
1963 |
-PDEPEND="app-eselect/eselect-python |
1964 |
- app-admin/python-updater" |
1965 |
- |
1966 |
-S="${WORKDIR}/${MY_P}" |
1967 |
- |
1968 |
-pkg_setup() { |
1969 |
- if [[ "${PV}" =~ ^3\.2(\.[1234])?(_pre)? ]]; then |
1970 |
- rm -f "${EROOT}usr/$(get_libdir)/llibpython3$(get_libname)" |
1971 |
- else |
1972 |
- die "Deprecated code not deleted" |
1973 |
- fi |
1974 |
-} |
1975 |
- |
1976 |
-src_prepare() { |
1977 |
- # Ensure that internal copies of expat, libffi and zlib are not used. |
1978 |
- rm -r Modules/expat |
1979 |
- rm -r Modules/_ctypes/libffi* |
1980 |
- rm -r Modules/zlib |
1981 |
- |
1982 |
- local excluded_patches |
1983 |
- if ! tc-is-cross-compiler; then |
1984 |
- excluded_patches="*_all_crosscompile.patch" |
1985 |
- fi |
1986 |
- |
1987 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
1988 |
- epatch "${WORKDIR}/patches" |
1989 |
- |
1990 |
- epatch "${FILESDIR}/python-3.2-CVE-2013-2099.patch" |
1991 |
- epatch "${FILESDIR}/CVE-2013-4238_py33.patch" |
1992 |
- epatch "${FILESDIR}/python-3.2-issue16248.patch" |
1993 |
- epatch "${FILESDIR}/python-3.2-issue18235.patch" |
1994 |
- epatch "${FILESDIR}/python-3.2-issue19521.patch" |
1995 |
- epatch "${FILESDIR}/python-3.2-issue19529.patch" |
1996 |
- epatch "${FILESDIR}/python-3.2-issue17919.patch" |
1997 |
- |
1998 |
- # Prefix' round of patches |
1999 |
- # http://prefix.gentooexperimental.org:8000/python-patches-3_2 |
2000 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
2001 |
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV} |
2002 |
- |
2003 |
- # we provide a fully working readline also on Darwin, so don't force |
2004 |
- # usage of half-implemented libedit |
2005 |
- sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
2006 |
- |
2007 |
- # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR. |
2008 |
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
2009 |
- |
2010 |
- # Make sure python doesn't use the host libffi. |
2011 |
- use prefix && epatch "${FILESDIR}/python-3.2-libffi-pkgconfig.patch" |
2012 |
- |
2013 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
2014 |
- Lib/distutils/command/install.py \ |
2015 |
- Lib/distutils/sysconfig.py \ |
2016 |
- Lib/site.py \ |
2017 |
- Lib/sysconfig.py \ |
2018 |
- Lib/test/test_site.py \ |
2019 |
- Makefile.pre.in \ |
2020 |
- Modules/Setup.dist \ |
2021 |
- Modules/getpath.c \ |
2022 |
- setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
2023 |
- |
2024 |
- # Disable ABI flags. |
2025 |
- sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed" |
2026 |
- |
2027 |
- # bug #514686 |
2028 |
- epatch "${FILESDIR}/${PN}-3.2-CVE-2014-4616.patch" |
2029 |
- # bug #500518 |
2030 |
- epatch "${FILESDIR}/${PN}-3.2-CVE-2014-1912.patch" |
2031 |
- |
2032 |
- epatch_user |
2033 |
- |
2034 |
- rm -f configure # force regeneration |
2035 |
- eautoconf |
2036 |
- eautoheader |
2037 |
-} |
2038 |
- |
2039 |
-src_configure() { |
2040 |
- if use build; then |
2041 |
- # Disable extraneous modules with extra dependencies. |
2042 |
- export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" |
2043 |
- export PYTHON_DISABLE_SSL="1" |
2044 |
- else |
2045 |
- local disable |
2046 |
- use gdbm || disable+=" gdbm" |
2047 |
- use ncurses || disable+=" _curses _curses_panel" |
2048 |
- use readline || disable+=" readline" |
2049 |
- use sqlite || disable+=" _sqlite3" |
2050 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
2051 |
- use tk || disable+=" _tkinter" |
2052 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
2053 |
- export PYTHON_DISABLE_MODULES="${disable}" |
2054 |
- |
2055 |
- if ! use xml; then |
2056 |
- ewarn "You have configured Python without XML support." |
2057 |
- ewarn "This is NOT a recommended configuration as you" |
2058 |
- ewarn "may face problems parsing any XML documents." |
2059 |
- fi |
2060 |
- fi |
2061 |
- |
2062 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
2063 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
2064 |
- fi |
2065 |
- |
2066 |
- if [[ "$(gcc-major-version)" -ge 4 ]]; then |
2067 |
- append-flags -fwrapv |
2068 |
- fi |
2069 |
- |
2070 |
- filter-flags -malign-double |
2071 |
- |
2072 |
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
2073 |
- |
2074 |
- # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
2075 |
- if is-flagq -O3; then |
2076 |
- is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
2077 |
- use hardened && replace-flags -O3 -O2 |
2078 |
- fi |
2079 |
- |
2080 |
- # Run the configure scripts in parallel. |
2081 |
- multijob_init |
2082 |
- |
2083 |
- mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}} |
2084 |
- |
2085 |
- if tc-is-cross-compiler; then |
2086 |
- ( |
2087 |
- multijob_child_init |
2088 |
- cd "${WORKDIR}"/${CBUILD} >/dev/null |
2089 |
- OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \ |
2090 |
- "${S}"/configure \ |
2091 |
- --{build,host}=${CBUILD} \ |
2092 |
- || die "cross-configure failed" |
2093 |
- ) & |
2094 |
- multijob_post_fork |
2095 |
- |
2096 |
- # The configure script assumes it's buggy when cross-compiling. |
2097 |
- export ac_cv_buggy_getaddrinfo=no |
2098 |
- export ac_cv_have_long_long_format=yes |
2099 |
- fi |
2100 |
- |
2101 |
- # Export CC so even AIX will use gcc instead of xlc_r. |
2102 |
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
2103 |
- tc-export CC CXX |
2104 |
- # The configure script fails to use pkg-config correctly. |
2105 |
- # http://bugs.python.org/issue15506 |
2106 |
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
2107 |
- |
2108 |
- # Set LDFLAGS so we link modules with -lpython3.2 correctly. |
2109 |
- # Needed on FreeBSD unless Python 3.2 is already installed. |
2110 |
- # Please query BSD team before removing this! |
2111 |
- append-ldflags "-L." |
2112 |
- |
2113 |
- local dbmliborder |
2114 |
- if use gdbm; then |
2115 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
2116 |
- fi |
2117 |
- |
2118 |
- # pymalloc #452720 |
2119 |
- cd "${WORKDIR}"/${CHOST} |
2120 |
- ECONF_SOURCE=${S} OPT="" \ |
2121 |
- econf \ |
2122 |
- --with-fpectl \ |
2123 |
- --enable-shared \ |
2124 |
- $(use_enable ipv6) \ |
2125 |
- $(use_with threads) \ |
2126 |
- $(use_with wide-unicode) \ |
2127 |
- --infodir='${prefix}/share/info' \ |
2128 |
- --mandir='${prefix}/share/man' \ |
2129 |
- --with-computed-gotos \ |
2130 |
- --with-dbmliborder="${dbmliborder}" \ |
2131 |
- --with-libc="" \ |
2132 |
- --enable-loadable-sqlite-extensions \ |
2133 |
- --with-system-expat \ |
2134 |
- --with-system-ffi \ |
2135 |
- --without-pymalloc |
2136 |
- |
2137 |
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
2138 |
- eerror "configure has detected that the sem_open function is broken." |
2139 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
2140 |
- die "Broken sem_open function (bug 496328)" |
2141 |
- fi |
2142 |
- |
2143 |
- if tc-is-cross-compiler; then |
2144 |
- # Modify the Makefile.pre so we don't regen for the host/ one. |
2145 |
- # We need to link the host python programs into $PWD and run |
2146 |
- # them from here because the distutils sysconfig module will |
2147 |
- # parse Makefile/etc... from argv[0], and we need it to pick |
2148 |
- # up the target settings, not the host ones. |
2149 |
- sed -i \ |
2150 |
- -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \ |
2151 |
- -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \ |
2152 |
- -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \ |
2153 |
- Makefile{.pre,} || die "sed failed" |
2154 |
- fi |
2155 |
- |
2156 |
- multijob_finish |
2157 |
-} |
2158 |
- |
2159 |
-src_compile() { |
2160 |
- if tc-is-cross-compiler; then |
2161 |
- cd "${WORKDIR}"/${CBUILD} |
2162 |
- # Disable as many modules as possible -- but we need a few to install. |
2163 |
- PYTHON_DISABLE_MODULES=$( |
2164 |
- sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \ |
2165 |
- egrep -v '(unicodedata|time|cStringIO|_struct|binascii)' |
2166 |
- ) \ |
2167 |
- PTHON_DISABLE_SSL="1" \ |
2168 |
- SYSROOT= \ |
2169 |
- emake |
2170 |
- # See comment in src_configure about these. |
2171 |
- ln python ../${CHOST}/hostpython || die |
2172 |
- ln Parser/pgen ../${CHOST}/Parser/hostpgen || die |
2173 |
- ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die |
2174 |
- fi |
2175 |
- |
2176 |
- cd "${WORKDIR}"/${CHOST} |
2177 |
- emake CPPFLAGS="" CFLAGS="" LDFLAGS="" |
2178 |
- |
2179 |
- # Work around bug 329499. See also bug 413751 and 457194. |
2180 |
- if has_version dev-libs/libffi[pax_kernel]; then |
2181 |
- pax-mark E python |
2182 |
- else |
2183 |
- pax-mark m python |
2184 |
- fi |
2185 |
-} |
2186 |
- |
2187 |
-src_test() { |
2188 |
- # Tests will not work when cross compiling. |
2189 |
- if tc-is-cross-compiler; then |
2190 |
- elog "Disabling tests due to crosscompiling." |
2191 |
- return |
2192 |
- fi |
2193 |
- |
2194 |
- cd "${WORKDIR}"/${CHOST} |
2195 |
- |
2196 |
- # Skip failing tests. |
2197 |
- local skipped_tests="gdb" |
2198 |
- |
2199 |
- for test in ${skipped_tests}; do |
2200 |
- mv "${S}"/Lib/test/test_${test}.py "${T}" |
2201 |
- done |
2202 |
- |
2203 |
- # Rerun failed tests in verbose mode (regrtest -w). |
2204 |
- PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-w" CPPFLAGS="" CFLAGS="" LDFLAGS="" < /dev/tty |
2205 |
- local result="$?" |
2206 |
- |
2207 |
- for test in ${skipped_tests}; do |
2208 |
- mv "${T}/test_${test}.py" "${S}"/Lib/test |
2209 |
- done |
2210 |
- |
2211 |
- elog "The following tests have been skipped:" |
2212 |
- for test in ${skipped_tests}; do |
2213 |
- elog "test_${test}.py" |
2214 |
- done |
2215 |
- |
2216 |
- elog "If you would like to run them, you may:" |
2217 |
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
2218 |
- elog "and run the tests separately." |
2219 |
- |
2220 |
- if [[ "${result}" -ne 0 ]]; then |
2221 |
- die "emake test failed" |
2222 |
- fi |
2223 |
-} |
2224 |
- |
2225 |
-src_install() { |
2226 |
- local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
2227 |
- |
2228 |
- cd "${WORKDIR}"/${CHOST} |
2229 |
- emake DESTDIR="${D}" altinstall |
2230 |
- |
2231 |
- sed \ |
2232 |
- -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
2233 |
- -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
2234 |
- -i "${libdir}/config-${SLOT}/Makefile" || die "sed failed" |
2235 |
- |
2236 |
- # Backwards compat with Gentoo divergence. |
2237 |
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT} |
2238 |
- |
2239 |
- # Fix collisions between different slots of Python. |
2240 |
- rm -f "${ED}usr/$(get_libdir)/libpython3$(get_libname)" || die |
2241 |
- |
2242 |
- if use build; then |
2243 |
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter} |
2244 |
- else |
2245 |
- use elibc_uclibc && rm -fr "${libdir}/test" |
2246 |
- use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*} |
2247 |
- use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*} |
2248 |
- fi |
2249 |
- |
2250 |
- use threads || rm -fr "${libdir}/multiprocessing" |
2251 |
- use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe |
2252 |
- |
2253 |
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
2254 |
- |
2255 |
- if use examples; then |
2256 |
- insinto /usr/share/doc/${PF}/examples |
2257 |
- find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr |
2258 |
- doins -r "${S}"/Tools |
2259 |
- fi |
2260 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
2261 |
- local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
2262 |
- emake --no-print-directory -s -f - 2>/dev/null) |
2263 |
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
2264 |
- |
2265 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
2266 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
2267 |
- sed \ |
2268 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
2269 |
- -e "s:@PYDOC@:pydoc${SLOT}:" \ |
2270 |
- -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
2271 |
- |
2272 |
- # for python-exec |
2273 |
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR |
2274 |
- |
2275 |
- # if not using a cross-compiler, use the fresh binary |
2276 |
- if ! tc-is-cross-compiler; then |
2277 |
- local PYTHON=./python \ |
2278 |
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
2279 |
- export LD_LIBRARY_PATH |
2280 |
- fi |
2281 |
- |
2282 |
- echo "EPYTHON='${EPYTHON}'" > epython.py |
2283 |
- python_domodule epython.py |
2284 |
-} |
2285 |
- |
2286 |
-pkg_preinst() { |
2287 |
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then |
2288 |
- python_updater_warning="1" |
2289 |
- fi |
2290 |
-} |
2291 |
- |
2292 |
-eselect_python_update() { |
2293 |
- if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
2294 |
- eselect python update |
2295 |
- fi |
2296 |
- |
2297 |
- if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
2298 |
- eselect python update --python${PV%%.*} |
2299 |
- fi |
2300 |
-} |
2301 |
- |
2302 |
-pkg_postinst() { |
2303 |
- ewarn "Please note that Python ${PV%.*} is no longer supported in Gentoo." |
2304 |
- ewarn "The interpreter is not well maintained, and may contain security" |
2305 |
- ewarn "vulnerabilities. Gentoo ebuilds will no longer be built with support" |
2306 |
- ewarn "for Python ${PV%.*}." |
2307 |
- ewarn |
2308 |
- ewarn "If you wish to use Python ${PV%.*} for your own purposes (development," |
2309 |
- ewarn "testing), we suggest establishing a virtualenv for this interpreter," |
2310 |
- ewarn "and installing the necessary dependencies inside it. However, we also" |
2311 |
- ewarn "strongly discourage using Python ${PV%.*} on production systems." |
2312 |
-} |
2313 |
- |
2314 |
-pkg_postrm() { |
2315 |
- eselect_python_update |
2316 |
-} |
2317 |
|
2318 |
diff --git a/dev-lang/python/python-3.3.3.ebuild b/dev-lang/python/python-3.3.3.ebuild |
2319 |
deleted file mode 100644 |
2320 |
index 8f989d8..0000000 |
2321 |
--- a/dev-lang/python/python-3.3.3.ebuild |
2322 |
+++ /dev/null |
2323 |
@@ -1,408 +0,0 @@ |
2324 |
-# Copyright 1999-2015 Gentoo Foundation |
2325 |
-# Distributed under the terms of the GNU General Public License v2 |
2326 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.3.3.ebuild,v 1.18 2014/03/18 16:43:13 ago Exp $ |
2327 |
- |
2328 |
-EAPI="4" |
2329 |
-WANT_AUTOMAKE="none" |
2330 |
-WANT_LIBTOOL="none" |
2331 |
- |
2332 |
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
2333 |
- |
2334 |
-MY_P="Python-${PV}" |
2335 |
-PATCHSET_REVISION="0" |
2336 |
-PREFIX_PATCHREV="-r2" |
2337 |
- |
2338 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
2339 |
-HOMEPAGE="http://www.python.org/" |
2340 |
-SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
2341 |
- http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz |
2342 |
- mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz |
2343 |
- http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2" |
2344 |
- |
2345 |
-LICENSE="PSF-2" |
2346 |
-SLOT="3.3" |
2347 |
-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" |
2348 |
-IUSE="aqua build +crypt doc elibc_uclibc examples gdbm hardened ipv6 +ncurses nis +readline sqlite +ssl +threads tk wininst +xml" |
2349 |
- |
2350 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
2351 |
-# If you need to apply a patch which requires python for bootstrapping, please |
2352 |
-# run the bootstrap code on your dev box and include the results in the |
2353 |
-# patchset. See bug 447752. |
2354 |
- |
2355 |
-RDEPEND="app-arch/bzip2 |
2356 |
- app-arch/xz-utils |
2357 |
- >=sys-libs/zlib-1.1.3 |
2358 |
- virtual/libffi |
2359 |
- virtual/libintl |
2360 |
- !build? ( |
2361 |
- gdbm? ( sys-libs/gdbm[berkdb] ) |
2362 |
- ncurses? ( |
2363 |
- >=sys-libs/ncurses-5.2 |
2364 |
- readline? ( >=sys-libs/readline-4.1 ) |
2365 |
- ) |
2366 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3 ) |
2367 |
- ssl? ( dev-libs/openssl ) |
2368 |
- tk? ( |
2369 |
- >=dev-lang/tk-8.0 |
2370 |
- dev-tcltk/blt |
2371 |
- ) |
2372 |
- xml? ( >=dev-libs/expat-2.1 ) |
2373 |
- ) |
2374 |
- !!<sys-apps/sandbox-2.6-r1" |
2375 |
-DEPEND="${RDEPEND} |
2376 |
- virtual/pkgconfig |
2377 |
- >=sys-devel/autoconf-2.65 |
2378 |
- !sys-devel/gcc[libffi]" |
2379 |
-RDEPEND+=" !build? ( app-misc/mime-types ) |
2380 |
- doc? ( dev-python/python-docs:${SLOT} )" |
2381 |
-PDEPEND="app-eselect/eselect-python |
2382 |
- app-admin/python-updater" |
2383 |
- |
2384 |
-S="${WORKDIR}/${MY_P}" |
2385 |
- |
2386 |
-src_prepare() { |
2387 |
- # Ensure that internal copies of expat, libffi and zlib are not used. |
2388 |
- rm -fr Modules/expat |
2389 |
- rm -fr Modules/_ctypes/libffi* |
2390 |
- rm -fr Modules/zlib |
2391 |
- |
2392 |
- if tc-is-cross-compiler; then |
2393 |
- # Invokes BUILDPYTHON, which is built for the host arch |
2394 |
- local EPATCH_EXCLUDE="05_all_regenerate_platform-specific_modules.patch" |
2395 |
- fi |
2396 |
- |
2397 |
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
2398 |
- epatch "${FILESDIR}/python-3.2-issue19521.patch" |
2399 |
- epatch "${FILESDIR}/python-3.3-issue17919.patch" |
2400 |
- epatch "${FILESDIR}/python-3.3-issue18235.patch" |
2401 |
- |
2402 |
- # Prefix' round of patches |
2403 |
- # http://prefix.gentooexperimental.org:8000/python-patches-3_3 |
2404 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
2405 |
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV} |
2406 |
- epatch "${FILESDIR}/python-3.3-issue21811.patch" |
2407 |
- |
2408 |
- # we provide a fully working readline also on Darwin, so don't force |
2409 |
- # usage of less functional libedit |
2410 |
- sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
2411 |
- |
2412 |
- # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR. |
2413 |
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
2414 |
- |
2415 |
- # Make sure python doesn't use the host libffi. |
2416 |
- use prefix && epatch "${FILESDIR}/python-3.2-libffi-pkgconfig.patch" |
2417 |
- |
2418 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
2419 |
- Lib/distutils/command/install.py \ |
2420 |
- Lib/distutils/sysconfig.py \ |
2421 |
- Lib/site.py \ |
2422 |
- Lib/sysconfig.py \ |
2423 |
- Lib/test/test_site.py \ |
2424 |
- Makefile.pre.in \ |
2425 |
- Modules/Setup.dist \ |
2426 |
- Modules/getpath.c \ |
2427 |
- setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
2428 |
- |
2429 |
- # workaround a development build env problem and muck around |
2430 |
- # framework install to get the best of both worlds (non-standard) |
2431 |
- sed -i \ |
2432 |
- -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \ |
2433 |
- -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \ |
2434 |
- configure.ac configure || die |
2435 |
- sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die |
2436 |
- |
2437 |
- # Disable ABI flags. |
2438 |
- sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed" |
2439 |
- |
2440 |
- epatch_user |
2441 |
- |
2442 |
- rm -f configure # force regeneration |
2443 |
- eautoconf |
2444 |
- eautoheader |
2445 |
-} |
2446 |
- |
2447 |
-src_configure() { |
2448 |
- if use build; then |
2449 |
- # Disable extraneous modules with extra dependencies. |
2450 |
- export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" |
2451 |
- export PYTHON_DISABLE_SSL="1" |
2452 |
- else |
2453 |
- local disable |
2454 |
- use crypt || disable+=" _crypt" |
2455 |
- use gdbm || disable+=" gdbm" |
2456 |
- use ncurses || disable+=" _curses _curses_panel" |
2457 |
- use nis || disable+=" nis" |
2458 |
- use readline || disable+=" readline" |
2459 |
- use sqlite || disable+=" _sqlite3" |
2460 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
2461 |
- use tk || disable+=" _tkinter" |
2462 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
2463 |
- export PYTHON_DISABLE_MODULES="${disable}" |
2464 |
- |
2465 |
- if ! use xml; then |
2466 |
- ewarn "You have configured Python without XML support." |
2467 |
- ewarn "This is NOT a recommended configuration as you" |
2468 |
- ewarn "may face problems parsing any XML documents." |
2469 |
- fi |
2470 |
- fi |
2471 |
- |
2472 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
2473 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
2474 |
- fi |
2475 |
- |
2476 |
- if [[ "$(gcc-major-version)" -ge 4 ]]; then |
2477 |
- append-flags -fwrapv |
2478 |
- fi |
2479 |
- |
2480 |
- filter-flags -malign-double |
2481 |
- |
2482 |
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
2483 |
- |
2484 |
- # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
2485 |
- if is-flagq -O3; then |
2486 |
- is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
2487 |
- use hardened && replace-flags -O3 -O2 |
2488 |
- fi |
2489 |
- |
2490 |
- # Export CC so even AIX will use gcc instead of xlc_r. |
2491 |
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
2492 |
- tc-export CC CXX |
2493 |
- # The configure script fails to use pkg-config correctly. |
2494 |
- # http://bugs.python.org/issue15506 |
2495 |
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
2496 |
- |
2497 |
- # Set LDFLAGS so we link modules with -lpython3.2 correctly. |
2498 |
- # Needed on FreeBSD unless Python 3.2 is already installed. |
2499 |
- # Please query BSD team before removing this! |
2500 |
- append-ldflags "-L." |
2501 |
- |
2502 |
- # make sure setup.py considers Prefix' paths before system ones |
2503 |
- use prefix && append-cppflags -I"${EPREFIX}"/usr/include |
2504 |
- use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib |
2505 |
- |
2506 |
- local dbmliborder |
2507 |
- if use gdbm; then |
2508 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
2509 |
- fi |
2510 |
- |
2511 |
- BUILD_DIR="${WORKDIR}/${CHOST}" |
2512 |
- mkdir -p "${BUILD_DIR}" || die |
2513 |
- cd "${BUILD_DIR}" || die |
2514 |
- |
2515 |
- if use aqua ; then |
2516 |
- ECONF_SOURCE="${S}" OPT="" \ |
2517 |
- econf \ |
2518 |
- --enable-framework="${EPREFIX}"/usr/lib \ |
2519 |
- --config-cache |
2520 |
- fi |
2521 |
- |
2522 |
- # pymalloc #452720 |
2523 |
- ECONF_SOURCE="${S}" OPT="" \ |
2524 |
- econf \ |
2525 |
- $(use aqua && echo --config-cache) \ |
2526 |
- --with-fpectl \ |
2527 |
- --enable-shared \ |
2528 |
- $(use_enable ipv6) \ |
2529 |
- $(use_with threads) \ |
2530 |
- --infodir='${prefix}/share/info' \ |
2531 |
- --mandir='${prefix}/share/man' \ |
2532 |
- --with-computed-gotos \ |
2533 |
- --with-dbmliborder="${dbmliborder}" \ |
2534 |
- --with-libc="" \ |
2535 |
- --enable-loadable-sqlite-extensions \ |
2536 |
- --with-system-expat \ |
2537 |
- --with-system-ffi \ |
2538 |
- --without-pymalloc |
2539 |
- |
2540 |
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
2541 |
- eerror "configure has detected that the sem_open function is broken." |
2542 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
2543 |
- die "Broken sem_open function (bug 496328)" |
2544 |
- fi |
2545 |
-} |
2546 |
- |
2547 |
-src_compile() { |
2548 |
- # http://bugs.python.org/issue19966 |
2549 |
- touch Include/Python-ast.h Python/Python-ast.c || die |
2550 |
- |
2551 |
- # Avoid invoking pgen for cross-compiles. |
2552 |
- touch Include/graminit.h Python/graminit.c || die |
2553 |
- |
2554 |
- cd "${BUILD_DIR}" || die |
2555 |
- emake CPPFLAGS="" CFLAGS="" LDFLAGS="" |
2556 |
- |
2557 |
- # Work around bug 329499. See also bug 413751 and 457194. |
2558 |
- if has_version dev-libs/libffi[pax_kernel]; then |
2559 |
- pax-mark E python |
2560 |
- else |
2561 |
- pax-mark m python |
2562 |
- fi |
2563 |
-} |
2564 |
- |
2565 |
-src_test() { |
2566 |
- # Tests will not work when cross compiling. |
2567 |
- if tc-is-cross-compiler; then |
2568 |
- elog "Disabling tests due to crosscompiling." |
2569 |
- return |
2570 |
- fi |
2571 |
- |
2572 |
- cd "${BUILD_DIR}" || die |
2573 |
- |
2574 |
- # Skip failing tests. |
2575 |
- local skipped_tests="gdb" |
2576 |
- |
2577 |
- for test in ${skipped_tests}; do |
2578 |
- mv "${S}"/Lib/test/test_${test}.py "${T}" |
2579 |
- done |
2580 |
- |
2581 |
- PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-u -network" FLAGS="" CFLAGS="" LDFLAGS="" < /dev/tty |
2582 |
- local result="$?" |
2583 |
- |
2584 |
- for test in ${skipped_tests}; do |
2585 |
- mv "${T}/test_${test}.py" "${S}"/Lib/test |
2586 |
- done |
2587 |
- |
2588 |
- elog "The following tests have been skipped:" |
2589 |
- for test in ${skipped_tests}; do |
2590 |
- elog "test_${test}.py" |
2591 |
- done |
2592 |
- |
2593 |
- elog "If you would like to run them, you may:" |
2594 |
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
2595 |
- elog "and run the tests separately." |
2596 |
- |
2597 |
- if [[ "${result}" -ne 0 ]]; then |
2598 |
- die "emake test failed" |
2599 |
- fi |
2600 |
-} |
2601 |
- |
2602 |
-src_install() { |
2603 |
- local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
2604 |
- |
2605 |
- cd "${BUILD_DIR}" || die |
2606 |
- |
2607 |
- emake DESTDIR="${D}" altinstall |
2608 |
- |
2609 |
- if use aqua ; then |
2610 |
- # avoid config.status to be triggered |
2611 |
- find Mac -name "Makefile" -exec touch \{\} + || die |
2612 |
- |
2613 |
- emake DESTDIR="${D}" -C Mac \ |
2614 |
- install_Python install_PythonLauncher install_IDLE \ |
2615 |
- || die |
2616 |
- |
2617 |
- local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${SLOT} |
2618 |
- ln -s "${EPREFIX}"/usr/include/python${SLOT} \ |
2619 |
- "${ED}${fwdir}"/Headers || die |
2620 |
- ln -s "${EPREFIX}"/usr/lib/libpython${SLOT}.dylib \ |
2621 |
- "${ED}${fwdir}"/Python || die |
2622 |
- fi |
2623 |
- |
2624 |
- sed \ |
2625 |
- -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
2626 |
- -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
2627 |
- -i "${libdir}/config-${SLOT}/Makefile" || die "sed failed" |
2628 |
- if [[ ${CHOST} == *-aix* ]]; then |
2629 |
- # fix upstream bugs with quite large proposed diffs still to be sorted out: |
2630 |
- # http://bugs.python.org/issue13493 |
2631 |
- # http://bugs.python.org/issue14150 |
2632 |
- # http://bugs.python.org/issue15590 |
2633 |
- # http://bugs.python.org/issue16189 |
2634 |
- sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config-${SLOT}/python.exp -lld|" \ |
2635 |
- -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" |
2636 |
- sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config-${SLOT}/python.exp|" \ |
2637 |
- -e 's| -bI:| -Wl,-bI:|g' \ |
2638 |
- -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ |
2639 |
- -e '/LINKFORSHARED/s| -lld||g' \ |
2640 |
- -i "${libdir}"/{_sysconfigdata.py,config-${SLOT}/Makefile} || die "sed failed" |
2641 |
- fi |
2642 |
- |
2643 |
- # Backwards compat with Gentoo divergence. |
2644 |
- dosym python${SLOT}-config /usr/bin/python-config-${SLOT} |
2645 |
- |
2646 |
- # Fix collisions between different slots of Python. |
2647 |
- rm -f "${ED}usr/$(get_libdir)/libpython3.so" |
2648 |
- |
2649 |
- if use build; then |
2650 |
- rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter} |
2651 |
- else |
2652 |
- use elibc_uclibc && rm -fr "${libdir}/test" |
2653 |
- use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*} |
2654 |
- use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*} |
2655 |
- fi |
2656 |
- |
2657 |
- use threads || rm -fr "${libdir}/multiprocessing" |
2658 |
- use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe |
2659 |
- |
2660 |
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
2661 |
- |
2662 |
- if use examples; then |
2663 |
- insinto /usr/share/doc/${PF}/examples |
2664 |
- find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr |
2665 |
- doins -r "${S}"/Tools |
2666 |
- fi |
2667 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
2668 |
- if use aqua ; then |
2669 |
- # we do framework, so the emake trick below returns a pathname |
2670 |
- # since that won't work here, use a (cheap) trick instead |
2671 |
- local libname=libpython${SLOT} |
2672 |
- else |
2673 |
- local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
2674 |
- emake --no-print-directory -s -f - 2>/dev/null) |
2675 |
- fi |
2676 |
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
2677 |
- |
2678 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
2679 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
2680 |
- sed \ |
2681 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
2682 |
- -e "s:@PYDOC@:pydoc${SLOT}:" \ |
2683 |
- -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
2684 |
- |
2685 |
- # for python-exec |
2686 |
- local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) |
2687 |
- |
2688 |
- # if not using a cross-compiler, use the fresh binary |
2689 |
- if ! tc-is-cross-compiler; then |
2690 |
- local -x PYTHON=./python |
2691 |
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
2692 |
- else |
2693 |
- vars=( PYTHON "${vars[@]}" ) |
2694 |
- fi |
2695 |
- |
2696 |
- python_export "python${SLOT}" "${vars[@]}" |
2697 |
- echo "EPYTHON='${EPYTHON}'" > epython.py |
2698 |
- python_domodule epython.py |
2699 |
-} |
2700 |
- |
2701 |
-pkg_preinst() { |
2702 |
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then |
2703 |
- python_updater_warning="1" |
2704 |
- fi |
2705 |
-} |
2706 |
- |
2707 |
-eselect_python_update() { |
2708 |
- if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
2709 |
- eselect python update |
2710 |
- fi |
2711 |
- |
2712 |
- if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
2713 |
- eselect python update --python${PV%%.*} |
2714 |
- fi |
2715 |
-} |
2716 |
- |
2717 |
-pkg_postinst() { |
2718 |
- eselect_python_update |
2719 |
- |
2720 |
- if [[ "${python_updater_warning}" == "1" ]]; then |
2721 |
- ewarn "You have just upgraded from an older version of Python." |
2722 |
- ewarn |
2723 |
- ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." |
2724 |
- ewarn |
2725 |
- ewarn "For legacy packages, you should switch active version of Python and run 'python-updater [options]' to rebuild Python modules." |
2726 |
- fi |
2727 |
-} |
2728 |
- |
2729 |
-pkg_postrm() { |
2730 |
- eselect_python_update |
2731 |
-} |
2732 |
|
2733 |
diff --git a/dev-lang/python/python-3.4.3-r5.ebuild b/dev-lang/python/python-3.4.3-r5.ebuild |
2734 |
index b2a6a49..2857528 100644 |
2735 |
--- a/dev-lang/python/python-3.4.3-r5.ebuild |
2736 |
+++ b/dev-lang/python/python-3.4.3-r5.ebuild |
2737 |
@@ -9,7 +9,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha |
2738 |
|
2739 |
MY_P="Python-${PV/_/}" |
2740 |
PATCHSET_VERSION="3.4.3-0" |
2741 |
-PREFIX_PATCHREV="r0" |
2742 |
+PREFIX_PATCHREV="r1" |
2743 |
CYGWINPORTS_GITREV="8ee84829be03c2a1aa74f0f095c994c1f43f4688" |
2744 |
|
2745 |
DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
2746 |
|
2747 |
diff --git a/dev-lang/python/python-3.5.1-r3.ebuild b/dev-lang/python/python-3.5.1-r3.ebuild |
2748 |
index 5e176fa..8422585 100644 |
2749 |
--- a/dev-lang/python/python-3.5.1-r3.ebuild |
2750 |
+++ b/dev-lang/python/python-3.5.1-r3.ebuild |
2751 |
@@ -9,7 +9,7 @@ inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolcha |
2752 |
|
2753 |
MY_P="Python-${PV/_/}" |
2754 |
PATCHSET_VERSION="3.5.1-0" |
2755 |
-PREFIX_PATCHREV="r1" |
2756 |
+PREFIX_PATCHREV="r2" |
2757 |
|
2758 |
DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
2759 |
HOMEPAGE="http://www.python.org/" |
2760 |
|
2761 |
diff --git a/dev-lang/python/python-3.5.1.ebuild b/dev-lang/python/python-3.5.1.ebuild |
2762 |
deleted file mode 100644 |
2763 |
index 3e6454f..0000000 |
2764 |
--- a/dev-lang/python/python-3.5.1.ebuild |
2765 |
+++ /dev/null |
2766 |
@@ -1,422 +0,0 @@ |
2767 |
-# Copyright 1999-2015 Gentoo Foundation |
2768 |
-# Distributed under the terms of the GNU General Public License v2 |
2769 |
-# $Id$ |
2770 |
- |
2771 |
-EAPI="5" |
2772 |
-WANT_LIBTOOL="none" |
2773 |
- |
2774 |
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs |
2775 |
- |
2776 |
-MY_P="Python-${PV/_/}" |
2777 |
-PATCHSET_VERSION="3.5.1-0" |
2778 |
-PREFIX_PATCHREV="r1" |
2779 |
- |
2780 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
2781 |
-HOMEPAGE="http://www.python.org/" |
2782 |
-SRC_URI="http://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz |
2783 |
- https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz |
2784 |
- https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" |
2785 |
- |
2786 |
-LICENSE="PSF-2" |
2787 |
-SLOT="3.5/3.5m" |
2788 |
-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" |
2789 |
-IUSE="aqua build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk wininst +xml" |
2790 |
- |
2791 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
2792 |
-# If you need to apply a patch which requires python for bootstrapping, please |
2793 |
-# run the bootstrap code on your dev box and include the results in the |
2794 |
-# patchset. See bug 447752. |
2795 |
- |
2796 |
-RDEPEND="app-arch/bzip2:0= |
2797 |
- app-arch/xz-utils:0= |
2798 |
- >=sys-libs/zlib-1.1.3:0= |
2799 |
- virtual/libffi |
2800 |
- virtual/libintl |
2801 |
- gdbm? ( sys-libs/gdbm:0=[berkdb] ) |
2802 |
- ncurses? ( |
2803 |
- >=sys-libs/ncurses-5.2:0= |
2804 |
- readline? ( >=sys-libs/readline-4.1:0= ) |
2805 |
- ) |
2806 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
2807 |
- ssl? ( |
2808 |
- !libressl? ( dev-libs/openssl:0= ) |
2809 |
- libressl? ( dev-libs/libressl:= ) |
2810 |
- ) |
2811 |
- tk? ( |
2812 |
- >=dev-lang/tcl-8.0:0= |
2813 |
- >=dev-lang/tk-8.0:0=[-aqua] |
2814 |
- dev-tcltk/blt:0= |
2815 |
- dev-tcltk/tix |
2816 |
- ) |
2817 |
- xml? ( >=dev-libs/expat-2.1:0= ) |
2818 |
- !!<sys-apps/sandbox-2.6-r1" |
2819 |
-DEPEND="${RDEPEND} |
2820 |
- virtual/pkgconfig |
2821 |
- !sys-devel/gcc[libffi(-)]" |
2822 |
-RDEPEND+=" !build? ( app-misc/mime-types )" |
2823 |
-PDEPEND=">=app-eselect/eselect-python-20151117-r1" |
2824 |
- |
2825 |
-S="${WORKDIR}/${MY_P}" |
2826 |
- |
2827 |
-PYVER=${SLOT%/*} |
2828 |
- |
2829 |
-src_prepare() { |
2830 |
- # Ensure that internal copies of expat, libffi and zlib are not used. |
2831 |
- rm -fr Modules/expat |
2832 |
- rm -fr Modules/_ctypes/libffi* |
2833 |
- rm -fr Modules/zlib |
2834 |
- |
2835 |
- if tc-is-cross-compiler; then |
2836 |
- # Invokes BUILDPYTHON, which is built for the host arch |
2837 |
- local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" |
2838 |
- fi |
2839 |
- |
2840 |
- EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
2841 |
- epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch" |
2842 |
- epatch "${FILESDIR}/3.5-secondary-targets.patch" |
2843 |
- |
2844 |
- # Prefix' round of patches |
2845 |
- # http://prefix.gentooexperimental.org:8000/python-patches-3_3 |
2846 |
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
2847 |
- epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV} |
2848 |
- |
2849 |
- # https://forums.developer.apple.com/thread/9233, bug #572726 |
2850 |
- sed -i -e '/$(RUNSHARED) .\/regen/s/^/export RUNSHARED=$(RUNSHARED); /' \ |
2851 |
- Makefile.pre.in || die |
2852 |
- sed -i -e '/python$EXE/s/^/env ${RUNSHARED} /' \ |
2853 |
- Lib/plat-darwin/regen || die |
2854 |
- |
2855 |
- # we provide a fully working readline also on Darwin, so don't force |
2856 |
- # usage of less functional libedit |
2857 |
- sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
2858 |
- |
2859 |
- # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR. |
2860 |
- sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
2861 |
- |
2862 |
- # Make sure python doesn't use the host libffi. |
2863 |
- use prefix && epatch "${FILESDIR}/python-3.2-libffi-pkgconfig.patch" |
2864 |
- |
2865 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
2866 |
- configure.ac \ |
2867 |
- Lib/distutils/command/install.py \ |
2868 |
- Lib/distutils/sysconfig.py \ |
2869 |
- Lib/site.py \ |
2870 |
- Lib/sysconfig.py \ |
2871 |
- Lib/test/test_site.py \ |
2872 |
- Makefile.pre.in \ |
2873 |
- Modules/getpath.c \ |
2874 |
- Modules/Setup.dist \ |
2875 |
- setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
2876 |
- |
2877 |
- #sed -i -e 's/\$(GRAMMAR_H): \$(GRAMMAR_INPUT) \$(PGEN)/$(GRAMMAR_H): \$(GRAMMAR_INPUT)/' Makefile.pre.in || die |
2878 |
- |
2879 |
- # workaround a development build env problem and muck around |
2880 |
- # framework install to get the best of both worlds (non-standard) |
2881 |
- sed -i \ |
2882 |
- -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \ |
2883 |
- -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \ |
2884 |
- configure.ac configure || die |
2885 |
- sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die |
2886 |
- |
2887 |
- # Disable ABI flags. |
2888 |
- sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed" |
2889 |
- |
2890 |
- epatch_user |
2891 |
- |
2892 |
- eautoreconf |
2893 |
-} |
2894 |
- |
2895 |
-src_configure() { |
2896 |
- local disable |
2897 |
- use gdbm || disable+=" gdbm" |
2898 |
- use ncurses || disable+=" _curses _curses_panel" |
2899 |
- use readline || disable+=" readline" |
2900 |
- use sqlite || disable+=" _sqlite3" |
2901 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
2902 |
- use tk || disable+=" _tkinter" |
2903 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
2904 |
- export PYTHON_DISABLE_MODULES="${disable}" |
2905 |
- |
2906 |
- if ! use xml; then |
2907 |
- ewarn "You have configured Python without XML support." |
2908 |
- ewarn "This is NOT a recommended configuration as you" |
2909 |
- ewarn "may face problems parsing any XML documents." |
2910 |
- fi |
2911 |
- |
2912 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
2913 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
2914 |
- fi |
2915 |
- |
2916 |
- if [[ "$(gcc-major-version)" -ge 4 ]]; then |
2917 |
- append-flags -fwrapv |
2918 |
- fi |
2919 |
- |
2920 |
- filter-flags -malign-double |
2921 |
- |
2922 |
- [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
2923 |
- |
2924 |
- # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
2925 |
- if is-flagq -O3; then |
2926 |
- is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
2927 |
- use hardened && replace-flags -O3 -O2 |
2928 |
- fi |
2929 |
- |
2930 |
- # Export CC so even AIX will use gcc instead of xlc_r. |
2931 |
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
2932 |
- tc-export CC CXX |
2933 |
- |
2934 |
- # The configure script fails to use pkg-config correctly. |
2935 |
- # http://bugs.python.org/issue15506 |
2936 |
- export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
2937 |
- |
2938 |
- # Set LDFLAGS so we link modules with -lpython3.2 correctly. |
2939 |
- # Needed on FreeBSD unless Python 3.2 is already installed. |
2940 |
- # Please query BSD team before removing this! |
2941 |
- append-ldflags "-L." |
2942 |
- |
2943 |
- # make sure setup.py considers Prefix' paths before system ones |
2944 |
- use prefix && append-cppflags -I"${EPREFIX}"/usr/include |
2945 |
- use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib |
2946 |
- |
2947 |
- local dbmliborder |
2948 |
- if use gdbm; then |
2949 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
2950 |
- fi |
2951 |
- |
2952 |
- BUILD_DIR="${WORKDIR}/${CHOST}" |
2953 |
- mkdir -p "${BUILD_DIR}" || die |
2954 |
- cd "${BUILD_DIR}" || die |
2955 |
- |
2956 |
- if use aqua ; then |
2957 |
- ECONF_SOURCE="${S}" OPT="" \ |
2958 |
- econf \ |
2959 |
- --enable-framework="${EPREFIX}"/usr/lib \ |
2960 |
- --config-cache |
2961 |
- fi |
2962 |
- |
2963 |
- # pymalloc #452720 |
2964 |
- local myeconfargs=( |
2965 |
- $(use aqua && echo --config-cache) \ |
2966 |
- --with-fpectl |
2967 |
- --enable-shared |
2968 |
- $(use_enable ipv6) |
2969 |
- $(use_with threads) |
2970 |
- --infodir='${prefix}/share/info' |
2971 |
- --mandir='${prefix}/share/man' |
2972 |
- --with-computed-gotos |
2973 |
- --with-dbmliborder="${dbmliborder}" |
2974 |
- --with-libc= |
2975 |
- --enable-loadable-sqlite-extensions |
2976 |
- --without-ensurepip |
2977 |
- --with-system-expat |
2978 |
- --with-system-ffi |
2979 |
- --without-pymalloc |
2980 |
- ) |
2981 |
- |
2982 |
- ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}" |
2983 |
- |
2984 |
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
2985 |
- eerror "configure has detected that the sem_open function is broken." |
2986 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
2987 |
- die "Broken sem_open function (bug 496328)" |
2988 |
- fi |
2989 |
-} |
2990 |
- |
2991 |
-src_compile() { |
2992 |
- # Avoid regenerating these for cross-compiles |
2993 |
- touch Include/graminit.h Python/graminit.c Python/importlib.h Python/importlib_external.h || die |
2994 |
- |
2995 |
- cd "${BUILD_DIR}" || die |
2996 |
- |
2997 |
- emake CPPFLAGS= CFLAGS= LDFLAGS= |
2998 |
- |
2999 |
- # Work around bug 329499. See also bug 413751 and 457194. |
3000 |
- if has_version dev-libs/libffi[pax_kernel]; then |
3001 |
- pax-mark E python |
3002 |
- else |
3003 |
- pax-mark m python |
3004 |
- fi |
3005 |
-} |
3006 |
- |
3007 |
-src_test() { |
3008 |
- # Tests will not work when cross compiling. |
3009 |
- if tc-is-cross-compiler; then |
3010 |
- elog "Disabling tests due to crosscompiling." |
3011 |
- return |
3012 |
- fi |
3013 |
- |
3014 |
- cd "${BUILD_DIR}" || die |
3015 |
- |
3016 |
- # Skip failing tests. |
3017 |
- local skipped_tests="gdb" |
3018 |
- |
3019 |
- for test in ${skipped_tests}; do |
3020 |
- mv "${S}"/Lib/test/test_${test}.py "${T}" |
3021 |
- done |
3022 |
- |
3023 |
- local -x PYTHONDONTWRITEBYTECODE= |
3024 |
- emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
3025 |
- local result=$? |
3026 |
- |
3027 |
- for test in ${skipped_tests}; do |
3028 |
- mv "${T}/test_${test}.py" "${S}"/Lib/test |
3029 |
- done |
3030 |
- |
3031 |
- elog "The following tests have been skipped:" |
3032 |
- for test in ${skipped_tests}; do |
3033 |
- elog "test_${test}.py" |
3034 |
- done |
3035 |
- |
3036 |
- elog "If you would like to run them, you may:" |
3037 |
- elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'" |
3038 |
- elog "and run the tests separately." |
3039 |
- |
3040 |
- if [[ ${result} -ne 0 ]]; then |
3041 |
- die "emake test failed" |
3042 |
- fi |
3043 |
-} |
3044 |
- |
3045 |
-src_install() { |
3046 |
- local libdir=${ED}/usr/$(get_libdir)/python${PYVER} |
3047 |
- |
3048 |
- cd "${BUILD_DIR}" || die |
3049 |
- |
3050 |
- emake DESTDIR="${D}" altinstall |
3051 |
- |
3052 |
- if use aqua ; then |
3053 |
- # avoid config.status to be triggered |
3054 |
- find Mac -name "Makefile" -exec touch \{\} + || die |
3055 |
- |
3056 |
- # Python_Launcher is kind of a wrapper, and we should fix it for |
3057 |
- # Prefix (it uses /usr/bin/pythonw) so useless |
3058 |
- # IDLE doesn't run, no idea, but definitely not used |
3059 |
- emake DESTDIR="${D}" -C Mac install_Python || die |
3060 |
- rmdir "${ED}"/Applications/Python* || die |
3061 |
- rmdir "${ED}"/Applications || die |
3062 |
- |
3063 |
- local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER} |
3064 |
- ln -s "${EPREFIX}"/usr/include/python${PYVER} \ |
3065 |
- "${ED}${fwdir}"/Headers || die |
3066 |
- ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \ |
3067 |
- "${ED}${fwdir}"/Python || die |
3068 |
- fi |
3069 |
- |
3070 |
- sed \ |
3071 |
- -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
3072 |
- -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
3073 |
- -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
3074 |
- |
3075 |
- # Fix collisions between different slots of Python. |
3076 |
- rm -f "${ED}usr/$(get_libdir)/libpython3.so" |
3077 |
- |
3078 |
- # Cheap hack to get version with ABIFLAGS |
3079 |
- local abiver=$(cd "${ED}usr/include"; echo python*) |
3080 |
- # Replace python3.X with a symlink if appropriate |
3081 |
- if [[ ${abiver} != python${PYVER} ]]; then |
3082 |
- rm "${ED}usr/bin/python${PYVER}" || die |
3083 |
- dosym "${abiver}" "/usr/bin/python${PYVER}" |
3084 |
- fi |
3085 |
- |
3086 |
- use elibc_uclibc && rm -fr "${libdir}/test" |
3087 |
- use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*} |
3088 |
- use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} |
3089 |
- |
3090 |
- use threads || rm -fr "${libdir}/multiprocessing" |
3091 |
- use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe |
3092 |
- |
3093 |
- dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
3094 |
- |
3095 |
- if use examples; then |
3096 |
- insinto /usr/share/doc/${PF}/examples |
3097 |
- find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr |
3098 |
- doins -r "${S}"/Tools |
3099 |
- fi |
3100 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
3101 |
- if use aqua ; then |
3102 |
- # we do framework, so the emake trick below returns a pathname |
3103 |
- # since that won't work here, use a (cheap) trick instead |
3104 |
- local libname=libpython${PYVER} |
3105 |
- else |
3106 |
- local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
3107 |
- emake --no-print-directory -s -f - 2>/dev/null) |
3108 |
- fi |
3109 |
- newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
3110 |
- |
3111 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
3112 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
3113 |
- sed \ |
3114 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
3115 |
- -e "s:@PYDOC@:pydoc${PYVER}:" \ |
3116 |
- -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed" |
3117 |
- |
3118 |
- # for python-exec |
3119 |
- local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) |
3120 |
- |
3121 |
- # if not using a cross-compiler, use the fresh binary |
3122 |
- if ! tc-is-cross-compiler; then |
3123 |
- local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) |
3124 |
- local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
3125 |
- local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}. |
3126 |
- else |
3127 |
- vars=( PYTHON "${vars[@]}" ) |
3128 |
- fi |
3129 |
- |
3130 |
- python_export "python${PYVER}" "${vars[@]}" |
3131 |
- echo "EPYTHON='${EPYTHON}'" > epython.py || die |
3132 |
- python_domodule epython.py |
3133 |
- |
3134 |
- # python-exec wrapping support |
3135 |
- local pymajor=${PYVER%.*} |
3136 |
- mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die |
3137 |
- # python and pythonX |
3138 |
- ln -s "../../../bin/${abiver}" \ |
3139 |
- "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die |
3140 |
- ln -s "python${pymajor}" \ |
3141 |
- "${D}${PYTHON_SCRIPTDIR}/python" || die |
3142 |
- # python-config and pythonX-config |
3143 |
- ln -s "../../../bin/${abiver}-config" \ |
3144 |
- "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die |
3145 |
- ln -s "python${pymajor}-config" \ |
3146 |
- "${D}${PYTHON_SCRIPTDIR}/python-config" || die |
3147 |
- # 2to3, pydoc, pyvenv |
3148 |
- ln -s "../../../bin/2to3-${PYVER}" \ |
3149 |
- "${D}${PYTHON_SCRIPTDIR}/2to3" || die |
3150 |
- ln -s "../../../bin/pydoc${PYVER}" \ |
3151 |
- "${D}${PYTHON_SCRIPTDIR}/pydoc" || die |
3152 |
- ln -s "../../../bin/pyvenv-${PYVER}" \ |
3153 |
- "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die |
3154 |
- |
3155 |
- # Compatibility link for stuff that calls ${PYTHON}-config |
3156 |
- # Remove this when all revdeps have been fixed to not do that. |
3157 |
- dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
3158 |
-} |
3159 |
- |
3160 |
-pkg_preinst() { |
3161 |
- if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then |
3162 |
- python_updater_warning="1" |
3163 |
- fi |
3164 |
-} |
3165 |
- |
3166 |
-eselect_python_update() { |
3167 |
- if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
3168 |
- eselect python update |
3169 |
- fi |
3170 |
- |
3171 |
- if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
3172 |
- eselect python update --python${PV%%.*} |
3173 |
- fi |
3174 |
-} |
3175 |
- |
3176 |
-pkg_postinst() { |
3177 |
- eselect_python_update |
3178 |
- |
3179 |
- if [[ "${python_updater_warning}" == "1" ]]; then |
3180 |
- ewarn "You have just upgraded from an older version of Python." |
3181 |
- ewarn |
3182 |
- ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." |
3183 |
- fi |
3184 |
-} |
3185 |
- |
3186 |
-pkg_postrm() { |
3187 |
- eselect_python_update |
3188 |
-} |