1 |
Hi, |
2 |
|
3 |
A number of package using cmake and qmake currently do something like this: |
4 |
|
5 |
LANGS="en de fr" |
6 |
for x in ${LANGS}; do |
7 |
IUSE="${IUSE} linguas_${x}" |
8 |
done |
9 |
|
10 |
This is ugly, so for some time the loop has been included in qt4-r2, and |
11 |
I'd also like to add it to cmake-utils. |
12 |
|
13 |
As far as I can see, this change will have no visible effect on ebuilds |
14 |
that already manually include the loop, and will cause only one package |
15 |
to get linguas_* flags that it doesn't already have (which I'll fix). |
16 |
|
17 |
Thoughts? |
18 |
|
19 |
--- cmake-utils.eclass |
20 |
+++ cmake-utils.eclass |
21 |
@@ -20,0 +21,29 @@ |
22 |
+# @ECLASS-VARIABLE: LANGS |
23 |
+# @DEFAULT_UNSET |
24 |
+# @DESCRIPTION: |
25 |
+# In case your application provides various translations, use this |
26 |
variable to specify |
27 |
+# them in order to populate "linguas_*" IUSE automatically. Make sure |
28 |
that you set this |
29 |
+# variable before inheriting cmake-utils eclass. |
30 |
+# Example: |
31 |
+# @CODE |
32 |
+# LANGS="en el de" |
33 |
+# @CODE |
34 |
+for x in ${LANGS}; do |
35 |
+ IUSE+=" linguas_${x}" |
36 |
+done |
37 |
+ |
38 |
+# @ECLASS-VARIABLE: LANGSLONG |
39 |
+# @DEFAULT_UNSET |
40 |
+# @DESCRIPTION: |
41 |
+# Same as above, but this variable is for LINGUAS that must be in long |
42 |
format. |
43 |
+# Remember to set this variable before inheriting cmake-utils eclass. |
44 |
+# Look at ${PORTDIR}/profiles/desc/linguas.desc for details. |
45 |
+# Example: |
46 |
+# @CODE |
47 |
+# LANGS="de_DE hu_HU" |
48 |
+# @CODE |
49 |
+for x in ${LANGSLONG}; do |
50 |
+ IUSE+=" linguas_${x%_*}" |
51 |
+done |
52 |
+unset x |
53 |
+ |
54 |
|
55 |
Best regards, |
56 |
Michael |