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, 29 Dec 2019 10:11:13
Message-Id: 1577614264.5ff1db16d154f92d0021af65d23d5b3b3790ba71.mgorny@gentoo
1 commit: 5ff1db16d154f92d0021af65d23d5b3b3790ba71
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 29 09:48:16 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 29 10:11:04 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ff1db16
7
8 dev-lang/python: Bump 2.7.17 to EAPI 7, unify
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-lang/python/Manifest | 1 +
13 ...ython-3.6.10.ebuild => python-2.7.17-r1.ebuild} | 153 +++++++++++----------
14 dev-lang/python/python-3.6.10.ebuild | 6 +-
15 3 files changed, 88 insertions(+), 72 deletions(-)
16
17 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
18 index 7165b0d55c1..c974616a85a 100644
19 --- a/dev-lang/python/Manifest
20 +++ b/dev-lang/python/Manifest
21 @@ -10,6 +10,7 @@ DIST Python-3.8.1.tar.xz 17828408 BLAKE2B db1841625de89b812cadcd538a990401a4e49d
22 DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd
23 DIST python-gentoo-patches-2.7.17.tar.xz 13476 BLAKE2B 788688e2941d2d6d4f768168881b2c3639213a97e214557b3a93f8db44d81e2b6d70be847b7462e54e3786660ebee4ee331402081d92167d74ad149279c3f389 SHA512 1641737635d33607a77ed2ee2462854cec603be39737de3f81abb188702aaf46f039d1616f9dcd413da1f4a8040175c66a2883e496132c2e4ebe8f860b36f9f1
24 DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed10748348484d314183c3de3ec950d5ca5ce7048bb322c470f3f5bff2d63eb7f2ed99c0fe75c621df050273d9d118681b28926061d SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec
25 +DIST python-gentoo-patches-3.6.10.tar.xz 10964 BLAKE2B e32c8cb3050c7324ee234f585be7fc40cfacc6ad87759eaa300e57289e6dc6cbaed3913f33ad632b8754638e8d71983d8364ceeaad8ef325cfa6d4d2dfb56df0 SHA512 71fea7306c876c63888c4547eaf14dc2e0413dec343609d748cd1b5888e4605d47888758ebc5120a287ce833b69dd538073f91989460da7c40462b53eefca7ce
26 DIST python-gentoo-patches-3.6.8.tar.xz 11224 BLAKE2B 5fe38282bcf28df18e0bd37756c880ae191ea738dc92f1cf83f682cfdc52525b9c44287dc99191a73d75c90672ab501b56adf49515b35ff1fdee88c8dc07b175 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df
27 DIST python-gentoo-patches-3.7.4-1.tar.xz 10100 BLAKE2B 63e8fada89b64b59ba083745626a1e8a07bec0cf93b7b6ab405c33a0f2932cbe497a331c52895a07f10434b230c438f27c9582efecdd57f3bad15d9aa604d157 SHA512 11b0e811a9890a1235c85426061b35f9964eba64cac0536f4c9e0498b1cc66eb005f14aed34eead735b43e91c2b5babced60e3310f5329231a1706871b95b547
28 DIST python-gentoo-patches-3.7.6.tar.xz 10084 BLAKE2B 220869e85bdaf9c21b1b05e13803bdb6ecc22ac0f69da77e57fd7c1cd93ef45ec43401b62732842e1bb3467feb6d65c8204120e2741e9eb6f4cab673fd3a8d62 SHA512 4c04b0cf7da55fa7973ab178e3ac2c59bc2142924bdced5954c058053280b6c663d7c39912286d10fe0e82ca30af6a0dd6a56fa85433f836217ca3dcbb284def
29
30 diff --git a/dev-lang/python/python-3.6.10.ebuild b/dev-lang/python/python-2.7.17-r1.ebuild
31 similarity index 70%
32 copy from dev-lang/python/python-3.6.10.ebuild
33 copy to dev-lang/python/python-2.7.17-r1.ebuild
34 index c0c1738557f..424cdec1208 100644
35 --- a/dev-lang/python/python-3.6.10.ebuild
36 +++ b/dev-lang/python/python-2.7.17-r1.ebuild
37 @@ -8,19 +8,18 @@ inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
38
39 MY_P="Python-${PV}"
40 PYVER=$(ver_cut 1-2)
41 -PATCHSET_VERSION="3.6.8"
42 +PATCHSET_VERSION="2.7.17"
43
44 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
45 HOMEPAGE="https://www.python.org/"
46 SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
47 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
48 + https://dev.gentoo.org/~mgorny/dist/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
49 S="${WORKDIR}/${MY_P}"
50
51 LICENSE="PSF-2"
52 -SLOT="${PYVER}/${PYVER}m"
53 +SLOT="${PYVER}"
54 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
55 -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
56 -RESTRICT="!test? ( test )"
57 +IUSE="-berkdb bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
58
59 # Do not add a dependency on dev-lang/python to this ebuild.
60 # If you need to apply a patch which requires python for bootstrapping, please
61 @@ -28,10 +27,20 @@ RESTRICT="!test? ( test )"
62 # patchset. See bug 447752.
63
64 RDEPEND="app-arch/bzip2:=
65 - app-arch/xz-utils:=
66 >=sys-libs/zlib-1.1.3:=
67 virtual/libffi:=
68 virtual/libintl
69 + berkdb? ( || (
70 + sys-libs/db:5.3
71 + sys-libs/db:5.1
72 + sys-libs/db:4.8
73 + sys-libs/db:4.7
74 + sys-libs/db:4.6
75 + sys-libs/db:4.5
76 + sys-libs/db:4.4
77 + sys-libs/db:4.3
78 + sys-libs/db:4.2
79 + ) )
80 gdbm? ( sys-libs/gdbm:=[berkdb] )
81 ncurses? ( >=sys-libs/ncurses-5.2:= )
82 readline? ( >=sys-libs/readline-4.1:= )
83 @@ -50,12 +59,26 @@ RDEPEND="app-arch/bzip2:=
84 # bluetooth requires headers from bluez
85 DEPEND="${RDEPEND}
86 bluetooth? ( net-wireless/bluez )
87 - test? ( app-arch/xz-utils[extra-filters(+)] )
88 virtual/pkgconfig
89 !sys-devel/gcc[libffi(-)]"
90 RDEPEND+=" !build? ( app-misc/mime-types )"
91 PDEPEND=">=app-eselect/eselect-python-20140125-r1"
92
93 +pkg_setup() {
94 + if use berkdb; then
95 + ewarn "'bsddb' module is out-of-date and no longer maintained inside"
96 + ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
97 + ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
98 + ewarn "is provided by dev-python/bsddb3."
99 + else
100 + if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
101 + ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
102 + ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
103 + ewarn "You might need to migrate your databases."
104 + fi
105 + fi
106 +}
107 +
108 src_prepare() {
109 # Ensure that internal copies of expat, libffi and zlib are not used.
110 rm -fr Modules/expat || die
111 @@ -64,6 +87,11 @@ src_prepare() {
112
113 local PATCHES=(
114 "${WORKDIR}/patches"
115 + # Fix for cross-compiling.
116 + "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
117 + "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
118 + "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
119 + "${FILESDIR}/python-2.7.10-system-libffi.patch"
120 )
121
122 default
123 @@ -77,14 +105,17 @@ src_prepare() {
124 Makefile.pre.in \
125 Modules/Setup.dist \
126 Modules/getpath.c \
127 - configure.ac \
128 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
129
130 eautoreconf
131 }
132
133 src_configure() {
134 + # dbm module can be linked against berkdb or gdbm.
135 + # Defaults to gdbm when both are enabled, #204343.
136 local disable
137 + use berkdb || use gdbm || disable+=" dbm"
138 + use berkdb || disable+=" _bsddb"
139 # disable automagic bluetooth headers detection
140 use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
141 use gdbm || disable+=" gdbm"
142 @@ -118,11 +149,20 @@ src_configure() {
143 use hardened && replace-flags -O3 -O2
144 fi
145
146 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
147 + if tc-is-cross-compiler; then
148 + # Force some tests that try to poke fs paths.
149 + export ac_cv_file__dev_ptc=no
150 + export ac_cv_file__dev_ptmx=yes
151 + fi
152 +
153 + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
154 tc-export CXX
155 + # The configure script fails to use pkg-config correctly.
156 + # http://bugs.python.org/issue15506
157 + export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
158
159 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
160 - # Needed on FreeBSD unless Python 3.2 is already installed.
161 + # Set LDFLAGS so we link modules with -lpython2.7 correctly.
162 + # Needed on FreeBSD unless Python 2.7 is already installed.
163 # Please query BSD team before removing this!
164 append-ldflags "-L."
165
166 @@ -130,21 +170,30 @@ src_configure() {
167 if use gdbm; then
168 dbmliborder+="${dbmliborder:+:}gdbm"
169 fi
170 + if use berkdb; then
171 + dbmliborder+="${dbmliborder:+:}bdb"
172 + fi
173
174 local myeconfargs=(
175 + # The check is broken on clang, and gives false positive:
176 + # https://bugs.gentoo.org/596798
177 + # (upstream dropped this flag in 3.2a4 anyway)
178 + ac_cv_opt_olimit_ok=no
179 +
180 --with-fpectl
181 --enable-shared
182 $(use_enable ipv6)
183 $(use_with threads)
184 + $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2")
185 --infodir='${prefix}/share/info'
186 --mandir='${prefix}/share/man'
187 --with-computed-gotos
188 --with-dbmliborder="${dbmliborder}"
189 --with-libc=
190 --enable-loadable-sqlite-extensions
191 - --without-ensurepip
192 --with-system-expat
193 --with-system-ffi
194 + --without-ensurepip
195 )
196
197 OPT="" econf "${myeconfargs[@]}"
198 @@ -161,7 +210,10 @@ src_compile() {
199 # https://bugs.gentoo.org/594768
200 local -x LC_ALL=C
201
202 - emake CPPFLAGS= CFLAGS= LDFLAGS=
203 + # Avoid invoking pgen for cross-compiles.
204 + touch Include/graminit.h Python/graminit.c
205 +
206 + emake
207
208 # Work around bug 329499. See also bug 413751 and 457194.
209 if has_version dev-libs/libffi[pax_kernel]; then
210 @@ -179,7 +231,7 @@ src_test() {
211 fi
212
213 # Skip failing tests.
214 - local skipped_tests="gdb"
215 + local skipped_tests="distutils gdb"
216
217 for test in ${skipped_tests}; do
218 mv "${S}"/Lib/test/test_${test}.py "${T}"
219 @@ -188,10 +240,14 @@ src_test() {
220 # bug 660358
221 local -x COLUMNS=80
222
223 - local -x PYTHONDONTWRITEBYTECODE=
224 + # Daylight saving time problem
225 + # https://bugs.python.org/issue22067
226 + # https://bugs.gentoo.org/610628
227 + local -x TZ=UTC
228
229 - emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
230 - local result=$?
231 + # Rerun failed tests in verbose mode (regrtest -w).
232 + emake test EXTRATESTOPTS="-w" < /dev/tty
233 + local result="$?"
234
235 for test in ${skipped_tests}; do
236 mv "${T}/test_${test}.py" "${S}"/Lib/test
237 @@ -216,39 +272,18 @@ src_install() {
238
239 emake DESTDIR="${D}" altinstall
240
241 - # Remove static library
242 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
243 -
244 - sed \
245 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
246 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
247 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
248 + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die
249
250 # Fix collisions between different slots of Python.
251 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
252 -
253 - # Cheap hack to get version with ABIFLAGS
254 - local abiver=$(cd "${ED}/usr/include"; echo python*)
255 - if [[ ${abiver} != python${PYVER} ]]; then
256 - # Replace python3.X with a symlink to python3.Xm
257 - rm "${ED}/usr/bin/python${PYVER}" || die
258 - dosym "${abiver}" "/usr/bin/python${PYVER}"
259 - # Create python3.X-config symlink
260 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
261 - # Create python-3.5m.pc symlink
262 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
263 - fi
264 -
265 - # python seems to get rebuilt in src_install (bug 569908)
266 - # Work around it for now.
267 - if has_version dev-libs/libffi[pax_kernel]; then
268 - pax-mark E "${ED}/usr/bin/${abiver}"
269 - else
270 - pax-mark m "${ED}/usr/bin/${abiver}"
271 - fi
272 + mv "${ED}/usr/bin/2to3" "${ED}/usr/bin/2to3-${PYVER}" || die
273 + mv "${ED}/usr/bin/pydoc" "${ED}/usr/bin/pydoc${PYVER}" || die
274 + mv "${ED}/usr/bin/idle" "${ED}/usr/bin/idle${PYVER}" || die
275 + rm "${ED}/usr/bin/smtpd.py" || die
276
277 + use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
278 use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
279 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
280 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,lib-tk} || die
281 + use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
282
283 use threads || rm -r "${libdir}/multiprocessing" || die
284 use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
285 @@ -257,7 +292,6 @@ src_install() {
286
287 if use examples; then
288 docinto examples
289 - find Tools -name __pycache__ -exec rm -fr {} + || die
290 dodoc -r Tools
291 fi
292 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
293 @@ -292,17 +326,12 @@ src_install() {
294 local pymajor=${PYVER%.*}
295 mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
296 # python and pythonX
297 - ln -s "../../../bin/${abiver}" \
298 + ln -s "../../../bin/python${PYVER}" \
299 "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
300 ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
301 # python-config and pythonX-config
302 - # note: we need to create a wrapper rather than symlinking it due
303 - # to some random dirname(argv[0]) magic performed by python-config
304 - cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
305 - #!/bin/sh
306 - exec "${abiver}-config" "\${@}"
307 - EOF
308 - chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
309 + ln -s "../../../bin/python${PYVER}-config" \
310 + "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
311 ln -s "python${pymajor}-config" \
312 "${D}${PYTHON_SCRIPTDIR}/python-config" || die
313 # 2to3, pydoc, pyvenv
314 @@ -310,8 +339,6 @@ src_install() {
315 "${D}${PYTHON_SCRIPTDIR}/2to3" || die
316 ln -s "../../../bin/pydoc${PYVER}" \
317 "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
318 - ln -s "../../../bin/pyvenv-${PYVER}" \
319 - "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
320 # idle
321 if use tk; then
322 ln -s "../../../bin/idle${PYVER}" \
323 @@ -319,12 +346,6 @@ src_install() {
324 fi
325 }
326
327 -pkg_preinst() {
328 - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
329 - python_updater_warning="1"
330 - fi
331 -}
332 -
333 eselect_python_update() {
334 if [[ -z "$(eselect python show)" || \
335 ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
336 @@ -340,12 +361,6 @@ eselect_python_update() {
337
338 pkg_postinst() {
339 eselect_python_update
340 -
341 - if [[ "${python_updater_warning}" == "1" ]]; then
342 - ewarn "You have just upgraded from an older version of Python."
343 - ewarn
344 - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
345 - fi
346 }
347
348 pkg_postrm() {
349
350 diff --git a/dev-lang/python/python-3.6.10.ebuild b/dev-lang/python/python-3.6.10.ebuild
351 index c0c1738557f..43dc80e812f 100644
352 --- a/dev-lang/python/python-3.6.10.ebuild
353 +++ b/dev-lang/python/python-3.6.10.ebuild
354 @@ -8,12 +8,12 @@ inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
355
356 MY_P="Python-${PV}"
357 PYVER=$(ver_cut 1-2)
358 -PATCHSET_VERSION="3.6.8"
359 +PATCHSET="python-gentoo-patches-3.6.10"
360
361 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
362 HOMEPAGE="https://www.python.org/"
363 SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
364 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
365 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
366 S="${WORKDIR}/${MY_P}"
367
368 LICENSE="PSF-2"
369 @@ -63,7 +63,7 @@ src_prepare() {
370 rm -fr Modules/zlib || die
371
372 local PATCHES=(
373 - "${WORKDIR}/patches"
374 + "${WORKDIR}/${PATCHSET}"
375 )
376
377 default