From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D43301384B4 for ; Thu, 17 Dec 2015 22:05:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A983221C065; Thu, 17 Dec 2015 22:03:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ED88221C047 for ; Thu, 17 Dec 2015 22:03:26 +0000 (UTC) Received: from localhost.localdomain (d202-251.icpnet.pl [109.173.202.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 8130B3402A2; Thu, 17 Dec 2015 22:03:25 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 4/5] python-single-r1.eclass: Support PYTHON_COMPAT_OVERRIDE Date: Thu, 17 Dec 2015 23:02:57 +0100 Message-Id: <1450389778-10144-5-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450389778-10144-1-git-send-email-mgorny@gentoo.org> References: <1450389778-10144-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 59f2a8a5-a5a4-4e15-9d1a-7f0a03050204 X-Archives-Hash: db7773886a157429c2562b7dae81624d --- eclass/python-single-r1.eclass | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 4c4f057..4d5026f 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -96,6 +96,25 @@ if [[ ! ${_PYTHON_SINGLE_R1} ]]; then # PYTHON_COMPAT=( python2_7 python3_{3,4} ) # @CODE +# @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE +# @INTERNAL +# @DESCRIPTION: +# This variable can be used when working with ebuilds to override +# the in-ebuild PYTHON_COMPAT. It is a string naming the implementation +# which package will be built for. It needs to be specified +# in the calling environment, and not in ebuilds. +# +# It should be noted that in order to preserve metadata immutability, +# PYTHON_COMPAT_OVERRIDE does not affect IUSE nor dependencies. +# The state of PYTHON_TARGETS and PYTHON_SINGLE_TARGET is ignored, +# and the implementation in PYTHON_COMPAT_OVERRIDE is built instead. +# Dependencies need to be satisfied manually. +# +# Example: +# @CODE +# PYTHON_COMPAT_OVERRIDE='pypy' emerge -1v dev-python/bar +# @CODE + # @ECLASS-VARIABLE: PYTHON_REQ_USE # @DEFAULT_UNSET # @DESCRIPTION: @@ -401,6 +420,23 @@ python_setup() { unset EPYTHON + # support developer override + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then + local impls=( ${PYTHON_COMPAT_OVERRIDE} ) + [[ ${#impls[@]} -eq 1 ]] || die "PYTHON_COMPAT_OVERRIDE must name exactly one implementation for python-single-r1" + + ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python" + ewarn "implementation will be used:" + ewarn + ewarn " ${PYTHON_COMPAT_OVERRIDE}" + ewarn + ewarn "Dependencies won't be satisfied, and PYTHON_SINGLE_TARGET flags will be ignored." + + python_export "${impls[0]}" EPYTHON PYTHON + python_wrapper_setup + return + fi + if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then if use "python_targets_${_PYTHON_SUPPORTED_IMPLS[0]}"; then # Only one supported implementation, enable it explicitly -- 2.6.4