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: Mon, 05 Oct 2020 21:58:01
Message-Id: 1601934751.57d26b264a530fb57bbc47ce49dcf28d00a1e54c.mgorny@gentoo
1 commit: 57d26b264a530fb57bbc47ce49dcf28d00a1e54c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 5 21:48:55 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 5 21:52:31 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57d26b26
7
8 dev-lang/python: Bump to 3.10.0a1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-lang/python/Manifest | 2 +
13 dev-lang/python/python-3.10.0_alpha1.ebuild | 331 ++++++++++++++++++++++++++++
14 2 files changed, 333 insertions(+)
15
16 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
17 index f85f6d22830..fa288b57af4 100644
18 --- a/dev-lang/python/Manifest
19 +++ b/dev-lang/python/Manifest
20 @@ -1,4 +1,5 @@
21 DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c SHA512 a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c
22 +DIST Python-3.10.0a1.tar.xz 18571152 BLAKE2B d74e467dfce1a0e3374377fc36865f1059e3810f67492608bbcfdb6880fc9a748ed19d1e3c4617a9218c842e8e9cb4119845eccb6848acae9b4af389cbbdb43a SHA512 eb1a0f6dd023efe67cfc2c833b0a7d390765d288e4da7aae932ba66b970d63ad377dbe48ddf0548c5cca5334a3aa1c7e92f972b68c54e4238ea1f3610adb8910
23 DIST Python-3.6.11.tar.xz 17213036 BLAKE2B 4dae9d9c5eb7e97a8990b0b5739d40ba8a85081c7e03adc22a3305e713d39b3a98ff66c17b395b9d45355e124307eed87803211378d14360e8b3455f7146a1ba SHA512 c76969a6602e095641ba5fd0999a47cf0187eb26559ba9a6e80fe401b8928f6cd9eabd963f615f7c667e48f56603f2508d2b5692c83ea8da1e21292131fb11d6
24 DIST Python-3.6.12.tar.xz 17202980 BLAKE2B c8d22e4d57bcaffe77cd902cda3a473e73adf2b74ab104c23b4d846f19632a24cc0c478af84079b16d784bd1c0956824c06c1f6134fd24f54e58aaab0fe96bb6 SHA512 1462801f3f6626a853097d34ccdca9838c4c5bd81ecc3abc751003f5f2f8d36eecdaa4130ef4218de351c5586093c11669639a34492668fbc5a2a4a241f4a070
25 DIST Python-3.7.8.tar.xz 17399552 BLAKE2B 4bf6c47b1132b6d31a79232002c4d38e2cd123ac05d52b21d6bfba5a4e19ec9130b8df8698d5ce6627e4297c4cf756643f036e694e36364c235306c72ef34bf8 SHA512 d2ba299e3cf8ed0f8fed9317f42bcd8d9af7e0e6175939b4be1be289c1658418bed17899e2608d762ffb15575021956cf6bf2054d7863c04b3bd7642f5b8c7ea
26 @@ -12,6 +13,7 @@ DIST Python-3.9.0rc2.tar.xz 18802576 BLAKE2B fa39f359ca79db83873a9a05c07b3915e75
27 DIST python-gentoo-patches-2.7.18-r1.tar.xz 15500 BLAKE2B 7008b29827dbbd80d4ab8f010ccf9efced99c6b4b9109e4430c0ba269ce53529cb6fedd832502c8d2d3aa21938749cc3591c2545b21c0a59a6e60f8598e84ccc SHA512 e656ab07281fd932b92165674619bbf55ecf410d2937ae4ae771d490b4532540498cc731d30d19c1e8aafd1f64df8a406bbfbb46ea985b3dcd8edb89a0b7f20f
28 DIST python-gentoo-patches-2.7.18-r2.tar.xz 18820 BLAKE2B 0855ca0d76b0027caab7a1655f7e13117eabd24bcb308419624d39265b1cbfb24783571bd64eccac88345bb5b6c98470de74564924a62d66124bca0f0405f211 SHA512 ce478125602b2c9a2142469de6b434e4e4be0fefcea685a9618dd8129a9f1cfea1a4244bec5991aedc0f73b5d5379cfae62241819af9bbd97e8d0439b97bb04a
29 DIST python-gentoo-patches-2.7.18-r3.tar.xz 18856 BLAKE2B e35b3d847dad114057b7dab7615941b4879f3531aff1d23bced22da2d445cdec77cdd416566611ca01a3d39f30f16ef224f835f35ca12a301024d7a9fb6a507b SHA512 abb102223555535d5214fa91fd4bb3d1241050c86027af1612a9bd43fea2721e184587e5b784e5af9cbf563b8fec5a25cd07dc5fa72d762228734713176cfcbd
30 +DIST python-gentoo-patches-3.10.0a1.tar.xz 8592 BLAKE2B 066fe89725469649a88a0b0c9f62d7d1380feb704ed12c696871cd595e4e920f23b54a2c771e15b5d2345dcdab21694365ef9b29e93f552f74d13642ebc59200 SHA512 e86df9e08ec7306f6457b5e3490171966022964fb700046587088bceb3d8977a45fe7e944f7dd39ad473000654f69f495b8c67edebb13bc12000b32716845533
31 DIST python-gentoo-patches-3.6.11-r3.tar.xz 14064 BLAKE2B 416780c15ee12cfc06bfd1397d510dd42fea61abcaafd9cf54f27d843342debf0caa93c9700686feb14f04239ad4ea8f20ce8736029638abe7d7b9c57b9d659d SHA512 de6a4a5bec89e6149b85b383991c99bd9460a8f59f52a700d54edd0154557727ccc79daaa90336dff434b222657c3f28dda1228d2d474002d0a28f31c9ed0b10
32 DIST python-gentoo-patches-3.6.12.tar.xz 11448 BLAKE2B a7fb7153ca6fd353649f9dc23f2d777e84ff144d67984d8c3d292619a4f671e3a71d8022bcc334b55f9f1f416ceeca113fb116da805e4bc45d8a67cbc098ead8 SHA512 7efb97abd3e058e4532b89205c99794836ba094079de2a6d7846fd2673ea8cc31e68573b83fd9f82453151653fb0ed9bc40b7961b41efdfe703b64cbed2576bf
33 DIST python-gentoo-patches-3.7.8-r3.tar.xz 13232 BLAKE2B 9df47b1f61d08f62a80221bc48d73ec27cd74a9ade8219912c5b02eaea919b70d91b1154837cd03c0129a5839186e9c970167ca3398129c044c25c7853f1f920 SHA512 e1477d425cb6125ca2286d816f4aa4e9e3c789d6a4f4907bd7b78549598356cae5766f642e2cad9e7c3abe2e82c12cf3cb7db3513be68aa213cb64cc0abc678a
34
35 diff --git a/dev-lang/python/python-3.10.0_alpha1.ebuild b/dev-lang/python/python-3.10.0_alpha1.ebuild
36 new file mode 100644
37 index 00000000000..ea470a43ed9
38 --- /dev/null
39 +++ b/dev-lang/python/python-3.10.0_alpha1.ebuild
40 @@ -0,0 +1,331 @@
41 +# Copyright 1999-2020 Gentoo Authors
42 +# Distributed under the terms of the GNU General Public License v2
43 +
44 +EAPI="7"
45 +WANT_LIBTOOL="none"
46 +
47 +inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
48 + python-utils-r1 toolchain-funcs
49 +
50 +MY_P="Python-${PV/_alpha/a}"
51 +PYVER=$(ver_cut 1-2)
52 +PATCHSET="python-gentoo-patches-3.10.0a1"
53 +
54 +DESCRIPTION="An interpreted, interactive, object-oriented programming language"
55 +HOMEPAGE="https://www.python.org/"
56 +SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
57 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
58 +S="${WORKDIR}/${MY_P}"
59 +
60 +LICENSE="PSF-2"
61 +SLOT="${PYVER}"
62 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
63 +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml"
64 +RESTRICT="!test? ( test )"
65 +
66 +# Do not add a dependency on dev-lang/python to this ebuild.
67 +# If you need to apply a patch which requires python for bootstrapping, please
68 +# run the bootstrap code on your dev box and include the results in the
69 +# patchset. See bug 447752.
70 +
71 +RDEPEND="app-arch/bzip2:=
72 + app-arch/xz-utils:=
73 + dev-libs/libffi:=
74 + sys-apps/util-linux:=
75 + >=sys-libs/zlib-1.1.3:=
76 + virtual/libcrypt:=
77 + virtual/libintl
78 + gdbm? ( sys-libs/gdbm:=[berkdb] )
79 + ncurses? ( >=sys-libs/ncurses-5.2:= )
80 + readline? ( >=sys-libs/readline-4.1:= )
81 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
82 + ssl? (
83 + !libressl? ( dev-libs/openssl:= )
84 + libressl? ( dev-libs/libressl:= )
85 + )
86 + tk? (
87 + >=dev-lang/tcl-8.0:=
88 + >=dev-lang/tk-8.0:=
89 + dev-tcltk/blt:=
90 + dev-tcltk/tix
91 + )
92 + xml? ( >=dev-libs/expat-2.1:= )"
93 +# bluetooth requires headers from bluez
94 +DEPEND="${RDEPEND}
95 + bluetooth? ( net-wireless/bluez )
96 + test? ( app-arch/xz-utils[extra-filters(+)] )
97 + virtual/pkgconfig
98 + !sys-devel/gcc[libffi(-)]"
99 +RDEPEND+=" !build? ( app-misc/mime-types )"
100 +PDEPEND=">=app-eselect/eselect-python-20140125-r1"
101 +
102 +# large file tests involve a 2.5G file being copied (duplicated)
103 +CHECKREQS_DISK_BUILD=5500M
104 +
105 +pkg_pretend() {
106 + use test && check-reqs_pkg_pretend
107 +}
108 +
109 +pkg_setup() {
110 + use test && check-reqs_pkg_setup
111 +}
112 +
113 +src_prepare() {
114 + # Ensure that internal copies of expat, libffi and zlib are not used.
115 + rm -fr Modules/expat || die
116 + rm -fr Modules/_ctypes/libffi* || die
117 + rm -fr Modules/zlib || die
118 +
119 + local PATCHES=(
120 + "${WORKDIR}/${PATCHSET}"
121 + )
122 +
123 + default
124 +
125 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
126 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
127 +
128 + # force correct number of jobs
129 + # https://bugs.gentoo.org/737660
130 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
131 + sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
132 + sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
133 +
134 + eautoreconf
135 +}
136 +
137 +src_configure() {
138 + local disable
139 + # disable automagic bluetooth headers detection
140 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
141 + use gdbm || disable+=" gdbm"
142 + use ncurses || disable+=" _curses _curses_panel"
143 + use readline || disable+=" readline"
144 + use sqlite || disable+=" _sqlite3"
145 + use ssl || export PYTHON_DISABLE_SSL="1"
146 + use tk || disable+=" _tkinter"
147 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
148 + export PYTHON_DISABLE_MODULES="${disable}"
149 +
150 + if ! use xml; then
151 + ewarn "You have configured Python without XML support."
152 + ewarn "This is NOT a recommended configuration as you"
153 + ewarn "may face problems parsing any XML documents."
154 + fi
155 +
156 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
157 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
158 + fi
159 +
160 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
161 + append-flags -fwrapv
162 + fi
163 +
164 + filter-flags -malign-double
165 +
166 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
167 + if is-flagq -O3; then
168 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
169 + use hardened && replace-flags -O3 -O2
170 + fi
171 +
172 + # https://bugs.gentoo.org/700012
173 + if is-flagq -flto || is-flagq '-flto=*'; then
174 + append-cflags $(test-flags-CC -ffat-lto-objects)
175 + fi
176 +
177 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
178 + tc-export CXX
179 +
180 + # Set LDFLAGS so we link modules with -lpython3.2 correctly.
181 + # Needed on FreeBSD unless Python 3.2 is already installed.
182 + # Please query BSD team before removing this!
183 + append-ldflags "-L."
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 +
215 +src_compile() {
216 + # Ensure sed works as expected
217 + # https://bugs.gentoo.org/594768
218 + local -x LC_ALL=C
219 +
220 + emake CPPFLAGS= CFLAGS= LDFLAGS=
221 +
222 + # Work around bug 329499. See also bug 413751 and 457194.
223 + if has_version dev-libs/libffi[pax_kernel]; then
224 + pax-mark E python
225 + else
226 + pax-mark m python
227 + fi
228 +}
229 +
230 +src_test() {
231 + # Tests will not work when cross compiling.
232 + if tc-is-cross-compiler; then
233 + elog "Disabling tests due to crosscompiling."
234 + return
235 + fi
236 +
237 + # Skip failing tests.
238 + local skipped_tests="gdb"
239 +
240 + for test in ${skipped_tests}; do
241 + mv "${S}"/Lib/test/test_${test}.py "${T}"
242 + done
243 +
244 + # bug 660358
245 + local -x COLUMNS=80
246 + local -x PYTHONDONTWRITEBYTECODE=
247 +
248 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
249 +
250 + emake test EXTRATESTOPTS="-u-network -j${jobs}" \
251 + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
252 + local result=$?
253 +
254 + for test in ${skipped_tests}; do
255 + mv "${T}/test_${test}.py" "${S}"/Lib/test
256 + done
257 +
258 + elog "The following tests have been skipped:"
259 + for test in ${skipped_tests}; do
260 + elog "test_${test}.py"
261 + done
262 +
263 + elog "If you would like to run them, you may:"
264 + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
265 + elog "and run the tests separately."
266 +
267 + if [[ ${result} -ne 0 ]]; then
268 + die "emake test failed"
269 + fi
270 +}
271 +
272 +src_install() {
273 + local libdir=${ED}/usr/lib/python${PYVER}
274 +
275 + emake DESTDIR="${D}" altinstall
276 +
277 + # Remove static library
278 + rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
279 +
280 + sed \
281 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
282 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
283 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
284 +
285 + # Fix collisions between different slots of Python.
286 + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
287 +
288 + # Cheap hack to get version with ABIFLAGS
289 + local abiver=$(cd "${ED}/usr/include"; echo python*)
290 + if [[ ${abiver} != python${PYVER} ]]; then
291 + # Replace python3.X with a symlink to python3.Xm
292 + rm "${ED}/usr/bin/python${PYVER}" || die
293 + dosym "${abiver}" "/usr/bin/python${PYVER}"
294 + # Create python3.X-config symlink
295 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
296 + # Create python-3.5m.pc symlink
297 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
298 + fi
299 +
300 + # python seems to get rebuilt in src_install (bug 569908)
301 + # Work around it for now.
302 + if has_version dev-libs/libffi[pax_kernel]; then
303 + pax-mark E "${ED}/usr/bin/${abiver}"
304 + else
305 + pax-mark m "${ED}/usr/bin/${abiver}"
306 + fi
307 +
308 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
309 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
310 +
311 + dodoc Misc/{ACKS,HISTORY,NEWS}
312 +
313 + if use examples; then
314 + docinto examples
315 + find Tools -name __pycache__ -exec rm -fr {} + || die
316 + dodoc -r Tools
317 + fi
318 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
319 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
320 + emake --no-print-directory -s -f - 2>/dev/null)
321 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
322 +
323 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
324 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
325 + sed \
326 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
327 + -e "s:@PYDOC@:pydoc${PYVER}:" \
328 + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
329 + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
330 +
331 + local -x EPYTHON=python${PYVER}
332 + # if not using a cross-compiler, use the fresh binary
333 + if ! tc-is-cross-compiler; then
334 + local -x PYTHON=./python
335 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
336 + else
337 + local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
338 + fi
339 +
340 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
341 + python_domodule epython.py
342 +
343 + # python-exec wrapping support
344 + local pymajor=${PYVER%.*}
345 + local scriptdir=${D}$(python_get_scriptdir)
346 + mkdir -p "${scriptdir}" || die
347 + # python and pythonX
348 + ln -s "../../../bin/${abiver}" \
349 + "${scriptdir}/python${pymajor}" || die
350 + ln -s "python${pymajor}" "${scriptdir}/python" || die
351 + # python-config and pythonX-config
352 + # note: we need to create a wrapper rather than symlinking it due
353 + # to some random dirname(argv[0]) magic performed by python-config
354 + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
355 + #!/bin/sh
356 + exec "${abiver}-config" "\${@}"
357 + EOF
358 + chmod +x "${scriptdir}/python${pymajor}-config" || die
359 + ln -s "python${pymajor}-config" \
360 + "${scriptdir}/python-config" || die
361 + # 2to3, pydoc
362 + ln -s "../../../bin/2to3-${PYVER}" \
363 + "${scriptdir}/2to3" || die
364 + ln -s "../../../bin/pydoc${PYVER}" \
365 + "${scriptdir}/pydoc" || die
366 + # idle
367 + if use tk; then
368 + ln -s "../../../bin/idle${PYVER}" \
369 + "${scriptdir}/idle" || die
370 + fi
371 +}