Diff python-3.7.5-r1 with a python-3.7.6

/usr/portage/dev-lang/python/python-3.7.6.ebuild 2020-02-12 22:39:00.000000000 +0300
7 7
inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
8 8

  
9 9
MY_P="Python-${PV}"
10
PATCHSET_VERSION="3.7.4-1"
10
PYVER=$(ver_cut 1-2)
11
PATCHSET="python-gentoo-patches-3.7.6"
11 12

  
12 13
DESCRIPTION="An interpreted, interactive, object-oriented programming language"
13 14
HOMEPAGE="https://www.python.org/"
14 15
SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
15
	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
16
	https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
17
S="${WORKDIR}/${MY_P}"
16 18

  
17 19
LICENSE="PSF-2"
18
SLOT="3.7/3.7m"
19
KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 ~sh sparc x86"
20
SLOT="${PYVER}/${PYVER}m"
21
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86"
20 22
IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml"
21 23
RESTRICT="!test? ( test )"
22 24

  
......
25 27
# run the bootstrap code on your dev box and include the results in the
26 28
# patchset. See bug 447752.
27 29

  
28
RDEPEND="app-arch/bzip2:0=
29
	app-arch/xz-utils:0=
30
	sys-apps/util-linux:0=
31
	>=sys-libs/zlib-1.1.3:0=
30
RDEPEND="app-arch/bzip2:=
31
	app-arch/xz-utils:=
32
	sys-apps/util-linux:=
33
	>=sys-libs/zlib-1.1.3:=
34
	virtual/libcrypt:=
32 35
	virtual/libffi:=
33 36
	virtual/libintl
34
	gdbm? ( sys-libs/gdbm:0=[berkdb] )
35
	ncurses? ( >=sys-libs/ncurses-5.2:0= )
36
	readline? ( >=sys-libs/readline-4.1:0= )
37
	gdbm? ( sys-libs/gdbm:=[berkdb] )
38
	ncurses? ( >=sys-libs/ncurses-5.2:= )
39
	readline? ( >=sys-libs/readline-4.1:= )
37 40
	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
38 41
	ssl? (
39
		!libressl? ( dev-libs/openssl:0= )
40
		libressl? ( dev-libs/libressl:0= )
42
		!libressl? ( dev-libs/openssl:= )
43
		libressl? ( dev-libs/libressl:= )
41 44
	)
42 45
	tk? (
43
		>=dev-lang/tcl-8.0:0=
44
		>=dev-lang/tk-8.0:0=
45
		dev-tcltk/blt:0=
46
		>=dev-lang/tcl-8.0:=
47
		>=dev-lang/tk-8.0:=
48
		dev-tcltk/blt:=
46 49
		dev-tcltk/tix
47 50
	)
48
	xml? ( >=dev-libs/expat-2.1:0= )"
51
	xml? ( >=dev-libs/expat-2.1:= )"
49 52
# bluetooth requires headers from bluez
50 53
DEPEND="${RDEPEND}
51 54
	bluetooth? ( net-wireless/bluez )
