1 |
On Tue, 2002-05-14 at 17:23, Erik Grinaker wrote: |
2 |
> The ebuild is for the Unix Amiga Emulator, or uae for short. uae allows |
3 |
> you to select which backend to compile against during ./configure, and |
4 |
> you can choose *either* x, svgalib, ncurses or sdl. |
5 |
|
6 |
When creating the xemacs-gamma ebuild I encountered the same dillema. |
7 |
When you say "*either*", I assume you mean that X, svga, ncurse and sdl |
8 |
are optional, but mutually exclusive. |
9 |
|
10 |
> If a user has, say, both X and svga in his USE variable, how do I |
11 |
> determine whether to use X or svgalib for backend? |
12 |
|
13 |
XEmacs gamma supports gtk OR motif OR lucid interfaces (each of which |
14 |
can be considered a use flag) in mutual exclusion. Of course, I don't |
15 |
want to dictate one of those three to the user, since my preference may |
16 |
not be theirs. |
17 |
|
18 |
I thought of a priority scheme, but couldn't see clearly how that would |
19 |
be done. How did you do it, BTW? |
20 |
|
21 |
What I ended up doing was checking for an env. var. named USE_PREF which |
22 |
is localized to xemacs-gamma. It allows the user to merge xemacs-gamma |
23 |
like this: |
24 |
|
25 |
USE_PREF=gtk app-editors/xemacs-gamma |
26 |
|
27 |
Inside the ebuild, I have a case statement which set the ./configure |
28 |
flags based on the value of USE_PREF. If no USE_PREF is given, then it |
29 |
defaults to a reasonable choice ("lucid" in xemacs-gamma's case). |
30 |
|
31 |
*** Note: USE_PREF is undocumented of course, unused by any other |
32 |
package AFAIK, and not an official Gentoo thing. *** |
33 |
|
34 |
Personally, I think my USE_PREF implementation sucks still because it |
35 |
really messes up RDEPEND/DEPEND. ie. RDEPEND/DEPEND become a function of |
36 |
USE_PREF. |
37 |
|
38 |
Perhaps I should have created the following? |
39 |
|
40 |
app-editors/xemacs-gamma-gtk |
41 |
app-editors/xemacs-gamma-lucid |
42 |
app-editors/xemacs-gamma-motif |
43 |
|
44 |
Ugh. What if you have two sets of mutually exclusive USE flags -- just |
45 |
multiply out the number of ebuilds you create. |
46 |
|
47 |
Perhaps I could have one app-editors/xemacs-gamma and build xemacs |
48 |
several times (one build for every use flag in gtk, motif, lucid), |
49 |
renaming the final binaries to /usr/bin/xemacs-21.4.8-{gtk,motif,lucid}. |
50 |
Even provide an xemacs-update script in the spirit of |
51 |
opengl-update/java-config just to complete my madness :) |
52 |
|
53 |
(ie. It's not possible to build a gtk, motif AND lucid based xemacs in a |
54 |
single ./configure) |
55 |
|
56 |
> According to what I believe is common sense I would prioritize them as |
57 |
> X, sdl, svga, ncurses - but is there a better way to do this, or do I |
58 |
|
59 |
Are you using the order in which X, sdl and svga appear in USE? What if |
60 |
I have X and svga in USE, but I want an svga amiga emulator? That's kind |
61 |
dillema I'm talking about. |
62 |
|
63 |
Matt |