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