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