public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] [PATCH] Introduce PYTHON_REQUIRED_USE variable, utilize it in distutils-r1 by default
@ 2013-05-11 23:11 Mike Gilbert
  2013-05-12  6:13 ` Michał Górny
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Gilbert @ 2013-05-11 23:11 UTC (permalink / raw
  To: gentoo-python

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

I think this is the safe/conservative method of implementing a
required-use check in the -r1 eclasses.

Just like with PYTHON_DEPS, we leave it to the ebuild author to
utilize the value by adding it to REQUIRED_USE. I will certainly
assist in the mass-update that will be necessary to implement this in
existing ebuilds. This does not need to be done immediately.

The PYTHON_REQUIRED_USE name may cause a bit of confusion with the
PYTHON_REQ_USE variable, but I think the latter was a poor naming
choice to begin with.

[-- Attachment #2: python-required-use.patch --]
[-- Type: application/octet-stream, Size: 1686 bytes --]

Index: distutils-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v
retrieving revision 1.70
diff -u -r1.70 distutils-r1.eclass
--- distutils-r1.eclass	30 Apr 2013 05:36:19 -0000	1.70
+++ distutils-r1.eclass	11 May 2013 23:00:11 -0000
@@ -98,6 +98,7 @@
 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
 	RDEPEND=${PYTHON_DEPS}
 	DEPEND=${PYTHON_DEPS}
+	REQUIRED_USE=${PYTHON_REQUIRED_USE}
 fi
 
 # @ECLASS-VARIABLE: PATCHES
Index: python-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v
retrieving revision 1.54
diff -u -r1.54 python-r1.eclass
--- python-r1.eclass	10 May 2013 22:03:30 -0000	1.54
+++ python-r1.eclass	11 May 2013 23:00:11 -0000
@@ -150,6 +150,24 @@
 # python_targets_python2_6(-)?,python_targets_python2_7(-)?
 # @CODE
 
+# @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
+# @DESCRIPTION:
+# This is an eclass-generated required-use expression which ensures at
+# least one Python implementation has been enabled.
+#
+# This expression should be utilized in an ebuild by including it in
+# REQUIRED_USE, optionally behind a use flag.
+#
+# Example use:
+# @CODE
+# REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+# @CODE
+#
+# Example value:
+# @CODE
+# || ( python_targets_python2_6 python_targets_python2_7 )
+# @CODE
+
 _python_set_globals() {
 	local impls=()
 
@@ -181,7 +199,7 @@
 	optflags+=,${flags_st[@]/%/(-)}
 
 	IUSE=${flags[*]}
-	#REQUIRED_USE="|| ( ${flags[*]} )"
+	PYTHON_REQUIRED_USE="|| ( ${flags[*]} )"
 	PYTHON_USEDEP=${optflags// /,}
 
 	# 1) well, python-exec would suffice as an RDEP

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-12 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-11 23:11 [gentoo-python] [PATCH] Introduce PYTHON_REQUIRED_USE variable, utilize it in distutils-r1 by default Mike Gilbert
2013-05-12  6:13 ` Michał Górny
2013-05-12 15:55   ` Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox