Gentoo Archives: gentoo-dev

From: Ben de Groot <yngwin@g.o>
To: gentoo-dev@l.g.o
Cc: kensington@g.o
Subject: Re: [gentoo-dev] Patch: Linguas USE support for cmake-utils.eclass
Date: Sun, 24 Jun 2012 08:36:05
Message-Id: CAB9SyzTtEc2MPzyV9gru-0niLsqe6NBonfVt3gxcmHqhV6ZoOw@mail.gmail.com
In Reply to: Re: [gentoo-dev] Patch: Linguas USE support for cmake-utils.eclass by "Michał Górny"
1 On 24 June 2012 01:57, Michał Górny <mgorny@g.o> wrote:
2 > On Sun, 24 Jun 2012 03:37:59 +1000
3 > Michael Palimaka <kensington@g.o> wrote:
4 >
5 >> --- cmake-utils.eclass
6 >> +++ cmake-utils.eclass
7 >> @@ -20,0 +21,29 @@
8 >> +# @ECLASS-VARIABLE: LANGS
9 >
10 > Please prefix.
11 >
12 >> +# @DEFAULT_UNSET
13 >> +# @DESCRIPTION:
14 >> +# In case your application provides various translations, use this
15 >> variable to specify
16 >> +# them in order to populate "linguas_*" IUSE automatically. Make
17 >> sure that you set this
18 >> +# variable before inheriting cmake-utils eclass.
19 >> +# Example:
20 >> +# @CODE
21 >> +#   LANGS="en el de"
22 >> +# @CODE
23 >> +for x in ${LANGS}; do
24 >> +       IUSE+=" linguas_${x}"
25 >> +done
26 >> +
27 >> +# @ECLASS-VARIABLE: LANGSLONG
28 >> +# @DEFAULT_UNSET
29 >> +# @DESCRIPTION:
30 >> +# Same as above, but this variable is for LINGUAS that must be in
31 >> long format.
32 >> +# Remember to set this variable before inheriting cmake-utils eclass.
33 >> +# Look at ${PORTDIR}/profiles/desc/linguas.desc for details.
34 >> +# Example:
35 >> +# @CODE
36 >> +#   LANGS="de_DE hu_HU"
37 >> +# @CODE
38 >
39 > Shouldn't this be LANGSLONG?
40 >
41 >> +for x in ${LANGSLONG}; do
42 >> +       IUSE+=" linguas_${x%_*}"
43 >> +done
44 >> +unset x
45 >> +
46 >
47 > And how does it exactly differ from LANGS above? Is there a reason
48 > those two can't be coerced into a single variable?
49
50 Some linguas correspond 1:1 between the package and portage's
51 linguas.desc, while others need the long form (e.g. el_GR) for the
52 package, but the short form (el) is used in portage.
53
54 > Shouldn't those do something more than setting IUSE? For example,
55 > actually ensuring those LINGUAS will be installed?
56
57 That would be a nice improvement.
58
59 We at qt@ have been discussing this on and off. We would like to
60 see a linguas.eclass happen, because already now we start having
61 code duplication. So instead of this duplication of code between
62 qt4-r2 and cmake-utils eclasses, why not put this into a separate
63 linguas.eclass that both can inherit?
64
65 Obviously the problem with handling more than just setting IUSE
66 is the variety of ways in which linguas are handled by different
67 packages and different build systems.
68
69 I'll be submitting some additions to qt4-r2.eclass for comments
70 later.
71
72 I hope we can continue this discussion. Ideas are very welcome!
73
74 --
75 Cheers,
76
77 Ben | yngwin
78 Gentoo developer
79 Gentoo Qt project lead

Replies