public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: hasufell@gentoo.org
Subject: Re: [gentoo-dev] python-distutils-ng.eclass: allow useflag dependencies for python
Date: Thu, 6 Sep 2012 22:58:15 +0200	[thread overview]
Message-ID: <20120906225815.0bd3dab4@pomiocik.lan> (raw)
In-Reply-To: <50490B32.5010507@gentoo.org>

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

On Thu, 06 Sep 2012 22:44:34 +0200
hasufell <hasufell@gentoo.org> wrote:

> --- python-distutils-ng.eclass
> +++ python-distutils-ng.eclass
> @@ -59,6 +59,25 @@
>  # Set to any value to disable automatic reinstallation of scripts in
> bin # directories. See python-distutils-ng_src_install function.
>  
> +# @ECLASS-VARIABLE: PYTHON_USE
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# comma seperated list of useflags needed for python
> +# this is directly substituted into dev-lang/python[${PYTHON_USE}]
> thus allowing +# all valid useflag dependencies
> +# example 1: PYTHON_USE="xml,sqlite"
> +# example 2: PYTHON_USE="xml?,threads?,-foo"
> +
> +# @ECLASS-VARIABLE: JYTHON_USE
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# same as PYTHON_USE just for JYTHON
> +
> +# @ECLASS-VARIABLE: PYPY_USE
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# same as PYTHON_USE just for PYPY
> +

Why I feel like we're close to PYTHON2_USE, PYTHON3_USE,
PYTHON3NG_USE...

>  EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test
> src_install 
>  case "${EAPI}" in
> @@ -107,16 +126,22 @@
>  fi
>  unset required_use_str
>  
> +# avoid empty use deps
> +[[ -n ${PYTHON_USE} ]] && _PYTHON_USE="[${PYTHON_USE}]" ||
> _PYTHON_USE="" +[[ -n ${JYTHON_USE} ]] &&
> _JYTHON_USE="[${JYTHON_USE}]" || _JYTHON_USE="" +[[ -n ${PYPY_USE} ]]
> && _PYPY_USE="[${PYPY_USE}]" || _PYPY_USE="" +
> +# set python DEPEND and RDEPEND
>  for impl in ${PYTHON_COMPAT}; do
>  	IUSE+=" python_targets_${impl}"
>  	dep_str="${impl/_/.}"
>  	case "${dep_str}" in
>  		python?.?)
> -			dep_str="dev-lang/python:${dep_str: -3}" ;;
> +			dep_str="dev-lang/python:${dep_str:
> -3}${_PYTHON_USE}" ;; jython?.?)
> -			dep_str="dev-java/jython:${dep_str: -3}" ;;
> +			dep_str="dev-java/jython:${dep_str:
> -3}${_JYTHON_USE}" ;; pypy?.?)
> -			dep_str="dev-python/pypy:${dep_str: -3}" ;;
> +			dep_str="dev-python/pypy:${dep_str:
> -3}${_PYPY_USE}" ;; *)
>  			die "Unsupported implementation: ${impl}" ;;
>  	esac

I have to think more about this.

Where are your use cases?

-- 
Best regards,
Michał Górny

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

  reply	other threads:[~2012-09-06 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 20:44 [gentoo-dev] python-distutils-ng.eclass: allow useflag dependencies for python hasufell
2012-09-06 20:58 ` Michał Górny [this message]
2012-09-08 13:04   ` hasufell
2012-09-08 18:36     ` Michał Górny
2012-09-06 21:27 ` Brian Harring
2012-09-06 23:08   ` [gentoo-dev] " Jonathan Callen

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=20120906225815.0bd3dab4@pomiocik.lan \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=hasufell@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