Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
Date: Tue, 31 Oct 2017 09:29:30
Message-Id: 1509442153.3b75d209b07832976303df1bfa6c91e1a7ce688a.grobian@gentoo
1 commit: 3b75d209b07832976303df1bfa6c91e1a7ce688a
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 31 09:29:13 2017 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 31 09:29:13 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=3b75d209
7
8 dev-lang/python: version bump to 2.7.14 with updated MiNT patch, bug #593586
9
10 Package-Manager: Portage-2.3.13-prefix, Repoman-2.3.4
11
12 dev-lang/python/Manifest | 3 +
13 .../files/python-2.7.14-libffi-pkgconfig.patch | 44 ++
14 dev-lang/python/python-2.7.14.ebuild | 632 +++++++++++++++++++++
15 3 files changed, 679 insertions(+)
16
17 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
18 index 221586ae58..6e6da0bcad 100644
19 --- a/dev-lang/python/Manifest
20 +++ b/dev-lang/python/Manifest
21 @@ -2,6 +2,7 @@ DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 SHA256 f813f6f9437cb15282
22 DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 SHA256 811b6fe82630a04a44a6d16074af76964e7e4005136ba479647eb741639099da SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62 WHIRLPOOL 73eba606051ed1232de22965f0879cd2dc3895d2d280a3e355581be788adf1af20e96c7eb725af2e71df1d022e6b208ab2ffe70515693536d6464f033224cd14
23 DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46 SHA512 72166763a2fe6aab45ecf378f55a1efc7322d1742c4638bae84f4ed4b9fb4c01f2a0293733c64426ae2c70df24d95ff2b1e2a4f3c2715de00d8f320d4d939ea0 WHIRLPOOL 7ebcff7a2fe775a21a3847dee10369b73aaea8685eb63b4bc33dab0f562b8fb984c398cb34e8158cf1e24f106002829649540aad30a5ec7f4de0018ce7449f69
24 DIST Python-2.7.12.tar.xz 12390820 SHA256 d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978 SHA512 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f WHIRLPOOL fe4224f4c3dc8dc5c49005051da0069922c86f39880a0072c09fac422e1913d924ac695e22be11603a961329dd8c17b1cf7696b31b62ef93398e42745a6446d6
25 +DIST Python-2.7.14.tar.xz 12576112 SHA256 71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66 SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 WHIRLPOOL c604d747daa874de926abb8ec142a7824f2706b79fd828aa189895ba0e7d4df044b9be58d49ab70a245e9e7abd5da4340abe54fa0ff9eab32a4dee7db7ee9d29
26 DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3
27 DIST Python-3.4.5.tar.xz 14516820 SHA256 ee64b1c8a47461009abf25252332d29a4e587cb4f0c1c96aa793a3732e9d898a SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c WHIRLPOOL 43e0aed0177d46148964447b4fb24475c4c736afb2ba84ec393fbf55db3da3f192308f9c8f236deaa7a608dac56946ee7755970fadaa82bf406c910a05f36883
28 DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f
29 @@ -10,6 +11,7 @@ DIST Python-3.5.4.tar.xz 15332320 SHA256 94d93bfabb3b109f8a10365a325f920f9ec98c6
30 DIST Python-3.6.3.tar.xz 16974296 SHA256 cda7d967c9a4bfa52337cdf551bcc5cff026b6ac50a8834e568ce4a794ca81da SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b WHIRLPOOL cdd04d265568d577e97ce921bef63e78c493f05426adcc8bc2bb1e5dbf02e35c3a4361ff467b7021e917e5056cd12d75cb038e5977093649881f8c2c5aabcc28
31 DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77
32 DIST python-gentoo-patches-2.7.12-0.tar.xz 13576 SHA256 cd842eec7202df57c153adc1fbb81e70b26ef651f8e9346e065d8577b93f343b SHA512 8bf530fca15c47fa5d9bc958e433b35943a12c98e4172806a45aa60dc85ec92f8ab6ffcd90f752dc5bf8ffc711414894c15820c4b6ef72dbcedc2808119fb1f6 WHIRLPOOL 54b8ca6a4371d460dadccfdffcc096c12930d58714eef95117a658d7a1337ea89c45c69553b5b993017211faaa0f8d670e09a8452e53c0fb176be3e908524ee6
33 +DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 SHA256 3567feeb8f0c66161efaea1922bbfe4e71f6051533ef5f54a74b6ccf9e0359b6 SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1 WHIRLPOOL ab77023ac66def132d1dce72f98add3108fd7be303ef5b167a2374df3a94949c75f089dcfdd84ed05a5eb813d6c22cfecd0de03b5819817a20b04f30030f5f6d
34 DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1
35 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 SHA256 84ee7630670a1dac4bbbc55fabf5f99b5b29007de4f140ad956e93d2e7aba8fa SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8 WHIRLPOOL f0248faa0b4ce5679e37381bba90f8a4d361a49db792787bffc06a54a4bc82fea4d53255120f10e6dbf51b99e12417fc1b469be9624e73508fa3a212a38e7352
36 DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc
37 @@ -18,6 +20,7 @@ DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 SHA256 30c9dbcd5c11ed025b9d8dd20
38 DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 SHA256 56729f9848557c52361c71404e5583368f6a0e93b5b6c2e643b59cb079e253d9 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3 WHIRLPOOL 90d1f12bee812f350ca0330a97290ce0d5c5fa9ccd816441944f042ef561d9023f4b79239f6d559f38a486fea458e48bf11d33d5bd6fa605875b686a2a845bd1
39 DIST python-prefix-2.7.11-gentoo-patches-r1.tar.xz 17268 SHA256 ecebc430e475030fdbfcd940f314f80ebcb8c6e01a6b2498478bb8f37e525484 SHA512 22218128ff83856dd042ecd6aab3615282ab29c4420e6cce4a0bba8b6508e3f5649c27cdf50cf342fffd3c87ea29f8b7d32d28b9b1f4dc200771b52ee41f27e5 WHIRLPOOL 2a942b39e56955df5b24f50d68a39ca78152e10f13ccc856340cd4651eb87847097ec3ff79efde81c2130b12f2885764194fb8d51c05278f4acc550bcd4ba032
40 DIST python-prefix-2.7.12-gentoo-patches-r0.tar.xz 17380 SHA256 c488011046a678eaf2febe3d02726a0efbd2f8378a0c5b896b03bcbed5b5f00a SHA512 ef17c8e8083da0ed0e6a63c96f59cc1243b0376fc6d4d7fcecb165e557403c54ae87625ed6dfe4d7d73693f8220ec98ef8a3f16124d8022dbac6a3a9d5514d9c WHIRLPOOL 7e427be36a8d558193058d7112f704993474eff7bb554b6f2f0d9cfe085c653a9cf0522a33249a92e813fad667a53439c9f70d74bcde0df9f78824bfbbfaae46
41 +DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 SHA256 1d57b53df4f2d3be36cbdcd046f6682ca2287ea87b6a5ce4a4704c3aaf1909af SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8 WHIRLPOOL 42a85d862e958c3bbb6a9121dac90c8370b88fdb0053292947cbe205eb4a841737025f038ea8df94c54cd0c48463466a2d545ca4767c7cc3a08f45349f8cc1fd
42 DIST python-prefix-3.4.3-gentoo-patches-r1.tar.xz 12896 SHA256 39da669913d8627a74e6d9a7e1ee6eae3e184d7525097090d4b05a71b0a79100 SHA512 dd1082ef9605fdcb84bcc769318be6934c889a5b6134971fb121b3be8301cb9519fb687841a359c65e0614d05a8c27eab4b3dbfe94ed8dbbf2fc64f82206a6d9 WHIRLPOOL 884f0e9e5e177543c74f3c3e87629113db6c53c556f55bf7310de79f101fa825472d886eea216cea471e981dc4fd6743622e1c7472b5ffe04eda4c6790d73c62
43 DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 SHA256 ab0b1f138c8bd22b2be862923e219d68513d98e77d32260b9625d19be08b1bf3 SHA512 e32556c63e48d8dacd86218945147d1bbbc5777a6bb3441373827da47771a8eb387f26885acd35343cc598c719c9feec63007144fc1fdd1aca253a2ec1a19825 WHIRLPOOL fda061e683462252bf777ea43d84958fb07ca0144be3f87cc42e4e2baa4f69cb0ed3075b55445398f88c514d28c8c310c6b5b312883a4949c8745161aaf3d786
44 DIST python-prefix-3.5.1-gentoo-patches-r2.tar.xz 12680 SHA256 73b1166eded9867b473c90171b613d32bbe8f72e523c74b1563a9c25c555e13b SHA512 82b08b8cf7f3620c4c2a6a6c3ed5ec8c3318c6f43e4bcc4950c7aeb56ec755e0e47d46f068843f5b04159583994c8620dab14827278a199789a3867532cc6e0c WHIRLPOOL ac4ea106ca744d6e154e14a53ae2e8eeb119207069ead95d0ef19657a58e1d31ed1933de6315ab61ce532c11d1ae4a999c73d34121028a0a246b7dd2b1ac857a
45
46 diff --git a/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
47 new file mode 100644
48 index 0000000000..85abb1b56b
49 --- /dev/null
50 +++ b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
51 @@ -0,0 +1,44 @@
52 +diff -u -r Python-2.7.5-orig//configure.ac Python-2.7.5/configure.ac
53 +--- Python-2.7.5-orig//configure.ac 2014-03-06 04:35:31.000000000 +0100
54 ++++ Python-2.7.5/configure.ac 2014-03-06 04:58:10.000000000 +0100
55 +@@ -2300,10 +2300,13 @@
56 +
57 + if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
58 + LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
59 ++ LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
60 + else
61 + LIBFFI_INCLUDEDIR=""
62 ++ LIBFFI_LIB=""
63 + fi
64 + AC_SUBST(LIBFFI_INCLUDEDIR)
65 ++AC_SUBST(LIBFFI_LIB)
66 +
67 + AC_MSG_RESULT($with_system_ffi)
68 +
69 +diff -u -r Python-2.7.5-orig//Makefile.pre.in Python-2.7.5/Makefile.pre.in
70 +--- Python-2.7.5-orig//Makefile.pre.in 2014-03-06 04:35:31.000000000 +0100
71 ++++ Python-2.7.5/Makefile.pre.in 2014-03-06 05:03:59.000000000 +0100
72 +@@ -224,6 +224,7 @@
73 +
74 +
75 + LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
76 ++LIBFFI_LIB= @LIBFFI_LIB@
77 +
78 + ##########################################################################
79 + # Parser
80 +diff -u -r Python-2.7.5-orig//setup.py Python-2.7.5/setup.py
81 +--- Python-2.7.5-orig//setup.py 2014-03-06 04:35:31.000000000 +0100
82 ++++ Python-2.7.5/setup.py 2014-03-06 04:56:15.000000000 +0100
83 +@@ -1893,8 +1893,10 @@
84 + ffi_inc = None
85 + print('Header file {} does not define LIBFFI_H or '
86 + 'ffi_wrapper_h'.format(ffi_h))
87 +- ffi_lib = None
88 +- if ffi_inc is not None:
89 ++ ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
90 ++ if not ffi_lib or ffi_lib == '':
91 ++ ffi_lib = None
92 ++ if ffi_inc is not None and ffi_lib is None:
93 + for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
94 + if (self.compiler.find_library_file(lib_dirs, lib_name)):
95 + ffi_lib = lib_name
96
97 diff --git a/dev-lang/python/python-2.7.14.ebuild b/dev-lang/python/python-2.7.14.ebuild
98 new file mode 100644
99 index 0000000000..a97995fb67
100 --- /dev/null
101 +++ b/dev-lang/python/python-2.7.14.ebuild
102 @@ -0,0 +1,632 @@
103 +# Copyright 1999-2017 Gentoo Foundation
104 +# Distributed under the terms of the GNU General Public License v2
105 +
106 +EAPI="5"
107 +WANT_LIBTOOL="none"
108 +
109 +inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
110 +
111 +MY_P="Python-${PV}"
112 +PATCHSET_VERSION="2.7.14-0"
113 +PREFIX_PATCHREV="r0"
114 +CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
115 +
116 +DESCRIPTION="An interpreted, interactive, object-oriented programming language"
117 +HOMEPAGE="https://www.python.org/"
118 +SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
119 + https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
120 + https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
121 +
122 +[[ -n ${CYGWINPORTS_GITREV} ]] &&
123 +SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )"
124 +
125 +LICENSE="PSF-2"
126 +SLOT="2.7"
127 +KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
128 +IUSE="aqua -berkdb build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
129 +
130 +# Do not add a dependency on dev-lang/python to this ebuild.
131 +# If you need to apply a patch which requires python for bootstrapping, please
132 +# run the bootstrap code on your dev box and include the results in the
133 +# patchset. See bug 447752.
134 +
135 +RDEPEND="app-arch/bzip2:0=
136 + >=sys-libs/zlib-1.1.3:0=
137 + !m68k-mint? ( virtual/libffi )
138 + virtual/libintl
139 + berkdb? ( || (
140 + sys-libs/db:5.3
141 + sys-libs/db:5.2
142 + sys-libs/db:5.1
143 + sys-libs/db:5.0
144 + sys-libs/db:4.8
145 + sys-libs/db:4.7
146 + sys-libs/db:4.6
147 + sys-libs/db:4.5
148 + sys-libs/db:4.4
149 + sys-libs/db:4.3
150 + sys-libs/db:4.2
151 + ) )
152 + gdbm? ( sys-libs/gdbm:0=[berkdb] )
153 + ncurses? (
154 + >=sys-libs/ncurses-5.2:0=
155 + readline? ( >=sys-libs/readline-4.1:0= )
156 + )
157 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
158 + ssl? (
159 + !libressl? ( dev-libs/openssl:0= )
160 + libressl? ( dev-libs/libressl:= )
161 + )
162 + tk? (
163 + >=dev-lang/tcl-8.0:0=
164 + >=dev-lang/tk-8.0:0=[-aqua]
165 + dev-tcltk/blt:0=
166 + dev-tcltk/tix
167 + )
168 + xml? ( >=dev-libs/expat-2.1 )
169 + !!<sys-apps/portage-2.1.9"
170 +DEPEND="${RDEPEND}
171 + virtual/pkgconfig
172 + >=sys-devel/autoconf-2.65
173 + !sys-devel/gcc[libffi(-)]"
174 +RDEPEND+=" !build? ( app-misc/mime-types )
175 + doc? ( dev-python/python-docs:${SLOT} )"
176 +PDEPEND=">=app-eselect/eselect-python-20140125-r1"
177 +
178 +S="${WORKDIR}/${MY_P}"
179 +
180 +pkg_setup() {
181 + if use berkdb; then
182 + ewarn "'bsddb' module is out-of-date and no longer maintained inside"
183 + ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
184 + ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
185 + ewarn "is provided by dev-python/bsddb3."
186 + else
187 + if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
188 + ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
189 + ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
190 + ewarn "You might need to migrate your databases."
191 + fi
192 + fi
193 +}
194 +
195 +src_prepare() {
196 + # Ensure that internal copies of expat, libffi and zlib are not used.
197 + rm -r Modules/expat || die
198 + rm -r Modules/_ctypes/libffi* || die
199 + rm -r Modules/zlib || die
200 +
201 + if tc-is-cross-compiler; then
202 + local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
203 + fi
204 +
205 + EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
206 +
207 + # if building a patched source-tar, comment the rm's above, and uncomment
208 + # this line:
209 + #local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch"
210 +
211 + # Prefix' round of patches
212 + # http://prefix.gentooexperimental.org:8000/python-patches-2_7
213 + EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
214 + epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
215 +
216 + if use aqua ; then
217 + # make sure we don't get a framework reference here
218 + sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
219 + -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
220 + Makefile.pre.in || die
221 + # Python upstream refuses to listen to configure arguments
222 + sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \
223 + configure.ac configure || die
224 + # we handle creation of symlinks in src_install
225 + sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die
226 + fi
227 + # don't try to do fancy things on Darwin
228 + sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
229 + # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
230 + sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
231 + # fix header standards conflicts on Solaris
232 + if [[ ${CHOST} == *-solaris* ]] ; then
233 + # GCC5 switched the default from gnu89 to gnu11, a standards
234 + # conflict arises from that, which can be solved by upgrading
235 + # _XOPEN_SOURCE from 500 to 600, but since it is compiler
236 + # version specific, just force the old standard onto the
237 + # compiler. Python 3 properly detects this.
238 + CC="$(tc-getCC) -std=gnu89"
239 + fi
240 +
241 + # Fix for cross-compiling.
242 + epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
243 + epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
244 + epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
245 + epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
246 + epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
247 +
248 + # Make sure python doesn't use the host libffi.
249 + use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
250 +
251 + if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
252 + local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
253 + for p in $(
254 + eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
255 + echo ${PATCH_URI}
256 + ); do
257 + # dropped by 01_all_prefix-no-patch-invention.patch
258 + [[ ${p} == *-tkinter-* ]] && continue
259 + epatch "${d}/${p}"
260 + done
261 + fi
262 +
263 + epatch_user
264 +
265 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
266 + Lib/distutils/command/install.py \
267 + Lib/distutils/sysconfig.py \
268 + Lib/site.py \
269 + Lib/sysconfig.py \
270 + Lib/test/test_site.py \
271 + Makefile.pre.in \
272 + Modules/Setup.dist \
273 + Modules/getpath.c \
274 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
275 +
276 + eautoreconf
277 +}
278 +
279 +src_configure() {
280 + # dbm module can be linked against berkdb or gdbm.
281 + # Defaults to gdbm when both are enabled, #204343.
282 + local disable
283 + use berkdb || use gdbm || disable+=" dbm"
284 + use berkdb || disable+=" _bsddb"
285 + use gdbm || disable+=" gdbm"
286 + use ncurses || disable+=" _curses _curses_panel"
287 + use readline || disable+=" readline"
288 + use sqlite || disable+=" _sqlite3"
289 + use ssl || export PYTHON_DISABLE_SSL="1"
290 + use tk || disable+=" _tkinter"
291 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
292 + [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
293 + [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs"
294 + export PYTHON_DISABLE_MODULES="${disable}"
295 +
296 + if ! use xml; then
297 + ewarn "You have configured Python without XML support."
298 + ewarn "This is NOT a recommended configuration as you"
299 + ewarn "may face problems parsing any XML documents."
300 + fi
301 +
302 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
303 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
304 + fi
305 +
306 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
307 + append-flags -fwrapv
308 + fi
309 +
310 + filter-flags -malign-double
311 +
312 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
313 + if is-flagq -O3; then
314 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
315 + use hardened && replace-flags -O3 -O2
316 + fi
317 +
318 + if tc-is-cross-compiler; then
319 + # Force some tests that try to poke fs paths.
320 + export ac_cv_file__dev_ptc=no
321 + export ac_cv_file__dev_ptmx=yes
322 + fi
323 +
324 + # http://bugs.gentoo.org/show_bug.cgi?id=302137
325 + if [[ ${CHOST} == powerpc-*-darwin* ]] && \
326 + ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \
327 + [[ ${CHOST} == powerpc64-*-darwin* ]];
328 + then
329 + replace-flags -O2 -O3
330 + replace-flags -Os -O3 # comment #14
331 + fi
332 +
333 +
334 + if use prefix ; then
335 + # for Python's setup.py not to do false assumptions (only looking in
336 + # host paths) we need to make explicit where Prefix stuff is
337 + append-cppflags -I"${EPREFIX}"/usr/include
338 + append-ldflags -L"${EPREFIX}"/$(get_libdir)
339 + append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
340 + # fix compilation on some 64-bits Linux hosts, #381163, #473520
341 + for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
342 + [[ -d ${hostlibdir} ]] || continue
343 + append-ldflags -L${hostlibdir}
344 + done
345 + # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that
346 + # local include paths - set in $(CPPFLAGS) - are searched first.
347 + sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
348 + fi
349 +
350 + # Export CC so even AIX will use gcc instead of xlc_r.
351 + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
352 + tc-export CC CXX
353 + # The configure script fails to use pkg-config correctly.
354 + # http://bugs.python.org/issue15506
355 + export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
356 +
357 + # Set LDFLAGS so we link modules with -lpython2.7 correctly.
358 + # Needed on FreeBSD unless Python 2.7 is already installed.
359 + # Please query BSD team before removing this!
360 + # On AIX this is not needed, but would record '.' as runpath.
361 + [[ ${CHOST} == *-aix* ]] ||
362 + append-ldflags "-L."
363 +
364 + local dbmliborder
365 + if use gdbm; then
366 + dbmliborder+="${dbmliborder:+:}gdbm"
367 + fi
368 + if use berkdb; then
369 + dbmliborder+="${dbmliborder:+:}bdb"
370 + fi
371 +
372 + [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
373 +
374 + # we need this to get pythonw, the GUI version of python
375 + # --enable-framework and --enable-shared are mutually exclusive:
376 + # http://bugs.python.org/issue5809
377 + local myshared=
378 + use aqua \
379 + && myshared="--enable-framework=${EPREFIX}/usr/lib" \
380 + || myshared="--enable-shared"
381 +
382 + BUILD_DIR="${WORKDIR}/${CHOST}"
383 + mkdir -p "${BUILD_DIR}" || die
384 + cd "${BUILD_DIR}" || die
385 +
386 + # note: for a framework build we need to use ucs2 because macOS
387 + # uses that internally too:
388 + # http://bugs.python.org/issue763708
389 + # HAS_HG to avoid finding obsolete hg of the host
390 + ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \
391 + econf \
392 + --with-fpectl \
393 + ${myshared} \
394 + $(use_enable ipv6) \
395 + $(use_with threads) \
396 + $( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
397 + --infodir='${prefix}/share/info' \
398 + --mandir='${prefix}/share/man' \
399 + --with-computed-gotos \
400 + --with-dbmliborder="${dbmliborder}" \
401 + --with-libc="" \
402 + --enable-loadable-sqlite-extensions \
403 + --with-system-expat \
404 + --with-system-ffi \
405 + --without-ensurepip
406 +
407 + if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
408 + eerror "configure has detected that the sem_open function is broken."
409 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
410 + die "Broken sem_open function (bug 496328)"
411 + fi
412 +}
413 +
414 +src_compile() {
415 + # Avoid invoking pgen for cross-compiles.
416 + touch Include/graminit.h Python/graminit.c
417 +
418 + cd "${BUILD_DIR}" || die
419 + emake
420 +
421 + # Work around bug 329499. See also bug 413751 and 457194.
422 + if has_version dev-libs/libffi[pax_kernel]; then
423 + pax-mark E python
424 + else
425 + pax-mark m python
426 + fi
427 +}
428 +
429 +src_test() {
430 + # Tests will not work when cross compiling.
431 + if tc-is-cross-compiler; then
432 + elog "Disabling tests due to crosscompiling."
433 + return
434 + fi
435 +
436 + cd "${BUILD_DIR}" || die
437 +
438 + # Skip failing tests.
439 + local skipped_tests="distutils gdb"
440 +
441 + for test in ${skipped_tests}; do
442 + mv "${S}"/Lib/test/test_${test}.py "${T}"
443 + done
444 +
445 + # Daylight saving time problem
446 + # https://bugs.python.org/issue22067
447 + # https://bugs.gentoo.org/610628
448 + local -x TZ=UTC
449 +
450 + # Rerun failed tests in verbose mode (regrtest -w).
451 + emake test EXTRATESTOPTS="-w" < /dev/tty
452 + local result="$?"
453 +
454 + for test in ${skipped_tests}; do
455 + mv "${T}/test_${test}.py" "${S}"/Lib/test
456 + done
457 +
458 + elog "The following tests have been skipped:"
459 + for test in ${skipped_tests}; do
460 + elog "test_${test}.py"
461 + done
462 +
463 + elog "If you would like to run them, you may:"
464 + elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
465 + elog "and run the tests separately."
466 +
467 + if [[ "${result}" -ne 0 ]]; then
468 + die "emake test failed"
469 + fi
470 +}
471 +
472 +src_install() {
473 + local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
474 +
475 + cd "${BUILD_DIR}" || die
476 + [[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/
477 + if use aqua ; then
478 + local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework
479 +
480 + # do not make multiple targets in parallel when there are broken
481 + # sharedmods (during bootstrap), would build them twice in parallel.
482 +
483 + # Python_Launcher is kind of a wrapper, and we should fix it for
484 + # Prefix (it uses /usr/bin/pythonw) so useless
485 + # IDLE doesn't run, no idea, but definitely not used
486 + sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
487 + Mac/Makefile || die
488 +
489 + # let the makefiles do their thing
490 + emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
491 + rmdir "${ED}"/Applications/Python* || die
492 + rmdir "${ED}"/Applications || die
493 +
494 + # avoid framework incompatability, degrade to a normal UNIX lib
495 + mkdir -p "${ED}"/usr/$(get_libdir)
496 + cp "${D}${fwdir}"/Versions/${SLOT}/Python \
497 + "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
498 + chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
499 + install_name_tool \
500 + -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
501 + "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
502 + chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
503 + cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
504 +
505 + # rebuild python executable to be the non-pythonw (python wrapper)
506 + # version so we don't get framework crap
507 + rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861
508 + $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
509 + -o "${ED}"/usr/bin/python${SLOT} \
510 + Modules/python.o || die
511 +
512 + # don't install the "Current" symlink, will always conflict
513 + rm "${D}${fwdir}"/Versions/Current || die
514 + # update whatever points to it, eselect-python sets them
515 + rm "${D}${fwdir}"/{Headers,Python,Resources} || die
516 +
517 + # remove unversioned files (that are not made versioned below)
518 + pushd "${ED}"/usr/bin > /dev/null
519 + rm -f python python-config python${SLOT}-config
520 + # python${SLOT} was created above
521 + for f in pythonw smtpd${SLOT}.py pydoc idle ; do
522 + rm -f ${f} ${f}${SLOT}
523 + done
524 + # pythonw needs to remain in the framework (that's the whole
525 + # reason we go through this framework hassle)
526 + ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
527 + # copy the scripts to we can fix their shebangs
528 + for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
529 + # for some reason sometimes they already exist, bug #347321
530 + rm -f ${f}
531 + cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
532 + sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
533 + ${f} || die
534 + done
535 + # "fix" to have below collision fix not to bail
536 + mv pydoc${SLOT} pydoc || die
537 + mv idle${SLOT} idle || die
538 + popd > /dev/null
539 +
540 + # basically we don't like the framework stuff at all, so just move
541 + # stuff around or add some symlinks to make our life easier
542 + mkdir -p "${ED}"/usr
543 + mv "${D}${fwdir}"/Versions/${SLOT}/share \
544 + "${ED}"/usr/ || die "can't move share"
545 + # get includes just UNIX style
546 + mkdir -p "${ED}"/usr/include
547 + mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
548 + "${ED}"/usr/include/ || die "can't move include"
549 + pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
550 + ln -s ../../../../../include/python${SLOT} || die
551 + popd > /dev/null
552 + rm -f "${ED}"/usr/share/man/man1/python{,2}.1
553 +
554 + # same for libs
555 + # NOTE: can't symlink the entire dir, because a real dir already exists
556 + # on upgrade (site-packages), however since we h4x0rzed python to
557 + # actually look into the UNIX-style dir, we just switch them around.
558 + mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
559 + mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
560 + "${ED}"/usr/$(get_libdir)/python${SLOT}/ \
561 + || die "can't move python${SLOT}"
562 + rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
563 + pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
564 + ln -s ../../../../python${SLOT} || die
565 + popd > /dev/null
566 +
567 + # fix up Makefile
568 + sed -i \
569 + -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
570 + -e '/^LDFLAGS=/s/=.*$/=/' \
571 + -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
572 + -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
573 + -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
574 + -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
575 + -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
576 + -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
577 + "${libdir}"/config/Makefile || die
578 + # and sysconfigdata likewise
579 + sed -i \
580 + -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
581 + -e "/'LDFLAGS'/s/:.*$/:'',/" \
582 + -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
583 + -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
584 + -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
585 + -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
586 + -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
587 + -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
588 + "${libdir}"/_sysconfigdata.py || die
589 +
590 + # add missing version.plist file
591 + mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
592 + cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
593 +<?xml version="1.0" encoding="UTF-8"?>
594 +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
595 +"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
596 +<plist version="1.0">
597 +<dict>
598 + <key>BuildVersion</key>
599 + <string>1</string>
600 + <key>CFBundleShortVersionString</key>
601 + <string>${PV}</string>
602 + <key>CFBundleVersion</key>
603 + <string>${PV}</string>
604 + <key>ProjectName</key>
605 + <string>Python</string>
606 + <key>SourceVersion</key>
607 + <string>${PV}</string>
608 +</dict>
609 +</plist>
610 +EOF
611 + else
612 + emake DESTDIR="${D}" altinstall
613 + fi
614 +
615 + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
616 + if [[ ${CHOST} == *-aix* ]]; then
617 + # fix upstream bugs with quite large proposed diffs still to be sorted out:
618 + # http://bugs.python.org/issue13493
619 + # http://bugs.python.org/issue14150
620 + # http://bugs.python.org/issue15590
621 + # http://bugs.python.org/issue16189
622 + sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \
623 + -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed"
624 + sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \
625 + -e 's| -bI:| -Wl,-bI:|g' \
626 + -e '/LINKFORSHARED/s|-bE:|-bI:|g' \
627 + -e '/LINKFORSHARED/s| -lld||g' \
628 + -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed"
629 + fi
630 +
631 + # Fix collisions between different slots of Python.
632 + mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
633 + mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
634 + mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
635 + rm -f "${ED}usr/bin/smtpd.py"
636 +
637 + # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
638 + # These #defines cause problems when building c99 compliant python modules
639 + # http://bugs.python.org/issue1759169
640 + [[ ${CHOST} == *-solaris* ]] && sed -i -e \
641 + 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
642 + "${ED}"/usr/include/python${SLOT}/pyconfig.h
643 +
644 + use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
645 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
646 + use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
647 + use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
648 +
649 + use threads || rm -r "${libdir}/multiprocessing" || die
650 + use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
651 +
652 + dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
653 +
654 + if use examples; then
655 + insinto /usr/share/doc/${PF}/examples
656 + doins -r "${S}"/Tools
657 + fi
658 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
659 + local libname
660 + if use aqua ; then
661 + # we do framework, so the emake trick below returns a pathname
662 + # since that won't work here, use a (cheap) trick instead
663 + libname=libpython${SLOT}
664 + else
665 + libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
666 + emake --no-print-directory -s -f - 2>/dev/null)
667 + fi
668 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
669 +
670 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
671 + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
672 + sed \
673 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
674 + -e "s:@PYDOC@:pydoc${SLOT}:" \
675 + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
676 +
677 + # for python-exec
678 + local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
679 +
680 + # if not using a cross-compiler, use the fresh binary
681 + if ! tc-is-cross-compiler; then
682 + local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
683 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
684 + local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}.
685 + else
686 + vars=( PYTHON "${vars[@]}" )
687 + fi
688 +
689 + python_export "python${SLOT}" "${vars[@]}"
690 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
691 + python_domodule epython.py
692 +
693 + # python-exec wrapping support
694 + local pymajor=${SLOT%.*}
695 + mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
696 + # python and pythonX
697 + ln -s "../../../bin/python${SLOT}" \
698 + "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
699 + ln -s "python${pymajor}" \
700 + "${D}${PYTHON_SCRIPTDIR}/python" || die
701 + # python-config and pythonX-config
702 + ln -s "../../../bin/python${SLOT}-config" \
703 + "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
704 + ln -s "python${pymajor}-config" \
705 + "${D}${PYTHON_SCRIPTDIR}/python-config" || die
706 + # 2to3, pydoc, pyvenv
707 + ln -s "../../../bin/2to3-${SLOT}" \
708 + "${D}${PYTHON_SCRIPTDIR}/2to3" || die
709 + ln -s "../../../bin/pydoc${SLOT}" \
710 + "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
711 + # idle
712 + if use tk; then
713 + ln -s "../../../bin/idle${SLOT}" \
714 + "${D}${PYTHON_SCRIPTDIR}/idle" || die
715 + fi
716 +}
717 +
718 +eselect_python_update() {
719 + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
720 + eselect python update
721 + fi
722 +
723 + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
724 + eselect python update --python${PV%%.*}
725 + fi
726 +}
727 +
728 +pkg_postinst() {
729 + eselect_python_update
730 +}
731 +
732 +pkg_postrm() {
733 + eselect_python_update
734 +}