Gentoo Archives: gentoo-dev

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] virtualx eclass
Date: Wed, 22 Oct 2008 11:06:15
Message-Id: 48FF0920.70101@gentoo.org
In Reply to: Re: [gentoo-dev] virtualx eclass by Doug Goldstein
1 Doug Goldstein wrote:
2 > Doug Goldstein wrote:
3 >> Doug Goldstein wrote:
4 >>
5 >>> While the rule of thumb has been if an eclass needs something it should
6 >>> provide it's own depends. However the virtualx eclass needs to be
7 >>> different simply because in some cases it's only uses for tests (this is
8 >>> it's most common usage in the whole) tree. When it's used for tests
9 >>> pulling in the xorg-server the most ideal situation would be if
10 >>> xorg-server was only pulled in on USE=test because currently for anyone
11 >>> emerging an app that uses GTK+ they have a weird situation in the fact
12 >>> that all of GTK+'s depends that have USE=X use it to mean libX11 (as do
13 >>> most usages of the X USE flag), however GTK+ itself due to it's usage of
14 >>> the virtualx eclass pulls in xorg-server when USE=X, which is only used
15 >>> for tests. This results in a confusing experience for users looking to
16 >>> built a headless machine.
17 >>>
18 >>> It'd be a lot more consistent if ebuilds provided a USE flag or directly
19 >>> depended on the xorg-server and then used the functions in the eclass.
20 >>> So in summary, those are the changes I plan on making very shortly. If
21 >>> someone's got some input, please speak up.
22 >>>
23 >>>
24 >>>
25 >> Alright... after talking to Diego, Dave, and Remi the final result that
26 >> I've come up with is the following:
27 >>
28 >> VIRTUALX_CONDITIONAL_USE="test"
29 >>
30 >> inherit virtualx
31 >>
32 >> That'll result in virtualx adding the following:
33 >>
34 >> DEPEND="test? ( x11-base/xorg-server x11-apps/xhost )"
35 >>
36 >> if VIRTUALX_CONDITIONAL_USE is unset (as it will be for all ebuilds
37 >> initially) the default will be "X". Which means the default is the same
38 >> as what we've got today. If it's set to an empty string, it'll always be
39 >> required. Otherwise, it will use the supplied USE flag.
40 >>
41 >>
42 > Turns out this situation breaks down when multiple USE flags are
43 > required/used. One suggestion is to allow for that via:
44 >
45 > VIRTUALX_CONDITIONAL_USE="test X"
46 >
47 > but needs someone to write some elegant shell to make that expansion
48 > happen. Also, it'll happen in the global scope when the data is cached
49 > so a little ugh on that part.
50 >
51
52 Huh?
53
54 VIRTUALX_DEPS="<insert eclass needed atoms here>"
55 for flag in ${VIRTUALX_CONDITIONAL_USE}; do
56 DEPEND="${DEPEND} ${flag}? ( ${VIRTUALX_DEPS )"
57 done
58
59 Am I missing something here?
60 The ebuild itself can then check if both need to be enabled etc.
61
62 Regards,
63 Petteri

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] virtualx eclass Doug Goldstein <cardoe@g.o>