Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 337320
Collapse All | Expand All

(-)python.eclass (-43 / +1 lines)
Lines 400-407 Link Here
400
# @DESCRIPTION:
400
# @DESCRIPTION:
401
# Perform sanity checks and initialize environment.
401
# Perform sanity checks and initialize environment.
402
#
402
#
403
# This function is exported in EAPI 2 and 3 when PYTHON_USE_WITH or PYTHON_USE_WITH_OR variable
403
# This function is exported in EAPI 2 and 3. Calling of this function is mandatory in EAPI >=4.
404
# is set and always in EAPI >=4. Calling of this function is mandatory in EAPI >=4.
405
python_pkg_setup() {
404
python_pkg_setup() {
406
	if [[ "${EBUILD_PHASE}" != "setup" ]]; then
405
	if [[ "${EBUILD_PHASE}" != "setup" ]]; then
407
		die "${FUNCNAME}() can be used only in pkg_setup() phase"
406
		die "${FUNCNAME}() can be used only in pkg_setup() phase"
Lines 421-467 Link Here
421
		PYTHON_ABI="${PYTHON_ABI:-$(PYTHON --ABI)}"
420
		PYTHON_ABI="${PYTHON_ABI:-$(PYTHON --ABI)}"
422
	fi
421
	fi
423
422
424
	if ! has "${EAPI:-0}" 0 1 && [[ -n "${PYTHON_USE_WITH}" || -n "${PYTHON_USE_WITH_OR}" ]]; then
425
		if [[ "${PYTHON_USE_WITH_OPT}" ]]; then
426
			if [[ "${PYTHON_USE_WITH_OPT}" == !* ]]; then
427
				use ${PYTHON_USE_WITH_OPT#!} && return
428
			else
429
				use !${PYTHON_USE_WITH_OPT} && return
430
			fi
431
		fi
432
433
		python_pkg_setup_check_USE_flags() {
434
			local python_atom USE_flag
435
			python_atom="$(python_get_implementational_package)"
436
437
			for USE_flag in ${PYTHON_USE_WITH}; do
438
				if ! has_version "${python_atom}[${USE_flag}]"; then
439
					eerror "Please rebuild ${python_atom} with the following USE flags enabled: ${PYTHON_USE_WITH}"
440
					die "Please rebuild ${python_atom} with the following USE flags enabled: ${PYTHON_USE_WITH}"
441
				fi
442
			done
443
444
			for USE_flag in ${PYTHON_USE_WITH_OR}; do
445
				if has_version "${python_atom}[${USE_flag}]"; then
446
					return
447
				fi
448
			done
449
450
			if [[ ${PYTHON_USE_WITH_OR} ]]; then
451
				eerror "Please rebuild ${python_atom} with at least one of the following USE flags enabled: ${PYTHON_USE_WITH_OR}"
452
				die "Please rebuild ${python_atom} with at least one of the following USE flags enabled: ${PYTHON_USE_WITH_OR}"
453
			fi
454
		}
455
456
		if _python_package_supporting_installation_for_multiple_python_abis; then
457
			PYTHON_SKIP_SANITY_CHECKS="1" python_execute_function -q python_pkg_setup_check_USE_flags
458
		else
459
			python_pkg_setup_check_USE_flags
460
		fi
461
462
		unset -f python_pkg_setup_check_USE_flags
463
	fi
464
465
	PYTHON_PKG_SETUP_EXECUTED="1"
423
	PYTHON_PKG_SETUP_EXECUTED="1"
466
}
424
}
467
425

Return to bug 337320