Gentoo Archives: gentoo-dev

From: Michael Palimaka <kensington@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Patch: Linguas USE support for cmake-utils.eclass
Date: Sat, 23 Jun 2012 17:40:06

A number of package using cmake and qmake currently do something like this:

LANGS="en de fr"
for x in ${LANGS}; do
         IUSE="${IUSE} linguas_${x}"

This is ugly, so for some time the loop has been included in qt4-r2, and 
I'd also like to add it to cmake-utils.

As far as I can see, this change will have no visible effect on ebuilds 
that already manually include the loop, and will cause only one package 
to get linguas_* flags that it doesn't already have (which I'll fix).


--- cmake-utils.eclass
+++ cmake-utils.eclass
@@ -20,0 +21,29 @@
+# In case your application provides various translations, use this 
variable to specify
+# them in order to populate "linguas_*" IUSE automatically. Make sure 
that you set this
+# variable before inheriting cmake-utils eclass.
+# Example:
+# @CODE
+#   LANGS="en el de"
+# @CODE
+for x in ${LANGS}; do
+       IUSE+=" linguas_${x}"
+# Same as above, but this variable is for LINGUAS that must be in long 
+# Remember to set this variable before inheriting cmake-utils eclass.
+# Look at ${PORTDIR}/profiles/desc/linguas.desc for details.
+# Example:
+# @CODE
+#   LANGS="de_DE hu_HU"
+# @CODE
+for x in ${LANGSLONG}; do
+       IUSE+=" linguas_${x%_*}"
+unset x

Best regards,