Gentoo Archives: gentoo-commits

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