Remove non-JACK midi++ ports.
[ardour.git] / autowaf.py
index 21ec430d37dd263cd7d7fb94e0a5b8b11dceb6d9..93f0910eb284322ac3bfaa6dd1619a8ecbe09b3b 100644 (file)
@@ -10,6 +10,7 @@ import Configure
 import Options
 import Utils
 import sys
+import glob
 from TaskGen import feature, before, after
 
 global g_is_child
@@ -130,6 +131,7 @@ def configure(conf):
        conf.env['DEBUG'] = Options.options.debug
        conf.env['STRICT'] = Options.options.strict
        conf.env['PREFIX'] = os.path.abspath(os.path.expanduser(os.path.normpath(conf.env['PREFIX'])))
+
        if Options.options.bundle:
                conf.env['BUNDLE'] = True
                conf.define('BUNDLE', 1)
@@ -365,6 +367,43 @@ def build_version_files(header_path, source_path, domain, major, minor, micro):
                
        return None
 
+# Internationalisation (gettext)
+def build_i18n(bld,dir,name,sources):
+       pwd = bld.get_curdir()
+       os.chdir(pwd)
+
+       pot_file = '%s.pot' % name
+
+       args = [ 'xgettext',
+                '--keyword=_',
+                '--keyword=N_',
+                '--from-code=UTF-8',
+                '-o', pot_file,
+                '--copyright-holder="Paul Davis"' ]
+       args += sources
+       Utils.pprint('GREEN', 'Updating ' + pot_file, sep='')
+       os.spawnvp (os.P_WAIT, 'xgettext', args)
+       
+       po_files = glob.glob ('po/*.po')
+       
+       for po_file in po_files:
+               args = [ 'msgmerge',
+                        '--update',
+                        po_file,
+                        pot_file ]
+               Utils.pprint('GREEN', 'Updating ' + po_file, sep='')
+               os.spawnvp (os.P_WAIT, 'msgmerge', args)
+               
+       for po_file in po_files:
+               mo_file = po_file.replace ('.po', '.mo')
+               args = [ 'msgfmt',
+                        '-c',
+                        '-o',
+                        mo_file,
+                        po_file ]
+               Utils.pprint('GREEN', 'Generating ' + po_file)
+               os.spawnvp (os.P_WAIT, 'msgfmt', args)
+
 def shutdown():
        # This isn't really correct (for packaging), but people asking is annoying
        if Options.commands['install']: