1 |
2009/5/15 Nikos Chantziaras <realnc@×××××.de>: |
2 |
> (It would be nice to reply on-list so the list's archives will be helpful to |
3 |
> others searching through it.) |
4 |
|
5 |
Aaargh. I vote for setting the reply-to-ist header for all gentoo lists. |
6 |
|
7 |
> The application uses qmake and it simply installs all languages (*.qm files) |
8 |
> unconditionally during "make install" and loads the appropriate one |
9 |
> according to the LANG env variable at runtime, falling back to English if |
10 |
> one isn't available. At this time, German ("de") is the only one supported |
11 |
> though (the app's built-in being English). |
12 |
|
13 |
Ah okay qmake. I somehow mixed this up with cmake. |
14 |
|
15 |
> The solution I arrived at in my ebuild is: |
16 |
> |
17 |
> IUSE="linguas_de" |
18 |
> |
19 |
> and then in src_install() I don't use the "install" make target which would |
20 |
> install the *.qm files unconditionally, but rather use the other targets |
21 |
> "install" depends upon, omitting "install_i18n": |
22 |
> |
23 |
> # Install everything except documentation and i18n. |
24 |
> emake INSTALL_ROOT="${D}" install_target install_charmaps \ |
25 |
> || die "make install failed" |
26 |
> # Install i18n files. |
27 |
> if use linguas_de; then |
28 |
> insinto "${GAMES_DATADIR}/${PN}/i18n" |
29 |
> doins "${PN}_de.qm" || die "doins ${PN}_de.qm failed" |
30 |
> fi |
31 |
|
32 |
This should work but more convenient would be if there is some |
33 |
configuration switch you can use to define the installed languages. |
34 |
|
35 |
> It works. I assume putting linguas_de directly in IUSE is correct? |
36 |
> |
37 |
|
38 |
I use this for appending LINGUAS to IUSE but only because I have seen |
39 |
this many times in other ebuilds |
40 |
|
41 |
IUSE="dbus debug kde monolithic +oxygen phonon postgres +server +ssl webkit +X" |
42 |
|
43 |
LANGS="cs da de fr hu it nb_NO ru sl tr" |
44 |
for l in ${LANGS}; do |
45 |
IUSE="${IUSE} linguas_${l}" |
46 |
done |
47 |
|
48 |
Putting it directly in IUSE will also work. |
49 |
|
50 |
-- |
51 |
Daniel Pielmeier |