Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: dev-lang/python/
Date: Fri, 26 Aug 2022 20:59:20
Message-Id: 1661547524.23586224370b2ed48f80c2d0f7e989facafead0a.quentin@gentoo
1 commit: 23586224370b2ed48f80c2d0f7e989facafead0a
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Fri Aug 26 14:34:01 2022 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Fri Aug 26 20:58:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=23586224
7
8 dev-lang/python: Remove old versions
9
10 Signed-off-by: orbea <orbea <AT> riseup.net>
11 Closes: https://github.com/gentoo/libressl/pull/451
12 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
13
14 dev-lang/python/Manifest | 10 -
15 dev-lang/python/python-3.10.4.ebuild | 410 -----------------------------------
16 dev-lang/python/python-3.10.5.ebuild | 409 ----------------------------------
17 dev-lang/python/python-3.9.12.ebuild | 406 ----------------------------------
18 dev-lang/python/python-3.9.13.ebuild | 405 ----------------------------------
19 5 files changed, 1640 deletions(-)
20
21 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
22 index b5bb2ab..50d403c 100644
23 --- a/dev-lang/python/Manifest
24 +++ b/dev-lang/python/Manifest
25 @@ -1,16 +1,6 @@
26 -DIST Python-3.10.4.tar.xz 19342692 BLAKE2B c430ad9bed71729fda29433af0614b6c0110a85e23f4cb5cff3a9b501febe99b20094367a5428f256fb3aeef97f34d439ef677fc8ae4d596d52da7976b65ebb5 SHA512 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113
27 -DIST Python-3.10.4.tar.xz.asc 833 BLAKE2B 289f2e96bfc2b60c4ae94b1591779d604f203890c4f5db2ee16e305bf03c6ddb9c8d6da4471a06b5943e12888f37ca572ea30876e9a80382a26814f66b41b7bf SHA512 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d
28 -DIST Python-3.10.5.tar.xz 19361320 BLAKE2B 7f3629f8a16faeb0311947b7d5162bc45d9ed6b2c051f776027d01ebbbdd42e4849efd67921fa57975f68ec67dc34f3135345ce216f2d3f02bfcfa4245d266f1 SHA512 aa7f58a9b31de9824185b3e7bfa7da0dcf64ae9e89840664eae9d98d9048a650fa012cd5b873a62ff44b65b856db86f095c4003117406ec5e9583ec5f7e78e90
29 -DIST Python-3.10.5.tar.xz.asc 833 BLAKE2B 36da2d557a5c38cfc473b2138412f9bc011d19c8538475e623bf41d81eb2c8f8e977945a3065a48c5b234d2b2c7d0dd5e83112c948591628cec344651dc9055c SHA512 72d0ab09900e2a10b85ccac804efd5536251152798e7347576e0e28bff4ab4a84b08d646329b225f9949047586686f9f4e7f05652526657a0948951b739c14e0
30 DIST Python-3.10.6.tar.xz 19600672 BLAKE2B b21398f68e13cf8464077aa2c7f08d9044198cc3d2e2829d12239d420c1c922cbad8427f3e0fae3fe62a4b8ebb7db7eff441266eff82f0c78d7a98a62d8e64c3 SHA512 f2bf424bf4f4caa524ee1248b431e8e06d0745c3fc3ba457710d75f3698e653733feb4b059cd124f1de2a9e851c30d847f567aa47abef12898c9dc8a6507b476
31 DIST Python-3.10.6.tar.xz.asc 833 BLAKE2B ea6546c01a4fbfe3f3e56b2f980da53f0692d9c638534bd25fb96a0f657424f979b6a82a01c77c05ddfded30441b4a0348cc407d5b29290ffc653a508ca32ec8 SHA512 9288e2f62f2e8c8208ad176372261545a64e675d737bb616403bcd888bc91177909257632e4cc0b5d688d612bea38a274030ec6989dc7d56c03064e32ad9903e
32 -DIST Python-3.9.12.tar.xz 19740524 BLAKE2B 05f2469aa53ca36221ef4976b17bfde3e5b86afd5a8114e5a7fd899f975a8e55022555ef718d5352ab68de1b7b23865a0bf713768c9c2b30d591438c9a396d25 SHA512 081981901e14149748fd35228db0b3b1d96fef227ae7404f07b8bad0fda4b02649bf31c348c94aefdaf3327565d78f9489437c2c02f647b15d41376a27a23e97
33 -DIST Python-3.9.12.tar.xz.asc 833 BLAKE2B 33436d0404a643215a8fd2b967ffd216201da24f374941bf65b888159ccfabcbe79b751eca2dd489b06605604338c8bbaab74aa10abbe4bcffaa54236301228e SHA512 dddaa27f8a29034f458edb6739398a5455c87fe37b6349e161865a9deedca118ffe9cb82663cc75bbe60b3b556399c0c6855f5262aac1fe90d36a3694fca65b2
34 DIST Python-3.9.13.tar.xz 19754368 BLAKE2B 4f583f66c28b791e19cd6d79695fe9eb815fd333542be22aec8bd73d1f4d3f17f2c4e9de198e7b16c1ca6362a613a8a02fb965c7dc7db3e510fd31de15ba2d19 SHA512 e9664e7f908092df11236b22465d217531d6f0378e88d889108d19fe77f28f46ffb629b8733f84b41409e255367321893a2b1bd64518930d9d8cae5d1b774d23
35 DIST Python-3.9.13.tar.xz.asc 833 BLAKE2B db01c01be9d56cd15f9ab4a9e2cfa800faf4ebecb92b01c133865d3b3134bc910258a33b766306c3d01f98e35bbf9c03c7cba697760b7095999cbd63ed6c276c SHA512 9367afe8ec32195adbb64fa32eb9e3881cfdbbb38efcb5e0804a15486232aecbc81ed20a8ffed652f06a881744f3efd2c2df3cc652d70671c94d6668a17a391e
36 -DIST python-gentoo-patches-3.10.4.tar.xz 8592 BLAKE2B 67fba3e1fedb17430e5cd93da995b4acaf714db512031b5a2f775a25f793f007941561663cfa413d645ccddc2e22d65d250a40fa166cafda8805488d877ff57d SHA512 3ed2b8ff8f1eb8febe7dcd4b5d13d6d54468be1d525f8f1118977d3bbc78f690a597b09383939d023b03380a306e4bff1693382e29ff562312d803305b1709b2
37 -DIST python-gentoo-patches-3.10.5.tar.xz 8584 BLAKE2B d4a812a33e485b1eae5629e519dca4dc6625b743b07c7f7bbc62562f345d87723ba499893702310b1e96e443d2946e27a8d4971f32ca1125d4827d0d594ccaa6 SHA512 77f0478f7d0491e103857a83a97d6e04a9ec68740a7f9357cbbdd316462e7d98ea8236bd05a30e7556457ece5fbcfa4a7a78a25d4eb12779455ce2bb5b6f30d0
38 DIST python-gentoo-patches-3.10.6_p2.tar.xz 12040 BLAKE2B 75c93fab19137a966b3775308bc20142f4d3648bbb9364e82c4eaffae93beda54011192881c52b85d2e2493a06cfe2a90f50675609908c3d5ebdb0103fe41644 SHA512 7e451a8a18a62592c2cd7b2db71065b77256960f43e172a0d7856b22b69138dcb1552f53b39bec14585a761cfe729c81613551c1b616fe1ec8d2b59856b11453
39 -DIST python-gentoo-patches-3.9.12.tar.xz 12848 BLAKE2B 5dd66fa94b136a463d2c4be3a5b7dfad770c3905467a1d81af02a35b2783ce7d614881c915ee8f8e764c1656963d6886d9c60c6e524f512e1bc496e42d01307b SHA512 07de63e47a8e547724099062239df8fcfd254f19d38be28131e6bbb094ffbab8483861fb6a5905e60d7fa7a1a5dc06785951fa31984ecad89516b0b742c47f91
40 -DIST python-gentoo-patches-3.9.13.tar.xz 12836 BLAKE2B ba687a3d6e00baf4d9640ab78a29c3e21bf1872b5019198991521cf37bb0780f592db742ee4fdfe6bfb1cab1c1f6587889dfdb024cae72766b6c83c2ffe319be SHA512 e393992ff92625771c6ffeb500637862f0163c689c685fd245a6e5bbdd3128154ce439ecab56eaf1359e67ea0d173dfb19f65a4098ea2266922bfb43aba517dc
41 DIST python-gentoo-patches-3.9.13_p4.tar.xz 22072 BLAKE2B a0e084eff35d075d2255b139d0db114d282cb6c9c0c2ea51a8ecb7f5f1dc8096d6578ae5f804b7583a2b7842152b5723ad802ca816d46813c40aaa756118afc8 SHA512 cdf8d43fd5263c4956be234f36c0767215ab2495705d4f2a060b32ecbfbe159e618e31693b0538a1b970f7b27ebe4953063f585930d074dcaf59f2f61486e6b6
42
43 diff --git a/dev-lang/python/python-3.10.4.ebuild b/dev-lang/python/python-3.10.4.ebuild
44 deleted file mode 100644
45 index 7b39aaa..0000000
46 --- a/dev-lang/python/python-3.10.4.ebuild
47 +++ /dev/null
48 @@ -1,410 +0,0 @@
49 -# Copyright 1999-2022 Gentoo Authors
50 -# Distributed under the terms of the GNU General Public License v2
51 -
52 -EAPI="7"
53 -WANT_LIBTOOL="none"
54 -
55 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
56 - python-utils-r1 toolchain-funcs verify-sig
57 -
58 -MY_PV=${PV/_rc/rc}
59 -MY_P="Python-${MY_PV%_p*}"
60 -PYVER=$(ver_cut 1-2)
61 -PATCHSET="python-gentoo-patches-${MY_PV}"
62 -
63 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
64 -HOMEPAGE="https://www.python.org/"
65 -SRC_URI="
66 - https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz
67 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
68 - verify-sig? (
69 - https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc
70 - )
71 -"
72 -S="${WORKDIR}/${MY_P}"
73 -
74 -LICENSE="PSF-2"
75 -SLOT="${PYVER}"
76 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
77 -IUSE="bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
78 -RESTRICT="!test? ( test )"
79 -
80 -# Do not add a dependency on dev-lang/python to this ebuild.
81 -# If you need to apply a patch which requires python for bootstrapping, please
82 -# run the bootstrap code on your dev box and include the results in the
83 -# patchset. See bug 447752.
84 -
85 -RDEPEND="
86 - app-arch/bzip2:=
87 - app-arch/xz-utils:=
88 - dev-lang/python-exec[python_targets_python3_10(-)]
89 - dev-libs/libffi:=
90 - sys-apps/util-linux:=
91 - >=sys-libs/zlib-1.1.3:=
92 - virtual/libcrypt:=
93 - virtual/libintl
94 - gdbm? ( sys-libs/gdbm:=[berkdb] )
95 - ncurses? ( >=sys-libs/ncurses-5.2:= )
96 - readline? (
97 - !libedit? ( >=sys-libs/readline-4.1:= )
98 - libedit? ( dev-libs/libedit:= )
99 - )
100 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
101 - ssl? ( >=dev-libs/openssl-1.1.1:= )
102 - tk? (
103 - >=dev-lang/tcl-8.0:=
104 - >=dev-lang/tk-8.0:=
105 - dev-tcltk/blt:=
106 - dev-tcltk/tix
107 - )
108 - xml? ( >=dev-libs/expat-2.1:= )
109 - !!<sys-apps/sandbox-2.21
110 -"
111 -# bluetooth requires headers from bluez
112 -DEPEND="
113 - ${RDEPEND}
114 - bluetooth? ( net-wireless/bluez )
115 - test? ( app-arch/xz-utils[extra-filters(+)] )
116 -"
117 -# autoconf-archive needed to eautoreconf
118 -BDEPEND="
119 - sys-devel/autoconf-archive
120 - virtual/awk
121 - virtual/pkgconfig
122 - verify-sig? ( sec-keys/openpgp-keys-python )
123 - !sys-devel/gcc[libffi(-)]
124 -"
125 -RDEPEND+="
126 - build? ( app-misc/mime-types )
127 -"
128 -
129 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
130 -
131 -# large file tests involve a 2.5G file being copied (duplicated)
132 -CHECKREQS_DISK_BUILD=5500M
133 -
134 -QA_PKGCONFIG_VERSION=${PYVER}
135 -
136 -pkg_pretend() {
137 - use test && check-reqs_pkg_pretend
138 -}
139 -
140 -pkg_setup() {
141 - use test && check-reqs_pkg_setup
142 -}
143 -
144 -src_unpack() {
145 - if use verify-sig; then
146 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
147 - fi
148 - default
149 -}
150 -
151 -src_prepare() {
152 - # Ensure that internal copies of expat, libffi and zlib are not used.
153 - rm -fr Modules/expat || die
154 - rm -fr Modules/_ctypes/libffi* || die
155 - rm -fr Modules/zlib || die
156 -
157 - local PATCHES=(
158 - "${WORKDIR}/${PATCHSET}"
159 - "${FILESDIR}"/${PN}-3.10.3-libressl.patch
160 - )
161 -
162 - default
163 -
164 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
165 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
166 -
167 - # force correct number of jobs
168 - # https://bugs.gentoo.org/737660
169 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
170 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
171 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
172 -
173 - eautoreconf
174 -}
175 -
176 -src_configure() {
177 - local disable
178 - # disable automagic bluetooth headers detection
179 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
180 - use gdbm || disable+=" gdbm"
181 - use ncurses || disable+=" _curses _curses_panel"
182 - use readline || disable+=" readline"
183 - use sqlite || disable+=" _sqlite3"
184 - use ssl || export PYTHON_DISABLE_SSL="1"
185 - use tk || disable+=" _tkinter"
186 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
187 - export PYTHON_DISABLE_MODULES="${disable}"
188 -
189 - if ! use xml; then
190 - ewarn "You have configured Python without XML support."
191 - ewarn "This is NOT a recommended configuration as you"
192 - ewarn "may face problems parsing any XML documents."
193 - fi
194 -
195 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
196 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
197 - fi
198 -
199 - append-flags -fwrapv
200 -
201 - filter-flags -malign-double
202 -
203 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
204 - if is-flagq -O3; then
205 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
206 - use hardened && replace-flags -O3 -O2
207 - fi
208 -
209 - # https://bugs.gentoo.org/700012
210 - if is-flagq -flto || is-flagq '-flto=*'; then
211 - append-cflags $(test-flags-CC -ffat-lto-objects)
212 - fi
213 -
214 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
215 - tc-export CXX
216 -
217 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
218 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
219 -
220 - local dbmliborder
221 - if use gdbm; then
222 - dbmliborder+="${dbmliborder:+:}gdbm"
223 - fi
224 -
225 - if use pgo; then
226 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
227 - export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
228 -
229 - # All of these seem to occasionally hang for PGO inconsistently
230 - # They'll even hang here but be fine in src_test sometimes.
231 - # bug #828535 (and related: bug #788022)
232 - PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
233 -
234 - if has_version "app-arch/rpm" ; then
235 - # Avoid sandbox failure (attempts to write to /var/lib/rpm)
236 - PROFILE_TASK+=" -x test_distutils"
237 - fi
238 - fi
239 -
240 - local myeconfargs=(
241 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
242 - # Python on glibc upgrade, remove it proactively to give
243 - # a chance for users rebuilding python before glibc
244 - ac_cv_header_stropts_h=no
245 -
246 - --enable-shared
247 - --without-static-libpython
248 - --enable-ipv6
249 - --infodir='${prefix}/share/info'
250 - --mandir='${prefix}/share/man'
251 - --with-computed-gotos
252 - --with-dbmliborder="${dbmliborder}"
253 - --with-libc=
254 - --enable-loadable-sqlite-extensions
255 - --without-ensurepip
256 - --with-system-expat
257 - --with-system-ffi
258 -
259 - $(use_with lto)
260 - $(use_enable pgo optimizations)
261 - $(use_with readline readline "$(usex libedit editline readline)")
262 - )
263 -
264 - # disable implicit optimization/debugging flags
265 - local -x OPT=
266 - # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
267 - # propagated to sysconfig for built extensions
268 - local -x CFLAGS_NODIST=${CFLAGS}
269 - local -x LDFLAGS_NODIST=${LDFLAGS}
270 - local -x CFLAGS= LDFLAGS=
271 -
272 - econf "${myeconfargs[@]}"
273 -
274 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
275 - eerror "configure has detected that the sem_open function is broken."
276 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
277 - die "Broken sem_open function (bug 496328)"
278 - fi
279 -}
280 -
281 -src_compile() {
282 - # Ensure sed works as expected
283 - # https://bugs.gentoo.org/594768
284 - local -x LC_ALL=C
285 - # Prevent using distutils bundled by setuptools.
286 - # https://bugs.gentoo.org/823728
287 - export SETUPTOOLS_USE_DISTUTILS=stdlib
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.10/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 - # bug 660358
338 - local -x COLUMNS=80
339 - local -x PYTHONDONTWRITEBYTECODE=
340 - # workaround https://bugs.gentoo.org/775416
341 - addwrite /usr/lib/python3.10/site-packages
342 -
343 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
344 -
345 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
346 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
347 - local result=$?
348 -
349 - for test in ${skipped_tests}; do
350 - mv "${T}/test_${test}.py" "${S}"/Lib/test
351 - done
352 -
353 - elog "The following tests have been skipped:"
354 - for test in ${skipped_tests}; do
355 - elog "test_${test}.py"
356 - done
357 -
358 - elog "If you would like to run them, you may:"
359 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
360 - elog "and run the tests separately."
361 -
362 - if [[ ${result} -ne 0 ]]; then
363 - die "emake test failed"
364 - fi
365 -}
366 -
367 -src_install() {
368 - local libdir=${ED}/usr/lib/python${PYVER}
369 -
370 - emake DESTDIR="${D}" altinstall
371 -
372 - # Fix collisions between different slots of Python.
373 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
374 -
375 - # Cheap hack to get version with ABIFLAGS
376 - local abiver=$(cd "${ED}/usr/include"; echo python*)
377 - if [[ ${abiver} != python${PYVER} ]]; then
378 - # Replace python3.X with a symlink to python3.Xm
379 - rm "${ED}/usr/bin/python${PYVER}" || die
380 - dosym "${abiver}" "/usr/bin/python${PYVER}"
381 - # Create python3.X-config symlink
382 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
383 - # Create python-3.5m.pc symlink
384 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
385 - fi
386 -
387 - # python seems to get rebuilt in src_install (bug 569908)
388 - # Work around it for now.
389 - if has_version dev-libs/libffi[pax-kernel]; then
390 - pax-mark E "${ED}/usr/bin/${abiver}"
391 - else
392 - pax-mark m "${ED}/usr/bin/${abiver}"
393 - fi
394 -
395 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
396 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
397 -
398 - dodoc Misc/{ACKS,HISTORY,NEWS}
399 -
400 - if use examples; then
401 - docinto examples
402 - find Tools -name __pycache__ -exec rm -fr {} + || die
403 - dodoc -r Tools
404 - fi
405 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
406 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
407 - emake --no-print-directory -s -f - 2>/dev/null)
408 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
409 -
410 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
411 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
412 - sed \
413 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
414 - -e "s:@PYDOC@:pydoc${PYVER}:" \
415 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
416 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
417 -
418 - local -x EPYTHON=python${PYVER}
419 - # if not using a cross-compiler, use the fresh binary
420 - if ! tc-is-cross-compiler; then
421 - local -x PYTHON=./python
422 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
423 - else
424 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
425 - fi
426 -
427 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
428 - python_domodule epython.py
429 -
430 - # python-exec wrapping support
431 - local pymajor=${PYVER%.*}
432 - local scriptdir=${D}$(python_get_scriptdir)
433 - mkdir -p "${scriptdir}" || die
434 - # python and pythonX
435 - ln -s "../../../bin/${abiver}" \
436 - "${scriptdir}/python${pymajor}" || die
437 - ln -s "python${pymajor}" "${scriptdir}/python" || die
438 - # python-config and pythonX-config
439 - # note: we need to create a wrapper rather than symlinking it due
440 - # to some random dirname(argv[0]) magic performed by python-config
441 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
442 - #!/bin/sh
443 - exec "${abiver}-config" "\${@}"
444 - EOF
445 - chmod +x "${scriptdir}/python${pymajor}-config" || die
446 - ln -s "python${pymajor}-config" \
447 - "${scriptdir}/python-config" || die
448 - # 2to3, pydoc
449 - ln -s "../../../bin/2to3-${PYVER}" \
450 - "${scriptdir}/2to3" || die
451 - ln -s "../../../bin/pydoc${PYVER}" \
452 - "${scriptdir}/pydoc" || die
453 - # idle
454 - if use tk; then
455 - ln -s "../../../bin/idle${PYVER}" \
456 - "${scriptdir}/idle" || die
457 - fi
458 -}
459
460 diff --git a/dev-lang/python/python-3.10.5.ebuild b/dev-lang/python/python-3.10.5.ebuild
461 deleted file mode 100644
462 index 02684e9..0000000
463 --- a/dev-lang/python/python-3.10.5.ebuild
464 +++ /dev/null
465 @@ -1,409 +0,0 @@
466 -# Copyright 1999-2022 Gentoo Authors
467 -# Distributed under the terms of the GNU General Public License v2
468 -
469 -EAPI="7"
470 -WANT_LIBTOOL="none"
471 -
472 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
473 - python-utils-r1 toolchain-funcs verify-sig
474 -
475 -MY_PV=${PV/_rc/rc}
476 -MY_P="Python-${MY_PV%_p*}"
477 -PYVER=$(ver_cut 1-2)
478 -PATCHSET="python-gentoo-patches-${MY_PV}"
479 -
480 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
481 -HOMEPAGE="https://www.python.org/"
482 -SRC_URI="
483 - https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz
484 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
485 - verify-sig? (
486 - https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc
487 - )
488 -"
489 -S="${WORKDIR}/${MY_P}"
490 -
491 -LICENSE="PSF-2"
492 -SLOT="${PYVER}"
493 -KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc ~x86"
494 -IUSE="bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
495 -RESTRICT="!test? ( test )"
496 -
497 -# Do not add a dependency on dev-lang/python to this ebuild.
498 -# If you need to apply a patch which requires python for bootstrapping, please
499 -# run the bootstrap code on your dev box and include the results in the
500 -# patchset. See bug 447752.
501 -
502 -RDEPEND="
503 - app-arch/bzip2:=
504 - app-arch/xz-utils:=
505 - dev-lang/python-exec[python_targets_python3_10(-)]
506 - dev-libs/libffi:=
507 - sys-apps/util-linux:=
508 - >=sys-libs/zlib-1.1.3:=
509 - virtual/libcrypt:=
510 - virtual/libintl
511 - gdbm? ( sys-libs/gdbm:=[berkdb] )
512 - ncurses? ( >=sys-libs/ncurses-5.2:= )
513 - readline? (
514 - !libedit? ( >=sys-libs/readline-4.1:= )
515 - libedit? ( dev-libs/libedit:= )
516 - )
517 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
518 - ssl? ( >=dev-libs/openssl-1.1.1:= )
519 - tk? (
520 - >=dev-lang/tcl-8.0:=
521 - >=dev-lang/tk-8.0:=
522 - dev-tcltk/blt:=
523 - dev-tcltk/tix
524 - )
525 - xml? ( >=dev-libs/expat-2.1:= )
526 - !!<sys-apps/sandbox-2.21
527 -"
528 -# bluetooth requires headers from bluez
529 -DEPEND="
530 - ${RDEPEND}
531 - bluetooth? ( net-wireless/bluez )
532 - test? ( app-arch/xz-utils[extra-filters(+)] )
533 -"
534 -# autoconf-archive needed to eautoreconf
535 -BDEPEND="
536 - sys-devel/autoconf-archive
537 - virtual/awk
538 - virtual/pkgconfig
539 - verify-sig? ( sec-keys/openpgp-keys-python )
540 - !sys-devel/gcc[libffi(-)]
541 -"
542 -RDEPEND+="
543 - build? ( app-misc/mime-types )
544 -"
545 -
546 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
547 -
548 -# large file tests involve a 2.5G file being copied (duplicated)
549 -CHECKREQS_DISK_BUILD=5500M
550 -
551 -QA_PKGCONFIG_VERSION=${PYVER}
552 -
553 -pkg_pretend() {
554 - use test && check-reqs_pkg_pretend
555 -}
556 -
557 -pkg_setup() {
558 - use test && check-reqs_pkg_setup
559 -}
560 -
561 -src_unpack() {
562 - if use verify-sig; then
563 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
564 - fi
565 - default
566 -}
567 -
568 -src_prepare() {
569 - # Ensure that internal copies of expat, libffi and zlib are not used.
570 - rm -fr Modules/expat || die
571 - rm -fr Modules/_ctypes/libffi* || die
572 - rm -fr Modules/zlib || die
573 -
574 - local PATCHES=(
575 - "${WORKDIR}/${PATCHSET}"
576 - "${FILESDIR}"/${PN}-3.10.3-libressl.patch
577 - )
578 -
579 - default
580 -
581 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
582 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
583 -
584 - # force correct number of jobs
585 - # https://bugs.gentoo.org/737660
586 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
587 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
588 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
589 -
590 - eautoreconf
591 -}
592 -
593 -src_configure() {
594 - local disable
595 - # disable automagic bluetooth headers detection
596 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
597 - use gdbm || disable+=" gdbm"
598 - use ncurses || disable+=" _curses _curses_panel"
599 - use readline || disable+=" readline"
600 - use sqlite || disable+=" _sqlite3"
601 - use ssl || export PYTHON_DISABLE_SSL="1"
602 - use tk || disable+=" _tkinter"
603 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
604 - export PYTHON_DISABLE_MODULES="${disable}"
605 -
606 - if ! use xml; then
607 - ewarn "You have configured Python without XML support."
608 - ewarn "This is NOT a recommended configuration as you"
609 - ewarn "may face problems parsing any XML documents."
610 - fi
611 -
612 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
613 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
614 - fi
615 -
616 - append-flags -fwrapv
617 -
618 - filter-flags -malign-double
619 -
620 - # https://bugs.gentoo.org/700012
621 - if is-flagq -flto || is-flagq '-flto=*'; then
622 - append-cflags $(test-flags-CC -ffat-lto-objects)
623 - fi
624 -
625 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
626 - tc-export CXX
627 -
628 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
629 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
630 -
631 - local dbmliborder
632 - if use gdbm; then
633 - dbmliborder+="${dbmliborder:+:}gdbm"
634 - fi
635 -
636 - if use pgo; then
637 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
638 - export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
639 -
640 - # All of these seem to occasionally hang for PGO inconsistently
641 - # They'll even hang here but be fine in src_test sometimes.
642 - # bug #828535 (and related: bug #788022)
643 - PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
644 -
645 - if has_version "app-arch/rpm" ; then
646 - # Avoid sandbox failure (attempts to write to /var/lib/rpm)
647 - PROFILE_TASK+=" -x test_distutils"
648 - fi
649 - fi
650 -
651 - local myeconfargs=(
652 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
653 - # Python on glibc upgrade, remove it proactively to give
654 - # a chance for users rebuilding python before glibc
655 - ac_cv_header_stropts_h=no
656 -
657 - --enable-shared
658 - --without-static-libpython
659 - --enable-ipv6
660 - --infodir='${prefix}/share/info'
661 - --mandir='${prefix}/share/man'
662 - --with-computed-gotos
663 - --with-dbmliborder="${dbmliborder}"
664 - --with-libc=
665 - --enable-loadable-sqlite-extensions
666 - --without-ensurepip
667 - --with-system-expat
668 - --with-system-ffi
669 -
670 - $(use_with lto)
671 - $(use_enable pgo optimizations)
672 - $(use_with readline readline "$(usex libedit editline readline)")
673 - )
674 -
675 - # disable implicit optimization/debugging flags
676 - local -x OPT=
677 - # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
678 - # propagated to sysconfig for built extensions
679 - local -x CFLAGS_NODIST=${CFLAGS}
680 - local -x LDFLAGS_NODIST=${LDFLAGS}
681 - local -x CFLAGS= LDFLAGS=
682 -
683 - econf "${myeconfargs[@]}"
684 -
685 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
686 - eerror "configure has detected that the sem_open function is broken."
687 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
688 - die "Broken sem_open function (bug 496328)"
689 - fi
690 -}
691 -
692 -src_compile() {
693 - # Ensure sed works as expected
694 - # https://bugs.gentoo.org/594768
695 - local -x LC_ALL=C
696 - # Prevent using distutils bundled by setuptools.
697 - # https://bugs.gentoo.org/823728
698 - export SETUPTOOLS_USE_DISTUTILS=stdlib
699 -
700 - # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
701 - # end up writing bytecode & violating sandbox.
702 - # bug #831897
703 - local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
704 -
705 - if use pgo ; then
706 - # bug 660358
707 - local -x COLUMNS=80
708 - local -x PYTHONDONTWRITEBYTECODE=
709 -
710 - addpredict /usr/lib/python3.10/site-packages
711 - fi
712 -
713 - # also need to clear the flags explicitly here or they end up
714 - # in _sysconfigdata*
715 - emake CPPFLAGS= CFLAGS= LDFLAGS=
716 -
717 - # Restore saved value from above.
718 - local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE}
719 -
720 - # Work around bug 329499. See also bug 413751 and 457194.
721 - if has_version dev-libs/libffi[pax-kernel]; then
722 - pax-mark E python
723 - else
724 - pax-mark m python
725 - fi
726 -}
727 -
728 -src_test() {
729 - # Tests will not work when cross compiling.
730 - if tc-is-cross-compiler; then
731 - elog "Disabling tests due to crosscompiling."
732 - return
733 - fi
734 -
735 - # Skip failing tests.
736 - local skipped_tests="gdb"
737 -
738 - if use sparc ; then
739 - # bug #788022
740 - skipped_tests+=" multiprocessing_fork"
741 - skipped_tests+=" multiprocessing_forkserver"
742 - fi
743 -
744 - for test in ${skipped_tests}; do
745 - mv "${S}"/Lib/test/test_${test}.py "${T}"
746 - done
747 -
748 - # bug 660358
749 - local -x COLUMNS=80
750 - local -x PYTHONDONTWRITEBYTECODE=
751 - # workaround https://bugs.gentoo.org/775416
752 - addwrite /usr/lib/python3.10/site-packages
753 -
754 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
755 -
756 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
757 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
758 - local result=$?
759 -
760 - for test in ${skipped_tests}; do
761 - mv "${T}/test_${test}.py" "${S}"/Lib/test
762 - done
763 -
764 - elog "The following tests have been skipped:"
765 - for test in ${skipped_tests}; do
766 - elog "test_${test}.py"
767 - done
768 -
769 - elog "If you would like to run them, you may:"
770 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
771 - elog "and run the tests separately."
772 -
773 - if [[ ${result} -ne 0 ]]; then
774 - die "emake test failed"
775 - fi
776 -}
777 -
778 -src_install() {
779 - local libdir=${ED}/usr/lib/python${PYVER}
780 -
781 - emake DESTDIR="${D}" altinstall
782 -
783 - # Fix collisions between different slots of Python.
784 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
785 -
786 - # Cheap hack to get version with ABIFLAGS
787 - local abiver=$(cd "${ED}/usr/include"; echo python*)
788 - if [[ ${abiver} != python${PYVER} ]]; then
789 - # Replace python3.X with a symlink to python3.Xm
790 - rm "${ED}/usr/bin/python${PYVER}" || die
791 - dosym "${abiver}" "/usr/bin/python${PYVER}"
792 - # Create python3.X-config symlink
793 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
794 - # Create python-3.5m.pc symlink
795 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
796 - fi
797 -
798 - # python seems to get rebuilt in src_install (bug 569908)
799 - # Work around it for now.
800 - if has_version dev-libs/libffi[pax-kernel]; then
801 - pax-mark E "${ED}/usr/bin/${abiver}"
802 - else
803 - pax-mark m "${ED}/usr/bin/${abiver}"
804 - fi
805 -
806 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
807 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
808 -
809 - dodoc Misc/{ACKS,HISTORY,NEWS}
810 -
811 - if use examples; then
812 - docinto examples
813 - find Tools -name __pycache__ -exec rm -fr {} + || die
814 - dodoc -r Tools
815 - fi
816 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
817 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
818 - emake --no-print-directory -s -f - 2>/dev/null)
819 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
820 -
821 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
822 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
823 - sed \
824 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
825 - -e "s:@PYDOC@:pydoc${PYVER}:" \
826 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
827 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
828 -
829 - local -x EPYTHON=python${PYVER}
830 - # if not using a cross-compiler, use the fresh binary
831 - if ! tc-is-cross-compiler; then
832 - cat > python.wrap <<-EOF || die
833 - #!/bin/sh
834 - export LD_LIBRARY_PATH=\${PWD}\${LD_LIBRARY_PATH+:\${LD_LIBRARY_PATH}}
835 - exec ./python "\${@}"
836 - EOF
837 - chmod +x python.wrap || die
838 - local -x PYTHON=./python.wrap
839 - else
840 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
841 - fi
842 -
843 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
844 - python_domodule epython.py
845 -
846 - # python-exec wrapping support
847 - local pymajor=${PYVER%.*}
848 - local scriptdir=${D}$(python_get_scriptdir)
849 - mkdir -p "${scriptdir}" || die
850 - # python and pythonX
851 - ln -s "../../../bin/${abiver}" \
852 - "${scriptdir}/python${pymajor}" || die
853 - ln -s "python${pymajor}" "${scriptdir}/python" || die
854 - # python-config and pythonX-config
855 - # note: we need to create a wrapper rather than symlinking it due
856 - # to some random dirname(argv[0]) magic performed by python-config
857 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
858 - #!/bin/sh
859 - exec "${abiver}-config" "\${@}"
860 - EOF
861 - chmod +x "${scriptdir}/python${pymajor}-config" || die
862 - ln -s "python${pymajor}-config" \
863 - "${scriptdir}/python-config" || die
864 - # 2to3, pydoc
865 - ln -s "../../../bin/2to3-${PYVER}" \
866 - "${scriptdir}/2to3" || die
867 - ln -s "../../../bin/pydoc${PYVER}" \
868 - "${scriptdir}/pydoc" || die
869 - # idle
870 - if use tk; then
871 - ln -s "../../../bin/idle${PYVER}" \
872 - "${scriptdir}/idle" || die
873 - fi
874 -}
875
876 diff --git a/dev-lang/python/python-3.9.12.ebuild b/dev-lang/python/python-3.9.12.ebuild
877 deleted file mode 100644
878 index e45953a..0000000
879 --- a/dev-lang/python/python-3.9.12.ebuild
880 +++ /dev/null
881 @@ -1,406 +0,0 @@
882 -# Copyright 1999-2022 Gentoo Authors
883 -# Distributed under the terms of the GNU General Public License v2
884 -
885 -EAPI="7"
886 -WANT_LIBTOOL="none"
887 -
888 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
889 - python-utils-r1 toolchain-funcs verify-sig
890 -
891 -MY_PV=${PV/_rc/rc}
892 -MY_P="Python-${MY_PV%_p*}"
893 -PYVER=$(ver_cut 1-2)
894 -PATCHSET="python-gentoo-patches-${MY_PV}"
895 -
896 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
897 -HOMEPAGE="https://www.python.org/"
898 -SRC_URI="
899 - https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
900 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
901 - verify-sig? (
902 - https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
903 - )
904 -"
905 -S="${WORKDIR}/${MY_P}"
906 -
907 -LICENSE="PSF-2"
908 -SLOT="${PYVER}"
909 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
910 -IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
911 -RESTRICT="!test? ( test )"
912 -
913 -# Do not add a dependency on dev-lang/python to this ebuild.
914 -# If you need to apply a patch which requires python for bootstrapping, please
915 -# run the bootstrap code on your dev box and include the results in the
916 -# patchset. See bug 447752.
917 -
918 -RDEPEND="
919 - app-arch/bzip2:=
920 - app-arch/xz-utils:=
921 - dev-lang/python-exec[python_targets_python3_9(-)]
922 - dev-libs/libffi:=
923 - sys-apps/util-linux:=
924 - >=sys-libs/zlib-1.1.3:=
925 - virtual/libcrypt:=
926 - virtual/libintl
927 - gdbm? ( sys-libs/gdbm:=[berkdb] )
928 - ncurses? ( >=sys-libs/ncurses-5.2:= )
929 - readline? ( >=sys-libs/readline-4.1:= )
930 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
931 - ssl? ( >=dev-libs/openssl-1.1.1:= )
932 - tk? (
933 - >=dev-lang/tcl-8.0:=
934 - >=dev-lang/tk-8.0:=
935 - dev-tcltk/blt:=
936 - dev-tcltk/tix
937 - )
938 - xml? ( >=dev-libs/expat-2.1:= )
939 -"
940 -# bluetooth requires headers from bluez
941 -DEPEND="
942 - ${RDEPEND}
943 - bluetooth? ( net-wireless/bluez )
944 - test? ( app-arch/xz-utils[extra-filters(+)] )
945 -"
946 -BDEPEND="
947 - virtual/awk
948 - virtual/pkgconfig
949 - sys-devel/autoconf-archive
950 - verify-sig? ( sec-keys/openpgp-keys-python )
951 - !sys-devel/gcc[libffi(-)]
952 -"
953 -RDEPEND+="
954 - !build? ( app-misc/mime-types )
955 -"
956 -
957 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
958 -
959 -# large file tests involve a 2.5G file being copied (duplicated)
960 -CHECKREQS_DISK_BUILD=5500M
961 -
962 -QA_PKGCONFIG_VERSION=${PYVER}
963 -
964 -pkg_pretend() {
965 - use test && check-reqs_pkg_pretend
966 -}
967 -
968 -pkg_setup() {
969 - use test && check-reqs_pkg_setup
970 -}
971 -
972 -src_unpack() {
973 - if use verify-sig; then
974 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
975 - fi
976 - default
977 -}
978 -
979 -src_prepare() {
980 - # Ensure that internal copies of expat, libffi and zlib are not used.
981 - rm -fr Modules/expat || die
982 - rm -fr Modules/_ctypes/libffi* || die
983 - rm -fr Modules/zlib || die
984 -
985 - rm -f "${WORKDIR}/${PATCHSET}"/0013-bpo-43998-Default-to-TLS-1.2-and-increase-cipher-sui.patch || die
986 -
987 - local PATCHES=(
988 - "${WORKDIR}/${PATCHSET}"
989 - "${FILESDIR}"/${PN}-3.9.9-r1-libressl.patch
990 - )
991 -
992 - default
993 -
994 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
995 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
996 -
997 - # force correct number of jobs
998 - # https://bugs.gentoo.org/737660
999 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
1000 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
1001 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
1002 -
1003 - eautoreconf
1004 -}
1005 -
1006 -src_configure() {
1007 - local disable
1008 - # disable automagic bluetooth headers detection
1009 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
1010 - use gdbm || disable+=" gdbm"
1011 - use ncurses || disable+=" _curses _curses_panel"
1012 - use readline || disable+=" readline"
1013 - use sqlite || disable+=" _sqlite3"
1014 - use ssl || export PYTHON_DISABLE_SSL="1"
1015 - use tk || disable+=" _tkinter"
1016 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
1017 - export PYTHON_DISABLE_MODULES="${disable}"
1018 -
1019 - if ! use xml; then
1020 - ewarn "You have configured Python without XML support."
1021 - ewarn "This is NOT a recommended configuration as you"
1022 - ewarn "may face problems parsing any XML documents."
1023 - fi
1024 -
1025 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
1026 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
1027 - fi
1028 -
1029 - append-flags -fwrapv
1030 -
1031 - filter-flags -malign-double
1032 -
1033 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
1034 - if is-flagq -O3; then
1035 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
1036 - use hardened && replace-flags -O3 -O2
1037 - fi
1038 -
1039 - # https://bugs.gentoo.org/700012
1040 - if is-flagq -flto || is-flagq '-flto=*'; then
1041 - append-cflags $(test-flags-CC -ffat-lto-objects)
1042 - fi
1043 -
1044 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
1045 - tc-export CXX
1046 -
1047 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
1048 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
1049 -
1050 - local dbmliborder
1051 - if use gdbm; then
1052 - dbmliborder+="${dbmliborder:+:}gdbm"
1053 - fi
1054 -
1055 - if use pgo; then
1056 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
1057 - export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
1058 -
1059 - # All of these seem to occasionally hang for PGO inconsistently
1060 - # They'll even hang here but be fine in src_test sometimes.
1061 - # bug #828535 (and related: bug #788022)
1062 - PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
1063 -
1064 - if has_version "app-arch/rpm" ; then
1065 - # Avoid sandbox failure (attempts to write to /var/lib/rpm)
1066 - PROFILE_TASK+=" -x test_distutils"
1067 - fi
1068 - fi
1069 -
1070 - local myeconfargs=(
1071 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
1072 - # Python on glibc upgrade, remove it proactively to give
1073 - # a chance for users rebuilding python before glibc
1074 - ac_cv_header_stropts_h=no
1075 -
1076 - --enable-shared
1077 - --enable-ipv6
1078 - --infodir='${prefix}/share/info'
1079 - --mandir='${prefix}/share/man'
1080 - --with-computed-gotos
1081 - --with-dbmliborder="${dbmliborder}"
1082 - --with-libc=
1083 - --enable-loadable-sqlite-extensions
1084 - --without-ensurepip
1085 - --with-system-expat
1086 - --with-system-ffi
1087 -
1088 - $(use_with lto)
1089 - $(use_enable pgo optimizations)
1090 - )
1091 -
1092 - # disable implicit optimization/debugging flags
1093 - local -x OPT=
1094 - # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
1095 - # propagated to sysconfig for built extensions
1096 - local -x CFLAGS_NODIST=${CFLAGS}
1097 - local -x LDFLAGS_NODIST=${LDFLAGS}
1098 - local -x CFLAGS= LDFLAGS=
1099 -
1100 - econf "${myeconfargs[@]}"
1101 -
1102 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
1103 - eerror "configure has detected that the sem_open function is broken."
1104 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
1105 - die "Broken sem_open function (bug 496328)"
1106 - fi
1107 -}
1108 -
1109 -src_compile() {
1110 - # Ensure sed works as expected
1111 - # https://bugs.gentoo.org/594768
1112 - local -x LC_ALL=C
1113 - # Prevent using distutils bundled by setuptools.
1114 - # https://bugs.gentoo.org/823728
1115 - export SETUPTOOLS_USE_DISTUTILS=stdlib
1116 -
1117 - # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
1118 - # end up writing bytecode & violating sandbox.
1119 - # bug #831897
1120 - local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
1121 -
1122 - if use pgo ; then
1123 - # bug 660358
1124 - local -x COLUMNS=80
1125 - local -x PYTHONDONTWRITEBYTECODE=
1126 -
1127 - addpredict /usr/lib/python3.9/site-packages
1128 - fi
1129 -
1130 - # also need to clear the flags explicitly here or they end up
1131 - # in _sysconfigdata*
1132 - emake CPPFLAGS= CFLAGS= LDFLAGS=
1133 -
1134 - # Restore saved value from above.
1135 - local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE}
1136 -
1137 - # Work around bug 329499. See also bug 413751 and 457194.
1138 - if has_version dev-libs/libffi[pax-kernel]; then
1139 - pax-mark E python
1140 - else
1141 - pax-mark m python
1142 - fi
1143 -}
1144 -
1145 -src_test() {
1146 - # Tests will not work when cross compiling.
1147 - if tc-is-cross-compiler; then
1148 - elog "Disabling tests due to crosscompiling."
1149 - return
1150 - fi
1151 -
1152 - # Skip failing tests.
1153 - local skipped_tests="gdb"
1154 -
1155 - if use sparc ; then
1156 - # bug #788022
1157 - skipped_tests+=" multiprocessing_fork"
1158 - skipped_tests+=" multiprocessing_forkserver"
1159 - fi
1160 -
1161 - for test in ${skipped_tests}; do
1162 - mv "${S}"/Lib/test/test_${test}.py "${T}"
1163 - done
1164 -
1165 - # bug 660358
1166 - local -x COLUMNS=80
1167 - local -x PYTHONDONTWRITEBYTECODE=
1168 -
1169 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
1170 -
1171 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
1172 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
1173 - local result=$?
1174 -
1175 - for test in ${skipped_tests}; do
1176 - mv "${T}/test_${test}.py" "${S}"/Lib/test
1177 - done
1178 -
1179 - elog "The following tests have been skipped:"
1180 - for test in ${skipped_tests}; do
1181 - elog "test_${test}.py"
1182 - done
1183 -
1184 - elog "If you would like to run them, you may:"
1185 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
1186 - elog "and run the tests separately."
1187 -
1188 - if [[ ${result} -ne 0 ]]; then
1189 - die "emake test failed"
1190 - fi
1191 -}
1192 -
1193 -src_install() {
1194 - local libdir=${ED}/usr/lib/python${PYVER}
1195 -
1196 - emake DESTDIR="${D}" altinstall
1197 -
1198 - # Remove static library
1199 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
1200 -
1201 - # Fix collisions between different slots of Python.
1202 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
1203 -
1204 - # Cheap hack to get version with ABIFLAGS
1205 - local abiver=$(cd "${ED}/usr/include"; echo python*)
1206 - if [[ ${abiver} != python${PYVER} ]]; then
1207 - # Replace python3.X with a symlink to python3.Xm
1208 - rm "${ED}/usr/bin/python${PYVER}" || die
1209 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1210 - # Create python3.X-config symlink
1211 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1212 - # Create python-3.5m.pc symlink
1213 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1214 - fi
1215 -
1216 - # python seems to get rebuilt in src_install (bug 569908)
1217 - # Work around it for now.
1218 - if has_version dev-libs/libffi[pax-kernel]; then
1219 - pax-mark E "${ED}/usr/bin/${abiver}"
1220 - else
1221 - pax-mark m "${ED}/usr/bin/${abiver}"
1222 - fi
1223 -
1224 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
1225 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
1226 -
1227 - dodoc Misc/{ACKS,HISTORY,NEWS}
1228 -
1229 - if use examples; then
1230 - docinto examples
1231 - find Tools -name __pycache__ -exec rm -fr {} + || die
1232 - dodoc -r Tools
1233 - fi
1234 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1235 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1236 - emake --no-print-directory -s -f - 2>/dev/null)
1237 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1238 -
1239 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1240 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1241 - sed \
1242 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1243 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1244 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
1245 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
1246 -
1247 - local -x EPYTHON=python${PYVER}
1248 - # if not using a cross-compiler, use the fresh binary
1249 - if ! tc-is-cross-compiler; then
1250 - local -x PYTHON=./python
1251 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
1252 - else
1253 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
1254 - fi
1255 -
1256 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1257 - python_domodule epython.py
1258 -
1259 - # python-exec wrapping support
1260 - local pymajor=${PYVER%.*}
1261 - local scriptdir=${D}$(python_get_scriptdir)
1262 - mkdir -p "${scriptdir}" || die
1263 - # python and pythonX
1264 - ln -s "../../../bin/${abiver}" \
1265 - "${scriptdir}/python${pymajor}" || die
1266 - ln -s "python${pymajor}" "${scriptdir}/python" || die
1267 - # python-config and pythonX-config
1268 - # note: we need to create a wrapper rather than symlinking it due
1269 - # to some random dirname(argv[0]) magic performed by python-config
1270 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
1271 - #!/bin/sh
1272 - exec "${abiver}-config" "\${@}"
1273 - EOF
1274 - chmod +x "${scriptdir}/python${pymajor}-config" || die
1275 - ln -s "python${pymajor}-config" \
1276 - "${scriptdir}/python-config" || die
1277 - # 2to3, pydoc
1278 - ln -s "../../../bin/2to3-${PYVER}" \
1279 - "${scriptdir}/2to3" || die
1280 - ln -s "../../../bin/pydoc${PYVER}" \
1281 - "${scriptdir}/pydoc" || die
1282 - # idle
1283 - if use tk; then
1284 - ln -s "../../../bin/idle${PYVER}" \
1285 - "${scriptdir}/idle" || die
1286 - fi
1287 -}
1288
1289 diff --git a/dev-lang/python/python-3.9.13.ebuild b/dev-lang/python/python-3.9.13.ebuild
1290 deleted file mode 100644
1291 index 60a681c..0000000
1292 --- a/dev-lang/python/python-3.9.13.ebuild
1293 +++ /dev/null
1294 @@ -1,405 +0,0 @@
1295 -# Copyright 1999-2022 Gentoo Authors
1296 -# Distributed under the terms of the GNU General Public License v2
1297 -
1298 -EAPI="7"
1299 -WANT_LIBTOOL="none"
1300 -
1301 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
1302 - python-utils-r1 toolchain-funcs verify-sig
1303 -
1304 -MY_PV=${PV/_rc/rc}
1305 -MY_P="Python-${MY_PV%_p*}"
1306 -PYVER=$(ver_cut 1-2)
1307 -PATCHSET="python-gentoo-patches-${MY_PV}"
1308 -
1309 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
1310 -HOMEPAGE="https://www.python.org/"
1311 -SRC_URI="
1312 - https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
1313 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
1314 - verify-sig? (
1315 - https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
1316 - )
1317 -"
1318 -S="${WORKDIR}/${MY_P}"
1319 -
1320 -LICENSE="PSF-2"
1321 -SLOT="${PYVER}"
1322 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc ~x86"
1323 -IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
1324 -RESTRICT="!test? ( test )"
1325 -
1326 -# Do not add a dependency on dev-lang/python to this ebuild.
1327 -# If you need to apply a patch which requires python for bootstrapping, please
1328 -# run the bootstrap code on your dev box and include the results in the
1329 -# patchset. See bug 447752.
1330 -
1331 -RDEPEND="
1332 - app-arch/bzip2:=
1333 - app-arch/xz-utils:=
1334 - dev-lang/python-exec[python_targets_python3_9(-)]
1335 - dev-libs/libffi:=
1336 - sys-apps/util-linux:=
1337 - >=sys-libs/zlib-1.1.3:=
1338 - virtual/libcrypt:=
1339 - virtual/libintl
1340 - gdbm? ( sys-libs/gdbm:=[berkdb] )
1341 - ncurses? ( >=sys-libs/ncurses-5.2:= )
1342 - readline? ( >=sys-libs/readline-4.1:= )
1343 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
1344 - ssl? ( >=dev-libs/openssl-1.1.1:= )
1345 - tk? (
1346 - >=dev-lang/tcl-8.0:=
1347 - >=dev-lang/tk-8.0:=
1348 - dev-tcltk/blt:=
1349 - dev-tcltk/tix
1350 - )
1351 - xml? ( >=dev-libs/expat-2.1:= )
1352 -"
1353 -# bluetooth requires headers from bluez
1354 -DEPEND="
1355 - ${RDEPEND}
1356 - bluetooth? ( net-wireless/bluez )
1357 - test? ( app-arch/xz-utils[extra-filters(+)] )
1358 -"
1359 -BDEPEND="
1360 - virtual/awk
1361 - virtual/pkgconfig
1362 - sys-devel/autoconf-archive
1363 - verify-sig? ( sec-keys/openpgp-keys-python )
1364 - !sys-devel/gcc[libffi(-)]
1365 -"
1366 -RDEPEND+="
1367 - !build? ( app-misc/mime-types )
1368 -"
1369 -
1370 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
1371 -
1372 -# large file tests involve a 2.5G file being copied (duplicated)
1373 -CHECKREQS_DISK_BUILD=5500M
1374 -
1375 -QA_PKGCONFIG_VERSION=${PYVER}
1376 -
1377 -pkg_pretend() {
1378 - use test && check-reqs_pkg_pretend
1379 -}
1380 -
1381 -pkg_setup() {
1382 - use test && check-reqs_pkg_setup
1383 -}
1384 -
1385 -src_unpack() {
1386 - if use verify-sig; then
1387 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
1388 - fi
1389 - default
1390 -}
1391 -
1392 -src_prepare() {
1393 - # Ensure that internal copies of expat, libffi and zlib are not used.
1394 - rm -fr Modules/expat || die
1395 - rm -fr Modules/_ctypes/libffi* || die
1396 - rm -fr Modules/zlib || die
1397 -
1398 - rm -f "${WORKDIR}/${PATCHSET}"/0013-bpo-43998-Default-to-TLS-1.2-and-increase-cipher-sui.patch || die
1399 -
1400 - local PATCHES=(
1401 - "${WORKDIR}/${PATCHSET}"
1402 - "${FILESDIR}"/${PN}-3.9.9-r1-libressl.patch
1403 - )
1404 -
1405 - default
1406 -
1407 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
1408 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
1409 -
1410 - # force correct number of jobs
1411 - # https://bugs.gentoo.org/737660
1412 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
1413 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
1414 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
1415 -
1416 - eautoreconf
1417 -}
1418 -
1419 -src_configure() {
1420 - local disable
1421 - # disable automagic bluetooth headers detection
1422 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
1423 - use gdbm || disable+=" gdbm"
1424 - use ncurses || disable+=" _curses _curses_panel"
1425 - use readline || disable+=" readline"
1426 - use sqlite || disable+=" _sqlite3"
1427 - use ssl || export PYTHON_DISABLE_SSL="1"
1428 - use tk || disable+=" _tkinter"
1429 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
1430 - export PYTHON_DISABLE_MODULES="${disable}"
1431 -
1432 - if ! use xml; then
1433 - ewarn "You have configured Python without XML support."
1434 - ewarn "This is NOT a recommended configuration as you"
1435 - ewarn "may face problems parsing any XML documents."
1436 - fi
1437 -
1438 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
1439 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
1440 - fi
1441 -
1442 - append-flags -fwrapv
1443 -
1444 - filter-flags -malign-double
1445 -
1446 - # https://bugs.gentoo.org/700012
1447 - if is-flagq -flto || is-flagq '-flto=*'; then
1448 - append-cflags $(test-flags-CC -ffat-lto-objects)
1449 - fi
1450 -
1451 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
1452 - tc-export CXX
1453 -
1454 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
1455 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
1456 -
1457 - local dbmliborder
1458 - if use gdbm; then
1459 - dbmliborder+="${dbmliborder:+:}gdbm"
1460 - fi
1461 -
1462 - if use pgo; then
1463 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
1464 - export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
1465 -
1466 - # All of these seem to occasionally hang for PGO inconsistently
1467 - # They'll even hang here but be fine in src_test sometimes.
1468 - # bug #828535 (and related: bug #788022)
1469 - PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
1470 -
1471 - if has_version "app-arch/rpm" ; then
1472 - # Avoid sandbox failure (attempts to write to /var/lib/rpm)
1473 - PROFILE_TASK+=" -x test_distutils"
1474 - fi
1475 - fi
1476 -
1477 - local myeconfargs=(
1478 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
1479 - # Python on glibc upgrade, remove it proactively to give
1480 - # a chance for users rebuilding python before glibc
1481 - ac_cv_header_stropts_h=no
1482 -
1483 - --enable-shared
1484 - --enable-ipv6
1485 - --infodir='${prefix}/share/info'
1486 - --mandir='${prefix}/share/man'
1487 - --with-computed-gotos
1488 - --with-dbmliborder="${dbmliborder}"
1489 - --with-libc=
1490 - --enable-loadable-sqlite-extensions
1491 - --without-ensurepip
1492 - --with-system-expat
1493 - --with-system-ffi
1494 -
1495 - $(use_with lto)
1496 - $(use_enable pgo optimizations)
1497 - )
1498 -
1499 - # disable implicit optimization/debugging flags
1500 - local -x OPT=
1501 - # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
1502 - # propagated to sysconfig for built extensions
1503 - local -x CFLAGS_NODIST=${CFLAGS}
1504 - local -x LDFLAGS_NODIST=${LDFLAGS}
1505 - local -x CFLAGS= LDFLAGS=
1506 -
1507 - econf "${myeconfargs[@]}"
1508 -
1509 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
1510 - eerror "configure has detected that the sem_open function is broken."
1511 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
1512 - die "Broken sem_open function (bug 496328)"
1513 - fi
1514 -}
1515 -
1516 -src_compile() {
1517 - # Ensure sed works as expected
1518 - # https://bugs.gentoo.org/594768
1519 - local -x LC_ALL=C
1520 - # Prevent using distutils bundled by setuptools.
1521 - # https://bugs.gentoo.org/823728
1522 - export SETUPTOOLS_USE_DISTUTILS=stdlib
1523 -
1524 - # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
1525 - # end up writing bytecode & violating sandbox.
1526 - # bug #831897
1527 - local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
1528 -
1529 - if use pgo ; then
1530 - # bug 660358
1531 - local -x COLUMNS=80
1532 - local -x PYTHONDONTWRITEBYTECODE=
1533 -
1534 - addpredict /usr/lib/python3.9/site-packages
1535 - fi
1536 -
1537 - # also need to clear the flags explicitly here or they end up
1538 - # in _sysconfigdata*
1539 - emake CPPFLAGS= CFLAGS= LDFLAGS=
1540 -
1541 - # Restore saved value from above.
1542 - local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE}
1543 -
1544 - # Work around bug 329499. See also bug 413751 and 457194.
1545 - if has_version dev-libs/libffi[pax-kernel]; then
1546 - pax-mark E python
1547 - else
1548 - pax-mark m python
1549 - fi
1550 -}
1551 -
1552 -src_test() {
1553 - # Tests will not work when cross compiling.
1554 - if tc-is-cross-compiler; then
1555 - elog "Disabling tests due to crosscompiling."
1556 - return
1557 - fi
1558 -
1559 - # Skip failing tests.
1560 - local skipped_tests="gdb"
1561 -
1562 - if use sparc ; then
1563 - # bug #788022
1564 - skipped_tests+=" multiprocessing_fork"
1565 - skipped_tests+=" multiprocessing_forkserver"
1566 - fi
1567 -
1568 - for test in ${skipped_tests}; do
1569 - mv "${S}"/Lib/test/test_${test}.py "${T}"
1570 - done
1571 -
1572 - # bug 660358
1573 - local -x COLUMNS=80
1574 - local -x PYTHONDONTWRITEBYTECODE=
1575 -
1576 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
1577 -
1578 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
1579 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
1580 - local result=$?
1581 -
1582 - for test in ${skipped_tests}; do
1583 - mv "${T}/test_${test}.py" "${S}"/Lib/test
1584 - done
1585 -
1586 - elog "The following tests have been skipped:"
1587 - for test in ${skipped_tests}; do
1588 - elog "test_${test}.py"
1589 - done
1590 -
1591 - elog "If you would like to run them, you may:"
1592 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
1593 - elog "and run the tests separately."
1594 -
1595 - if [[ ${result} -ne 0 ]]; then
1596 - die "emake test failed"
1597 - fi
1598 -}
1599 -
1600 -src_install() {
1601 - local libdir=${ED}/usr/lib/python${PYVER}
1602 -
1603 - emake DESTDIR="${D}" altinstall
1604 -
1605 - # Remove static library
1606 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
1607 -
1608 - # Fix collisions between different slots of Python.
1609 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
1610 -
1611 - # Cheap hack to get version with ABIFLAGS
1612 - local abiver=$(cd "${ED}/usr/include"; echo python*)
1613 - if [[ ${abiver} != python${PYVER} ]]; then
1614 - # Replace python3.X with a symlink to python3.Xm
1615 - rm "${ED}/usr/bin/python${PYVER}" || die
1616 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1617 - # Create python3.X-config symlink
1618 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1619 - # Create python-3.5m.pc symlink
1620 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1621 - fi
1622 -
1623 - # python seems to get rebuilt in src_install (bug 569908)
1624 - # Work around it for now.
1625 - if has_version dev-libs/libffi[pax-kernel]; then
1626 - pax-mark E "${ED}/usr/bin/${abiver}"
1627 - else
1628 - pax-mark m "${ED}/usr/bin/${abiver}"
1629 - fi
1630 -
1631 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
1632 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
1633 -
1634 - dodoc Misc/{ACKS,HISTORY,NEWS}
1635 -
1636 - if use examples; then
1637 - docinto examples
1638 - find Tools -name __pycache__ -exec rm -fr {} + || die
1639 - dodoc -r Tools
1640 - fi
1641 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1642 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1643 - emake --no-print-directory -s -f - 2>/dev/null)
1644 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1645 -
1646 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1647 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1648 - sed \
1649 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1650 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1651 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
1652 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
1653 -
1654 - local -x EPYTHON=python${PYVER}
1655 - # if not using a cross-compiler, use the fresh binary
1656 - if ! tc-is-cross-compiler; then
1657 - cat > python.wrap <<-EOF || die
1658 - #!/bin/sh
1659 - export LD_LIBRARY_PATH=\${PWD}\${LD_LIBRARY_PATH+:\${LD_LIBRARY_PATH}}
1660 - exec ./python "\${@}"
1661 - EOF
1662 - chmod +x python.wrap || die
1663 - local -x PYTHON=./python.wrap
1664 - else
1665 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
1666 - fi
1667 -
1668 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1669 - python_domodule epython.py
1670 -
1671 - # python-exec wrapping support
1672 - local pymajor=${PYVER%.*}
1673 - local scriptdir=${D}$(python_get_scriptdir)
1674 - mkdir -p "${scriptdir}" || die
1675 - # python and pythonX
1676 - ln -s "../../../bin/${abiver}" \
1677 - "${scriptdir}/python${pymajor}" || die
1678 - ln -s "python${pymajor}" "${scriptdir}/python" || die
1679 - # python-config and pythonX-config
1680 - # note: we need to create a wrapper rather than symlinking it due
1681 - # to some random dirname(argv[0]) magic performed by python-config
1682 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
1683 - #!/bin/sh
1684 - exec "${abiver}-config" "\${@}"
1685 - EOF
1686 - chmod +x "${scriptdir}/python${pymajor}-config" || die
1687 - ln -s "python${pymajor}-config" \
1688 - "${scriptdir}/python-config" || die
1689 - # 2to3, pydoc
1690 - ln -s "../../../bin/2to3-${PYVER}" \
1691 - "${scriptdir}/2to3" || die
1692 - ln -s "../../../bin/pydoc${PYVER}" \
1693 - "${scriptdir}/pydoc" || die
1694 - # idle
1695 - if use tk; then
1696 - ln -s "../../../bin/idle${PYVER}" \
1697 - "${scriptdir}/idle" || die
1698 - fi
1699 -}