1 |
commit: d2dc297b3648001be1cf39fcef2b75e56441e8cb |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 6 18:16:44 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 6 18:16:44 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2dc297b |
7 |
|
8 |
dev-lang/python: Bump to 3.10.5 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-lang/python/Manifest | 3 + |
13 |
dev-lang/python/python-3.10.5.ebuild | 414 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 417 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index 63071f2e2b09..e7f695bea471 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -2,6 +2,8 @@ DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381 |
21 |
DIST Python-2.7.18.tar.xz.asc 833 BLAKE2B 1d98770e46171971fb99994508d238c01d2755281d2f94353314014d9e83e0ec5f0b3e3950ea1fdf5fce9ba6b8f55312355845c2a3fc4291c27ee56fe6215448 SHA512 c2a5f5a52f47dec52460ad3275758d4e5de6e7075c3def4353c988d74d563a39b42cae2d5eb24e2a23a6247cef69100f91620b11a49c2359fbf99b203c9cbda8 |
22 |
DIST Python-3.10.4.tar.xz 19342692 BLAKE2B c430ad9bed71729fda29433af0614b6c0110a85e23f4cb5cff3a9b501febe99b20094367a5428f256fb3aeef97f34d439ef677fc8ae4d596d52da7976b65ebb5 SHA512 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113 |
23 |
DIST Python-3.10.4.tar.xz.asc 833 BLAKE2B 289f2e96bfc2b60c4ae94b1591779d604f203890c4f5db2ee16e305bf03c6ddb9c8d6da4471a06b5943e12888f37ca572ea30876e9a80382a26814f66b41b7bf SHA512 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d |
24 |
+DIST Python-3.10.5.tar.xz 19361320 BLAKE2B 7f3629f8a16faeb0311947b7d5162bc45d9ed6b2c051f776027d01ebbbdd42e4849efd67921fa57975f68ec67dc34f3135345ce216f2d3f02bfcfa4245d266f1 SHA512 aa7f58a9b31de9824185b3e7bfa7da0dcf64ae9e89840664eae9d98d9048a650fa012cd5b873a62ff44b65b856db86f095c4003117406ec5e9583ec5f7e78e90 |
25 |
+DIST Python-3.10.5.tar.xz.asc 833 BLAKE2B 36da2d557a5c38cfc473b2138412f9bc011d19c8538475e623bf41d81eb2c8f8e977945a3065a48c5b234d2b2c7d0dd5e83112c948591628cec344651dc9055c SHA512 72d0ab09900e2a10b85ccac804efd5536251152798e7347576e0e28bff4ab4a84b08d646329b225f9949047586686f9f4e7f05652526657a0948951b739c14e0 |
26 |
DIST Python-3.11.0b1.tar.xz 19416160 BLAKE2B b0eeb2d9ee9d54def7bf555d9d0dc9f343e98b48b77ce4d9a9ec5b7c45a4bfb11e70159cca8a4e384f8d21678f210dcaca5016f68ac59859a1bf336148498dc0 SHA512 f59f2905315593b2f486827ed7a1ffcce9e0faaac671c16026373c3e40d1e1c7b3e1f3384c2fbcbff8acc72c2466cd11c20fd04fbb6e839510d85966b38ebbf1 |
27 |
DIST Python-3.11.0b1.tar.xz.asc 833 BLAKE2B d2e9fe9271d916133e3e9e13cef72af193cd3fd870143702f200ab77f14e85d1fdae2a59d12a62a361cc38f2a70d03aa0225f57f4c56c6ecdec9e687f9db245b SHA512 e47f2ad1ebc98681f82de74250b5d890e13d1c3c3573da24a4e646f9cdd41e035b9405646e0aee331df120d977f544a215df370b7a4b203082cf489776eca5ff |
28 |
DIST Python-3.11.0b2.tar.xz 19529360 BLAKE2B be2bb1b111d8fca4fe1a9d141c9ac82c9d7465ceed56955642d9addd946ac688cca97994c643ba6a66c42bed5516a12dfd273641304f4a8608e8ac60c48c876e SHA512 3298b2fe66fb04435138b995174245648f38f2bb75e2a8d8c4bcacf2d4510734b90e860dc37347eef22e298fa5772374238559815bbf546fb4fe9c1f0dd952f0 |
29 |
@@ -19,6 +21,7 @@ DIST Python-3.9.13.tar.xz.asc 833 BLAKE2B db01c01be9d56cd15f9ab4a9e2cfa800faf4eb |
30 |
DIST python-gentoo-patches-2.7.18_p15.tar.xz 34956 BLAKE2B d173f276dd9c0ce31004dcc55a0d18e9ce25a47683c2df3c4dd62e967dfbbb35be59a2f08cf20f30a19475a8a2344dd95b17400eafa88b5fdbe9270a12ccbf32 SHA512 d9386808265f978808e5c0ffd384cefe54fb0e05aeccfd394167d5227d9cd66e25c8e93c54914762b2cfc3c2dd851b26a7a84d62634c6aa8a0798aacbb7ac25f |
31 |
DIST python-gentoo-patches-3.10.4.tar.xz 8592 BLAKE2B 67fba3e1fedb17430e5cd93da995b4acaf714db512031b5a2f775a25f793f007941561663cfa413d645ccddc2e22d65d250a40fa166cafda8805488d877ff57d SHA512 3ed2b8ff8f1eb8febe7dcd4b5d13d6d54468be1d525f8f1118977d3bbc78f690a597b09383939d023b03380a306e4bff1693382e29ff562312d803305b1709b2 |
32 |
DIST python-gentoo-patches-3.10.4_p1.tar.xz 9648 BLAKE2B e89fa6d4d0d56614242e23d112931cab3447db258548f86e6d09af3db95a3c4f97bb4a939659b85fcc897c0ce4d613c5d55af5da3ae2bd074c2cfc91210d4d34 SHA512 d6bb91ce471cb01891bf5bc1f03914714a34e6a1780f279b937dfb21aea1cf65d84c89c792e0d46286f3c9030ad99bc42b2657aa7e8c6bf0ed0d973b381fb5f9 |
33 |
+DIST python-gentoo-patches-3.10.5.tar.xz 8584 BLAKE2B d4a812a33e485b1eae5629e519dca4dc6625b743b07c7f7bbc62562f345d87723ba499893702310b1e96e443d2946e27a8d4971f32ca1125d4827d0d594ccaa6 SHA512 77f0478f7d0491e103857a83a97d6e04a9ec68740a7f9357cbbdd316462e7d98ea8236bd05a30e7556457ece5fbcfa4a7a78a25d4eb12779455ce2bb5b6f30d0 |
34 |
DIST python-gentoo-patches-3.11.0b1.tar.xz 3324 BLAKE2B aa54baab51376b63d7ec4783f9dd9d18581a07c935aaf3619d009d32e754b3a54cbcc2b4f9b0dd556bb91f74198a27ebee4e31baaac04907ba0f1fa87ad04121 SHA512 d609d95fe2e89550f70bb0cb3e4b468e571d00fa3e8a60020193a048c089685b7452146d8bb51e5e39203f08b0b53c661c156ba7711bdd7b107ceebd4ceec440 |
35 |
DIST python-gentoo-patches-3.11.0b2.tar.xz 3324 BLAKE2B 6368fed7be55e0a04d19be09fe1a935ecba5f6f7a12ff4e7926e6f611cd7448bb7ffd83240022e245b5f4452529e7469de65bf9a388e93bbdd0ffef2ba352209 SHA512 fe2ecf265f94ef3954b528bbd7b25ee8f3bdb27ffde4e94dd105c440848509ba5da05614d855859ad56b840e8858ee1435af51e84add9fb212d8827044158da3 |
36 |
DIST python-gentoo-patches-3.11.0b2_p1.tar.xz 4888 BLAKE2B d82a1c2e6e18a8d9ab8fbe5e1f81268442f45114f6ac58ce8d6204f8874c06769b725d480d5aaa7c624ef7f9d59c9dcff5371622a5b8c44d37ea0f9d960304fe SHA512 3b8b1859e4ca941d0ec21171d3ee491a19bffb612935217f9a0a59361270dcae3b97e366b6ef14aa4e5e6415871b2b1509e9a276a0783c86af9883e1345f71e7 |
37 |
|
38 |
diff --git a/dev-lang/python/python-3.10.5.ebuild b/dev-lang/python/python-3.10.5.ebuild |
39 |
new file mode 100644 |
40 |
index 000000000000..87ba9d3a2e1d |
41 |
--- /dev/null |
42 |
+++ b/dev-lang/python/python-3.10.5.ebuild |
43 |
@@ -0,0 +1,414 @@ |
44 |
+# Copyright 1999-2022 Gentoo Authors |
45 |
+# Distributed under the terms of the GNU General Public License v2 |
46 |
+ |
47 |
+EAPI="7" |
48 |
+WANT_LIBTOOL="none" |
49 |
+ |
50 |
+inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \ |
51 |
+ python-utils-r1 toolchain-funcs verify-sig |
52 |
+ |
53 |
+MY_PV=${PV/_rc/rc} |
54 |
+MY_P="Python-${MY_PV%_p*}" |
55 |
+PYVER=$(ver_cut 1-2) |
56 |
+PATCHSET="python-gentoo-patches-${MY_PV}" |
57 |
+ |
58 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
59 |
+HOMEPAGE="https://www.python.org/" |
60 |
+SRC_URI=" |
61 |
+ https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz |
62 |
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
63 |
+ verify-sig? ( |
64 |
+ https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc |
65 |
+ ) |
66 |
+" |
67 |
+S="${WORKDIR}/${MY_P}" |
68 |
+ |
69 |
+LICENSE="PSF-2" |
70 |
+SLOT="${PYVER}" |
71 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
72 |
+IUSE="bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml" |
73 |
+RESTRICT="!test? ( test )" |
74 |
+ |
75 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
76 |
+# If you need to apply a patch which requires python for bootstrapping, please |
77 |
+# run the bootstrap code on your dev box and include the results in the |
78 |
+# patchset. See bug 447752. |
79 |
+ |
80 |
+RDEPEND=" |
81 |
+ app-arch/bzip2:= |
82 |
+ app-arch/xz-utils:= |
83 |
+ dev-lang/python-exec[python_targets_python3_10(-)] |
84 |
+ dev-libs/libffi:= |
85 |
+ sys-apps/util-linux:= |
86 |
+ >=sys-libs/zlib-1.1.3:= |
87 |
+ virtual/libcrypt:= |
88 |
+ virtual/libintl |
89 |
+ gdbm? ( sys-libs/gdbm:=[berkdb] ) |
90 |
+ ncurses? ( >=sys-libs/ncurses-5.2:= ) |
91 |
+ readline? ( |
92 |
+ !libedit? ( >=sys-libs/readline-4.1:= ) |
93 |
+ libedit? ( dev-libs/libedit:= ) |
94 |
+ ) |
95 |
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
96 |
+ ssl? ( >=dev-libs/openssl-1.1.1:= ) |
97 |
+ tk? ( |
98 |
+ >=dev-lang/tcl-8.0:= |
99 |
+ >=dev-lang/tk-8.0:= |
100 |
+ dev-tcltk/blt:= |
101 |
+ dev-tcltk/tix |
102 |
+ ) |
103 |
+ xml? ( >=dev-libs/expat-2.1:= ) |
104 |
+ !!<sys-apps/sandbox-2.21 |
105 |
+" |
106 |
+# bluetooth requires headers from bluez |
107 |
+DEPEND=" |
108 |
+ ${RDEPEND} |
109 |
+ bluetooth? ( net-wireless/bluez ) |
110 |
+ test? ( app-arch/xz-utils[extra-filters(+)] ) |
111 |
+" |
112 |
+# autoconf-archive needed to eautoreconf |
113 |
+BDEPEND=" |
114 |
+ sys-devel/autoconf-archive |
115 |
+ virtual/awk |
116 |
+ virtual/pkgconfig |
117 |
+ verify-sig? ( sec-keys/openpgp-keys-python ) |
118 |
+ !sys-devel/gcc[libffi(-)] |
119 |
+" |
120 |
+RDEPEND+=" |
121 |
+ build? ( app-misc/mime-types ) |
122 |
+" |
123 |
+ |
124 |
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
125 |
+ |
126 |
+# large file tests involve a 2.5G file being copied (duplicated) |
127 |
+CHECKREQS_DISK_BUILD=5500M |
128 |
+ |
129 |
+QA_PKGCONFIG_VERSION=${PYVER} |
130 |
+ |
131 |
+pkg_pretend() { |
132 |
+ use test && check-reqs_pkg_pretend |
133 |
+} |
134 |
+ |
135 |
+pkg_setup() { |
136 |
+ use test && check-reqs_pkg_setup |
137 |
+} |
138 |
+ |
139 |
+src_unpack() { |
140 |
+ if use verify-sig; then |
141 |
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
142 |
+ fi |
143 |
+ default |
144 |
+} |
145 |
+ |
146 |
+src_prepare() { |
147 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
148 |
+ rm -fr Modules/expat || die |
149 |
+ rm -fr Modules/_ctypes/libffi* || die |
150 |
+ rm -fr Modules/zlib || die |
151 |
+ |
152 |
+ local PATCHES=( |
153 |
+ "${WORKDIR}/${PATCHSET}" |
154 |
+ ) |
155 |
+ |
156 |
+ default |
157 |
+ |
158 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
159 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
160 |
+ |
161 |
+ # force correct number of jobs |
162 |
+ # https://bugs.gentoo.org/737660 |
163 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
164 |
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
165 |
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
166 |
+ |
167 |
+ eautoreconf |
168 |
+} |
169 |
+ |
170 |
+src_configure() { |
171 |
+ local disable |
172 |
+ # disable automagic bluetooth headers detection |
173 |
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no |
174 |
+ use gdbm || disable+=" gdbm" |
175 |
+ use ncurses || disable+=" _curses _curses_panel" |
176 |
+ use readline || disable+=" readline" |
177 |
+ use sqlite || disable+=" _sqlite3" |
178 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
179 |
+ use tk || disable+=" _tkinter" |
180 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
181 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
182 |
+ |
183 |
+ if ! use xml; then |
184 |
+ ewarn "You have configured Python without XML support." |
185 |
+ ewarn "This is NOT a recommended configuration as you" |
186 |
+ ewarn "may face problems parsing any XML documents." |
187 |
+ fi |
188 |
+ |
189 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
190 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
191 |
+ fi |
192 |
+ |
193 |
+ append-flags -fwrapv |
194 |
+ |
195 |
+ filter-flags -malign-double |
196 |
+ |
197 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
198 |
+ if is-flagq -O3; then |
199 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
200 |
+ use hardened && replace-flags -O3 -O2 |
201 |
+ fi |
202 |
+ |
203 |
+ # https://bugs.gentoo.org/700012 |
204 |
+ if is-flagq -flto || is-flagq '-flto=*'; then |
205 |
+ append-cflags $(test-flags-CC -ffat-lto-objects) |
206 |
+ fi |
207 |
+ |
208 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
209 |
+ tc-export CXX |
210 |
+ |
211 |
+ # Fix implicit declarations on cross and prefix builds. Bug #674070. |
212 |
+ use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
213 |
+ |
214 |
+ local dbmliborder |
215 |
+ if use gdbm; then |
216 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
217 |
+ fi |
218 |
+ |
219 |
+ if use pgo; then |
220 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
221 |
+ export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network" |
222 |
+ |
223 |
+ # All of these seem to occasionally hang for PGO inconsistently |
224 |
+ # They'll even hang here but be fine in src_test sometimes. |
225 |
+ # bug #828535 (and related: bug #788022) |
226 |
+ PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc" |
227 |
+ |
228 |
+ if has_version "app-arch/rpm" ; then |
229 |
+ # Avoid sandbox failure (attempts to write to /var/lib/rpm) |
230 |
+ PROFILE_TASK+=" -x test_distutils" |
231 |
+ fi |
232 |
+ fi |
233 |
+ |
234 |
+ local myeconfargs=( |
235 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
236 |
+ # Python on glibc upgrade, remove it proactively to give |
237 |
+ # a chance for users rebuilding python before glibc |
238 |
+ ac_cv_header_stropts_h=no |
239 |
+ |
240 |
+ --enable-shared |
241 |
+ --without-static-libpython |
242 |
+ --enable-ipv6 |
243 |
+ --infodir='${prefix}/share/info' |
244 |
+ --mandir='${prefix}/share/man' |
245 |
+ --with-computed-gotos |
246 |
+ --with-dbmliborder="${dbmliborder}" |
247 |
+ --with-libc= |
248 |
+ --enable-loadable-sqlite-extensions |
249 |
+ --without-ensurepip |
250 |
+ --with-system-expat |
251 |
+ --with-system-ffi |
252 |
+ |
253 |
+ $(use_with lto) |
254 |
+ $(use_enable pgo optimizations) |
255 |
+ $(use_with readline readline "$(usex libedit editline readline)") |
256 |
+ ) |
257 |
+ |
258 |
+ # disable implicit optimization/debugging flags |
259 |
+ local -x OPT= |
260 |
+ # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
261 |
+ # propagated to sysconfig for built extensions |
262 |
+ local -x CFLAGS_NODIST=${CFLAGS} |
263 |
+ local -x LDFLAGS_NODIST=${LDFLAGS} |
264 |
+ local -x CFLAGS= LDFLAGS= |
265 |
+ |
266 |
+ econf "${myeconfargs[@]}" |
267 |
+ |
268 |
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
269 |
+ eerror "configure has detected that the sem_open function is broken." |
270 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
271 |
+ die "Broken sem_open function (bug 496328)" |
272 |
+ fi |
273 |
+} |
274 |
+ |
275 |
+src_compile() { |
276 |
+ # Ensure sed works as expected |
277 |
+ # https://bugs.gentoo.org/594768 |
278 |
+ local -x LC_ALL=C |
279 |
+ # Prevent using distutils bundled by setuptools. |
280 |
+ # https://bugs.gentoo.org/823728 |
281 |
+ export SETUPTOOLS_USE_DISTUTILS=stdlib |
282 |
+ |
283 |
+ # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't |
284 |
+ # end up writing bytecode & violating sandbox. |
285 |
+ # bug #831897 |
286 |
+ local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} |
287 |
+ |
288 |
+ if use pgo ; then |
289 |
+ # bug 660358 |
290 |
+ local -x COLUMNS=80 |
291 |
+ local -x PYTHONDONTWRITEBYTECODE= |
292 |
+ |
293 |
+ addpredict /usr/lib/python3.10/site-packages |
294 |
+ fi |
295 |
+ |
296 |
+ # also need to clear the flags explicitly here or they end up |
297 |
+ # in _sysconfigdata* |
298 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
299 |
+ |
300 |
+ # Restore saved value from above. |
301 |
+ local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} |
302 |
+ |
303 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
304 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
305 |
+ pax-mark E python |
306 |
+ else |
307 |
+ pax-mark m python |
308 |
+ fi |
309 |
+} |
310 |
+ |
311 |
+src_test() { |
312 |
+ # Tests will not work when cross compiling. |
313 |
+ if tc-is-cross-compiler; then |
314 |
+ elog "Disabling tests due to crosscompiling." |
315 |
+ return |
316 |
+ fi |
317 |
+ |
318 |
+ # Skip failing tests. |
319 |
+ local skipped_tests="gdb" |
320 |
+ |
321 |
+ if use sparc ; then |
322 |
+ # bug #788022 |
323 |
+ skipped_tests+=" multiprocessing_fork" |
324 |
+ skipped_tests+=" multiprocessing_forkserver" |
325 |
+ fi |
326 |
+ |
327 |
+ for test in ${skipped_tests}; do |
328 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
329 |
+ done |
330 |
+ |
331 |
+ # bug 660358 |
332 |
+ local -x COLUMNS=80 |
333 |
+ local -x PYTHONDONTWRITEBYTECODE= |
334 |
+ # workaround https://bugs.gentoo.org/775416 |
335 |
+ addwrite /usr/lib/python3.10/site-packages |
336 |
+ |
337 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
338 |
+ |
339 |
+ emake test EXTRATESTOPTS="-u-network -j${jobs}" \ |
340 |
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
341 |
+ local result=$? |
342 |
+ |
343 |
+ for test in ${skipped_tests}; do |
344 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
345 |
+ done |
346 |
+ |
347 |
+ elog "The following tests have been skipped:" |
348 |
+ for test in ${skipped_tests}; do |
349 |
+ elog "test_${test}.py" |
350 |
+ done |
351 |
+ |
352 |
+ elog "If you would like to run them, you may:" |
353 |
+ elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" |
354 |
+ elog "and run the tests separately." |
355 |
+ |
356 |
+ if [[ ${result} -ne 0 ]]; then |
357 |
+ die "emake test failed" |
358 |
+ fi |
359 |
+} |
360 |
+ |
361 |
+src_install() { |
362 |
+ local libdir=${ED}/usr/lib/python${PYVER} |
363 |
+ |
364 |
+ emake DESTDIR="${D}" altinstall |
365 |
+ |
366 |
+ # Fix collisions between different slots of Python. |
367 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
368 |
+ |
369 |
+ # Cheap hack to get version with ABIFLAGS |
370 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
371 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
372 |
+ # Replace python3.X with a symlink to python3.Xm |
373 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
374 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
375 |
+ # Create python3.X-config symlink |
376 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
377 |
+ # Create python-3.5m.pc symlink |
378 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
379 |
+ fi |
380 |
+ |
381 |
+ # python seems to get rebuilt in src_install (bug 569908) |
382 |
+ # Work around it for now. |
383 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
384 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
385 |
+ else |
386 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
387 |
+ fi |
388 |
+ |
389 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
390 |
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
391 |
+ |
392 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
393 |
+ |
394 |
+ if use examples; then |
395 |
+ docinto examples |
396 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
397 |
+ dodoc -r Tools |
398 |
+ fi |
399 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
400 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
401 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
402 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
403 |
+ |
404 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
405 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
406 |
+ sed \ |
407 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
408 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
409 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
410 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
411 |
+ |
412 |
+ local -x EPYTHON=python${PYVER} |
413 |
+ # if not using a cross-compiler, use the fresh binary |
414 |
+ if ! tc-is-cross-compiler; then |
415 |
+ cat > python.wrap <<-EOF || die |
416 |
+ #!/bin/sh |
417 |
+ export LD_LIBRARY_PATH=\${PWD}\${LD_LIBRARY_PATH+:\${LD_LIBRARY_PATH}} |
418 |
+ exec ./python "\${@}" |
419 |
+ EOF |
420 |
+ chmod +x python.wrap || die |
421 |
+ local -x PYTHON=./python.wrap |
422 |
+ else |
423 |
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
424 |
+ fi |
425 |
+ |
426 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
427 |
+ python_domodule epython.py |
428 |
+ |
429 |
+ # python-exec wrapping support |
430 |
+ local pymajor=${PYVER%.*} |
431 |
+ local scriptdir=${D}$(python_get_scriptdir) |
432 |
+ mkdir -p "${scriptdir}" || die |
433 |
+ # python and pythonX |
434 |
+ ln -s "../../../bin/${abiver}" \ |
435 |
+ "${scriptdir}/python${pymajor}" || die |
436 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
437 |
+ # python-config and pythonX-config |
438 |
+ # note: we need to create a wrapper rather than symlinking it due |
439 |
+ # to some random dirname(argv[0]) magic performed by python-config |
440 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
441 |
+ #!/bin/sh |
442 |
+ exec "${abiver}-config" "\${@}" |
443 |
+ EOF |
444 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
445 |
+ ln -s "python${pymajor}-config" \ |
446 |
+ "${scriptdir}/python-config" || die |
447 |
+ # 2to3, pydoc |
448 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
449 |
+ "${scriptdir}/2to3" || die |
450 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
451 |
+ "${scriptdir}/pydoc" || die |
452 |
+ # idle |
453 |
+ if use tk; then |
454 |
+ ln -s "../../../bin/idle${PYVER}" \ |
455 |
+ "${scriptdir}/idle" || die |
456 |
+ fi |
457 |
+} |