1 |
On Thu, Jan 26, 2006 at 06:10:08PM +0100, Michael Haubenwallner wrote: |
2 |
> Hi, |
3 |
> |
4 |
> when talking to a colleague of mine (he's using Gentoo-Linux, and wants |
5 |
> to use prefixed portage), an idea for the prefix-api came up: |
6 |
> |
7 |
> Currently, there's the PREFIX variable (among others) for the ebuilds. |
8 |
> |
9 |
> The idea is to substitute this with a bash-function, echoing a prefix. |
10 |
> |
11 |
> This function could be defined to get one argument, which is much like |
12 |
> the same syntax as the *DEPEND settings, but only for a single package. |
13 |
> If no argument, the current package is used. |
14 |
> |
15 |
> Yes, the current implementation would be simple: |
16 |
> prefix() { |
17 |
> echo $PREFIX |
18 |
> } |
19 |
> |
20 |
> But the idea behind that is: |
21 |
> |
22 |
> Once portage could handle interdomain dependencies, the prefix-api need |
23 |
> not to be changed to let ebuilds find the prefix of their dependencies. |
24 |
> |
25 |
> A sample ebuild-snippet: |
26 |
> |
27 |
> DEPEND="<my-dependency-2" |
28 |
> |
29 |
> econf-or-src_build() { |
30 |
> .../configure \ |
31 |
> --prefix=$(prefix) \ |
32 |
> --with-my-dependency=$(prefix "<my-dependency-2") |
33 |
> } |
34 |
|
35 |
Dunno about that construct; aside from violating metadata constant |
36 |
rules (realize it's just an example), the prefix optional arg syntax |
37 |
seems like an easy way to get bit in the ass if a variable you thought |
38 |
was set/had a value, turned out to be [ -z ] |
39 |
|
40 |
Imo, PREFIX should be "this is where this ebuild is installing", |
41 |
grabbing prefix/root location for deps should be a seperate function; |
42 |
avoids the issue of different behaviour if an optional arg is |
43 |
available (and the potential for people to screw it up). |
44 |
|
45 |
|
46 |
> Another possible feature in the future (not finished thinking about yet) |
47 |
> could be to have portage install each (non-system-)package into a |
48 |
> separate prefix within its domain, without need to change prefix-api. |
49 |
> This could help ebuild-devs to detect unknown dependencies, which are |
50 |
> not found implicitly if not specified at configure-line. |
51 |
> Well - only for a testing system, and to be enabled explicitly |
52 |
> by setting FEATURES. |
53 |
> |
54 |
> What do you think about this ? |
55 |
|
56 |
Gnu stow attempted this- would probably be worthwhile poking them for |
57 |
info on prefix issues. |
58 |
|
59 |
Granted, they're doing symlinks to maintain the appearance of a normal |
60 |
install, but still, probably could raid a few tricks from them |
61 |
depending on if they ever managed to build up an actual repository of |
62 |
packages. |
63 |
|
64 |
~brian |