Diff python-3.10.13 with a python-3.11.5

/usr/portage/dev-lang/python/python-3.11.5.ebuild 2023-10-09 14:52:29.472368350 +0300
31 31
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
32 32
IUSE="
33 33
	bluetooth build debug +ensurepip examples gdbm libedit lto
34
	+ncurses pgo +readline +sqlite +ssl test tk valgrind +xml
34
	+ncurses pgo +readline +sqlite +ssl test tk valgrind
35 35
"
36 36
RESTRICT="!test? ( test )"
37 37

  
......
43 43
RDEPEND="
44 44
	app-arch/bzip2:=
45 45
	app-arch/xz-utils:=
46
	dev-lang/python-exec[python_targets_python3_10(-)]
46
	app-crypt/libb2
47
	>=dev-libs/expat-2.1:=
47 48
	dev-libs/libffi:=
48 49
	dev-python/gentoo-common
49 50
	>=sys-libs/zlib-1.1.3:=
......
65 66
		dev-tcltk/blt:=
66 67
		dev-tcltk/tix
67 68
	)
68
	xml? ( >=dev-libs/expat-2.1:= )
69 69
"
70 70
# bluetooth requires headers from bluez
71 71
DEPEND="
72 72
	${RDEPEND}
73 73
	bluetooth? ( net-wireless/bluez )
74
	valgrind? ( dev-util/valgrind )
75 74
	test? ( app-arch/xz-utils[extra-filters(+)] )
75
	valgrind? ( dev-util/valgrind )
76 76
"
77 77
# autoconf-archive needed to eautoreconf
78 78
BDEPEND="
......
84 84
RDEPEND+="
85 85
	!build? ( app-misc/mime-types )
86 86
"
87
if [[ ${PV} != *_alpha* ]]; then
88
	RDEPEND+="
89
		dev-lang/python-exec[python_targets_python${PYVER/./_}(-)]
90
	"
91
fi
87 92

  
88 93
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
89 94

  
......
147 152
	local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
148 153

  
149 154
	# We need to build our own Python on CBUILD first, and feed it in.
150
	# bug #847910 and bug #864911.
155
	# bug #847910
151 156
	local myeconfargs_cbuild=(
152 157
		"${myeconfargs[@]}"
153 158

  
......
158 163
		--disable-shared
159 164

  
160 165
		# As minimal as possible for the mini CBUILD Python
161
		# we build just for cross.
166
		# we build just for cross to satisfy --with-build-python.
162 167
		--without-lto
168
		--without-readline
163 169
		--disable-optimizations
164 170
	)
165 171

  
......
172 178

  
173 179
	# Avoid as many dependencies as possible for the cross build.
174 180
	cat >> Makefile <<-EOF || die
175
		MODULE_NIS=disabled
176
		MODULE__DBM=disabled
177
		MODULE__GDBM=disabled
178
		MODULE__DBM=disabled
179
		MODULE__SQLITE3=disabled
180
		MODULE__HASHLIB=disabled
181
		MODULE__SSL=disabled
182
		MODULE__CURSES=disabled
183
		MODULE__CURSES_PANEL=disabled
184
		MODULE_READLINE=disabled
185
		MODULE__TKINTER=disabled
186
		MODULE_PYEXPAT=disabled
187
		MODULE_ZLIB=disabled
181
		MODULE_NIS_STATE=disabled
182
		MODULE__DBM_STATE=disabled
183
		MODULE__GDBM_STATE=disabled
184
		MODULE__DBM_STATE=disabled
185
		MODULE__SQLITE3_STATE=disabled
186
		MODULE__HASHLIB_STATE=disabled
187
		MODULE__SSL_STATE=disabled
188
		MODULE__CURSES_STATE=disabled
189
		MODULE__CURSES_PANEL_STATE=disabled
190
		MODULE_READLINE_STATE=disabled
191
		MODULE__TKINTER_STATE=disabled
192
		MODULE_PYEXPAT_STATE=disabled
193
		MODULE_ZLIB_STATE=disabled
188 194
	EOF
189 195

  
190 196
	# Unfortunately, we do have to build this immediately, and
191 197
	# not in src_compile, because CHOST configure for Python
192
	# will check the existence of the Python it was pointed to
198
	# will check the existence of the --with-build-python value
193 199
	# immediately.
194 200
	PYTHON_DISABLE_MODULES+=" _ctypes _crypt" emake
195 201
	popd &> /dev/null || die