......
55 58
RDEPEND+=" !build? ( app-misc/mime-types )"
56 59
PDEPEND=">=app-eselect/eselect-python-20140125-r1"
57 60

  
58
S="${WORKDIR}/${MY_P}"
59
PYVER=${SLOT%/*}
60

  
61 61
src_prepare() {
62 62
	# Ensure that internal copies of expat, libffi and zlib are not used.
63
	rm -fr Modules/expat
64
	rm -fr Modules/_ctypes/libffi*
65
	rm -fr Modules/zlib
63
	rm -fr Modules/expat || die
64
	rm -fr Modules/_ctypes/libffi* || die
65
	rm -fr Modules/zlib || die
66 66

  
67 67
	local PATCHES=(
68
		"${FILESDIR}/python-3.7.5-hashlib.patch"
69
		"${WORKDIR}/patches"
68
		"${WORKDIR}/${PATCHSET}"
70 69
	)
71 70

  
72 71
	default
......
81 80
	local disable
82 81
	# disable automagic bluetooth headers detection
83 82
	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
84
	use gdbm     || disable+=" gdbm"
85
	use ncurses  || disable+=" _curses _curses_panel"
86
	use readline || disable+=" readline"
87
	use sqlite   || disable+=" _sqlite3"
88
	use ssl      || export PYTHON_DISABLE_SSL="1"
89
	use tk       || disable+=" _tkinter"
90
	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
83
	use gdbm      || disable+=" gdbm"
84
	use ncurses   || disable+=" _curses _curses_panel"
85
	use readline  || disable+=" readline"
86
	use sqlite    || disable+=" _sqlite3"
87
	use ssl       || export PYTHON_DISABLE_SSL="1"
88
	use tk        || disable+=" _tkinter"
89
	use xml       || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
91 90
	export PYTHON_DISABLE_MODULES="${disable}"
92 91

  
93 92
	if ! use xml; then
......
205 204

  
206 205
	emake DESTDIR="${D}" altinstall
207 206

  
207
	# Remove static library
208
	rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
209

  
208 210
	sed \
209 211
		-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
210 212
		-e "s/\(PY_LDFLAGS=\).*/\1/" \
211 213
		-i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
212 214

  
213 215
	# Fix collisions between different slots of Python.
214
	rm -f "${ED}/usr/$(get_libdir)/libpython3.so"
216
	rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
215 217

  
216 218
	# Cheap hack to get version with ABIFLAGS
217 219
	local abiver=$(cd "${ED}/usr/include"; echo python*)
......
238 240

  
239 241
	use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
240 242

  
241
	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
243
	dodoc Misc/{ACKS,HISTORY,NEWS}
242 244

  
243 245
	if use examples; then
244
		insinto /usr/share/doc/${PF}/examples
245
		find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
246
		doins -r "${S}"/Tools
246
		docinto examples
247
		find Tools -name __pycache__ -exec rm -fr {} + || die
248
		dodoc -r Tools
247 249
	fi
248 250
	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
249 251
	local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
......
255 257
	sed \
256 258
		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
257 259
		-e "s:@PYDOC@:pydoc${PYVER}:" \
258
		-i "${ED}/etc/conf.d/pydoc-${PYVER}" "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
260
		-i "${ED}/etc/conf.d/pydoc-${PYVER}" \
261
		"${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
259 262

  
260 263
	# for python-exec
261 264
	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
......
276 279
	local pymajor=${PYVER%.*}
277 280
	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
278 281
	# python and pythonX
279
	ln -s "../../../bin/${abiver}" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
282
	ln -s "../../../bin/${abiver}" \
283
		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
280 284
	ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
281 285
	# python-config and pythonX-config
282 286
	# note: we need to create a wrapper rather than symlinking it due
......
286 290
		exec "${abiver}-config" "\${@}"
287 291
	EOF
288 292
	chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
289
	ln -s "python${pymajor}-config" "${D}${PYTHON_SCRIPTDIR}/python-config" || die
293
	ln -s "python${pymajor}-config" \
294
		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
290 295
	# 2to3, pydoc, pyvenv
291
	ln -s "../../../bin/2to3-${PYVER}" "${D}${PYTHON_SCRIPTDIR}/2to3" || die
292
	ln -s "../../../bin/pydoc${PYVER}" "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
293
	ln -s "../../../bin/pyvenv-${PYVER}" "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
296
	ln -s "../../../bin/2to3-${PYVER}" \
297
		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
298
	ln -s "../../../bin/pydoc${PYVER}" \
299
		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
300
	ln -s "../../../bin/pyvenv-${PYVER}" \
301
		"${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
294 302
	# idle
295 303
	if use tk; then
296
		ln -s "../../../bin/idle${PYVER}" "${D}${PYTHON_SCRIPTDIR}/idle" || die
304
		ln -s "../../../bin/idle${PYVER}" \
305
			"${D}${PYTHON_SCRIPTDIR}/idle" || die
297 306
	fi
298 307
}
299 308

  
......
304 313
}
305 314

  
306 315
eselect_python_update() {
307
	if [[ -z "$(eselect python show)" || ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
316
	if [[ -z "$(eselect python show)" || \
317
			! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
308 318
		eselect python update
309 319
	fi
310 320

  
311
	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
321
	if [[ -z "$(eselect python show --python${PV%%.*})" || \
322
			! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]
323
	then
312 324
		eselect python update --python${PV%%.*}
313 325
	fi
314 326
}
Thank you!