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