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, 02 Aug 2022 13:03:04
Message-Id: 1659445037.afe6882a35e428eb4d1e53726d373ebb017c23c7.mgorny@gentoo
1 commit: afe6882a35e428eb4d1e53726d373ebb017c23c7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 2 10:48:43 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 12:57:17 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=afe6882a
7
8 dev-lang/python: Bump to 3.10.6
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.6.ebuild | 408 +++++++++++++++++++++++++++++++++++
14 2 files changed, 411 insertions(+)
15
16 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
17 index d2d708bc4858..18918c1d4ed6 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.5.tar.xz 19361320 BLAKE2B 7f3629f8a16faeb0311947b7d5162bc45d9ed6b2c051f776027d01ebbbdd42e4849efd67921fa57975f68ec67dc34f3135345ce216f2d3f02bfcfa4245d266f1 SHA512 aa7f58a9b31de9824185b3e7bfa7da0dcf64ae9e89840664eae9d98d9048a650fa012cd5b873a62ff44b65b856db86f095c4003117406ec5e9583ec5f7e78e90
23 DIST Python-3.10.5.tar.xz.asc 833 BLAKE2B 36da2d557a5c38cfc473b2138412f9bc011d19c8538475e623bf41d81eb2c8f8e977945a3065a48c5b234d2b2c7d0dd5e83112c948591628cec344651dc9055c SHA512 72d0ab09900e2a10b85ccac804efd5536251152798e7347576e0e28bff4ab4a84b08d646329b225f9949047586686f9f4e7f05652526657a0948951b739c14e0
24 +DIST Python-3.10.6.tar.xz 19600672 BLAKE2B b21398f68e13cf8464077aa2c7f08d9044198cc3d2e2829d12239d420c1c922cbad8427f3e0fae3fe62a4b8ebb7db7eff441266eff82f0c78d7a98a62d8e64c3 SHA512 f2bf424bf4f4caa524ee1248b431e8e06d0745c3fc3ba457710d75f3698e653733feb4b059cd124f1de2a9e851c30d847f567aa47abef12898c9dc8a6507b476
25 +DIST Python-3.10.6.tar.xz.asc 833 BLAKE2B ea6546c01a4fbfe3f3e56b2f980da53f0692d9c638534bd25fb96a0f657424f979b6a82a01c77c05ddfded30441b4a0348cc407d5b29290ffc653a508ca32ec8 SHA512 9288e2f62f2e8c8208ad176372261545a64e675d737bb616403bcd888bc91177909257632e4cc0b5d688d612bea38a274030ec6989dc7d56c03064e32ad9903e
26 DIST Python-3.11.0b4.tar.xz 19573532 BLAKE2B d28b85c4af39ea8c8b1448857698a7018c9d115f0f861ff1649101e4c9d3ebbea14e1f5da8158b1734bf8743d96ed3683a8192e07ff06c0ccd964ec7ddee3832 SHA512 1530f4dcba6325ac8e9bb955604fc504a4306e3291b667d1d8490b78e1c50924d81ff8ab50d08c736e70d3e42788aabaa162179a77c03860ee8064f17f93bb09
27 DIST Python-3.11.0b4.tar.xz.asc 833 BLAKE2B eaedd106d3599c7ee6974ff9eee33899b119fdb45ab5b760f5f02e51e12ba58b3161f6853464a32638385fd596ddd350097c28dde55e3efeacc6719f16275d84 SHA512 8f6c633911755767d351fc86e031df6cedd6091ca5ec0ef55331ac65d2ad532c71e568c173513a2bbb2235e5e3fc9dd77e1b7ed230df1f0d8bd6e23da470b1e2
28 DIST Python-3.11.0b5.tar.xz 19792136 BLAKE2B 574ed58b2d063b954931c39c1154e776f5d233fe6e3f0803e5a93b68f48aacef1d9df60a2839df952b631d8988d6c44fee073dae5486420b808866944a3025d5 SHA512 b1013e449c9a0e9b61df5a266b5f05458d284b3524c6c44d44d8a5007bcb95ff754f21296cd695f353111575c7cce71f8a2808a9adf8c573512bf97f691d2200
29 @@ -12,6 +14,7 @@ DIST Python-3.9.13.tar.xz 19754368 BLAKE2B 4f583f66c28b791e19cd6d79695fe9eb815fd
30 DIST Python-3.9.13.tar.xz.asc 833 BLAKE2B db01c01be9d56cd15f9ab4a9e2cfa800faf4ebecb92b01c133865d3b3134bc910258a33b766306c3d01f98e35bbf9c03c7cba697760b7095999cbd63ed6c276c SHA512 9367afe8ec32195adbb64fa32eb9e3881cfdbbb38efcb5e0804a15486232aecbc81ed20a8ffed652f06a881744f3efd2c2df3cc652d70671c94d6668a17a391e
31 DIST python-gentoo-patches-2.7.18_p15.tar.xz 34956 BLAKE2B d173f276dd9c0ce31004dcc55a0d18e9ce25a47683c2df3c4dd62e967dfbbb35be59a2f08cf20f30a19475a8a2344dd95b17400eafa88b5fdbe9270a12ccbf32 SHA512 d9386808265f978808e5c0ffd384cefe54fb0e05aeccfd394167d5227d9cd66e25c8e93c54914762b2cfc3c2dd851b26a7a84d62634c6aa8a0798aacbb7ac25f
32 DIST python-gentoo-patches-3.10.5.tar.xz 8584 BLAKE2B d4a812a33e485b1eae5629e519dca4dc6625b743b07c7f7bbc62562f345d87723ba499893702310b1e96e443d2946e27a8d4971f32ca1125d4827d0d594ccaa6 SHA512 77f0478f7d0491e103857a83a97d6e04a9ec68740a7f9357cbbdd316462e7d98ea8236bd05a30e7556457ece5fbcfa4a7a78a25d4eb12779455ce2bb5b6f30d0
33 +DIST python-gentoo-patches-3.10.6.tar.xz 8580 BLAKE2B 4ff3839be2f6bf172acdca22bbded702804809d6334e088190cee4ae4c61e25580a3bdc105bfe27b7f3c3b5f219d363cdca21ef895a3e91f13515afb348a77a0 SHA512 c58a85f7c48a4e822527411a6e0618be5408e1a82fe72b21a254dac77b4e5d4b01ac24cf70dc277cd16ccdc8499a9fa53b7cebae3b9f8facc9c978adcc8a2876
34 DIST python-gentoo-patches-3.11.0b4.tar.xz 4388 BLAKE2B 16b112f1ecdce86022ed64d7c7007fb323b7bd4497b5802a48bb0a86667c282d1a9150d744f44cefbe9321af4916d35941707c1259a0cf175c0161c8e1b17e97 SHA512 f9c8c7180da20e839a0862571b9077b2702dbee8a1acd55ebb11329912cf9f81862ba615be484b92d39461c3eb6c38890f8d58bcbce2c4722418a967faedc1f5
35 DIST python-gentoo-patches-3.11.0b5.tar.xz 4384 BLAKE2B b036e9103f8315d6e2bb6e85a2db12ec60f8e05ccff083183f24c0b4ba16c807a2eb1fa43b88f8d7a253d5bbeef0880b31d60e13b449f7de992156319753ef33 SHA512 af6315f97b0f2463d6c0f18a99a5ff5f96c3d18567ae0d73461f0fc82ca2173a8f6c3fedc2fada2b9460547a457d4264bc2acb90f1906599229afe85bcc2afde
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.10.6.ebuild b/dev-lang/python/python-3.10.6.ebuild
39 new file mode 100644
40 index 000000000000..18d079692b96
41 --- /dev/null
42 +++ b/dev-lang/python/python-3.10.6.ebuild
43 @@ -0,0 +1,408 @@
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/700012
198 + if is-flagq -flto || is-flagq '-flto=*'; then
199 + append-cflags $(test-flags-CC -ffat-lto-objects)
200 + fi
201 +
202 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
203 + tc-export CXX
204 +
205 + # Fix implicit declarations on cross and prefix builds. Bug #674070.
206 + use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
207 +
208 + local dbmliborder
209 + if use gdbm; then
210 + dbmliborder+="${dbmliborder:+:}gdbm"
211 + fi
212 +
213 + if use pgo; then
214 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
215 + export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
216 +
217 + # All of these seem to occasionally hang for PGO inconsistently
218 + # They'll even hang here but be fine in src_test sometimes.
219 + # bug #828535 (and related: bug #788022)
220 + PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
221 +
222 + if has_version "app-arch/rpm" ; then
223 + # Avoid sandbox failure (attempts to write to /var/lib/rpm)
224 + PROFILE_TASK+=" -x test_distutils"
225 + fi
226 + fi
227 +
228 + local myeconfargs=(
229 + # glibc-2.30 removes it; since we can't cleanly force-rebuild
230 + # Python on glibc upgrade, remove it proactively to give
231 + # a chance for users rebuilding python before glibc
232 + ac_cv_header_stropts_h=no
233 +
234 + --enable-shared
235 + --without-static-libpython
236 + --enable-ipv6
237 + --infodir='${prefix}/share/info'
238 + --mandir='${prefix}/share/man'
239 + --with-computed-gotos
240 + --with-dbmliborder="${dbmliborder}"
241 + --with-libc=
242 + --enable-loadable-sqlite-extensions
243 + --without-ensurepip
244 + --with-system-expat
245 + --with-system-ffi
246 +
247 + $(use_with lto)
248 + $(use_enable pgo optimizations)
249 + $(use_with readline readline "$(usex libedit editline readline)")
250 + )
251 +
252 + # disable implicit optimization/debugging flags
253 + local -x OPT=
254 + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
255 + # propagated to sysconfig for built extensions
256 + local -x CFLAGS_NODIST=${CFLAGS}
257 + local -x LDFLAGS_NODIST=${LDFLAGS}
258 + local -x CFLAGS= LDFLAGS=
259 +
260 + econf "${myeconfargs[@]}"
261 +
262 + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
263 + eerror "configure has detected that the sem_open function is broken."
264 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
265 + die "Broken sem_open function (bug 496328)"
266 + fi
267 +}
268 +
269 +src_compile() {
270 + # Ensure sed works as expected
271 + # https://bugs.gentoo.org/594768
272 + local -x LC_ALL=C
273 + # Prevent using distutils bundled by setuptools.
274 + # https://bugs.gentoo.org/823728
275 + export SETUPTOOLS_USE_DISTUTILS=stdlib
276 +
277 + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
278 + # end up writing bytecode & violating sandbox.
279 + # bug #831897
280 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
281 +
282 + if use pgo ; then
283 + # bug 660358
284 + local -x COLUMNS=80
285 + local -x PYTHONDONTWRITEBYTECODE=
286 +
287 + addpredict /usr/lib/python3.10/site-packages
288 + fi
289 +
290 + # also need to clear the flags explicitly here or they end up
291 + # in _sysconfigdata*
292 + emake CPPFLAGS= CFLAGS= LDFLAGS=
293 +
294 + # Restore saved value from above.
295 + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE}
296 +
297 + # Work around bug 329499. See also bug 413751 and 457194.
298 + if has_version dev-libs/libffi[pax-kernel]; then
299 + pax-mark E python
300 + else
301 + pax-mark m python
302 + fi
303 +}
304 +
305 +src_test() {
306 + # Tests will not work when cross compiling.
307 + if tc-is-cross-compiler; then
308 + elog "Disabling tests due to crosscompiling."
309 + return
310 + fi
311 +
312 + # Skip failing tests.
313 + local skipped_tests="gdb"
314 +
315 + if use sparc ; then
316 + # bug #788022
317 + skipped_tests+=" multiprocessing_fork"
318 + skipped_tests+=" multiprocessing_forkserver"
319 + fi
320 +
321 + for test in ${skipped_tests}; do
322 + mv "${S}"/Lib/test/test_${test}.py "${T}"
323 + done
324 +
325 + # bug 660358
326 + local -x COLUMNS=80
327 + local -x PYTHONDONTWRITEBYTECODE=
328 + # workaround https://bugs.gentoo.org/775416
329 + addwrite /usr/lib/python3.10/site-packages
330 +
331 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
332 +
333 + emake test EXTRATESTOPTS="-u-network -j${jobs}" \
334 + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
335 + local result=$?
336 +
337 + for test in ${skipped_tests}; do
338 + mv "${T}/test_${test}.py" "${S}"/Lib/test
339 + done
340 +
341 + elog "The following tests have been skipped:"
342 + for test in ${skipped_tests}; do
343 + elog "test_${test}.py"
344 + done
345 +
346 + elog "If you would like to run them, you may:"
347 + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
348 + elog "and run the tests separately."
349 +
350 + if [[ ${result} -ne 0 ]]; then
351 + die "emake test failed"
352 + fi
353 +}
354 +
355 +src_install() {
356 + local libdir=${ED}/usr/lib/python${PYVER}
357 +
358 + emake DESTDIR="${D}" altinstall
359 +
360 + # Fix collisions between different slots of Python.
361 + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
362 +
363 + # Cheap hack to get version with ABIFLAGS
364 + local abiver=$(cd "${ED}/usr/include"; echo python*)
365 + if [[ ${abiver} != python${PYVER} ]]; then
366 + # Replace python3.X with a symlink to python3.Xm
367 + rm "${ED}/usr/bin/python${PYVER}" || die
368 + dosym "${abiver}" "/usr/bin/python${PYVER}"
369 + # Create python3.X-config symlink
370 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
371 + # Create python-3.5m.pc symlink
372 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
373 + fi
374 +
375 + # python seems to get rebuilt in src_install (bug 569908)
376 + # Work around it for now.
377 + if has_version dev-libs/libffi[pax-kernel]; then
378 + pax-mark E "${ED}/usr/bin/${abiver}"
379 + else
380 + pax-mark m "${ED}/usr/bin/${abiver}"
381 + fi
382 +
383 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
384 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
385 +
386 + dodoc Misc/{ACKS,HISTORY,NEWS}
387 +
388 + if use examples; then
389 + docinto examples
390 + find Tools -name __pycache__ -exec rm -fr {} + || die
391 + dodoc -r Tools
392 + fi
393 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
394 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
395 + emake --no-print-directory -s -f - 2>/dev/null)
396 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
397 +
398 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
399 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
400 + sed \
401 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
402 + -e "s:@PYDOC@:pydoc${PYVER}:" \
403 + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
404 + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
405 +
406 + local -x EPYTHON=python${PYVER}
407 + # if not using a cross-compiler, use the fresh binary
408 + if ! tc-is-cross-compiler; then
409 + cat > python.wrap <<-EOF || die
410 + #!/bin/sh
411 + export LD_LIBRARY_PATH=\${PWD}\${LD_LIBRARY_PATH+:\${LD_LIBRARY_PATH}}
412 + exec ./python "\${@}"
413 + EOF
414 + chmod +x python.wrap || die
415 + local -x PYTHON=./python.wrap
416 + else
417 + local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
418 + fi
419 +
420 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
421 + python_domodule epython.py
422 +
423 + # python-exec wrapping support
424 + local pymajor=${PYVER%.*}
425 + local scriptdir=${D}$(python_get_scriptdir)
426 + mkdir -p "${scriptdir}" || die
427 + # python and pythonX
428 + ln -s "../../../bin/${abiver}" \
429 + "${scriptdir}/python${pymajor}" || die
430 + ln -s "python${pymajor}" "${scriptdir}/python" || die
431 + # python-config and pythonX-config
432 + # note: we need to create a wrapper rather than symlinking it due
433 + # to some random dirname(argv[0]) magic performed by python-config
434 + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
435 + #!/bin/sh
436 + exec "${abiver}-config" "\${@}"
437 + EOF
438 + chmod +x "${scriptdir}/python${pymajor}-config" || die
439 + ln -s "python${pymajor}-config" \
440 + "${scriptdir}/python-config" || die
441 + # 2to3, pydoc
442 + ln -s "../../../bin/2to3-${PYVER}" \
443 + "${scriptdir}/2to3" || die
444 + ln -s "../../../bin/pydoc${PYVER}" \
445 + "${scriptdir}/pydoc" || die
446 + # idle
447 + if use tk; then
448 + ln -s "../../../bin/idle${PYVER}" \
449 + "${scriptdir}/idle" || die
450 + fi
451 +}