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, 04 May 2021 12:41:40
Message-Id: 1620132089.770c204d92603aa15921c08dc688f7e0797352b6.mgorny@gentoo
1 commit: 770c204d92603aa15921c08dc688f7e0797352b6
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 4 12:00:02 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue May 4 12:41:29 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=770c204d
7
8 dev-lang/python: Bump to 3.8.10
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.8.10.ebuild | 336 +++++++++++++++++++++++++++++++++++
14 2 files changed, 339 insertions(+)
15
16 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
17 index d691418d09e..086284856b5 100644
18 --- a/dev-lang/python/Manifest
19 +++ b/dev-lang/python/Manifest
20 @@ -8,6 +8,8 @@ DIST Python-3.6.13.tar.xz 17213520 BLAKE2B 7c1938f92616d428d107a70397a9f7fc82377
21 DIST Python-3.6.13.tar.xz.asc 833 BLAKE2B bc1df46c2e460c2d237647ecff84e12c75f6ed24a432d2f9cbefdead8a77d4468e5e4ed9f4debac593c63cf95d27c9f7d0f94dce69af8746cc71f0d0b1810245 SHA512 f6e8936a5e5b45d3ad41184717f5ed75debe29f81138fd1b75b53bc7d2905edff42b42dd7995b11ba6d80233c5c3755521edb19d7ac28d414bfebb2d1dfc0c86
22 DIST Python-3.7.10.tar.xz 17392580 BLAKE2B b030db731d141b97f1be794a19382cc252c5bbf867661d09c9455640ebcfd3030e8a691f57fe91a2e0c4e5d3bd4f8f3de07fa4bd287a58900d8c6e1fba2f0583 SHA512 5cb61739acbd29f526d25073443398b2ca0eef30d01d134e8236c8bbc7ab0586c44ec00689f5a75e6aedc0170acf4551721ada5e967e4b99a146cfcaad949128
23 DIST Python-3.7.10.tar.xz.asc 833 BLAKE2B a528daa1638b52f08fd69d197a2d4f8af59a620939957d450da6f5f8947b8eefbfb48ee50bb6327c8f3a352415dedc6e91ef23075fabbfd38c65575857065c74 SHA512 5d0fdcf60f0f4113b3055dd4097814b8b969d6cba4f2cc4cef6cd013b0e728375549b9d7818e6e94e6f0d4888188e751f4659a18f905e6e4c75783e2f323c4ef
24 +DIST Python-3.8.10.tar.xz 18433456 BLAKE2B 57318da9ca049559594911a8873141f89d40c0326f8f278ef47b64195a0d51400f24f91dc68633d628f99dc0a9e280565ff830df66801afbc8734593d0fc3162 SHA512 0be69705483ff9692e12048a96180e586f9d84c8d53066629f7fb2389585eb75c0f3506bb8182936e322508f58b71f4d8c6dfebbab9049b31b49da11d3b98e80
25 +DIST Python-3.8.10.tar.xz.asc 833 BLAKE2B ab1ea0d26f51bc3b88ef5130238f7695bd12383193d1f312b000e997e48beb63f75787a3545b7b635ef515e4896e6ec2994cce564126f3b698495a51f5e34038 SHA512 ebc363df372031aba9c547b4929c98e5065ecf53604897a83df134dfbf7c3f3e9e0de1c072bee2e7c2f4db0f90610fa3931ed6d5a5ed877ab15712becd63deaf
26 DIST Python-3.8.8.tar.xz 18271736 BLAKE2B af0ff1acd919b365a58278e82678324ff884cc8120bcaf12e0e3afb1bd978e6469e256335df131935f51ff481fb83dda04e4b6f1cd1746611f9ec944db73d692 SHA512 64181db5aa48281284a3230436ebfb8cb91b645a9dec956fd48c0048334498477073fc4e14d6b426d0ef7fbcdcfd5d59cbf01a504e6c9014dc9529494b9309fb
27 DIST Python-3.8.8.tar.xz.asc 833 BLAKE2B a11188f9f68c518259de1a4e271bf56409d7356a7eb3dd8cbea7bbb0b5bc1b43f9aeb85bda4add65bbae906bef65cb20a30bcc77da04c0d383cd5b527821fd85 SHA512 0e6f11a310c1796dd056d9a4b63b5e03aa8dbd290088966e04a590a78c00003887dbfd7a7029a6cf8c5626ecd6ca91c1c16433bb0a41bf1225b02b8db8541b95
28 DIST Python-3.8.9.tar.xz 18271948 BLAKE2B 67802a8ea0f4e7f6d33abfe0efab7de9f6bdd20077541c6f76a460325c8027d9338fc630221f39193ffe1eab85e192db997c1764b2a1f876b819f42de8363299 SHA512 e7872a6767f9a8941e8fd76d384fc1a528bcee18514ad13fcb4d3d59f6075c6283e4c933a728b9ae68b9606da2f0a3ae0208e46fbefe3bd7899ced61da5dcf47
29 @@ -26,6 +28,7 @@ DIST python-gentoo-patches-3.6.13_p1.tar.xz 14972 BLAKE2B 0c479bc6bac5e2c53236d8
30 DIST python-gentoo-patches-3.6.13_p3.tar.xz 17640 BLAKE2B 255e96f61ad8adb7fdf1cc9f11ca99c8368601dfe9bab4c96adf1e77472dfdf365a6ce197ecc72b574849e2a6235063d63558711049e9e7407862871dc0f2f20 SHA512 7b9a39cd65129c495c513e1b8c259a88194b8877b891cedaa5289bedcc44dbcb5e63e3b9922ef085321e7f4db73b5a5090d30725b456491a98d7ef40b85601eb
31 DIST python-gentoo-patches-3.7.10_p1.tar.xz 14140 BLAKE2B 2d9a80f27e7ba5be2d5cdb5c1cd95eb6e32de7a0bc86c58a4ff9e8727d2ad588ceec064d2222dffe783d1710bef91d35ba02128508944a5f9266f4d4332217d7 SHA512 6705311d03212d61c7e6e97d83e4110ca1ec621a24a7d0ad16812fabcb87dfce9ef8c1184b16f7f0f5998576bfa87840e105b754edebd6e21c0ad33786255a0c
32 DIST python-gentoo-patches-3.7.10_p3.tar.xz 16804 BLAKE2B 1db238e4b928332d459b5f3c36ecb7f3bc3d3b754fd82e4434c91843ef7574306aef044df9a2644749a17b14ce9fefcd3c3dd44cafaa4ace0b7dc62fb66e73c8 SHA512 61a262a05d1f8e9b08875285db989160362eec66123a15345dd16b8c1f1161aeed31b20df8f69d27ae71902ae2e678328b82e511881d9a5560932619234bbe7d
33 +DIST python-gentoo-patches-3.8.10.tar.xz 15180 BLAKE2B 1f8c57c6ed8d49c5ff42ecaaf19f470567db7fc68ed95eb44a89e9e85a542c085708207f02a1e50ebd7e6fc5e876e232ccd47f49e7653d338ec0520b7dac1a3d SHA512 65e3ec0a0fd49c0c6e96eb07c98b93ce5168e430bbfcd1e62185f6df6bd42fb1a5b5752cbe8bde93101510c0cfd37e604dde40549703b1d1c0e37d24cc327472
34 DIST python-gentoo-patches-3.8.8_p1.tar.xz 15456 BLAKE2B 7d9f55f951f97ef7e08d0245dddd21f5b8d126735c1c392ba6326ad1c18023b477f62e9b6663d8e5b6f0362e442137d0b6ed3ea13b279cca6734d36dbe6e654f SHA512 7fff74d03a0c4cd4b5c977761179c2b9a0ed472847ee9544f54331cef7549557ac4d6b78e676058bd2b01c96ca59d84f04c55beca8ddc45f16b11ce349210eea
35 DIST python-gentoo-patches-3.8.9.tar.xz 10940 BLAKE2B 5e4a767e2795eebe122114f854db2351ff82bde33b5c20549b59d5b64a4f41f911eff7dc9e17038ddebb2d8c84f28ce2d5f2d5f022d92c26164b7763941b1999 SHA512 ee75568d09febccaf08d60beca38995927193348a1b1df4ffd40fd9c858f16161f52b93249c29cf98cf3f7d0b8202e1ecf5f9eb5efe37e64c4b20c25e46dd9c5
36 DIST python-gentoo-patches-3.8.9_p2.tar.xz 16600 BLAKE2B 895eebdfabfe9cc4a30d87255112033b506511a8def7cecb03e37b0bde350f1c4b53f06a7e8ead53218c29e2cf4866f2ddfc9d30a07e9f5c67e4c7c271c18cba SHA512 5751c4bcdd1f637f9678d3fa3455c701b2dec051e12d5a1fa6468d7745c1387fb0485672e53dc619b4244435897f21702699c64b63ad9a0422ed91edd7fb2491
37
38 diff --git a/dev-lang/python/python-3.8.10.ebuild b/dev-lang/python/python-3.8.10.ebuild
39 new file mode 100644
40 index 00000000000..0a87aec9180
41 --- /dev/null
42 +++ b/dev-lang/python/python-3.8.10.ebuild
43 @@ -0,0 +1,336 @@
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 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 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
70 +IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +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:= )
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 +# bluetooth requires headers from bluez
98 +DEPEND="${RDEPEND}
99 + bluetooth? ( net-wireless/bluez )
100 + test? ( app-arch/xz-utils[extra-filters(+)] )"
101 +BDEPEND="
102 + virtual/pkgconfig
103 + sys-devel/autoconf-archive
104 + verify-sig? ( app-crypt/openpgp-keys-python )
105 + !sys-devel/gcc[libffi(-)]"
106 +PDEPEND="app-eselect/eselect-python"
107 +RDEPEND+=" !build? ( app-misc/mime-types )"
108 +
109 +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc
110 +
111 +src_unpack() {
112 + if use verify-sig; then
113 + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
114 + fi
115 + default
116 +}
117 +
118 +src_prepare() {
119 + # Ensure that internal copies of expat, libffi and zlib are not used.
120 + rm -fr Modules/expat || die
121 + rm -fr Modules/_ctypes/libffi* || die
122 + rm -fr Modules/zlib || die
123 +
124 + local PATCHES=(
125 + "${WORKDIR}/${PATCHSET}"
126 + )
127 +
128 + default
129 +
130 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
131 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
132 +
133 + # force correct number of jobs
134 + # https://bugs.gentoo.org/737660
135 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
136 + sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
137 + sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
138 +
139 + eautoreconf
140 +}
141 +
142 +src_configure() {
143 + local disable
144 + # disable automagic bluetooth headers detection
145 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
146 + use gdbm || disable+=" gdbm"
147 + use ncurses || disable+=" _curses _curses_panel"
148 + use readline || disable+=" readline"
149 + use sqlite || disable+=" _sqlite3"
150 + use ssl || export PYTHON_DISABLE_SSL="1"
151 + use tk || disable+=" _tkinter"
152 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
153 + export PYTHON_DISABLE_MODULES="${disable}"
154 +
155 + if ! use xml; then
156 + ewarn "You have configured Python without XML support."
157 + ewarn "This is NOT a recommended configuration as you"
158 + ewarn "may face problems parsing any XML documents."
159 + fi
160 +
161 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
162 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
163 + fi
164 +
165 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
166 + append-flags -fwrapv
167 + fi
168 +
169 + filter-flags -malign-double
170 +
171 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
172 + if is-flagq -O3; then
173 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
174 + use hardened && replace-flags -O3 -O2
175 + fi
176 +
177 + # https://bugs.gentoo.org/700012
178 + if is-flagq -flto || is-flagq '-flto=*'; then
179 + append-cflags $(test-flags-CC -ffat-lto-objects)
180 + fi
181 +
182 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
183 + tc-export CXX
184 +
185 + # Fix implicit declarations on cross and prefix builds. Bug #674070.
186 + use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
187 +
188 + local dbmliborder
189 + if use gdbm; then
190 + dbmliborder+="${dbmliborder:+:}gdbm"
191 + fi
192 +
193 + local myeconfargs=(
194 + # glibc-2.30 removes it; since we can't cleanly force-rebuild
195 + # Python on glibc upgrade, remove it proactively to give
196 + # a chance for users rebuilding python before glibc
197 + ac_cv_header_stropts_h=no
198 +
199 + --enable-shared
200 + $(use_enable ipv6)
201 + --infodir='${prefix}/share/info'
202 + --mandir='${prefix}/share/man'
203 + --with-computed-gotos
204 + --with-dbmliborder="${dbmliborder}"
205 + --with-libc=
206 + --enable-loadable-sqlite-extensions
207 + --without-ensurepip
208 + --with-system-expat
209 + --with-system-ffi
210 + )
211 +
212 + OPT="" econf "${myeconfargs[@]}"
213 +
214 + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
215 + eerror "configure has detected that the sem_open function is broken."
216 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
217 + die "Broken sem_open function (bug 496328)"
218 + fi
219 +}
220 +
221 +src_compile() {
222 + # Ensure sed works as expected
223 + # https://bugs.gentoo.org/594768
224 + local -x LC_ALL=C
225 +
226 + emake CPPFLAGS= CFLAGS= LDFLAGS=
227 +
228 + # Work around bug 329499. See also bug 413751 and 457194.
229 + if has_version dev-libs/libffi[pax_kernel]; then
230 + pax-mark E python
231 + else
232 + pax-mark m python
233 + fi
234 +}
235 +
236 +src_test() {
237 + # Tests will not work when cross compiling.
238 + if tc-is-cross-compiler; then
239 + elog "Disabling tests due to crosscompiling."
240 + return
241 + fi
242 +
243 + # Skip failing tests.
244 + local skipped_tests="gdb"
245 +
246 + for test in ${skipped_tests}; do
247 + mv "${S}"/Lib/test/test_${test}.py "${T}"
248 + done
249 +
250 + # bug 660358
251 + local -x COLUMNS=80
252 + local -x PYTHONDONTWRITEBYTECODE=
253 +
254 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
255 +
256 + emake test EXTRATESTOPTS="-u-network -j${jobs}" \
257 + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
258 + local result=$?
259 +
260 + for test in ${skipped_tests}; do
261 + mv "${T}/test_${test}.py" "${S}"/Lib/test
262 + done
263 +
264 + elog "The following tests have been skipped:"
265 + for test in ${skipped_tests}; do
266 + elog "test_${test}.py"
267 + done
268 +
269 + elog "If you would like to run them, you may:"
270 + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
271 + elog "and run the tests separately."
272 +
273 + if [[ ${result} -ne 0 ]]; then
274 + die "emake test failed"
275 + fi
276 +}
277 +
278 +src_install() {
279 + local libdir=${ED}/usr/lib/python${PYVER}
280 +
281 + emake DESTDIR="${D}" altinstall
282 +
283 + # Remove static library
284 + rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
285 +
286 + sed \
287 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
288 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
289 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
290 +
291 + # Fix collisions between different slots of Python.
292 + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
293 +
294 + # Cheap hack to get version with ABIFLAGS
295 + local abiver=$(cd "${ED}/usr/include"; echo python*)
296 + if [[ ${abiver} != python${PYVER} ]]; then
297 + # Replace python3.X with a symlink to python3.Xm
298 + rm "${ED}/usr/bin/python${PYVER}" || die
299 + dosym "${abiver}" "/usr/bin/python${PYVER}"
300 + # Create python3.X-config symlink
301 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
302 + # Create python-3.5m.pc symlink
303 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
304 + fi
305 +
306 + # python seems to get rebuilt in src_install (bug 569908)
307 + # Work around it for now.
308 + if has_version dev-libs/libffi[pax_kernel]; then
309 + pax-mark E "${ED}/usr/bin/${abiver}"
310 + else
311 + pax-mark m "${ED}/usr/bin/${abiver}"
312 + fi
313 +
314 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
315 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
316 +
317 + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
318 +
319 + dodoc Misc/{ACKS,HISTORY,NEWS}
320 +
321 + if use examples; then
322 + docinto examples
323 + find Tools -name __pycache__ -exec rm -fr {} + || die
324 + dodoc -r Tools
325 + fi
326 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
327 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
328 + emake --no-print-directory -s -f - 2>/dev/null)
329 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
330 +
331 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
332 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
333 + sed \
334 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
335 + -e "s:@PYDOC@:pydoc${PYVER}:" \
336 + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
337 + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
338 +
339 + local -x EPYTHON=python${PYVER}
340 + # if not using a cross-compiler, use the fresh binary
341 + if ! tc-is-cross-compiler; then
342 + local -x PYTHON=./python
343 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
344 + else
345 + local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
346 + fi
347 +
348 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
349 + python_domodule epython.py
350 +
351 + # python-exec wrapping support
352 + local pymajor=${PYVER%.*}
353 + local scriptdir=${D}$(python_get_scriptdir)
354 + mkdir -p "${scriptdir}" || die
355 + # python and pythonX
356 + ln -s "../../../bin/${abiver}" \
357 + "${scriptdir}/python${pymajor}" || die
358 + ln -s "python${pymajor}" "${scriptdir}/python" || die
359 + # python-config and pythonX-config
360 + # note: we need to create a wrapper rather than symlinking it due
361 + # to some random dirname(argv[0]) magic performed by python-config
362 + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
363 + #!/bin/sh
364 + exec "${abiver}-config" "\${@}"
365 + EOF
366 + chmod +x "${scriptdir}/python${pymajor}-config" || die
367 + ln -s "python${pymajor}-config" \
368 + "${scriptdir}/python-config" || die
369 + # 2to3, pydoc
370 + ln -s "../../../bin/2to3-${PYVER}" \
371 + "${scriptdir}/2to3" || die
372 + ln -s "../../../bin/pydoc${PYVER}" \
373 + "${scriptdir}/pydoc" || die
374 + # idle
375 + if use tk; then
376 + ln -s "../../../bin/idle${PYVER}" \
377 + "${scriptdir}/idle" || die
378 + fi
379 +}