Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   Generate PYTHON_USEDEP for use in cross-package deps. (http://www.linux-archive.org/gentoo-development/705654-generate-python_usedep-use-cross-package-deps.html)

Michał Górny 09-19-2012 09:43 PM

Generate PYTHON_USEDEP for use in cross-package deps.
 
This is based on a suggestion from Ian Stakenvicius.
---
gx86/eclass/python-r1.eclass | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
index 957db68..487b5e0 100644
--- a/gx86/eclass/python-r1.eclass
+++ b/gx86/eclass/python-r1.eclass
@@ -56,11 +56,25 @@ _PYTHON_ALL_IMPLS=(
# DEPEND="${RDEPEND}"
# @CODE

+# @ECLASS-VARIABLE: PYTHON_USEDEP
+# @DESCRIPTION:
+# This is an eclass-generated USE-dependency string which can be used to
+# depend on another Python package being built for the same Python
+# implementations. It should be used like:
+#
+# @CODE
+# RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
+# @CODE
+
PYTHON_COMPAT=( ${PYTHON_COMPAT[@]} )

_python_set_globals() {
- IUSE=${PYTHON_COMPAT[@]/#/python_targets_}
- REQUIRED_USE="|| ( ${IUSE} )"
+ local flags=( "${PYTHON_COMPAT[@]/#/python_targets_}" )
+ local optflags=${flags[@]/%/?}
+
+ IUSE=${flags}
+ REQUIRED_USE="|| ( ${flags} )"
+ PYTHON_USEDEP=${optflags// /,}

PYTHON_DEPS=
local i
--
1.7.12


All times are GMT. The time now is 04:44 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.