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: Sun, 05 Sep 2021 06:24:00
Message-Id: 1630823032.b2756f1479a0dad86aba80a962c308e803cea218.mgorny@gentoo
1 commit: b2756f1479a0dad86aba80a962c308e803cea218
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 5 06:13:45 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 5 06:23:52 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2756f14
7
8 dev-lang/python: Bump to 3.7.12
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.7.12.ebuild | 329 +++++++++++++++++++++++++++++++++++
14 2 files changed, 332 insertions(+)
15
16 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
17 index bfe90edca7f..1811f7858c0 100644
18 --- a/dev-lang/python/Manifest
19 +++ b/dev-lang/python/Manifest
20 @@ -6,6 +6,8 @@ DIST Python-3.6.14.tar.xz 17218148 BLAKE2B efe655cb907ffa678ca135f88ba9d867e5239
21 DIST Python-3.6.14.tar.xz.asc 833 BLAKE2B 81c79dca5728b21b8c2badcaa1242836f1cf13984bb755463cfe9e4fd96a02ebf31f1a9239759a937c6d6a04c18bfc682a82cb0ab2e5a473de153423a7248c9c SHA512 600bf504f2c0d3ce7d1e8e953b4f27a7a7c996b7b9cd70efb876178fa5424130bff5414d5ac7deb8b45103ed417fd40d830613db39750d35a0c967c8fdfea50d
22 DIST Python-3.7.11.tar.xz 17393380 BLAKE2B 6394d69935950366da7c4cecd4816d76254170d5313adeb4de9edddae13bda7dea373308517c2abe00cb7eeea8eb428619124feed8df858f9bb904bd423e96d6 SHA512 b8d8c6958444ee9bdd59f0804f7e61d9657c0805c7c58c3352d1c1efb33ba2be8d3485cd2656a2b2b99618a439879687a918f57dfdd125e989af637043600a59
23 DIST Python-3.7.11.tar.xz.asc 833 BLAKE2B 8af6b3e58b607a34c91f57af2fbe9c3f3c7cb6fa5e435e963edd7edcf7649e70c3a76bd346ff8ef1b3c890d8a92d3b2fed27ee01b512c579ff8ce80be61274fb SHA512 f19db95e88c9269174a2b4ac4d8c68fa7ed666b6698af26d2da202e30d145686e8679be763eecba9f8a0c34a207639724094463cffce659c3855ed4b133b0a59
24 +DIST Python-3.7.12.tar.xz 17401916 BLAKE2B f01b5cc54cd0ffe2e8756767c624dda8d2fbf24e90f22a16b5a406dad995ef218613db10f0b3fb2da0ece50ccb02c8a8e007ceb0842ce9e93ee9df7348ef1528 SHA512 e1a5942908c1d1469c0ab129fb4287d4ba6eb2a030e88fd71c043fe187a1bc86c00878dab29147199617a361a0c60d9e720fe3bc58bc7bc4cc8ec4bb50c7ea2a
25 +DIST Python-3.7.12.tar.xz.asc 833 BLAKE2B 587fcf019f4b07b811834d7279b9861eb709731a431be9cbe8f5b868ac72b6d9a4de8b24e3fefd6b339813299514a0ac12b5f627acd04c185ff8dea22a044723 SHA512 a47003dd5c784eca4e3c34dc8705d1171043e060f3a97e4dd63ce4aec2bceac56d7e808924d63b2a38f9a020bf799cf29e5055fb444b9b2c3f03976d47122355
26 DIST Python-3.8.11.tar.xz 18437648 BLAKE2B 957c553ced3387d19c1d1baf2eea7d41e9abfbf398c4514f475eadae29336dc02dbd2cdf7b90ab5fee1e49c083a366c113dcd73149445b663fcdf81a3b2b04f6 SHA512 c8c17491b05d83a9f8940474019034780a6b1ff4148654cd62c8f708c539718a0312cf0665efa2b8c42ed773f4306080bd105701a211ed56e6cab40837d5b2df
27 DIST Python-3.8.11.tar.xz.asc 833 BLAKE2B 52239149331a6529351714db10b5f6b2a37e9a9ce13470e0ab8ae4bf439544878df095995bdc28a534d55039a539c400f532aec8fb7d9b9ce7132167f0e39529 SHA512 40381e83a1bef996333d5044a361ce441c4631725457f8382588e9a86f586a9539ee139b8398aff3d988a317041fa87476f29cf6fcd2b31fe0e9b4cd21ede68a
28 DIST Python-3.8.12.tar.xz 18443568 BLAKE2B 73413aee7a31347ac4342718a54d23d4036220262c4cd41cd50b06c3b1698d52d11cf7ac2c781b919f2cdb0dcb6397d623c463dcdcd1edca99abbbce239a3c6e SHA512 2f93fe5ff83f470c7b6a1b7f29f499a2a010fabd649e9fe65ad3fbfa21b6e1966e77c9b7ac012d978159bc3fe63fec2d64bc6982fc2ee1714d3fa0e47631f279
29 @@ -22,6 +24,7 @@ DIST python-gentoo-patches-3.6.14.tar.xz 14744 BLAKE2B b9482f9d2b7ada60eff9a5672
30 DIST python-gentoo-patches-3.6.14_p1.tar.xz 16576 BLAKE2B 902a9073e6d3e40cfba105680d9947b64a4bfa1632381bc71afbd2691350dccb36f498bf17ac7dfc8ce331dfc3fb7e3cdd539cea3f5e9db1c49210ad4d124182 SHA512 4aa354f1ca8d9bb3c30b666ef61cac8380741342102aeb9ea77cc06ae62179f595acc1c2e6321e9c2395abbc3fbc649ecc93b80443d139859924524989539992
31 DIST python-gentoo-patches-3.7.11.tar.xz 16708 BLAKE2B 4f74b38f400c20b4112f080447021e7140704b282d6369a1479886740d12a17e7818b52a382a4b115238847bb08df0260b092b6ead491623b869c3d3a56f4cc2 SHA512 b96d7af8c9f7fb4b246a8b66e6440336a7d123678d990dd259d7ffb87d79ce74295ff350e220fee38d1b12f1ca94533899c2d2ce700391b3eac907722a79bba6
32 DIST python-gentoo-patches-3.7.11_p1.tar.xz 18540 BLAKE2B 717f3b279368faa355e9b306ede5aa3cf750b7a862e50553caf4efe19b6b8d40431974fbb510414291c4c91623addebff54fd6d4f7f7553c686c5382174bc81f SHA512 e403d2364bbe600d7c3dba8f70157b1f243b00848e3826e6f350d7dbbdd0966229fbf9aa11e0e87fb5ab93b8ea69893f389e5b92c22d7315f99657d69695ded2
33 +DIST python-gentoo-patches-3.7.12.tar.xz 17292 BLAKE2B f2e6629c8386c352254f8335fbfc53ddd5e7d86e1b6b71d57b6ff84f11974bf58ab894e687e866c4af60c25f43db01b11427f10c0755b494fa1f579af1b68750 SHA512 d6a1fb5e9ecf2691060f24078039dcbdafa4a27f17b7ede843bbda45016e86756a57e453da3e370b57c74d05c6dc894aa201f356e13ce94d3d9776fcbb673ed2
34 DIST python-gentoo-patches-3.8.11.tar.xz 16932 BLAKE2B aaa1df33997f4077916fb7cca2ec3a2b2ac1c0ead3db7c638a5152a82cfaaf5fc2768a10ac7235c417e25b2b735c53628ec096878f08eef0d211b03f4747103c SHA512 d2639b95c5a32f7145f92e52a94aec7c63f3ed4a66036ff73f052ff6836742d1e1dd7180f8634b65b4a44a10bf336092695bcc2230a7fd8be35bae870ed64b08
35 DIST python-gentoo-patches-3.8.12.tar.xz 14936 BLAKE2B 1cb6cdb0bb659b1bc3f8a4ecd80da74b41a9fa2f4d5646ac4b48ddecd5124677cb24574a425404fedab4fb9c7faba4b1cb54cc3482785559a54fa3e9b3ca13f1 SHA512 86c30622bbf6847efcdf2bc43d916b05ee78ab17f45b93148a01cf4c181592029ecc52e8c4887112d97aeece63a92ee0f685a689287c133443cf51b3f8171fb9
36 DIST python-gentoo-patches-3.9.6_p1.tar.xz 12764 BLAKE2B 927718f1aadb5d5ef67e647a639a10bffdd48474bf01e50bd37ef1242bce57606b7b54c4823c1da3585ee76e737028163e38e9b4e19037585cc53f925e1c5fa7 SHA512 f06fb55786bd942e72e3225ee9ce218724aeee29f301279743588749007e991851a8f29db5b5dfd85435e3d763c00942947909a6fc60581bd0f3e8a6e913bff8
37
38 diff --git a/dev-lang/python/python-3.7.12.ebuild b/dev-lang/python/python-3.7.12.ebuild
39 new file mode 100644
40 index 00000000000..710da1dda38
41 --- /dev/null
42 +++ b/dev-lang/python/python-3.7.12.ebuild
43 @@ -0,0 +1,329 @@
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_P="Python-${PV%_p*}"
54 +PYVER=$(ver_cut 1-2)
55 +PATCHSET="python-gentoo-patches-${PV}"
56 +
57 +DESCRIPTION="An interpreted, interactive, object-oriented programming language"
58 +HOMEPAGE="https://www.python.org/"
59 +SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
60 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
61 + verify-sig? (
62 + https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
63 + )"
64 +S="${WORKDIR}/${MY_P}"
65 +
66 +LICENSE="PSF-2"
67 +SLOT="${PYVER}/${PYVER}m"
68 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
69 +IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
70 +RESTRICT="!test? ( test )"
71 +
72 +# Do not add a dependency on dev-lang/python to this ebuild.
73 +# If you need to apply a patch which requires python for bootstrapping, please
74 +# run the bootstrap code on your dev box and include the results in the
75 +# patchset. See bug 447752.
76 +
77 +RDEPEND="app-arch/bzip2:=
78 + app-arch/xz-utils:=
79 + dev-libs/libffi:=
80 + sys-apps/util-linux:=
81 + >=sys-libs/zlib-1.1.3:=
82 + virtual/libcrypt:=
83 + virtual/libintl
84 + gdbm? ( sys-libs/gdbm:=[berkdb] )
85 + ncurses? ( >=sys-libs/ncurses-5.2:= )
86 + readline? ( >=sys-libs/readline-4.1:= )
87 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
88 + ssl? ( >=dev-libs/openssl-1.1.1:= )
89 + tk? (
90 + >=dev-lang/tcl-8.0:=
91 + >=dev-lang/tk-8.0:=
92 + dev-tcltk/blt:=
93 + dev-tcltk/tix
94 + )
95 + xml? ( >=dev-libs/expat-2.1:= )"
96 +# bluetooth requires headers from bluez
97 +DEPEND="${RDEPEND}
98 + bluetooth? ( net-wireless/bluez )
99 + test? ( app-arch/xz-utils[extra-filters(+)] )"
100 +BDEPEND="
101 + virtual/pkgconfig
102 + verify-sig? ( app-crypt/openpgp-keys-python )
103 + !sys-devel/gcc[libffi(-)]"
104 +RDEPEND+=" !build? ( app-misc/mime-types )"
105 +
106 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
107 +
108 +src_unpack() {
109 + if use verify-sig; then
110 + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
111 + fi
112 + default
113 +}
114 +
115 +src_prepare() {
116 + # Ensure that internal copies of expat, libffi and zlib are not used.
117 + rm -fr Modules/expat || die
118 + rm -fr Modules/_ctypes/libffi* || die
119 + rm -fr Modules/zlib || die
120 +
121 + local PATCHES=(
122 + "${WORKDIR}/${PATCHSET}"
123 + )
124 +
125 + default
126 +
127 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
128 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
129 +
130 + # force correct number of jobs
131 + # https://bugs.gentoo.org/737660
132 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
133 + sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
134 +
135 + eautoreconf
136 +}
137 +
138 +src_configure() {
139 + local disable
140 + # disable automagic bluetooth headers detection
141 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
142 + use gdbm || disable+=" gdbm"
143 + use ncurses || disable+=" _curses _curses_panel"
144 + use readline || disable+=" readline"
145 + use sqlite || disable+=" _sqlite3"
146 + use ssl || export PYTHON_DISABLE_SSL="1"
147 + use tk || disable+=" _tkinter"
148 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
149 + export PYTHON_DISABLE_MODULES="${disable}"
150 +
151 + if ! use xml; then
152 + ewarn "You have configured Python without XML support."
153 + ewarn "This is NOT a recommended configuration as you"
154 + ewarn "may face problems parsing any XML documents."
155 + fi
156 +
157 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
158 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
159 + fi
160 +
161 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
162 + append-flags -fwrapv
163 + fi
164 +
165 + filter-flags -malign-double
166 +
167 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
168 + if is-flagq -O3; then
169 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
170 + use hardened && replace-flags -O3 -O2
171 + fi
172 +
173 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
174 + tc-export CXX
175 +
176 + # Fix implicit declarations on cross and prefix builds. Bug #674070.
177 + use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
178 +
179 + local dbmliborder
180 + if use gdbm; then
181 + dbmliborder+="${dbmliborder:+:}gdbm"
182 + fi
183 +
184 + local myeconfargs=(
185 + # glibc-2.30 removes it; since we can't cleanly force-rebuild
186 + # Python on glibc upgrade, remove it proactively to give
187 + # a chance for users rebuilding python before glibc
188 + ac_cv_header_stropts_h=no
189 +
190 + --enable-shared
191 + --enable-ipv6
192 + --infodir='${prefix}/share/info'
193 + --mandir='${prefix}/share/man'
194 + --with-computed-gotos
195 + --with-dbmliborder="${dbmliborder}"
196 + --with-libc=
197 + --enable-loadable-sqlite-extensions
198 + --without-ensurepip
199 + --with-system-expat
200 + --with-system-ffi
201 + )
202 +
203 + OPT="" econf "${myeconfargs[@]}"
204 +
205 + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
206 + eerror "configure has detected that the sem_open function is broken."
207 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
208 + die "Broken sem_open function (bug 496328)"
209 + fi
210 +}
211 +
212 +src_compile() {
213 + # Ensure sed works as expected
214 + # https://bugs.gentoo.org/594768
215 + local -x LC_ALL=C
216 +
217 + emake CPPFLAGS= CFLAGS= LDFLAGS=
218 +
219 + # Work around bug 329499. See also bug 413751 and 457194.
220 + if has_version dev-libs/libffi[pax-kernel]; then
221 + pax-mark E python
222 + else
223 + pax-mark m python
224 + fi
225 +}
226 +
227 +src_test() {
228 + # Tests will not work when cross compiling.
229 + if tc-is-cross-compiler; then
230 + elog "Disabling tests due to crosscompiling."
231 + return
232 + fi
233 +
234 + # Skip failing tests.
235 + local skipped_tests="gdb"
236 +
237 + for test in ${skipped_tests}; do
238 + mv "${S}"/Lib/test/test_${test}.py "${T}"
239 + done
240 +
241 + # bug 660358
242 + local -x COLUMNS=80
243 + local -x PYTHONDONTWRITEBYTECODE=
244 +
245 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
246 +
247 + emake test EXTRATESTOPTS="-u-network -j${jobs}" \
248 + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
249 + local result=$?
250 +
251 + for test in ${skipped_tests}; do
252 + mv "${T}/test_${test}.py" "${S}"/Lib/test
253 + done
254 +
255 + elog "The following tests have been skipped:"
256 + for test in ${skipped_tests}; do
257 + elog "test_${test}.py"
258 + done
259 +
260 + elog "If you would like to run them, you may:"
261 + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
262 + elog "and run the tests separately."
263 +
264 + if [[ ${result} -ne 0 ]]; then
265 + die "emake test failed"
266 + fi
267 +}
268 +
269 +src_install() {
270 + local libdir=${ED}/usr/lib/python${PYVER}
271 +
272 + emake DESTDIR="${D}" altinstall
273 +
274 + # Remove static library
275 + rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
276 +
277 + sed \
278 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
279 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
280 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
281 +
282 + # Fix collisions between different slots of Python.
283 + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
284 +
285 + # Cheap hack to get version with ABIFLAGS
286 + local abiver=$(cd "${ED}/usr/include"; echo python*)
287 + if [[ ${abiver} != python${PYVER} ]]; then
288 + # Replace python3.X with a symlink to python3.Xm
289 + rm "${ED}/usr/bin/python${PYVER}" || die
290 + dosym "${abiver}" "/usr/bin/python${PYVER}"
291 + # Create python3.X-config symlink
292 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
293 + # Create python-3.5m.pc symlink
294 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
295 + fi
296 +
297 + # python seems to get rebuilt in src_install (bug 569908)
298 + # Work around it for now.
299 + if has_version dev-libs/libffi[pax-kernel]; then
300 + pax-mark E "${ED}/usr/bin/${abiver}"
301 + else
302 + pax-mark m "${ED}/usr/bin/${abiver}"
303 + fi
304 +
305 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
306 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
307 +
308 + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
309 +
310 + dodoc Misc/{ACKS,HISTORY,NEWS}
311 +
312 + if use examples; then
313 + docinto examples
314 + find Tools -name __pycache__ -exec rm -fr {} + || die
315 + dodoc -r Tools
316 + fi
317 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
318 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
319 + emake --no-print-directory -s -f - 2>/dev/null)
320 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
321 +
322 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
323 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
324 + sed \
325 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
326 + -e "s:@PYDOC@:pydoc${PYVER}:" \
327 + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
328 + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
329 +
330 + local -x EPYTHON=python${PYVER}
331 + # if not using a cross-compiler, use the fresh binary
332 + if ! tc-is-cross-compiler; then
333 + local -x PYTHON=./python
334 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
335 + else
336 + local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
337 + fi
338 +
339 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
340 + python_domodule epython.py
341 +
342 + # python-exec wrapping support
343 + local pymajor=${PYVER%.*}
344 + local scriptdir=${D}$(python_get_scriptdir)
345 + mkdir -p "${scriptdir}" || die
346 + # python and pythonX
347 + ln -s "../../../bin/${abiver}" \
348 + "${scriptdir}/python${pymajor}" || die
349 + ln -s "python${pymajor}" "${scriptdir}/python" || die
350 + # python-config and pythonX-config
351 + # note: we need to create a wrapper rather than symlinking it due
352 + # to some random dirname(argv[0]) magic performed by python-config
353 + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
354 + #!/bin/sh
355 + exec "${abiver}-config" "\${@}"
356 + EOF
357 + chmod +x "${scriptdir}/python${pymajor}-config" || die
358 + ln -s "python${pymajor}-config" \
359 + "${scriptdir}/python-config" || die
360 + # 2to3, pydoc, pyvenv
361 + ln -s "../../../bin/2to3-${PYVER}" \
362 + "${scriptdir}/2to3" || die
363 + ln -s "../../../bin/pydoc${PYVER}" \
364 + "${scriptdir}/pydoc" || die
365 + ln -s "../../../bin/pyvenv-${PYVER}" \
366 + "${scriptdir}/pyvenv" || die
367 + # idle
368 + if use tk; then
369 + ln -s "../../../bin/idle${PYVER}" \
370 + "${scriptdir}/idle" || die
371 + fi
372 +}