196 202
}
197 203

  
198 204
src_configure() {
205
	local disable
199 206
	# disable automagic bluetooth headers detection
200 207
	if ! use bluetooth; then
201 208
		local -x ac_cv_header_bluetooth_bluetooth_h=no
202 209
	fi
203
	local disable
204
	use gdbm      || disable+=" gdbm"
205
	use ncurses   || disable+=" _curses _curses_panel"
206
	use readline  || disable+=" readline"
207
	use sqlite    || disable+=" _sqlite3"
208
	use ssl       || export PYTHON_DISABLE_SSL="1"
209
	use tk        || disable+=" _tkinter"
210
	use xml       || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
211
	export PYTHON_DISABLE_MODULES="${disable}"
212

  
213
	if ! use xml; then
214
		ewarn "You have configured Python without XML support."
215
		ewarn "This is NOT a recommended configuration as you"
216
		ewarn "may face problems parsing any XML documents."
217
	fi
218

  
219
	if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
220
		einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
221
	fi
222 210

  
223 211
	append-flags -fwrapv
224 212
	filter-flags -malign-double
......
293 281
		--without-ensurepip
294 282
		--with-system-expat
295 283
		--with-system-ffi
284
		--with-platlibdir=lib
285
		--with-pkg-config=yes
296 286
		--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
297 287

  
298 288
		$(use_with debug assertions)
......
307 297

  
308 298
	if tc-is-cross-compiler ; then
309 299
		build_cbuild_python
310
		# Point the imminent CHOST build to the Python we just
311
		# built for CBUILD.
312
		export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
300
		myeconfargs+=(
301
			# Point the imminent CHOST build to the Python we just
302
			# built for CBUILD.
303
			--with-build-python="${WORKDIR}"/${P}-${CBUILD}/python
304
		)
313 305
	fi
314 306

  
315 307
	# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
......
332 324
		die "Broken sem_open function (bug 496328)"
333 325
	fi
334 326

  
327
	# force-disable modules we don't want built
328
	local disable_modules=( NIS )
329
	use gdbm || disable_modules+=( _GDBM _DBM )
330
	use sqlite || disable_modules+=( _SQLITE3 )
331
	use ssl || disable_modules+=( _HASHLIB _SSL )
332
	use ncurses || disable_modules+=( _CURSES _CURSES_PANEL )
333
	use readline || disable_modules+=( READLINE )
334
	use tk || disable_modules+=( _TKINTER )
335

  
336
	local mod
337
	for mod in "${disable_modules[@]}"; do
338
		echo "MODULE_${mod}_STATE=disabled"
339
	done >> Makefile || die
340

  
335 341
	# install epython.py as part of stdlib
336 342
	echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die
337 343
}
......
343 349
	# Prevent using distutils bundled by setuptools.
344 350
	# https://bugs.gentoo.org/823728
345 351
	export SETUPTOOLS_USE_DISTUTILS=stdlib
352
	export PYTHONSTRICTEXTENSIONBUILD=1
346 353

  
347 354
	# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
348 355
	# end up writing bytecode & violating sandbox.
......
379 386
		return
380 387
	fi
381 388

  
389
	# this just happens to skip test_support.test_freeze that is broken
390
	# without bundled expat
391
	# TODO: get a proper skip for it upstream
392
	local -x LOGNAME=buildbot
393

  
382 394
	local test_opts=(
383 395
		-u-network
384 396
		-j "$(makeopts_jobs)"
......
418 430
src_install() {
419 431
	local libdir=${ED}/usr/lib/python${PYVER}
420 432

  
421
	emake DESTDIR="${D}" altinstall
433
	# -j1 hack for now for bug #843458
434
	emake -j1 DESTDIR="${D}" altinstall
422 435

  
423 436
	# Fix collisions between different slots of Python.
424 437
	rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
......
448 461
		rm -r "${libdir}"/ensurepip || die
449 462
	fi
450 463
	if ! use sqlite; then
451
		rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
464
		rm -r "${libdir}/"sqlite3 || die
452 465
	fi
453 466
	if ! use tk; then
454 467
		rm -r "${ED}/usr/bin/idle${PYVER}" || die
......
504 517
		ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die
505 518
	fi
506 519
}
520

  
521
pkg_postinst() {
522
	local v
523
	for v in ${REPLACING_VERSIONS}; do
524
		if ver_test "${v}" -lt 3.11.0_beta4-r2; then
525
			ewarn "Python 3.11.0b4 has changed its module ABI.  The .pyc files"
526
			ewarn "installed previously are no longer valid and will be regenerated"
527
			ewarn "(or ignored) on the next import.  This may cause sandbox failures"
528
			ewarn "when installing some packages and checksum mismatches when removing"
529
			ewarn "old versions.  To actively prevent this, rebuild all packages"
530
			ewarn "installing Python 3.11 modules, e.g. using:"
531
			ewarn
532
			ewarn "  emerge -1v /usr/lib/python3.11/site-packages"
533
		fi
534
	done
535
}
Thank you!