1 |
commit: 0f6956814596cf91cff853a23ad8bef530a2c662 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 29 19:58:08 2017 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 29 19:58:08 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=0f695681 |
7 |
|
8 |
dev-lang/python: bump to 3.6.3 |
9 |
|
10 |
Package-Manager: Portage-2.3.13-prefix, Repoman-2.3.4 |
11 |
|
12 |
dev-lang/python/Manifest | 3 + |
13 |
dev-lang/python/files/3.6-blake2.patch | 37 +++ |
14 |
dev-lang/python/python-3.6.3.ebuild | 407 +++++++++++++++++++++++++++++++++ |
15 |
3 files changed, 447 insertions(+) |
16 |
|
17 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
18 |
index d8a1cbde99..221586ae58 100644 |
19 |
--- a/dev-lang/python/Manifest |
20 |
+++ b/dev-lang/python/Manifest |
21 |
@@ -7,6 +7,7 @@ DIST Python-3.4.5.tar.xz 14516820 SHA256 ee64b1c8a47461009abf25252332d29a4e587cb |
22 |
DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f |
23 |
DIST Python-3.5.2.tar.xz 15222676 SHA256 0010f56100b9b74259ebcd5d4b295a32324b58b517403a10d1a2aa7cb22bca40 SHA512 c07c3366f1c81e214241444bb9da6db9d11da32ad66bfa29cdad5a3b2e34e4d870bda6d4ce3c3910b582942e91f1d8c8a1c1a7b9464cc147b83c9e0007012742 WHIRLPOOL cf55d67f362b6a7529d43bb5aa8014c8349be190c6d4dae9d48de1679ab8623087478f41686cdced981cf18bb3d107052732cd437ff31ba5de2cc06b04ec2289 |
24 |
DIST Python-3.5.4.tar.xz 15332320 SHA256 94d93bfabb3b109f8a10365a325f920f9ec98c6e2380bf228f9700a14054c84c SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff WHIRLPOOL 63bca2b7b6f5da024c30f84d7e4152a37232e3b277fc5ec58ede9a1da57a44e31bb5f2e5ee33874328526f8d7fdd05dc12df5c69fb827394d5b57907671d3dd3 |
25 |
+DIST Python-3.6.3.tar.xz 16974296 SHA256 cda7d967c9a4bfa52337cdf551bcc5cff026b6ac50a8834e568ce4a794ca81da SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b WHIRLPOOL cdd04d265568d577e97ce921bef63e78c493f05426adcc8bc2bb1e5dbf02e35c3a4361ff467b7021e917e5056cd12d75cb038e5977093649881f8c2c5aabcc28 |
26 |
DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77 |
27 |
DIST python-gentoo-patches-2.7.12-0.tar.xz 13576 SHA256 cd842eec7202df57c153adc1fbb81e70b26ef651f8e9346e065d8577b93f343b SHA512 8bf530fca15c47fa5d9bc958e433b35943a12c98e4172806a45aa60dc85ec92f8ab6ffcd90f752dc5bf8ffc711414894c15820c4b6ef72dbcedc2808119fb1f6 WHIRLPOOL 54b8ca6a4371d460dadccfdffcc096c12930d58714eef95117a658d7a1337ea89c45c69553b5b993017211faaa0f8d670e09a8452e53c0fb176be3e908524ee6 |
28 |
DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1 |
29 |
@@ -14,6 +15,7 @@ DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 SHA256 84ee7630670a1dac4bbbc55fa |
30 |
DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc |
31 |
DIST python-gentoo-patches-3.5.2-0.tar.xz 12008 SHA256 eb898fb448bd40f086ae2910e94c608faa932eb377fe40bd34f4390b4c37aac1 SHA512 e2ef1b8f10f9ea849bf52a0be65d48f7cfecf07bdf151cbbd7e3a1c9428a8d96e901650496c4ae7fd0093af8cc90de8df674dc1a4c66ad21916a4ee45a81efc8 WHIRLPOOL 66b99c7c50e3eaca783f773349b3e8a357f706a7da6a66bd2e0a53946bc81d965ac99d8fd4c50ba7e42052aa84508c8aede5eacedbb95f040a48cf1a5de6b6b0 |
32 |
DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 SHA256 30c9dbcd5c11ed025b9d8dd201da84c5b9f9756f9b6ba77ccaebc6b79a91e320 SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec WHIRLPOOL 2191dc89805c1bc11d125005a5c5dd0e5fe635eb0a3d6698bef8b55f54741edc3b3e2588bb21f5eda517963489c15296cd5fd265c8a548d78be6093698e6b002 |
33 |
+DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 SHA256 56729f9848557c52361c71404e5583368f6a0e93b5b6c2e643b59cb079e253d9 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3 WHIRLPOOL 90d1f12bee812f350ca0330a97290ce0d5c5fa9ccd816441944f042ef561d9023f4b79239f6d559f38a486fea458e48bf11d33d5bd6fa605875b686a2a845bd1 |
34 |
DIST python-prefix-2.7.11-gentoo-patches-r1.tar.xz 17268 SHA256 ecebc430e475030fdbfcd940f314f80ebcb8c6e01a6b2498478bb8f37e525484 SHA512 22218128ff83856dd042ecd6aab3615282ab29c4420e6cce4a0bba8b6508e3f5649c27cdf50cf342fffd3c87ea29f8b7d32d28b9b1f4dc200771b52ee41f27e5 WHIRLPOOL 2a942b39e56955df5b24f50d68a39ca78152e10f13ccc856340cd4651eb87847097ec3ff79efde81c2130b12f2885764194fb8d51c05278f4acc550bcd4ba032 |
35 |
DIST python-prefix-2.7.12-gentoo-patches-r0.tar.xz 17380 SHA256 c488011046a678eaf2febe3d02726a0efbd2f8378a0c5b896b03bcbed5b5f00a SHA512 ef17c8e8083da0ed0e6a63c96f59cc1243b0376fc6d4d7fcecb165e557403c54ae87625ed6dfe4d7d73693f8220ec98ef8a3f16124d8022dbac6a3a9d5514d9c WHIRLPOOL 7e427be36a8d558193058d7112f704993474eff7bb554b6f2f0d9cfe085c653a9cf0522a33249a92e813fad667a53439c9f70d74bcde0df9f78824bfbbfaae46 |
36 |
DIST python-prefix-3.4.3-gentoo-patches-r1.tar.xz 12896 SHA256 39da669913d8627a74e6d9a7e1ee6eae3e184d7525097090d4b05a71b0a79100 SHA512 dd1082ef9605fdcb84bcc769318be6934c889a5b6134971fb121b3be8301cb9519fb687841a359c65e0614d05a8c27eab4b3dbfe94ed8dbbf2fc64f82206a6d9 WHIRLPOOL 884f0e9e5e177543c74f3c3e87629113db6c53c556f55bf7310de79f101fa825472d886eea216cea471e981dc4fd6743622e1c7472b5ffe04eda4c6790d73c62 |
37 |
@@ -21,3 +23,4 @@ DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 SHA256 ab0b1f138c8bd22b2 |
38 |
DIST python-prefix-3.5.1-gentoo-patches-r2.tar.xz 12680 SHA256 73b1166eded9867b473c90171b613d32bbe8f72e523c74b1563a9c25c555e13b SHA512 82b08b8cf7f3620c4c2a6a6c3ed5ec8c3318c6f43e4bcc4950c7aeb56ec755e0e47d46f068843f5b04159583994c8620dab14827278a199789a3867532cc6e0c WHIRLPOOL ac4ea106ca744d6e154e14a53ae2e8eeb119207069ead95d0ef19657a58e1d31ed1933de6315ab61ce532c11d1ae4a999c73d34121028a0a246b7dd2b1ac857a |
39 |
DIST python-prefix-3.5.2-gentoo-patches-r0.tar.xz 12652 SHA256 2a1288ef4b50c0dd679e29912cff93cfd168f9d843dc3090751460968cf40d7c SHA512 e214583393aaf6ec603495531fd2c8d3c668c1fc72c4e3226a4daa537ad34e763302d7110b9ca8a58eb77955aad22371f6cf13247c6d06350f56989301faae8b WHIRLPOOL 4fb513181557fe3be4cf3a3fe12cac5b99bfc7365c37df28a8b30e05a2b58ec74d9b2e8e6c9a7ecfca643c3ab477d2b65b27e4a33f929f28f9749611d913b04a |
40 |
DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 SHA256 cb62db1caaa01aeab6a9e5264d2873eff1c194f9d6fb8e6e1bce0e515a8611ad SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5 WHIRLPOOL 295187be131a3f89597e68072687bf1f1140757798230cc76cedb964fe810642b4b4c81d190d92fd40927542d8024c9d7ad877224d2c0ab8702d2435b3fd5b6e |
41 |
+DIST python-prefix-3.6.3-gentoo-patches-r0.tar.xz 12676 SHA256 8f35037e2a425f455cceca72a658ca49ecb17cebafb57103fa10cbf1c593a414 SHA512 9d1673bc7b327be6b7e95491940eeeaa40db9e94f2183f4605a9a5a7fd2e187017164e9b2ef31f3bc8d694e467de6843706d3341b4ce24d4d8717513c246b62f WHIRLPOOL c829b3d03817c8eb60e328b3567968c5fa874db0d03eeaef28fca7198109e5708e30a61b63c4254b2da84c5020894401909e7819d3f340f5d0fcdaa0ae0eb87b |
42 |
|
43 |
diff --git a/dev-lang/python/files/3.6-blake2.patch b/dev-lang/python/files/3.6-blake2.patch |
44 |
new file mode 100644 |
45 |
index 0000000000..48ee585595 |
46 |
--- /dev/null |
47 |
+++ b/dev-lang/python/files/3.6-blake2.patch |
48 |
@@ -0,0 +1,37 @@ |
49 |
+From 2e7c906c085a01ea8175a19e1e143257abc8f566 Mon Sep 17 00:00:00 2001 |
50 |
+From: Mike Gilbert <floppym@g.o> |
51 |
+Date: Sun, 30 Jul 2017 11:17:39 -0400 |
52 |
+Subject: [PATCH] blake2: remove commented code |
53 |
+ |
54 |
+The nested comments cause a build failure. |
55 |
+ |
56 |
+Bug: https://bugs.gentoo.org/608586 |
57 |
+--- |
58 |
+ Modules/_blake2/impl/blake2s-load-xop.h | 11 ----------- |
59 |
+ 1 file changed, 11 deletions(-) |
60 |
+ |
61 |
+diff --git a/Modules/_blake2/impl/blake2s-load-xop.h b/Modules/_blake2/impl/blake2s-load-xop.h |
62 |
+index a3b5d65e2d..7e76c399c6 100644 |
63 |
+--- a/Modules/_blake2/impl/blake2s-load-xop.h |
64 |
++++ b/Modules/_blake2/impl/blake2s-load-xop.h |
65 |
+@@ -18,17 +18,6 @@ |
66 |
+ |
67 |
+ #define TOB(x) ((x)*4*0x01010101 + 0x03020100) /* ..or not TOB */ |
68 |
+ |
69 |
+-/* Basic VPPERM emulation, for testing purposes */ |
70 |
+-/*static __m128i _mm_perm_epi8(const __m128i src1, const __m128i src2, const __m128i sel) |
71 |
+-{ |
72 |
+- const __m128i sixteen = _mm_set1_epi8(16); |
73 |
+- const __m128i t0 = _mm_shuffle_epi8(src1, sel); |
74 |
+- const __m128i s1 = _mm_shuffle_epi8(src2, _mm_sub_epi8(sel, sixteen)); |
75 |
+- const __m128i mask = _mm_or_si128(_mm_cmpeq_epi8(sel, sixteen), |
76 |
+- _mm_cmpgt_epi8(sel, sixteen)); /* (>=16) = 0xff : 00 */ |
77 |
+- return _mm_blendv_epi8(t0, s1, mask); |
78 |
+-}*/ |
79 |
+- |
80 |
+ #define LOAD_MSG_0_1(buf) \ |
81 |
+ buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) ); |
82 |
+ |
83 |
+-- |
84 |
+2.13.3 |
85 |
+ |
86 |
|
87 |
diff --git a/dev-lang/python/python-3.6.3.ebuild b/dev-lang/python/python-3.6.3.ebuild |
88 |
new file mode 100644 |
89 |
index 0000000000..6cf6bb0a9a |
90 |
--- /dev/null |
91 |
+++ b/dev-lang/python/python-3.6.3.ebuild |
92 |
@@ -0,0 +1,407 @@ |
93 |
+# Copyright 1999-2017 Gentoo Foundation |
94 |
+# Distributed under the terms of the GNU General Public License v2 |
95 |
+ |
96 |
+EAPI="5" |
97 |
+WANT_LIBTOOL="none" |
98 |
+ |
99 |
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs |
100 |
+ |
101 |
+MY_P="Python-${PV}" |
102 |
+PATCHSET_VERSION="3.6.2-0" |
103 |
+PREFIX_PATCHREV="r0" |
104 |
+ |
105 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
106 |
+HOMEPAGE="https://www.python.org/" |
107 |
+SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
108 |
+ https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz |
109 |
+ https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" |
110 |
+ |
111 |
+LICENSE="PSF-2" |
112 |
+SLOT="3.6/3.6m" |
113 |
+KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
114 |
+IUSE="aqua build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk wininst +xml" |
115 |
+ |
116 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
117 |
+# If you need to apply a patch which requires python for bootstrapping, please |
118 |
+# run the bootstrap code on your dev box and include the results in the |
119 |
+# patchset. See bug 447752. |
120 |
+ |
121 |
+RDEPEND="app-arch/bzip2:0= |
122 |
+ app-arch/xz-utils:0= |
123 |
+ >=sys-libs/zlib-1.1.3:0= |
124 |
+ virtual/libffi |
125 |
+ virtual/libintl |
126 |
+ gdbm? ( sys-libs/gdbm:0=[berkdb] ) |
127 |
+ ncurses? ( |
128 |
+ >=sys-libs/ncurses-5.2:0= |
129 |
+ readline? ( >=sys-libs/readline-4.1:0= ) |
130 |
+ ) |
131 |
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
132 |
+ ssl? ( |
133 |
+ !libressl? ( dev-libs/openssl:0= ) |
134 |
+ libressl? ( dev-libs/libressl:= ) |
135 |
+ ) |
136 |
+ tk? ( |
137 |
+ >=dev-lang/tcl-8.0:0= |
138 |
+ >=dev-lang/tk-8.0:0=[-aqua] |
139 |
+ dev-tcltk/blt:0= |
140 |
+ dev-tcltk/tix |
141 |
+ ) |
142 |
+ xml? ( >=dev-libs/expat-2.1:0= ) |
143 |
+ !!<sys-apps/sandbox-2.6-r1" |
144 |
+DEPEND="${RDEPEND} |
145 |
+ virtual/pkgconfig |
146 |
+ !sys-devel/gcc[libffi(-)]" |
147 |
+RDEPEND+=" !build? ( app-misc/mime-types )" |
148 |
+PDEPEND=">=app-eselect/eselect-python-20140125-r1" |
149 |
+ |
150 |
+S="${WORKDIR}/${MY_P}" |
151 |
+PYVER=${SLOT%/*} |
152 |
+ |
153 |
+src_prepare() { |
154 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
155 |
+ rm -fr Modules/expat |
156 |
+ rm -fr Modules/_ctypes/libffi* |
157 |
+ rm -fr Modules/zlib |
158 |
+ |
159 |
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
160 |
+ epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch" |
161 |
+ epatch "${FILESDIR}/3.6-blake2.patch" |
162 |
+ |
163 |
+ epatch_user |
164 |
+ |
165 |
+ # Prefix' round of patches |
166 |
+ # http://prefix.gentooexperimental.org:8000/python-patches-3_3 |
167 |
+ EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
168 |
+ epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV} |
169 |
+ |
170 |
+ # we provide a fully working readline also on Darwin, so don't force |
171 |
+ # usage of less functional libedit |
172 |
+ sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die |
173 |
+ |
174 |
+ # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR. |
175 |
+ sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die |
176 |
+ |
177 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
178 |
+ Lib/distutils/command/install.py \ |
179 |
+ Lib/distutils/sysconfig.py \ |
180 |
+ Lib/site.py \ |
181 |
+ Lib/sysconfig.py \ |
182 |
+ Lib/test/test_site.py \ |
183 |
+ Makefile.pre.in \ |
184 |
+ Modules/Setup.dist \ |
185 |
+ Modules/getpath.c \ |
186 |
+ configure.ac \ |
187 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
188 |
+ |
189 |
+ # workaround a development build env problem and muck around |
190 |
+ # framework install to get the best of both worlds (non-standard) |
191 |
+ sed -i \ |
192 |
+ -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \ |
193 |
+ -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \ |
194 |
+ configure.ac configure || die |
195 |
+ sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die |
196 |
+ |
197 |
+ # Disable ABI flags. |
198 |
+ sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed" |
199 |
+ |
200 |
+ eautoreconf |
201 |
+} |
202 |
+ |
203 |
+src_configure() { |
204 |
+ local disable |
205 |
+ use gdbm || disable+=" gdbm" |
206 |
+ use ncurses || disable+=" _curses _curses_panel" |
207 |
+ use readline || disable+=" readline" |
208 |
+ use sqlite || disable+=" _sqlite3" |
209 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
210 |
+ use tk || disable+=" _tkinter" |
211 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
212 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
213 |
+ |
214 |
+ if ! use xml; then |
215 |
+ ewarn "You have configured Python without XML support." |
216 |
+ ewarn "This is NOT a recommended configuration as you" |
217 |
+ ewarn "may face problems parsing any XML documents." |
218 |
+ fi |
219 |
+ |
220 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
221 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
222 |
+ fi |
223 |
+ |
224 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
225 |
+ append-flags -fwrapv |
226 |
+ fi |
227 |
+ |
228 |
+ filter-flags -malign-double |
229 |
+ |
230 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
231 |
+ if is-flagq -O3; then |
232 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
233 |
+ use hardened && replace-flags -O3 -O2 |
234 |
+ fi |
235 |
+ |
236 |
+ # Export CC so even AIX will use gcc instead of xlc_r. |
237 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
238 |
+ tc-export CC CXX |
239 |
+ |
240 |
+ # Set LDFLAGS so we link modules with -lpython3.2 correctly. |
241 |
+ # Needed on FreeBSD unless Python 3.2 is already installed. |
242 |
+ # Please query BSD team before removing this! |
243 |
+ append-ldflags "-L." |
244 |
+ |
245 |
+ # make sure setup.py considers Prefix' paths before system ones |
246 |
+ use prefix && append-cppflags -I"${EPREFIX}"/usr/include |
247 |
+ use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib |
248 |
+ |
249 |
+ local dbmliborder |
250 |
+ if use gdbm; then |
251 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
252 |
+ fi |
253 |
+ |
254 |
+ if use aqua ; then |
255 |
+ ECONF_SOURCE="${S}" OPT="" \ |
256 |
+ econf \ |
257 |
+ --enable-framework="${EPREFIX}"/usr/lib \ |
258 |
+ --config-cache |
259 |
+ fi |
260 |
+ |
261 |
+ # pymalloc #452720 |
262 |
+ local myeconfargs=( |
263 |
+ $(use aqua && echo --config-cache) \ |
264 |
+ --with-fpectl |
265 |
+ --enable-shared |
266 |
+ $(use_enable ipv6) |
267 |
+ $(use_with threads) |
268 |
+ --infodir='${prefix}/share/info' |
269 |
+ --mandir='${prefix}/share/man' |
270 |
+ --with-computed-gotos |
271 |
+ --with-dbmliborder="${dbmliborder}" |
272 |
+ --with-libc= |
273 |
+ --enable-loadable-sqlite-extensions |
274 |
+ --without-ensurepip |
275 |
+ --with-system-expat |
276 |
+ --with-system-ffi |
277 |
+ --without-pymalloc |
278 |
+ ) |
279 |
+ |
280 |
+ OPT="" econf "${myeconfargs[@]}" |
281 |
+ |
282 |
+ if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
283 |
+ eerror "configure has detected that the sem_open function is broken." |
284 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
285 |
+ die "Broken sem_open function (bug 496328)" |
286 |
+ fi |
287 |
+} |
288 |
+ |
289 |
+src_compile() { |
290 |
+ # Ensure sed works as expected |
291 |
+ # https://bugs.gentoo.org/594768 |
292 |
+ local -x LC_ALL=C |
293 |
+ |
294 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
295 |
+ |
296 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
297 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
298 |
+ pax-mark E python |
299 |
+ else |
300 |
+ pax-mark m python |
301 |
+ fi |
302 |
+} |
303 |
+ |
304 |
+src_test() { |
305 |
+ # Tests will not work when cross compiling. |
306 |
+ if tc-is-cross-compiler; then |
307 |
+ elog "Disabling tests due to crosscompiling." |
308 |
+ return |
309 |
+ fi |
310 |
+ |
311 |
+ # Skip failing tests. |
312 |
+ local skipped_tests="gdb" |
313 |
+ |
314 |
+ for test in ${skipped_tests}; do |
315 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
316 |
+ done |
317 |
+ |
318 |
+ local -x PYTHONDONTWRITEBYTECODE= |
319 |
+ |
320 |
+ emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
321 |
+ local result=$? |
322 |
+ |
323 |
+ for test in ${skipped_tests}; do |
324 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
325 |
+ done |
326 |
+ |
327 |
+ elog "The following tests have been skipped:" |
328 |
+ for test in ${skipped_tests}; do |
329 |
+ elog "test_${test}.py" |
330 |
+ done |
331 |
+ |
332 |
+ elog "If you would like to run them, you may:" |
333 |
+ elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'" |
334 |
+ elog "and run the tests separately." |
335 |
+ |
336 |
+ if [[ ${result} -ne 0 ]]; then |
337 |
+ die "emake test failed" |
338 |
+ fi |
339 |
+} |
340 |
+ |
341 |
+src_install() { |
342 |
+ local libdir=${ED}/usr/$(get_libdir)/python${PYVER} |
343 |
+ |
344 |
+ emake DESTDIR="${D}" altinstall |
345 |
+ |
346 |
+ if use aqua ; then |
347 |
+ # avoid config.status to be triggered |
348 |
+ find Mac -name "Makefile" -exec touch \{\} + || die |
349 |
+ |
350 |
+ # Python_Launcher is kind of a wrapper, and we should fix it for |
351 |
+ # Prefix (it uses /usr/bin/pythonw) so useless |
352 |
+ # IDLE doesn't run, no idea, but definitely not used |
353 |
+ emake DESTDIR="${D}" -C Mac install_Python || die |
354 |
+ rmdir "${ED}"/Applications/Python* || die |
355 |
+ rmdir "${ED}"/Applications || die |
356 |
+ |
357 |
+ local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER} |
358 |
+ ln -s "${EPREFIX}"/usr/include/python${PYVER} \ |
359 |
+ "${ED}${fwdir}"/Headers || die |
360 |
+ ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \ |
361 |
+ "${ED}${fwdir}"/Python || die |
362 |
+ fi |
363 |
+ |
364 |
+ sed \ |
365 |
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
366 |
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
367 |
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
368 |
+ |
369 |
+ # Fix collisions between different slots of Python. |
370 |
+ rm -f "${ED}usr/$(get_libdir)/libpython3.so" |
371 |
+ |
372 |
+ # Cheap hack to get version with ABIFLAGS |
373 |
+ local abiver=$(cd "${ED}usr/include"; echo python*) |
374 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
375 |
+ # Replace python3.X with a symlink to python3.Xm |
376 |
+ rm "${ED}usr/bin/python${PYVER}" || die |
377 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
378 |
+ # Create python3.X-config symlink |
379 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
380 |
+ # Create python-3.5m.pc symlink |
381 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
382 |
+ fi |
383 |
+ |
384 |
+ # python seems to get rebuilt in src_install (bug 569908) |
385 |
+ # Work around it for now. |
386 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
387 |
+ pax-mark E "${ED}usr/bin/${abiver}" |
388 |
+ else |
389 |
+ pax-mark m "${ED}usr/bin/${abiver}" |
390 |
+ fi |
391 |
+ |
392 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
393 |
+ use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
394 |
+ |
395 |
+ use threads || rm -r "${libdir}/multiprocessing" || die |
396 |
+ use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die |
397 |
+ |
398 |
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
399 |
+ |
400 |
+ if use examples; then |
401 |
+ insinto /usr/share/doc/${PF}/examples |
402 |
+ find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr |
403 |
+ doins -r "${S}"/Tools |
404 |
+ fi |
405 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
406 |
+ if use aqua ; then |
407 |
+ # we do framework, so the emake trick below returns a pathname |
408 |
+ # since that won't work here, use a (cheap) trick instead |
409 |
+ local libname=libpython${PYVER} |
410 |
+ else |
411 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
412 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
413 |
+ fi |
414 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
415 |
+ |
416 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
417 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
418 |
+ sed \ |
419 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
420 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
421 |
+ -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed" |
422 |
+ |
423 |
+ # for python-exec |
424 |
+ local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) |
425 |
+ |
426 |
+ # if not using a cross-compiler, use the fresh binary |
427 |
+ if ! tc-is-cross-compiler; then |
428 |
+ local -x PYTHON=./python |
429 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
430 |
+ local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}. |
431 |
+ else |
432 |
+ vars=( PYTHON "${vars[@]}" ) |
433 |
+ fi |
434 |
+ |
435 |
+ python_export "python${PYVER}" "${vars[@]}" |
436 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
437 |
+ python_domodule epython.py |
438 |
+ |
439 |
+ # python-exec wrapping support |
440 |
+ local pymajor=${PYVER%.*} |
441 |
+ mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die |
442 |
+ # python and pythonX |
443 |
+ ln -s "../../../bin/${abiver}" \ |
444 |
+ "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die |
445 |
+ ln -s "python${pymajor}" \ |
446 |
+ "${D}${PYTHON_SCRIPTDIR}/python" || die |
447 |
+ # python-config and pythonX-config |
448 |
+ # note: we need to create a wrapper rather than symlinking it due |
449 |
+ # to some random dirname(argv[0]) magic performed by python-config |
450 |
+ cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die |
451 |
+ #!/bin/sh |
452 |
+ exec "${abiver}-config" "\${@}" |
453 |
+ EOF |
454 |
+ chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die |
455 |
+ ln -s "python${pymajor}-config" \ |
456 |
+ "${D}${PYTHON_SCRIPTDIR}/python-config" || die |
457 |
+ # 2to3, pydoc, pyvenv |
458 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
459 |
+ "${D}${PYTHON_SCRIPTDIR}/2to3" || die |
460 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
461 |
+ "${D}${PYTHON_SCRIPTDIR}/pydoc" || die |
462 |
+ ln -s "../../../bin/pyvenv-${PYVER}" \ |
463 |
+ "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die |
464 |
+ # idle |
465 |
+ if use tk; then |
466 |
+ ln -s "../../../bin/idle${PYVER}" \ |
467 |
+ "${D}${PYTHON_SCRIPTDIR}/idle" || die |
468 |
+ fi |
469 |
+} |
470 |
+ |
471 |
+pkg_preinst() { |
472 |
+ if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then |
473 |
+ python_updater_warning="1" |
474 |
+ fi |
475 |
+} |
476 |
+ |
477 |
+eselect_python_update() { |
478 |
+ if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
479 |
+ eselect python update |
480 |
+ fi |
481 |
+ |
482 |
+ if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
483 |
+ eselect python update --python${PV%%.*} |
484 |
+ fi |
485 |
+} |
486 |
+ |
487 |
+pkg_postinst() { |
488 |
+ eselect_python_update |
489 |
+ |
490 |
+ if [[ "${python_updater_warning}" == "1" ]]; then |
491 |
+ ewarn "You have just upgraded from an older version of Python." |
492 |
+ ewarn |
493 |
+ ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." |
494 |
+ fi |
495 |
+} |
496 |
+ |
497 |
+pkg_postrm() { |
498 |
+ eselect_python_update |
499 |
+} |