mail[Wesnoth-commits] r25351 - /trunk/SConstruct


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on March 30, 2008 - 23:42:
Author: esr
Date: Sun Mar 30 23:42:16 2008
New Revision: 25351

URL: http://svn.gna.org/viewcvs/wesnoth?rev=25351&view=rev
Log:
Guard the catalog combination so install won't blow up igf gmsgfmt is missing.

Modified:
    trunk/SConstruct

Modified: trunk/SConstruct
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/SConstruct?rev=25351&r1=25350&r2=25351&view=diff
==============================================================================
--- trunk/SConstruct (original)
+++ trunk/SConstruct Sun Mar 30 23:42:16 2008
@@ -885,32 +885,12 @@
 env.Command("TAGS", sources, 'etags -l c++ $SOURCES')
 env.Clean(all, 'TAGS')
 
-translation_dirs = os.listdir("po")
-translation_dirs.remove(".svn")
-translation_dirs.remove("wesnoth-manpages")
-translation_dirs.remove("wesnoth-manual")
-translation_dirs = map(lambda dir: os.path.join("po", dir), translation_dirs)
-translation_dirs = filter(os.path.isdir, translation_dirs)
-
-lingua_re = re.compile(r"po/.*/(.*)\.po")
-for dir in translation_dirs:
-    pos = glob(os.path.join(dir, "*.po"))
-    linguas = map(lingua_re.findall, pos)
-    for lingua in linguas:
-        lingua = lingua[0]
-        name = os.path.basename(dir)
-       env.Command(
-            os.path.join("translations", lingua, "LC_MESSAGES", name + 
".mo"),
-           os.path.join("po", name, lingua + ".po"),
-            "gmsgfmt -c --statistics -o $TARGET $SOURCE"
-           )
-
 #
 # Unix installation productions
 #
 # These will not be portable to Windows or Mac. They assume a Unix-like
 # directory structure and FreeDesktop standard locations foicon, app,
-# snd doc files.
+# and doc files.
 #
 
 bindir = os.path.normpath(os.path.join(env['prefix'], "bin"))
@@ -1048,6 +1028,33 @@
 env.Alias("install-campaignd", env.Clone().Install(bindir, campaignd))
 
 #
+# If we have the right tool in place, create targets to invoke gmsgfmt to
+# compile message catalogs to binary format at installation time.
+# Without this step, the i18n support won't work.
+#
+if env.WhereIs("gmsgfmt"):
+    translation_dirs = os.listdir("po")
+    translation_dirs.remove(".svn")
+    translation_dirs.remove("wesnoth-manpages")
+    translation_dirs.remove("wesnoth-manual")
+    translation_dirs = map(lambda dir: os.path.join("po", dir),
+                           translation_dirs)
+    translation_dirs = filter(os.path.isdir, translation_dirs)
+    lingua_re = re.compile(r"po/.*/(.*)\.po")
+    for dir in translation_dirs:
+        pos = glob(os.path.join(dir, "*.po"))
+        linguas = map(lingua_re.findall, pos)
+        for lingua in linguas:
+            lingua = lingua[0]
+            name = os.path.basename(dir)
+            env.Command(
+                os.path.join("translations", lingua, "LC_MESSAGES", 
name+".mo"),
+                os.path.join("po", name, lingua + ".po"),
+                "gmsgfmt -c --statistics -o $TARGET $SOURCE"
+                )
+    else:
+        print "Can't find gmsgfmt, i18n support won't work in this build."
+#
 # Un-installation
 #
 deletions = map(lambda x: Delete(os.path.join(bindir, str(x[0]))), 
clientside + daemons) \




Related Messages


Powered by MHonArc, Updated Mon Mar 31 00:01:47 2008