1c1f06ce206faa92c85e86f49c93873636b02f04
[ardour.git] / gtk2_ardour / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options, TaskGen
4 import waflib.Logs as Logs, waflib.Utils as Utils
5 import os
6 import sys
7 import re
8 import time
9 from waflib.Task import Task
10
11 # Version of this package (even if built as a child)
12 MAJOR = '3'
13 MINOR = '0'
14 MICRO = '0'
15 GTK2_ARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
16
17 # Variables for 'waf dist'
18 APPNAME = 'gtk2_ardour'
19 VERSION = GTK2_ARDOUR_VERSION
20
21 # Mandatory variables
22 top = '.'
23 out = 'build'
24
25 path_prefix = 'gtk2_ardour/'
26
27 gtk2_ardour_sources = [
28         'about.cc',
29         'actions.cc',
30         'add_midi_cc_track_dialog.cc',
31         'add_route_dialog.cc',
32         'ambiguous_file_dialog.cc',
33         'analysis_window.cc',
34         'ardour_button.cc',
35         'ardour_dialog.cc',
36         'ardour_ui.cc',
37         'ardour_ui2.cc',
38         'ardour_ui_dependents.cc',
39         'ardour_ui_dialogs.cc',
40         'ardour_ui_ed.cc',
41         'ardour_ui_mixer.cc',
42         'ardour_ui_options.cc',
43         'audio_clock.cc',
44         'audio_region_editor.cc',
45         'audio_region_view.cc',
46         'audio_streamview.cc',
47         'audio_time_axis.cc',
48         'automation_controller.cc',
49         'automation_line.cc',
50         'automation_region_view.cc',
51         'automation_streamview.cc',
52         'automation_time_axis.cc',
53         'axis_view.cc',
54         'bundle_manager.cc',
55         'cairo_widget.cc',
56         'canvas-flag.cc',
57         'canvas-hit.cc',
58         'canvas-note-event.cc',
59         'canvas-note.cc',
60         'canvas_patch_change.cc',
61         'canvas-simpleline.c',
62         'canvas-simplerect.c',
63         'canvas-sysex.cc',
64         'canvas-waveview.c',
65         'clock_group.cc',
66         'configinfo.cc',
67         'control_point.cc',
68         'control_point_dialog.cc',
69         'crossfade_edit.cc',
70         'crossfade_view.cc',
71         'curvetest.cc',
72         'debug.cc',
73         'diamond.cc',
74         'edit_note_dialog.cc',
75         'editing.cc',
76         'editor.cc',
77         'editor_actions.cc',
78         'editor_audio_import.cc',
79         'editor_audiotrack.cc',
80         'editor_canvas.cc',
81         'editor_canvas_events.cc',
82         'editor_component.cc',
83         'editor_cursors.cc',
84         'editor_drag.cc',
85         'editor_route_groups.cc',
86         'editor_export_audio.cc',
87         'editor_group_tabs.cc',
88         'editor_keys.cc',
89         'editor_locations.cc',
90         'editor_markers.cc',
91         'editor_mixer.cc',
92         'editor_mouse.cc',
93         'editor_nudge.cc',
94         'editor_ops.cc',
95         'editor_regions.cc',
96         'editor_routes.cc',
97         'editor_rulers.cc',
98         'editor_scrub.cc',
99         'editor_selection.cc',
100         'editor_snapshots.cc',
101         'editor_summary.cc',
102         'editor_tempodisplay.cc',
103         'editor_timefx.cc',
104         'engine_dialog.cc',
105         'enums.cc',
106         'export_channel_selector.cc',
107         'export_dialog.cc',
108         'export_file_notebook.cc',
109         'export_filename_selector.cc',
110         'export_format_dialog.cc',
111         'export_format_selector.cc',
112         'export_preset_selector.cc',
113         'export_timespan_selector.cc',
114         'fft.cc',
115         'fft_graph.cc',
116         'fft_result.cc',
117         'gain_meter.cc',
118         'generic_pluginui.cc',
119         'ghostregion.cc',
120         'global_port_matrix.cc',
121         'group_tabs.cc',
122         'gtk-custom-hruler.c',
123         'gtk-custom-ruler.c',
124         'gtk_pianokeyboard.c',
125         'gui_object.cc',
126         'insert_time_dialog.cc',
127         'interthread_progress_window.cc',
128         'io_selector.cc',
129         'keyboard.cc',
130         'keyeditor.cc',
131         'latency_gui.cc',
132         'led.cc',
133         'level_meter.cc',
134         'lineset.cc',
135         'location_ui.cc',
136         'main.cc',
137         'marker.cc',
138         'midi_automation_line.cc',
139         'midi_channel_dialog.cc',
140         'midi_channel_selector.cc',
141         'midi_cut_buffer.cc',
142         'midi_list_editor.cc',
143         'midi_port_dialog.cc',
144         'midi_region_view.cc',
145         'midi_scroomer.cc',
146         'midi_streamview.cc',
147         'midi_time_axis.cc',
148         'midi_tracer.cc',
149         'missing_file_dialog.cc',
150         'missing_plugin_dialog.cc',
151         'mixer_actor.cc',
152         'mixer_group_tabs.cc',
153         'mixer_strip.cc',
154         'mixer_ui.cc',
155         'monitor_section.cc',
156         'mono_panner.cc',
157         'mouse_cursors.cc',
158         'nag.cc',
159         'new_plugin_preset_dialog.cc',
160         'normalize_dialog.cc',
161         'note_player.cc',
162         'option_editor.cc',
163         'opts.cc',
164         'panner2d.cc',
165         'panner_ui.cc',
166         'piano_roll_header.cc',
167         'playlist_selector.cc',
168         'plugin_eq_gui.cc',
169         'plugin_selector.cc',
170         'plugin_ui.cc',
171         'port_group.cc',
172         'port_insert_ui.cc',
173         'port_matrix.cc',
174         'port_matrix_body.cc',
175         'port_matrix_column_labels.cc',
176         'port_matrix_component.cc',
177         'port_matrix_grid.cc',
178         'port_matrix_labels.cc',
179         'port_matrix_row_labels.cc',
180         'processor_box.cc',
181         'patch_change_dialog.cc',
182         'progress_reporter.cc',
183         'prompter.cc',
184         'public_editor.cc',
185         'quantize_dialog.cc',
186         'rc_option_editor.cc',
187         'region_editor.cc',
188         'region_gain_line.cc',
189         'region_layering_order_editor.cc',
190         'region_selection.cc',
191         'region_view.cc',
192         'return_ui.cc',
193         'rhythm_ferret.cc',
194         'route_group_dialog.cc',
195         'route_group_menu.cc',
196         'route_params_ui.cc',
197         'route_processor_selection.cc',
198         'route_time_axis.cc',
199         'route_ui.cc',
200         'search_path_option.cc',
201         'selection.cc',
202         'send_ui.cc',
203         'session_import_dialog.cc',
204         'session_metadata_dialog.cc',
205         'session_option_editor.cc',
206         'sfdb_ui.cc',
207         'shuttle_control.cc',
208         'simpleline.cc',
209         'simplerect.cc',
210         'splash.cc',
211         'speaker_dialog.cc',
212         'startup.cc',
213         'step_editor.cc',
214         'step_entry.cc',
215         'stereo_panner.cc',
216         'streamview.cc',
217         'strip_silence_dialog.cc',
218         'tape_region_view.cc',
219         'tempo_dialog.cc',
220         'tempo_lines.cc',
221         'theme_manager.cc',
222         'time_axis_view.cc',
223         'time_axis_view_item.cc',
224         'time_fx_dialog.cc',
225         'time_info_box.cc',
226         'time_selection.cc',
227         'track_selection.cc',
228         'track_view_list.cc',
229         'transpose_dialog.cc',
230         'ui_config.cc',
231         'utils.cc',
232         'verbose_cursor.cc',
233         'version.cc',
234         'visibility_group.cc',
235         'volume_controller.cc',
236         'waveview.cc',
237         'window_proxy.cc'
238 ]
239
240 def options(opt):
241     autowaf.set_options(opt)
242
243 def configure(conf):
244     conf.load('misc')
245     conf.load('compiler_cxx')
246     autowaf.build_version_files(
247         path_prefix + 'version.h',
248         path_prefix + 'version.cc',
249         'gtk2_ardour', MAJOR, MINOR, MICRO)
250     autowaf.configure(conf)
251
252     if re.search ("linux", sys.platform) != None:
253         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
254
255     # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
256
257     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
258                       atleast_version='1.2.1')
259     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
260                       atleast_version='2.10.1')
261     autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
262                       atleast_version='2.18')
263     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
264                       atleast_version='2.18')
265     autowaf.check_pkg(conf, 'libgnomecanvas-2.0',
266                       uselib_store='GNOMECANVAS', atleast_version='2.30')
267     autowaf.check_pkg(conf, 'libgnomecanvasmm-2.6',
268                       uselib_store='GNOMECANVASMM', atleast_version='2.16')
269     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
270     autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.3', mandatory=False)
271
272     conf.write_config_header('gtk2ardour-config.h', remove=False)
273
274     # Boost headers
275     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
276     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
277
278 # Add a waf `feature' to allow compilation of things using winegcc
279 from waflib.TaskGen import feature
280 @feature("wine")
281 def set_winegcc(self):
282     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
283     self.env.CC = 'winegcc'
284
285 def _doPyp(infileName, deps = False):
286     outStr = ''
287     out = []
288     re_spaces = re.compile("\s+")
289
290     if infileName == '-':
291         fd = sys.stdin
292     else:
293         fd = open(infileName)
294     inLines = fd.readlines()
295     if fd != sys.stdin:
296         fd.close()
297         
298
299     for line in inLines:
300         bits = re_spaces.split(line)
301         if bits[0] == '##include':
302             incName = bits[1]
303             if (deps):
304                 out += [ incName ]
305             else:
306                 # assume included file comes from same place as source file
307                 incName = os.path.join (os.path.dirname (infileName), incName);
308                 outStr += _doPyp(incName)
309         else:
310             if not deps:
311                 outStr += line
312
313     # done
314     if deps:
315         return out
316     else:
317         return outStr
318
319 def include_processor(task):
320     infileName = task.inputs[0].srcpath()
321     outfileName = os.path.join(out, task.outputs[0].bldpath())
322     fdOut = open (outfileName, "w")
323     fdOut.write (_doPyp(infileName))
324     fdOut.close ()
325
326
327 def build_color_scheme(path, prefix):
328     f = open (path, 'r')
329     color_scheme = ''
330     for line in f:
331         if re.search ('^#@color', line):
332             line.strip() # remove newline
333             words = line.split()
334             if len(color_scheme):
335                 color_scheme += ';'
336             color_scheme += prefix
337             color_scheme += '_'
338             color_scheme += words[1]
339             color_scheme += ':'
340             color_scheme += words[2]
341     f.close()
342     return color_scheme
343
344 def build(bld):
345     # GTK front-end; if we're using VST we build this as a shared library,
346     # otherwise it's a normal executabale
347     if bld.is_defined('VST_SUPPORT'):
348         obj = bld(features = 'cxx c cxxshlib')
349     else:
350         obj = bld(features = 'cxx c cxxprogram')
351
352     obj.includes     = ['.']
353     obj.source       = gtk2_ardour_sources
354     obj.name         = 'gtk2_ardour'
355     obj.linkflags    = []
356     if bld.is_defined('VST_SUPPORT'):
357         obj.target = 'gtk2_ardour'
358         obj.includes += ['../libs/fst']
359     else:
360         obj.target = 'ardour-3.0'
361     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
362     obj.uselib       = 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
363     obj.uselib       += ' GTKMM GNOMECANVASMM GNOMECANVAS '
364     obj.uselib       += ' AUDIOUNITS OSX GTKOSX '
365     obj.use          = [ 'libpbd',
366                          'libmidipp',
367                          'libtaglib',
368                          'libardour',
369                          'libardour_cp',
370                          'libgtkmm2ext',
371                          'libtaglib' ]
372     if sys.platform == 'darwin':
373         obj.use += ' libappleutility'
374     obj.defines     = [
375         'PACKAGE="gtk2_ardour3"',
376         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
377         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
378         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
379         'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
380         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']),
381                                      'locale') + '"',
382         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
383         ]
384     obj.includes += ['../libs']
385
386     if bld.is_defined('HAVE_SUIL'):
387         obj.source += [ 'lv2_plugin_ui.cc' ]
388         obj.uselib += ' SUIL '
389
390     if bld.is_defined('FREESOUND'):
391         obj.source +=  [ 'sfdb_freesound_mootcher.cc' ]
392         obj.defines += [ 'FREESOUND' ]
393
394     if bld.is_defined('VST_SUPPORT'):
395         obj.source += [ 'vst_pluginui.cc' ]
396         obj.defines += [ 'VST_SUPPORT' ]
397         obj.uselib += ' X11 '
398
399     if bld.is_defined('LXVST_SUPPORT'):
400         obj.source += [ 'vstfxwin.cc', 'lxvst_pluginui.cc' ]
401         obj.defines += [ 'LXVST_SUPPORT' ]
402         obj.uselib += ' X11 '
403         
404     if bld.is_defined('PHONE_HOME'):
405         obj.defines += [ 'PHONE_HOME' ]
406
407     if bld.is_defined('HAVE_COREAUDIO'):
408         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
409         obj.source += [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
410         obj.use += ' libappleutility '
411
412     if bld.is_defined('VST_SUPPORT'):
413         # If we require VST support we build a stub main() and the FST library
414         # here using winegcc, and link it to the GTK front-end library
415         obj = bld(features = 'cxx c cxxprogram wine')
416         obj.source = '''
417                 ../libs/fst/fst.c
418                 ../libs/fst/fstinfofile.c
419                 ../libs/fst/vsti.c
420                 ../libs/fst/vstwin.c
421                 ../vst/winmain.c
422         '''
423         obj.includes = '../libs/fst'
424         obj.target = 'ardour-3.0-vst'
425         obj.linkflags += ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
426         obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
427         obj.uselib = 'ALSA'
428         obj.use = ['libpbd','libmidipp','libtaglib','libardour',
429                             'libardour_cp','libgtkmm2ext','libtaglib',
430                             'gtk2_ardour']
431
432     # Wrappers
433
434     wrapper_subst_dict = {
435             'INSTALL_PREFIX' : bld.env['PREFIX'],
436             'LIBDIR'         : os.path.normpath(bld.env['LIBDIR']),
437             'LIBS'           : 'build/libs',
438             'VERSION'        : '3.0',
439             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-3.0'
440     }
441
442     def set_subst_dict(obj, dict):
443         for i in dict:
444             setattr(obj, i, dict[i])
445
446     obj              = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
447     obj.source       = 'ardev_common.sh.in'
448     obj.target       = 'ardev_common_waf.sh'
449     obj.chmod        = Utils.O755
450     obj.dict         = wrapper_subst_dict
451     set_subst_dict(obj, wrapper_subst_dict)
452
453     obj              = bld(features = 'subst')
454     obj.source       = 'ardour.sh.in'
455     obj.target       = 'ardour3'
456     obj.chmod        = Utils.O755
457     obj.dict         = wrapper_subst_dict
458     obj.install_path = bld.env['BINDIR']
459     set_subst_dict(obj, wrapper_subst_dict)
460
461     # Font configuration
462
463     dark_rc_subst_dict = {}
464     light_rc_subst_dict = {}
465     font_sizes      = {}
466     base_font       = ""
467
468     # Set up font sizes
469     if bld.is_defined('GTKOSX'): # OS X fonts
470         basefont = "Lucida Grande"
471         font_sizes = {
472                 'TINY' : '7',
473                 'SMALLER' : '9',
474                 'SMALL' : '10',
475                 'NORMAL' : '11',
476                 'BIG' : '12',
477                 'BIGGER' : '14',
478                 'LARGE' : '18',
479                 'LARGER' : '28',
480                 'HUGER' : '36',
481                 'MASSIVE' : '60'
482         }
483     else: # Linux/X11 fonts
484         basefont = '' # unspecified - use system defaults
485         font_sizes = {
486                 'TINY' : '6',
487                 'SMALLER' : '8',
488                 'SMALL' : '9',
489                 'NORMAL' : '10',
490                 'BIG' : '14',
491                 'BIGGER' : '16',
492                 'LARGE' : '18',
493                 'LARGER' : '24',
494                 'HUGER' : '34',
495                 'MASSIVE' : '60'
496         }
497
498     # Set up font substitution dictionary
499     # @FONT_XXXX@
500     for style in ['', 'BOLD', 'ITALIC']:
501         for sizename,points in iter(font_sizes.items()):
502             if (len (style)):
503                 key = "_".join (['FONT',style,sizename])
504                 fontstyle = " ".join ([basefont,style.lower(),points])
505             else:
506                 key = "_".join (['FONT',sizename])
507                 fontstyle = " ".join ([basefont,points])
508
509             dark_rc_subst_dict[key] = fontstyle
510             light_rc_subst_dict[key] = fontstyle
511
512     # @FONT_SIZE_XXXX@
513     for sizename,points in iter(font_sizes.items()):
514             key = "_".join (['FONT_SIZE',sizename])
515             dark_rc_subst_dict[key] = points
516             light_rc_subst_dict[key] = points
517
518     # RC files
519     dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
520         'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
521     dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
522     light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
523         'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
524     light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
525
526     obj              = bld(features = 'subst')
527     obj.source       = [ 'ardour3_ui_dark.rc.in' ]
528     obj.target       = 'ardour3_ui_dark.rc.pre'
529     obj.install_path = None
530     set_subst_dict(obj, dark_rc_subst_dict)
531
532     obj              = bld(features = 'subst')
533     obj.source       = [ 'ardour3_ui_light.rc.in' ]
534     obj.target       = 'ardour3_ui_light.rc.pre'
535     obj.install_path = None
536     set_subst_dict(obj, light_rc_subst_dict)
537
538     obj              = bld(features = 'subst')
539     obj.source       = [ 'ardour3_styles.rc.in' ]
540     obj.target       = 'ardour3_dark_styles.rc'
541     obj.install_path = None
542     set_subst_dict(obj, dark_rc_subst_dict)
543
544     obj              = bld(features = 'subst')
545     obj.source       = [ 'ardour3_styles.rc.in' ]
546     obj.target       = 'ardour3_light_styles.rc'
547     obj.install_path = None
548     set_subst_dict(obj, light_rc_subst_dict)
549
550     obj              = bld(features = 'subst')
551     obj.source       = [ 'ardour3_fonts.rc.in' ]
552     obj.target       = 'ardour3_dark_fonts.rc'
553     obj.install_path = None
554     set_subst_dict(obj, dark_rc_subst_dict)
555
556     obj              = bld(features = 'subst')
557     obj.source       = [ 'ardour3_fonts.rc.in' ]
558     obj.target       = 'ardour3_light_fonts.rc'
559     obj.install_path = None
560     set_subst_dict(obj, light_rc_subst_dict)
561
562     obj              = bld(rule = 'cp ${SRC} ${TGT}')
563     obj.source       = [ 'ardour3_widget_list.rc' ]
564     obj.target       = 'ardour3_widgets.rc'
565     obj.install_path = None
566
567     obj = bld (rule = include_processor)
568     obj.source = [ 'ardour3_ui_dark.rc.pre' ]
569     # find and add all ##include dependencies as sources
570     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
571     obj.target = 'ardour3_ui_dark.rc'
572     obj.install_path = '${SYSCONFDIR}/ardour3'
573
574     obj = bld (rule = include_processor)
575     obj.source = [ 'ardour3_ui_light.rc.pre' ]
576     # find and add all ##include dependencies as sources
577     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
578     obj.target = 'ardour3_ui_light.rc'
579     obj.install_path = '${SYSCONFDIR}/ardour3'
580
581     # Menus
582     menus_argv = []
583     if bld.is_defined('GTKOSX'):
584         menus_argv = [ '-E', '-P', '-DGTKOSX' ]
585     else:
586         menus_argv = [ '-E', '-P' ]
587     obj = bld(features = 'command-output')
588     obj.command = 'cpp'
589     obj.command_is_external = True
590     obj.no_inputs = True
591     obj.argv = menus_argv
592     obj.stdin = 'ardour.menus.in'
593     obj.stdout = 'ardour.menus'
594     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
595                       'ardour.menus')
596
597     # Keybindings
598
599     # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
600     # 'SAE-us-nokeypad', 'ergonomic-us'
601
602     for b in [ 'mnemonic-us' ] :
603         obj = bld(
604             target = b + '.bindings',
605             source = b + '.bindings.in',
606             rule = '../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap <${SRC} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
607             )
608         obj.install_path = os.path.join(bld.env['SYSCONFDIR'], 'ardour3')
609
610     # not modified at present
611     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
612                       'step_editing.bindings')
613     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
614                       'mixer.bindings')
615
616     # Icons/Images
617     bld.install_files('${DATADIR}/ardour3/icons', bld.path.ant_glob('icons/*.png'))
618     bld.install_files('${DATADIR}/ardour3/pixmaps', bld.path.ant_glob('pixmaps/*.xpm'))
619     bld.install_files('${DATADIR}/ardour3', 'splash.png')
620
621     # Default UI configuration
622     bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_ui_default.conf')
623     # Generic widget style mappings
624     bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_widgets.rc')
625
626     # Default export stuff
627     bld.install_files('${SYSCONFDIR}/ardour3/export', bld.path.ant_glob('export/*.format'))
628
629     # i18n
630     if bld.is_defined('ENABLE_NLS'):
631         mo_files = bld.path.ant_glob('po/*.mo')
632         for mo in mo_files:
633             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
634             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
635                                         lang, 'LC_MESSAGES', APPNAME + '.mo'),
636                            mo)
637
638 def i18n(bld):
639     autowaf.build_i18n(bld, top, 'gtk2_ardour', APPNAME, gtk2_ardour_sources,
640                        'Paul Davis')