Diff python-3.6.10 with a python-3.7.5-r1

/usr/portage/dev-lang/python/python-3.7.5-r1.ebuild 2020-02-11 20:51: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
PYVER=$(ver_cut 1-2)
11
PATCHSET="python-gentoo-patches-3.6.10"
10
PATCHSET_VERSION="3.7.4-1"
12 11

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

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

  
25 23
# Do not add a dependency on dev-lang/python to this ebuild.
......
27 25
# run the bootstrap code on your dev box and include the results in the
28 26
# patchset. See bug 447752.
29 27

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

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

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

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

  
70 72
	default
71 73

  
72 74
	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
73
		Lib/distutils/command/install.py \
74
		Lib/distutils/sysconfig.py \
75
		Lib/site.py \
76
		Lib/sysconfig.py \
77
		Lib/test/test_site.py \
78
		Makefile.pre.in \
79
		Modules/Setup.dist \
80
		Modules/getpath.c \
81
		configure.ac \
82 75
		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
83 76

  
84 77
	eautoreconf
......
88 81
	local disable
89 82
	# disable automagic bluetooth headers detection
90 83
	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.
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.
98 91
	export PYTHON_DISABLE_MODULES="${disable}"
99 92

  
100 93
	if ! use xml; then
......
127 120
	# Please query BSD team before removing this!
128 121
	append-ldflags "-L."
129 122

  
123
	# Fix implicit declarations on cross and prefix builds. Bug #674070.
124
	use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
125

  
130 126
	local dbmliborder
131 127
	if use gdbm; then
132 128
		dbmliborder+="${dbmliborder:+:}gdbm"
133 129
	fi
134 130

  
135 131
	local myeconfargs=(
136
		--with-fpectl
137 132
		--enable-shared
138 133
		$(use_enable ipv6)
139
		$(use_with threads)
140 134
		--infodir='${prefix}/share/info'
141 135
		--mandir='${prefix}/share/man'
142 136
		--with-computed-gotos
......
149 143
	)
150 144

  
151 145
	OPT="" econf "${myeconfargs[@]}"
152

  
153
	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
154
		eerror "configure has detected that the sem_open function is broken."
155
		eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
156
		die "Broken sem_open function (bug 496328)"
157
	fi
158 146
}
159 147

  
160 148
src_compile() {
......
204 192
	done
205 193

  
206 194
	elog "If you would like to run them, you may:"
207
	elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
195
	elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
208 196
	elog "and run the tests separately."
209 197

  
210 198
	if [[ ${result} -ne 0 ]]; then
......
213 201
}
214 202

  
215 203
src_install() {
216
	local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
204
	local libdir=${ED}/usr/lib/python${PYVER}
217 205

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

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

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

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

  
231 216
	# Cheap hack to get version with ABIFLAGS
232 217
	local abiver=$(cd "${ED}/usr/include"; echo python*)
......
251 236
	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
252 237
	use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
253 238

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

  
257
	dodoc Misc/{ACKS,HISTORY,NEWS}
241
	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
258 242

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

  
277 260
	# for python-exec
278 261
	local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
......
293 276
	local pymajor=${PYVER%.*}
294 277
	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
295 278
	# python and pythonX
296
	ln -s "../../../bin/${abiver}" \
297
		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
279
	ln -s "../../../bin/${abiver}" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
298 280
	ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
299 281
	# python-config and pythonX-config
300 282
	# note: we need to create a wrapper rather than symlinking it due
......
304 286
		exec "${abiver}-config" "\${@}"
305 287
	EOF
306 288
	chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
307
	ln -s "python${pymajor}-config" \
308
		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
289
	ln -s "python${pymajor}-config" "${D}${PYTHON_SCRIPTDIR}/python-config" || die
309 290
	# 2to3, pydoc, pyvenv
310
	ln -s "../../../bin/2to3-${PYVER}" \
311
		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
312
	ln -s "../../../bin/pydoc${PYVER}" \
313
		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
314
	ln -s "../../../bin/pyvenv-${PYVER}" \
315
		"${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
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
316 294
	# idle
317 295
	if use tk; then
318
		ln -s "../../../bin/idle${PYVER}" \
319
			"${D}${PYTHON_SCRIPTDIR}/idle" || die
296
		ln -s "../../../bin/idle${PYVER}" "${D}${PYTHON_SCRIPTDIR}/idle" || die
320 297
	fi
321 298
}
322 299

  
......
327 304
}
328 305

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

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