public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-python <gentoo-python@lists.gentoo.org>
Subject: Re: [gentoo-python] [PATCH] Introduce PYTHON_REQUIRED_USE variable, utilize it in distutils-r1 by default
Date: Sun, 12 May 2013 11:55:51 -0400	[thread overview]
Message-ID: <CAJ0EP41JHKzZp-8EvqU3dhb89tnMBpEjfVmZWrMO-X3BuDeJ1w@mail.gmail.com> (raw)
In-Reply-To: <20130512081342.0d8c22ca@gentoo.org>

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

      reply	other threads:[~2013-05-12 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ0EP41JHKzZp-8EvqU3dhb89tnMBpEjfVmZWrMO-X3BuDeJ1w@mail.gmail.com \
    --to=floppym@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox