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 2E20B138010 for ; Wed, 19 Sep 2012 21:45:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3AF7E21C068; Wed, 19 Sep 2012 21:44:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0E502E0417 for ; Wed, 19 Sep 2012 21:43:07 +0000 (UTC) Received: from pomiocik.lan (77-254-69-147.adsl.inetia.pl [77.254.69.147]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 7F9FA33D0A6; Wed, 19 Sep 2012 21:43:06 +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 1/3] Generate python depstrings in python-r1 (updated). Date: Wed, 19 Sep 2012 23:43:06 +0200 Message-Id: <1348090988-2801-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1348048827-1290-1-git-send-email-mgorny@gentoo.org> References: <1348048827-1290-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: 1cfb2c1d-14e4-41e9-bf9a-9d9b0a25d23c X-Archives-Hash: 07c77bf642942b6cf0b728cded124395 I've renamed PYTHON_DEPEND to avoid confusion with python.eclass. --- gx86/eclass/python-distutils-ng.eclass | 20 ++----------------- gx86/eclass/python-r1.eclass | 35 ++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/gx86/eclass/python-distutils-ng.eclass b/gx86/eclass/python-distutils-ng.eclass index 5df965c..34717aa 100644 --- a/gx86/eclass/python-distutils-ng.eclass +++ b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@ _python-distutils-ng_get_binary_for_implementation() { esac } -for impl in ${PYTHON_COMPAT[@]}; do - dep_str="${impl/_/.}" - case "${dep_str}" in - python?.?) - dep_str="dev-lang/python:${dep_str: -3}" ;; - jython?.?) - dep_str="dev-java/jython:${dep_str: -3}" ;; - pypy?.?) - dep_str="dev-python/pypy:${dep_str: -3}" ;; - *) - die "Unsupported implementation: ${impl}" ;; - esac - dep_str="python_targets_${impl}? ( ${dep_str} )" - - RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND} ${dep_str}" - unset dep_str -done +RDEPEND=${PYTHON_DEPS} +DEPEND=${PYTHON_DEPS} _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}" diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass index 18f9246..957db68 100644 --- a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass @@ -40,14 +40,45 @@ _PYTHON_ALL_IMPLS=( # a package supports. It must be set before the `inherit' call. # The default is to enable all implementations. # -# PYTHON_COMPAT can be either a scalar or an array. If it's a scalar, the eclass -# will implicitly convert it to an array. +# PYTHON_COMPAT can be either a scalar or an array. If it's a scalar, +# the eclass will implicitly convert it to an array. : ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}} +# @ECLASS-VARIABLE: PYTHON_DEPS +# @DESCRIPTION: +# This is an eclass-generated Python dependency string for all +# implementations listed in PYTHON_COMPAT. It should be used +# in RDEPEND and/or DEPEND like: +# +# @CODE +# RDEPEND="${PYTHON_DEPS} +# dev-foo/mydep" +# DEPEND="${RDEPEND}" +# @CODE + PYTHON_COMPAT=( ${PYTHON_COMPAT[@]} ) _python_set_globals() { IUSE=${PYTHON_COMPAT[@]/#/python_targets_} REQUIRED_USE="|| ( ${IUSE} )" + + PYTHON_DEPS= + local i + for i in ${PYTHON_COMPAT[@]}; do + local d + case ${i} in + python*) + d='dev-lang/python';; + jython*) + d='dev-java/jython';; + pypy*) + d='dev-python/pypy';; + *) + die "Invalid implementation: ${i}" + esac + + local v=${i##*[a-z]} + PYTHON_DEPS+=" python_targets_${i}? ( ${d}:${v/_/.} )" + done } _python_set_globals -- 1.7.12