Diff python-3.6.9 with a python-3.6.10

/usr/portage/dev-lang/python/python-3.6.10.ebuild 2020-02-12 22:39:00.000000000 +0300
1 1
# Copyright 1999-2020 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI="6"
4
EAPI="7"
5 5
WANT_LIBTOOL="none"
6 6

  
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.6.8"
10
PYVER=$(ver_cut 1-2)
11
PATCHSET="python-gentoo-patches-3.6.10"
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.6/3.6m"
19
KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
20
SLOT="${PYVER}/${PYVER}m"
21
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
20 22
IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads 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-libs/zlib-1.1.3:0=
30
RDEPEND="app-arch/bzip2:=
31
	app-arch/xz-utils:=
32
	>=sys-libs/zlib-1.1.3:=
33
	virtual/libcrypt:=
31 34
	virtual/libffi:=
32 35
	virtual/libintl
33
	gdbm? ( sys-libs/gdbm:0=[berkdb] )
34
	ncurses? ( >=sys-libs/ncurses-5.2:0= )
35
	readline? ( >=sys-libs/readline-4.1:0= )
36
	gdbm? ( sys-libs/gdbm:=[berkdb] )
37
	ncurses? ( >=sys-libs/ncurses-5.2:= )
38
	readline? ( >=sys-libs/readline-4.1:= )
36 39
	sqlite? ( >=dev-db/sqlite-3.3.8:3= )
37 40
	ssl? (
38
		!libressl? ( dev-libs/openssl:0= )
39
		libressl? ( dev-libs/libressl:0= )
41
		!libressl? ( dev-libs/openssl:= )
42
		libressl? ( dev-libs/libressl:= )
40 43
	)
41 44
	tk? (
42
		>=dev-lang/tcl-8.0:0=
43
		>=dev-lang/tk-8.0:0=
44
		dev-tcltk/blt:0=
45
		>=dev-lang/tcl-8.0:=
46
		>=dev-lang/tk-8.0:=
47
		dev-tcltk/blt:=
45 48
		dev-tcltk/tix
46 49
	)
47
	xml? ( >=dev-libs/expat-2.1:0= )"
50
	xml? ( >=dev-libs/expat-2.1:= )"
48 51
# bluetooth requires headers from bluez
49 52
DEPEND="${RDEPEND}
50 53
	bluetooth? ( net-wireless/bluez )
......
54 57
RDEPEND+=" !build? ( app-misc/mime-types )"
55 58
PDEPEND=">=app-eselect/eselect-python-20140125-r1"
56 59

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

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

  
66 66
	local PATCHES=(
67
		"${WORKDIR}/patches"
67
		"${WORKDIR}/${PATCHSET}"
68 68
	)
69 69

  
70 70
	default
......
88 88
	local disable
89 89
	# disable automagic bluetooth headers detection
90 90
	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
91
	use gdbm     || disable+=" gdbm"
92
	use ncurses  || disable+=" _curses _curses_panel"
93
	use readline || disable+=" readline"
94
	use sqlite   || disable+=" _sqlite3"
95
	use ssl      || export PYTHON_DISABLE_SSL="1"
96
	use tk       || disable+=" _tkinter"
97
	use xml      || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
91
	use gdbm      || disable+=" gdbm"
92
	use ncurses   || disable+=" _curses _curses_panel"
93
	use readline  || disable+=" readline"
94
	use sqlite    || disable+=" _sqlite3"
95
	use ssl       || export PYTHON_DISABLE_SSL="1"
96
	use tk        || disable+=" _tkinter"
97
	use xml       || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
98 98
	export PYTHON_DISABLE_MODULES="${disable}"
99 99

  
100 100
	if ! use xml; then
......
217 217

  
218 218
	emake DESTDIR="${D}" altinstall
219 219

  
220
	# Remove static library
221
	rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
222

  
220 223
	sed \
221 224
		-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
222 225
		-e "s/\(PY_LDFLAGS=\).*/\1/" \
223 226
		-i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
224 227

  
225 228
	# Fix collisions between different slots of Python.
226
	rm -f "${ED}usr/$(get_libdir)/libpython3.so"
229
	rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
227 230

  
228 231
	# Cheap hack to get version with ABIFLAGS
229
	local abiver=$(cd "${ED}usr/include"; echo python*)
232
	local abiver=$(cd "${ED}/usr/include"; echo python*)
230 233
	if [[ ${abiver} != python${PYVER} ]]; then
231 234
		# Replace python3.X with a symlink to python3.Xm
232
		rm "${ED}usr/bin/python${PYVER}" || die
235
		rm "${ED}/usr/bin/python${PYVER}" || die
233 236
		dosym "${abiver}" "/usr/bin/python${PYVER}"
234 237
		# Create python3.X-config symlink
235 238
		dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
......
240 243
	# python seems to get rebuilt in src_install (bug 569908)
241 244
	# Work around it for now.
242 245
	if has_version dev-libs/libffi[pax_kernel]; then
243
		pax-mark E "${ED}usr/bin/${abiver}"
246
		pax-mark E "${ED}/usr/bin/${abiver}"
244 247
	else
245
		pax-mark m "${ED}usr/bin/${abiver}"
248
		pax-mark m "${ED}/usr/bin/${abiver}"
246 249
	fi
247 250

  
248 251
	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
249
	use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
252
	use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
250 253

  
251 254
	use threads || rm -r "${libdir}/multiprocessing" || die
252 255
	use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
253 256

  
254
	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
257
	dodoc Misc/{ACKS,HISTORY,NEWS}
255 258

  
256 259
	if use examples; then
257
		insinto /usr/share/doc/${PF}/examples
258
		find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
259
		doins -r "${S}"/Tools
260
		docinto examples
261
		find Tools -name __pycache__ -exec rm -fr {} + || die
262
		dodoc -r Tools
260 263
	fi
261 264
	insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
262 265
	local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
......
268 271
	sed \
269 272
		-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
270 273
		-e "s:@PYDOC@:pydoc${PYVER}:" \
271
		-i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
274
		-i "${ED}/etc/conf.d/pydoc-${PYVER}" \
275
		"${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
272 276

  
273 277
	# for python-exec
274 278
	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
......
291 295
	# python and pythonX
292 296
	ln -s "../../../bin/${abiver}" \
293 297
		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
294
	ln -s "python${pymajor}" \
295
		"${D}${PYTHON_SCRIPTDIR}/python" || die
298
	ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
296 299
	# python-config and pythonX-config
297 300
	# note: we need to create a wrapper rather than symlinking it due
298 301
	# to some random dirname(argv[0]) magic performed by python-config
......
324 327
}
325 328

  
326 329
eselect_python_update() {
327
	if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
330
	if [[ -z "$(eselect python show)" || \
331
			! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
328 332
		eselect python update
329 333
	fi
330 334

  
331
	if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
335
	if [[ -z "$(eselect python show --python${PV%%.*})" || \
336
			! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]
337
	then
332 338
		eselect python update --python${PV%%.*}
333 339
	fi
334 340
}
Thank you!