Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined
Date: Sat, 26 Jul 2014 08:58:46
Message-Id: pan$786bc$85d0c6bf$9863f56b$ccadbafe@cox.net
In Reply to: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined by Duncan <1i5t5.duncan@cox.net>
1 Duncan posted on Sat, 26 Jul 2014 08:05:32 +0000 as excerpted:
2
3 > Ian Stakenvicius posted on Fri, 25 Jul 2014 14:49:44 -0400 as excerpted:
4 >
5 >> Hey all.. So, putting aside for now how much of a mess this would be
6 >> to implement in the virtuals' ebuilds themselves, what do people think
7 >> of changing the virtuals so that they contain an entry in IUSE for each
8 >> provider that can satisfy it?
9 >>
10 >> The idea here is that the package satisfying a virtual could be
11 >> optionally explicitly-chosen through package.use (or USE= in make.conf,
12 >> perhaps) instead of having an entry in @world, that way if nothing
13 >> depends on the virtual then it and the provider can be - --depclean'ed
14 >> from the system. The idea is specifically NOT to have rdeps depend on
15 >> these flags, that would undermine the whole purpose of the virtual; it
16 >> would just be for end-users to set if they so chose.
17 >
18 > What about handling each such virtual_USE as a USE_EXPAND?
19
20 > [Example] VIRTUAL_KRB5
21
22 Hmm, thinking toward implementation, what about a virtual.eclass,
23 inherited by virtuals?
24
25 It could even have a declarative interface, such that from
26 virtual/krb5-0.ebuild (I've left out the minversion and multilib-usedep
27 stuff here as the example above did as well, but it could be passed
28 too)...
29
30 inherit virtual
31 VIRTUAL_EXCLUSIVE="app-crypt/mit-krb5 app-crypt/heimdal"
32
33 ... would setup most of the basics for an exclusive virtual, including
34 the VIRTUAL_KRB5 USE_EXPAND name (based on $PN), the two providers and
35 rdepends, the fact that they're exclusive and thus a default pkg_pretend
36 or required_use, etc.
37
38 In for instance virtual/editors, this could be used in place of its
39 current RDEPEND:
40
41 VIRTUAL_MULTI="
42 app-editors/nano
43 app-editors/dav
44 app-editors/e3
45 ...
46 mail-client/alpine[-onlyalpine]
47 sys-apps/ed
48 "
49
50 With an eclass, the default pkg_pretend for exclusive-virtuals would be
51 standardized, standardizing the error message and explanation for it as
52 well, giving it a chance to be a bit more informative than unstandardized
53 one-offs might tend to be.
54
55 Of course the same eclass idea could be used with simple USE flags as
56 well, but I prefer the USE_EXPANDs.
57
58 --
59 Duncan - List replies preferred. No HTML msgs.
60 "Every nonfree program has a lord, a master --
61 and if you use the program, he is your master." Richard Stallman