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