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, 07 Dec 2021 09:32:28
Message-Id: 1638869539.0a4be9c449f1248badebcaf888fe9bad73ffe062.mgorny@gentoo
1 commit: 0a4be9c449f1248badebcaf888fe9bad73ffe062
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 7 08:06:03 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 7 09:32:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a4be9c4
7
8 dev-lang/python: Bump to 3.10.1
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.1.ebuild | 370 +++++++++++++++++++++++++++++++++++
14 2 files changed, 373 insertions(+)
15
16 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
17 index 7670a47c22e9..0561015356bd 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.0.tar.xz 18726176 BLAKE2B 77143edf733cadf7e52327a58782f0617b1dd0d132cf58e0f26d37a454bb97f82e7931118a6a71f22779d9b6ec4efca974c43c19a6338b4b24a9fd616b60cc89 SHA512 82b2729afc7d72a80882f199970667dce7d971a2e5ecfe6cf84f7b68612ab2caf6ed6d7a8cb81f24ea85cb0816464bb2e8b2e6884eda62fa40742edc674193bd
23 DIST Python-3.10.0.tar.xz.asc 833 BLAKE2B 295df19932ea076bb1a50acb38782055ff34fb235df0380fa361727eedb3ca68aeca2a31419de5b05ce128c2e21ad04605c226e7a61d508a17607f615e46e570 SHA512 67236e02bc49da1423717cb54216b745f613ba2fc4b372a4aa15a36ab15fe69d9b9087070382957d480df7576d13056caedcd979fb56531799a1190b822f673d
24 +DIST Python-3.10.1.tar.xz 18775460 BLAKE2B d2dbf875ef5f9cee6dfd66e2d2489b884813c6a4eb3ef4da25713361efebb9ab271dc7050de25d4b07808bd3fd510700975c733ca8f283caa7426d16f273a93d SHA512 1c559e33f1252e51bafb941c380de16f142c0735858363c84cb8dbed6767843de3af126889c2826ffb94bd4777d7cdfc31040301c8c74de56af52b80b1aa9e76
25 +DIST Python-3.10.1.tar.xz.asc 833 BLAKE2B a5678c522b486a246993616ee36ddb3f74a093fb5729d8d2da3cfc4de5c3e1fcf3f4f55504b7bbf929050204d22a89ff3c7750b599034a3d5c941666f54fcad4 SHA512 645d5f40e6e80a590923a48763f20dea7da3f3eea5825bb79e08618d81d1b8eee0ddee2b57503321a584280536e0671e4913e5ad450568fbbb44509c01d3907d
26 DIST Python-3.11.0a2.tar.xz 18714064 BLAKE2B 54680f117b639fdebbe1300df4d4fcc43099d30d146861577eee7ad5d9a7de43b54bec0f058db58d4d7067a8ab31cbe344a276c837dddcd3df9105d2a5aa615f SHA512 9a7c4d2be0cdf5801aaf6ec6337390a2f0e711badf0e0e35bcf0e5c98f652c68cf523afb991e87f4a1d1604eed3d19c56654d55922986ab27234e82675b20391
27 DIST Python-3.11.0a2.tar.xz.asc 833 BLAKE2B f3714b71fc1e167e2d5a9989003159606a5eb5288f6d44c5332d7fe101be79e411f035ad1fcc3acd930f9e02377ed8c45f6b981827405dc501b8b074b5eb3dcf SHA512 617181a854c884c6d3a79368000ca82430bc391573ae3a1b25f69939bce3d2d365e8ca7166d941856a78f3598ab4e7720a144ecb6c3a9de1aff5928799c2988d
28 DIST Python-3.6.15.tar.xz 17223796 BLAKE2B c139c6f93ea70ad898d5626dfa964280a14de9676f0d9d55668ad91618b1ba330874cbba8d6526a87e53b585ff34e3bf242613ca3fb17ee60f362a9676306c7d SHA512 f1894d704c91669d94ec83b5631288bf1e0c73ddcf33cea0977575f262eb672caebc8ac00e34e9b99c321c19cc9a71d6081fa957bb8e23cf5bfba50f345145ef
29 @@ -14,6 +16,7 @@ DIST Python-3.9.9.tar.xz 19144372 BLAKE2B 3a144ca5e4b11b2fd09d05a4a40ddf3f622c07
30 DIST Python-3.9.9.tar.xz.asc 833 BLAKE2B 41d05ee1ec256f0cab4e9d3540877783745f0f30e3f1177d01096b352341a90893c5c9523926bed8176bd304cbb1fd6619be3b4e375103874eac5e5ebc113135 SHA512 84fb739c60216ab9a7a487a0ec4039a7e85c7684ef1f71d8b3bc415ff2ae284f79474103ae05385502bc2510401f8cfb33d84dccf5d0ea9a0dd62528519d935f
31 DIST python-gentoo-patches-2.7.18_p13.tar.xz 33296 BLAKE2B 91b711458aff4f6337ee1b34aff58d7edda6725644a64c9320076a1e04c816729ed163d82333cfe4dfef379a9ad5ef50ba00abdbbfed4503b0f92c8f0b7ca683 SHA512 97f3657a4a95e8492aa710801b974a56e6dd4636e475aea45cbbe76e7ae32d00f07b05769887f05e49cb0df8584ac9499a7ce842bad77f837a7c869f9b769b07
32 DIST python-gentoo-patches-3.10.0_p1.tar.xz 10068 BLAKE2B 1c9817b449831559f0a0b722c02a5f55d94b3dfde98e5882c1403fe24a4addf7074ab39c09b91cff6fd7ace2e4b6e8ed899d9a0b9ffd6612ce315c4c192bd309 SHA512 39aa41dbf17b6dc5255491c75031a3dae6962b44125e426dbfdce365a6533c5dae9856b1fff8016a189124b7cff72d2665ce99da344c2f9dff005ba685e8c2c4
33 +DIST python-gentoo-patches-3.10.1.tar.xz 8580 BLAKE2B 58d165c6c21a6736787d77d5bbeb770adff7f3729a47f62d0b7c4f0982c15c6a50b326be33638f3fca5574936cbce35d26e9ce0868faa3b5a3412b30586b066a SHA512 f86adf4e5195b1eb13cedbf24c1956964ce56745f0524a62b1e7c6baf74c6f1802e05cf4c08519b147579945c0526ff0a0ffc01cfb4372c0ec4f403b25e81012
34 DIST python-gentoo-patches-3.11.0a2.tar.xz 8472 BLAKE2B 440e31d70895a537bb89099cec440bd5de56cc3ddb65d71483f5f82eeb253fe4a99f87c41b8ad28ed039ffaa3eb48674de15b9e031572fd81aba4c1c79ad2ec0 SHA512 f87a7550fa20027c870500babcc8893c2c4dcaf68a25d8096e0edfa1f473fefbd0117bd847514f2784fe22cb0027b3b269c7bc7d7395c1f96932a56d02bfd404
35 DIST python-gentoo-patches-3.6.15.tar.xz 15300 BLAKE2B f49fd96f6ad1a1c94fea6b83acd229a81754b86061e243044ead4b9a9d5122a2e43b270b68722c359c084c05a566a3ad70aa46588ab7a005ee560ee118b92b8b SHA512 cc33491a33f3f1d990cf494d53b91b74db761142e8aebe1bd4b128ef10a268ff945e5ba08daad39cee095612a8e52265d6988873ecf9c073377cbbc10735aa39
36 DIST python-gentoo-patches-3.7.12_p1.tar.xz 19112 BLAKE2B e9964244af3db544dd6e96d85ca4bc24d7131b48eda85df5bafa3fb36474a024cecbbf4b27324e1f35f76ae6a1aed31dd7896e831b79b574b45a4371afcc7e5b SHA512 9ec996c2904f99bd6651ed1b700eabd91f2b82b1e9e0f3d9572243886a9c7139bf8ac2af04169485d3ca6339e1a87044cba203f6f0aee9609d2a1d53c812548d
37
38 diff --git a/dev-lang/python/python-3.10.1.ebuild b/dev-lang/python/python-3.10.1.ebuild
39 new file mode 100644
40 index 000000000000..42698f3105cf
41 --- /dev/null
42 +++ b/dev-lang/python/python-3.10.1.ebuild
43 @@ -0,0 +1,370 @@
44 +# Copyright 1999-2021 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="https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz
61 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
62 + verify-sig? (
63 + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc
64 + )"
65 +S="${WORKDIR}/${MY_P}"
66 +
67 +LICENSE="PSF-2"
68 +SLOT="${PYVER}"
69 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
70 +IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
71 +RESTRICT="!test? ( test )"
72 +
73 +# Do not add a dependency on dev-lang/python to this ebuild.
74 +# If you need to apply a patch which requires python for bootstrapping, please
75 +# run the bootstrap code on your dev box and include the results in the
76 +# patchset. See bug 447752.
77 +
78 +RDEPEND="app-arch/bzip2:=
79 + app-arch/xz-utils:=
80 + dev-libs/libffi:=
81 + sys-apps/util-linux:=
82 + >=sys-libs/zlib-1.1.3:=
83 + virtual/libcrypt:=
84 + virtual/libintl
85 + gdbm? ( sys-libs/gdbm:=[berkdb] )
86 + ncurses? ( >=sys-libs/ncurses-5.2:= )
87 + readline? ( >=sys-libs/readline-4.1:= )
88 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
89 + ssl? ( >=dev-libs/openssl-1.1.1:= )
90 + tk? (
91 + >=dev-lang/tcl-8.0:=
92 + >=dev-lang/tk-8.0:=
93 + dev-tcltk/blt:=
94 + dev-tcltk/tix
95 + )
96 + xml? ( >=dev-libs/expat-2.1:= )
97 + !!<sys-apps/sandbox-2.21"
98 +# bluetooth requires headers from bluez
99 +DEPEND="${RDEPEND}
100 + bluetooth? ( net-wireless/bluez )
101 + test? ( app-arch/xz-utils[extra-filters(+)] )"
102 +# autoconf-archive needed to eautoreconf
103 +BDEPEND="
104 + sys-devel/autoconf-archive
105 + virtual/awk
106 + virtual/pkgconfig
107 + verify-sig? ( app-crypt/openpgp-keys-python )
108 + !sys-devel/gcc[libffi(-)]"
109 +RDEPEND+=" !build? ( app-misc/mime-types )"
110 +
111 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
112 +
113 +# large file tests involve a 2.5G file being copied (duplicated)
114 +CHECKREQS_DISK_BUILD=5500M
115 +
116 +pkg_pretend() {
117 + use test && check-reqs_pkg_pretend
118 +}
119 +
120 +pkg_setup() {
121 + use test && check-reqs_pkg_setup
122 +}
123 +
124 +src_unpack() {
125 + if use verify-sig; then
126 + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
127 + fi
128 + default
129 +}
130 +
131 +src_prepare() {
132 + # Ensure that internal copies of expat, libffi and zlib are not used.
133 + rm -fr Modules/expat || die
134 + rm -fr Modules/_ctypes/libffi* || die
135 + rm -fr Modules/zlib || die
136 +
137 + local PATCHES=(
138 + "${WORKDIR}/${PATCHSET}"
139 + )
140 +
141 + default
142 +
143 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
144 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
145 +
146 + # force correct number of jobs
147 + # https://bugs.gentoo.org/737660
148 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
149 + sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
150 + sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
151 +
152 + eautoreconf
153 +}
154 +
155 +src_configure() {
156 + local disable
157 + # disable automagic bluetooth headers detection
158 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
159 + use gdbm || disable+=" gdbm"
160 + use ncurses || disable+=" _curses _curses_panel"
161 + use readline || disable+=" readline"
162 + use sqlite || disable+=" _sqlite3"
163 + use ssl || export PYTHON_DISABLE_SSL="1"
164 + use tk || disable+=" _tkinter"
165 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
166 + export PYTHON_DISABLE_MODULES="${disable}"
167 +
168 + if ! use xml; then
169 + ewarn "You have configured Python without XML support."
170 + ewarn "This is NOT a recommended configuration as you"
171 + ewarn "may face problems parsing any XML documents."
172 + fi
173 +
174 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
175 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
176 + fi
177 +
178 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
179 + append-flags -fwrapv
180 + fi
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"
209 +
210 + if has_version "app-arch/rpm" ; then
211 + # Avoid sandbox failure (attempts to write to /var/lib/rpm)
212 + PROFILE_TASK+=" -x test_distutils"
213 + fi
214 + fi
215 +
216 + local myeconfargs=(
217 + # glibc-2.30 removes it; since we can't cleanly force-rebuild
218 + # Python on glibc upgrade, remove it proactively to give
219 + # a chance for users rebuilding python before glibc
220 + ac_cv_header_stropts_h=no
221 +
222 + --enable-shared
223 + --without-static-libpython
224 + --enable-ipv6
225 + --infodir='${prefix}/share/info'
226 + --mandir='${prefix}/share/man'
227 + --with-computed-gotos
228 + --with-dbmliborder="${dbmliborder}"
229 + --with-libc=
230 + --enable-loadable-sqlite-extensions
231 + --without-ensurepip
232 + --with-system-expat
233 + --with-system-ffi
234 +
235 + $(use_with lto)
236 + $(use_enable pgo optimizations)
237 + )
238 +
239 + OPT="" econf "${myeconfargs[@]}"
240 +
241 + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
242 + eerror "configure has detected that the sem_open function is broken."
243 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
244 + die "Broken sem_open function (bug 496328)"
245 + fi
246 +}
247 +
248 +src_compile() {
249 + # Ensure sed works as expected
250 + # https://bugs.gentoo.org/594768
251 + local -x LC_ALL=C
252 + # Prevent using distutils bundled by setuptools.
253 + # https://bugs.gentoo.org/823728
254 + export SETUPTOOLS_USE_DISTUTILS=stdlib
255 +
256 + if use pgo ; then
257 + # bug 660358
258 + local -x COLUMNS=80
259 + local -x PYTHONDONTWRITEBYTECODE=
260 +
261 + addpredict /usr/lib/python3.10/site-packages
262 + fi
263 +
264 + emake CPPFLAGS= CFLAGS= LDFLAGS=
265 +
266 + # Work around bug 329499. See also bug 413751 and 457194.
267 + if has_version dev-libs/libffi[pax-kernel]; then
268 + pax-mark E python
269 + else
270 + pax-mark m python
271 + fi
272 +}
273 +
274 +src_test() {
275 + # Tests will not work when cross compiling.
276 + if tc-is-cross-compiler; then
277 + elog "Disabling tests due to crosscompiling."
278 + return
279 + fi
280 +
281 + # Skip failing tests.
282 + local skipped_tests="gdb"
283 +
284 + for test in ${skipped_tests}; do
285 + mv "${S}"/Lib/test/test_${test}.py "${T}"
286 + done
287 +
288 + # bug 660358
289 + local -x COLUMNS=80
290 + local -x PYTHONDONTWRITEBYTECODE=
291 + addpredict /usr/lib/python3.10/site-packages
292 +
293 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
294 +
295 + emake test EXTRATESTOPTS="-u-network -j${jobs}" \
296 + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
297 + local result=$?
298 +
299 + for test in ${skipped_tests}; do
300 + mv "${T}/test_${test}.py" "${S}"/Lib/test
301 + done
302 +
303 + elog "The following tests have been skipped:"
304 + for test in ${skipped_tests}; do
305 + elog "test_${test}.py"
306 + done
307 +
308 + elog "If you would like to run them, you may:"
309 + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
310 + elog "and run the tests separately."
311 +
312 + if [[ ${result} -ne 0 ]]; then
313 + die "emake test failed"
314 + fi
315 +}
316 +
317 +src_install() {
318 + local libdir=${ED}/usr/lib/python${PYVER}
319 +
320 + emake DESTDIR="${D}" altinstall
321 +
322 + sed \
323 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
324 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
325 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
326 +
327 + # Fix collisions between different slots of Python.
328 + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
329 +
330 + # Cheap hack to get version with ABIFLAGS
331 + local abiver=$(cd "${ED}/usr/include"; echo python*)
332 + if [[ ${abiver} != python${PYVER} ]]; then
333 + # Replace python3.X with a symlink to python3.Xm
334 + rm "${ED}/usr/bin/python${PYVER}" || die
335 + dosym "${abiver}" "/usr/bin/python${PYVER}"
336 + # Create python3.X-config symlink
337 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
338 + # Create python-3.5m.pc symlink
339 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
340 + fi
341 +
342 + # python seems to get rebuilt in src_install (bug 569908)
343 + # Work around it for now.
344 + if has_version dev-libs/libffi[pax-kernel]; then
345 + pax-mark E "${ED}/usr/bin/${abiver}"
346 + else
347 + pax-mark m "${ED}/usr/bin/${abiver}"
348 + fi
349 +
350 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
351 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
352 +
353 + dodoc Misc/{ACKS,HISTORY,NEWS}
354 +
355 + if use examples; then
356 + docinto examples
357 + find Tools -name __pycache__ -exec rm -fr {} + || die
358 + dodoc -r Tools
359 + fi
360 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
361 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
362 + emake --no-print-directory -s -f - 2>/dev/null)
363 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
364 +
365 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
366 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
367 + sed \
368 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
369 + -e "s:@PYDOC@:pydoc${PYVER}:" \
370 + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
371 + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
372 +
373 + local -x EPYTHON=python${PYVER}
374 + # if not using a cross-compiler, use the fresh binary
375 + if ! tc-is-cross-compiler; then
376 + local -x PYTHON=./python
377 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
378 + else
379 + local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
380 + fi
381 +
382 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
383 + python_domodule epython.py
384 +
385 + # python-exec wrapping support
386 + local pymajor=${PYVER%.*}
387 + local scriptdir=${D}$(python_get_scriptdir)
388 + mkdir -p "${scriptdir}" || die
389 + # python and pythonX
390 + ln -s "../../../bin/${abiver}" \
391 + "${scriptdir}/python${pymajor}" || die
392 + ln -s "python${pymajor}" "${scriptdir}/python" || die
393 + # python-config and pythonX-config
394 + # note: we need to create a wrapper rather than symlinking it due
395 + # to some random dirname(argv[0]) magic performed by python-config
396 + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
397 + #!/bin/sh
398 + exec "${abiver}-config" "\${@}"
399 + EOF
400 + chmod +x "${scriptdir}/python${pymajor}-config" || die
401 + ln -s "python${pymajor}-config" \
402 + "${scriptdir}/python-config" || die
403 + # 2to3, pydoc
404 + ln -s "../../../bin/2to3-${PYVER}" \
405 + "${scriptdir}/2to3" || die
406 + ln -s "../../../bin/pydoc${PYVER}" \
407 + "${scriptdir}/pydoc" || die
408 + # idle
409 + if use tk; then
410 + ln -s "../../../bin/idle${PYVER}" \
411 + "${scriptdir}/idle" || die
412 + fi
413 +}