[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] virtualx eclass
From:       Doug Goldstein <cardoe () gentoo ! org>
Date:       2008-10-28 17:32:18
Message-ID: 49074CA2.8030807 () gentoo ! org
[Download RAW message or body]

Petteri Räty wrote:
> Doug Goldstein wrote:
>   
>> Doug Goldstein wrote:
>>     
>>> Doug Goldstein wrote:
>>>   
>>>       
>>>> While the rule of thumb has been if an eclass needs something it should
>>>> provide it's own depends. However the virtualx eclass needs to be
>>>> different simply because in some cases it's only uses for tests (this is
>>>> it's most common usage in the whole) tree. When it's used for tests
>>>> pulling in the xorg-server the most ideal situation would be if
>>>> xorg-server was only pulled in on USE=test because currently for anyone
>>>> emerging an app that uses GTK+ they have a weird situation in the fact
>>>> that all of GTK+'s depends that have USE=X use it to mean libX11 (as do
>>>> most usages of the X USE flag), however GTK+ itself due to it's usage of
>>>> the virtualx eclass pulls in xorg-server when USE=X, which is only used
>>>> for tests. This results in a confusing experience for users looking to
>>>> built a headless machine.
>>>>
>>>> It'd be a lot more consistent if ebuilds provided a USE flag or directly
>>>> depended on the xorg-server and then used the functions in the eclass.
>>>> So in summary, those are the changes I plan on making very shortly. If
>>>> someone's got some input, please speak up.
>>>>
>>>>   
>>>>     
>>>>         
>>> Alright... after talking to Diego, Dave, and Remi the final result that
>>> I've come up with is the following:
>>>
>>> VIRTUALX_CONDITIONAL_USE="test"
>>>
>>> inherit virtualx
>>>
>>> That'll result in virtualx adding the following:
>>>
>>> DEPEND="test? ( x11-base/xorg-server x11-apps/xhost )"
>>>
>>> if VIRTUALX_CONDITIONAL_USE is unset (as it will be for all ebuilds
>>> initially) the default will be "X". Which means the default is the same
>>> as what we've got today. If it's set to an empty string, it'll always be
>>> required. Otherwise, it will use the supplied USE flag.
>>>
>>>   
>>>       
>> Turns out this situation breaks down when multiple USE flags are
>> required/used. One suggestion is to allow for that via:
>>
>> VIRTUALX_CONDITIONAL_USE="test X"
>>
>> but needs someone to write some elegant shell to make that expansion
>> happen. Also, it'll happen in the global scope when the data is cached
>> so a little ugh on that part.
>>
>>     
>
> Huh?
>
> VIRTUALX_DEPS="<insert eclass needed atoms here>"
> for flag in ${VIRTUALX_CONDITIONAL_USE}; do
> 	DEPEND="${DEPEND} ${flag}? ( ${VIRTUALX_DEPS )"
> done
>
> Am I missing something here?
> The ebuild itself can then check if both need to be enabled etc.
>
> Regards,
> Petteri
>
>   
All that's going to do is create the following..

DEPEND="X? ( ${VIRTUALX_DEPS} ) test? ( ${VIRTUALX_DEPS} )"

Which would make it depend on the dependencies when either USE="test" or
USE="X", which is not what we want. We want it when BOTH are set.

Right now there's no viable solution short of my original proposal which
involves having each ebuild stick ${VIRTUALX_DEPS} where it needs them.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic