1 |
> IUSE="nhc" |
2 |
> DEPEND="virtual/haskell-compiler" |
3 |
> |
4 |
> src_compile() { |
5 |
> if [ `use nhc` ]; then |
6 |
> # compile with nhc |
7 |
> else |
8 |
> # compile with ghc |
9 |
> fi |
10 |
> } |
11 |
> |
12 |
> The nhc USE variable would work similarly to the gtk2 USE variable (use gtk2 |
13 |
> in preference to gtk where possible). |
14 |
|
15 |
There are a few tools that might only work with nhc, but if something |
16 |
can be compiled with both ghc and nhc, then usually ghc is the preferred |
17 |
compiler, so an nhc USE flag seems the right way to go. |
18 |
|
19 |
However, the use of a virtual seems to be counterproductive here. A better |
20 |
way would be to just make the dependencies depend on the USE flag if there |
21 |
is a choice. Something like |
22 |
|
23 |
IUSE="nhc" |
24 |
DEPEND="nhc? (dev-lang/nhc98 : dev-lang/ghc)" |
25 |
|
26 |
But I think the syntax above or something equivalent is not really |
27 |
allowed. Or does |
28 |
|
29 |
IUSE="nhc" |
30 |
|
31 |
if [ `use nhc`]; then |
32 |
DEPEND="dev-lang/nhc98" |
33 |
else |
34 |
DEPEND="dev-lang/ghc" |
35 |
fi |
36 |
|
37 |
work? |
38 |
|
39 |
Anyway, in the example given above, if dev-lang/ghc provides |
40 |
virtual/haskell-compiler, but USE="nhc" is set on a system where only |
41 |
dev-lang/ghc is installed, then installation will fail. |
42 |
|
43 |
Best, |
44 |
Andres |
45 |
|
46 |
-- |
47 |
|
48 |
Andres Loeh, Universiteit Utrecht |
49 |
|
50 |
mailto:andres@×××××.nl mailto:mail@×××××××××××.de |
51 |
http://www.andres-loeh.de |
52 |
|
53 |
-- |
54 |
gentoo-dev@g.o mailing list |