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

* Re: [gentoo-python] [PATCH] Introduce PYTHON_REQUIRED_USE variable, utilize it in distutils-r1 by default
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2013-05-12  6:13 UTC (permalink / raw
  To: Mike Gilbert; +Cc: gentoo-python

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

On Sat, 11 May 2013 19:11:23 -0400
Mike Gilbert <floppym@gentoo.org> wrote:

> 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.

Please update python-single-r1 too.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

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

* Re: [gentoo-python] [PATCH] Introduce PYTHON_REQUIRED_USE variable, utilize it in distutils-r1 by default
  2013-05-12  6:13 ` Michał Górny
@ 2013-05-12 15:55   ` Mike Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Gilbert @ 2013-05-12 15:55 UTC (permalink / raw
  To: gentoo-python

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

On Sun, May 12, 2013 at 2:13 AM, Michał Górny <mgorny@gentoo.org> wrote:
> On Sat, 11 May 2013 19:11:23 -0400
> Mike Gilbert <floppym@gentoo.org> wrote:
>
>> 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.
>
> Please update python-single-r1 too.
>

Thanks for the reminder. See attached.

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

Index: python-single-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v
retrieving revision 1.17
diff -u -r1.17 python-single-r1.eclass
--- python-single-r1.eclass	10 May 2013 22:03:30 -0000	1.17
+++ python-single-r1.eclass	12 May 2013 15:54:09 -0000
@@ -133,6 +133,27 @@
 # python_targets_python2_7(-)?,python_single_target_python2_7(+)?
 # @CODE
 
+# @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
+# @DESCRIPTION:
+# This is an eclass-generated required-use expression which ensures the following:
+# 1. Exactly one PYTHON_SINGLE_TARGET value has been enabled.
+# 2. The selected PYTHON_SINGLE_TARGET value is enabled in PYTHON_TARGETS.
+#
+# 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_single_target_python2_6? ( python_targets_python2_6 )
+# python_single_target_python2_7? ( python_targets_python2_7 )
+# ^^ ( python_single_target_python2_6 python_single_target_python2_7 )
+# @CODE
+
 _python_single_set_globals() {
 	local impls=()
 
@@ -144,7 +165,7 @@
 		# The chosen targets need to be in PYTHON_TARGETS as well.
 		# This is in order to enforce correct dependencies on packages
 		# supporting multiple implementations.
-		#REQUIRED_USE+=" python_single_target_${i}? ( python_targets_${i} )"
+		PYTHON_REQUIRED_USE+=" python_single_target_${i}? ( python_targets_${i} )"
 
 		python_export "${i}" PYTHON_PKG_DEP
 		PYTHON_DEPS+="python_single_target_${i}? ( ${PYTHON_PKG_DEP} ) "
@@ -163,7 +184,7 @@
 	optflags+=,${flags[@]/%/(+)?}
 
 	IUSE="${flags_mt[*]} ${flags[*]}"
-	#REQUIRED_USE="|| ( ${flags_mt[*]} ) ^^ ( ${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