add mixbus profile which removes the tearoffs
[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 shutil
7 import sys
8 import re
9 import time
10 from waflib.Task import Task
11
12 I18N_PACKAGE = 'gtk2_ardour3'
13
14 # Mandatory variables
15 top = '.'
16 out = 'build'
17
18 path_prefix = 'gtk2_ardour/'
19
20 gtk2_ardour_sources = [
21         'about.cc',
22         'actions.cc',
23         'add_route_dialog.cc',
24         'ambiguous_file_dialog.cc',
25         'analysis_window.cc',
26         'ardour_button.cc',
27         'ardour_dialog.cc',
28         'ardour_dropdown.cc',
29         'ardour_ui.cc',
30         'ardour_ui2.cc',
31         'ardour_ui_dependents.cc',
32         'ardour_ui_dialogs.cc',
33         'ardour_ui_ed.cc',
34         'ardour_ui_mixer.cc',
35         'ardour_ui_options.cc',
36         'ardour_window.cc',
37         'audio_clock.cc',
38         'audio_region_editor.cc',
39         'audio_region_view.cc',
40         'audio_streamview.cc',
41         'audio_time_axis.cc',
42         'automation_controller.cc',
43         'automation_line.cc',
44         'automation_region_view.cc',
45         'automation_streamview.cc',
46         'automation_time_axis.cc',
47         'axis_view.cc',
48         'big_clock_window.cc',
49         'bundle_manager.cc',
50         'button_joiner.cc',
51         'clock_group.cc',
52         'configinfo.cc',
53         'control_point.cc',
54         'control_point_dialog.cc',
55         'curvetest.cc',
56         'debug.cc',
57         'edit_note_dialog.cc',
58         'editing.cc',
59         'editor.cc',
60         'editor_actions.cc',
61         'editor_audio_import.cc',
62         'editor_audiotrack.cc',
63         'editor_canvas.cc',
64         'editor_canvas_events.cc',
65         'editor_component.cc',
66         'editor_cursors.cc',
67         'editor_drag.cc',
68         'editor_route_groups.cc',
69         'editor_export_audio.cc',
70         'editor_group_tabs.cc',
71         'editor_keys.cc',
72         'editor_locations.cc',
73         'editor_markers.cc',
74         'editor_mixer.cc',
75         'editor_mouse.cc',
76         'editor_ops.cc',
77         'editor_regions.cc',
78         'editor_routes.cc',
79         'editor_rulers.cc',
80         'editor_selection.cc',
81         'editor_snapshots.cc',
82         'editor_summary.cc',
83         'editor_tempodisplay.cc',
84         'editor_timefx.cc',
85         'engine_dialog.cc',
86         'enums.cc',
87         'export_channel_selector.cc',
88         'export_dialog.cc',
89         'export_file_notebook.cc',
90         'export_filename_selector.cc',
91         'export_format_dialog.cc',
92         'export_format_selector.cc',
93         'export_preset_selector.cc',
94         'export_timespan_selector.cc',
95         'fft.cc',
96         'fft_graph.cc',
97         'fft_result.cc',
98         'sfdb_freesound_mootcher.cc',
99         'gain_meter.cc',
100         'generic_pluginui.cc',
101         'ghostregion.cc',
102         'global_port_matrix.cc',
103         'group_tabs.cc',
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         'ruler_dialog.cc',
197         'search_path_option.cc',
198         'selection.cc',
199         'send_ui.cc',
200         'session_dialog.cc',
201         'session_import_dialog.cc',
202         'session_metadata_dialog.cc',
203         'session_option_editor.cc',
204         'sfdb_ui.cc',
205         'shuttle_control.cc',
206         'soundcloud_export_selector.cc',
207         'splash.cc',
208         'speaker_dialog.cc',
209         'startup.cc',
210         'step_editor.cc',
211         'step_entry.cc',
212         'stereo_panner.cc',
213         'stereo_panner_editor.cc',
214         'streamview.cc',
215         'strip_silence_dialog.cc',
216         'sys_ex.cc',
217         'tape_region_view.cc',
218         'tempo_dialog.cc',
219         'tempo_lines.cc',
220         'theme_manager.cc',
221         'time_axis_view.cc',
222         'time_axis_view_item.cc',
223         'time_fx_dialog.cc',
224         'time_info_box.cc',
225         'time_selection.cc',
226         'track_selection.cc',
227         'track_view_list.cc',
228         'transpose_dialog.cc',
229         'ui_config.cc',
230         'utils.cc',
231         'verbose_cursor.cc',
232         'version.cc',
233         'visibility_group.cc',
234         'volume_controller.cc',
235         'window_manager.cc',
236 # video-timeline related sources:
237         'video_image_frame.cc',
238         'add_video_dialog.cc',
239         'editor_videotimeline.cc',
240         'video_timeline.cc',
241         'video_monitor.cc',
242         'transcode_ffmpeg.cc',
243         'transcode_video_dialog.cc',
244         'video_server_dialog.cc',
245         'utils_videotl.cc',
246         'export_video_dialog.cc',
247         'export_video_infobox.cc'
248 ]
249
250 def options(opt):
251     autowaf.set_options(opt)
252
253 def configure(conf):
254     conf.load('misc')
255     conf.load('compiler_cxx')
256     # we don't use hard-coded micro versions with ardour, so hard code it to zero
257     autowaf.build_version_files(
258         path_prefix + 'version.h',
259         path_prefix + 'version.cc',
260         'gtk2_ardour', conf.env['MAJOR'], conf.env['MINOR'], 0,
261         '', '')
262     autowaf.configure(conf)
263
264     # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
265
266     autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
267                       mandatory=True)
268     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
269                       atleast_version='1.2.1')
270     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
271                       atleast_version='2.10.1')
272     autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
273                       atleast_version='2.18')
274     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
275                       atleast_version='2.18')
276     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
277     autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
278     autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
279
280     conf.write_config_header('gtk2ardour-config.h', remove=False)
281
282     # Boost headers
283     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
284     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
285
286 # Add a waf `feature' to allow compilation of things using winegcc
287 from waflib.TaskGen import feature
288 @feature("wine")
289 def set_winegcc(self):
290     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
291     self.env.CC = 'winegcc'
292
293 def _doPyp(infileName, deps = False):
294     outStr = ''
295     out = []
296     re_spaces = re.compile("\s+")
297
298     if infileName == '-':
299         fd = sys.stdin
300     else:
301         fd = open(infileName)
302     inLines = fd.readlines()
303     if fd != sys.stdin:
304         fd.close()
305         
306
307     for line in inLines:
308         bits = re_spaces.split(line)
309         if bits[0] == '##include':
310             incName = bits[1]
311             if (deps):
312                 out += [ incName ]
313             else:
314                 # assume included file comes from same place as source file
315                 incName = os.path.join (os.path.dirname (infileName), incName);
316                 outStr += _doPyp(incName)
317         else:
318             if not deps:
319                 outStr += line
320
321     # done
322     if deps:
323         return out
324     else:
325         return outStr
326
327 def include_processor(task):
328     infileName = task.inputs[0].srcpath()
329     outfileName = os.path.join(out, task.outputs[0].bldpath())
330     fdOut = open (outfileName, "w")
331     fdOut.write (_doPyp(infileName))
332     fdOut.close ()
333
334
335 def build_color_scheme(path, prefix):
336     f = open (path, 'r')
337     color_scheme = ''
338     for line in f:
339         if re.search ('^#@color', line):
340             line.strip() # remove newline
341             words = line.split()
342             if len(color_scheme):
343                 color_scheme += ';'
344             color_scheme += prefix
345             color_scheme += '_'
346             color_scheme += words[1]
347             color_scheme += ':'
348             color_scheme += words[2]
349     f.close()
350     return color_scheme
351
352 def build(bld):
353
354     VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
355
356     if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
357         # Windows VST support w/wine
358         # If we require VST support we build a stub main() and the FST library
359         # here using winegcc, and link it to the GTK front-end library
360         obj = bld (features = 'cxx c cxxprogram wine')
361         obj.source = (
362             '../libs/fst/vstwin.c',
363             '../vst/winmain.c',
364             )
365         #
366         # XXX do we really need to explicitly link to all of these for the wine executable?
367         #
368         obj.use          = [ 'libpbd',
369                              'libmidipp',
370                              'libardour',
371                              'libardour_cp',
372                              'libtimecode',
373                              'libmidipp',
374                              'libgtk2_ardour',
375                              'libgtkmm2ext',
376                              'libcanvas'
377                              ]
378         obj.target = 'ardour-' + bld.env['VERSION'] + '-vst.exe.so'
379         obj.includes  = [ '../libs/fst', '.' ]
380         obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
381         obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
382         obj.install_path = bld.env['DLLDIR']
383         # end of the wine executable
384
385         # now the shared library containing the GTK GUI for ardour
386         obj = bld (features = 'cxx c cxxshlib')
387         obj.source    = gtk2_ardour_sources
388         obj.includes  = [ '../libs/fst', '.' ]
389         obj.name      = 'libgtk2_ardour'
390         obj.target    = 'gtk2_ardour'
391     else:
392         # just the normal executable version of the GTK GUI
393         obj = bld (features = 'cxx c cxxprogram')
394         obj.source    = gtk2_ardour_sources
395         obj.target = 'ardour-' + bld.env['VERSION']
396         obj.includes = ['.']
397         obj.ldflags = ['-no-undefined']
398
399         if bld.is_defined('WINDOWS_VST_SUPPORT'):
400         # Windows VST support mingw
401             obj.source += [ '../vst/winmain.c' ]
402             obj.includes += [ '../libs/fst' ]
403
404     # at this point, "obj" refers to either the normal native executable
405     # OR the shared library built for use with wine on linux.
406
407     obj.use      = [ 'libpbd',
408                      'libardour',
409                      'libardour_cp',
410                      'libtimecode',
411                      'libmidipp',
412                      'libgtkmm2ext',
413                      'libcanvas',
414                      ]
415
416     obj.defines = [
417         'PACKAGE="' + I18N_PACKAGE + '"',
418         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
419         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
420         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
421         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
422         ]
423     obj.install_path = bld.env['DLLDIR']
424     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL'
425     obj.uselib       += ' GTKMM CANVAS FFTW3F'
426     obj.uselib       += ' AUDIOUNITS OSX GTKOSX LO '
427     obj.uselib       += ' TAGLIB '
428
429     if sys.platform == 'darwin':
430         obj.uselib += ' AUDIOUNITS OSX GTKOSX'
431         obj.use    += ' libappleutility'
432         obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
433     elif bld.env['build_target'] == 'mingw':
434         obj.source += [ 'bundle_env_mingw.cc' ]
435     else:
436         obj.source += [ 'bundle_env_linux.cc' ]
437
438     obj.includes += ['../libs']
439
440     if bld.env['build_target'] == 'mingw':
441         if bld.env['DEBUG'] == False:
442             obj.linkflags = ['-mwindows']
443
444     if bld.is_defined('HAVE_SUIL'):
445         obj.source += [ 'lv2_plugin_ui.cc' ]
446         obj.use += [ 'SUIL' ]
447
448     if bld.is_defined('NEED_INTL'):
449         obj.linkflags = ' -lintl'
450
451     if bld.is_defined('WINDOWS_VST_SUPPORT'):
452         obj.source += [ 'windows_vst_plugin_ui.cc' ]
453         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
454         if bld.env['build_target'] != 'mingw':
455             obj.use += [ 'X11' ]
456         
457     if bld.is_defined('LXVST_SUPPORT'):
458         obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
459         obj.defines += [ 'LXVST_SUPPORT' ]
460         obj.use += [ 'X11' ]
461
462     if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
463         obj.source += [ 'vst_plugin_ui.cc' ]
464         
465     if bld.is_defined('PHONE_HOME'):
466         obj.defines += [ 'PHONE_HOME' ]
467
468     if bld.is_defined('HAVE_COREAUDIO'):
469         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
470         obj.use += ' libappleutility '
471
472     if bld.is_defined('AUDIOUNIT_SUPPORT'):
473         obj.source += [ 'au_pluginui.mm' ]
474
475     # Wrappers
476
477         print 'DLL = ' + bld.env['DLLDIR'], '\n'
478         print 'DATADIR = ' + bld.env['DATADIR'], '\n'
479         print 'CONF = ' + bld.env['CONFDIR'], '\n'
480
481     wrapper_subst_dict = {
482             'INSTALL_PREFIX' : bld.env['PREFIX'],
483             'LIBDIR'         : os.path.normpath(bld.env['DLLDIR']),
484             'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
485             'CONFDIR'        : os.path.normpath(bld.env['CONFDIR']),
486             'LIBS'           : 'build/libs',
487             'VERSION'        : bld.env['VERSION'],
488             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-' + bld.env['VERSION']
489     }
490
491     def set_subst_dict(obj, dict):
492         for i in dict:
493             setattr(obj, i, dict[i])
494
495     obj              = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
496     obj.source       = 'ardev_common.sh.in'
497     obj.target       = 'ardev_common_waf.sh'
498     obj.chmod        = Utils.O755
499     obj.dict         = wrapper_subst_dict
500     set_subst_dict(obj, wrapper_subst_dict)
501
502     obj              = bld(features = 'subst')
503     obj.source       = 'ardour.sh.in'
504     obj.target       = 'ardour3'
505     obj.chmod        = Utils.O755
506     obj.dict         = wrapper_subst_dict
507     obj.install_path = bld.env['BINDIR']
508     set_subst_dict(obj, wrapper_subst_dict)
509
510     if bld.is_defined('WINDOWS_VST_SUPPORT'):
511         obj              = bld(features = 'subst')
512         obj.source       = '../vst/ardourvst.in'
513         obj.target       = 'ardourvst3'
514         obj.chmod        = Utils.O755
515         obj.dict         = wrapper_subst_dict
516         obj.install_path = bld.env['BINDIR']
517         set_subst_dict(obj, wrapper_subst_dict)
518
519     # Font configuration
520
521     dark_rc_subst_dict = {}
522     light_rc_subst_dict = {}
523     ui_conf_dict = {}
524     font_sizes      = {}
525     base_font       = ""
526
527     # Set up font sizes
528     if bld.is_defined('GTKOSX'): # OS X fonts
529         basefont = ""
530         font_sizes = {
531                 'SMALLER' : '9',
532                 'SMALL' : '10',
533                 'NORMAL' : '11',
534                 'BIG' : '13',
535                 'BIGGER' : '17',
536                 'LARGE' : '18',
537                 'LARGER' : '28',
538                 'HUGER' : '36',
539                 'MASSIVE' : '60',
540         }
541         
542         # There is no acceptable monospace font available on older versions of OS X
543         # and no API on those versions to load TTF files that will work with 
544         # GTK/fontconfig/pango.
545         #
546         # In addition, the ArdourMono font gets clipped for some reason on OS X
547         #
548         # Moreover, Lucida Grande just seems to work even though it is not monospace
549         # so just use it.
550         #
551         font_names = {
552             'MONOSPACE' : 'Lucida Grande',
553         }
554     else: # Linux/X11 fonts
555         basefont = '' # unspecified - use system defaults
556         font_sizes = {
557                 'SMALLER' : '8',
558                 'SMALL' : '9',
559                 'NORMAL' : '10',
560                 'BIG' : '14',
561                 'BIGGER' : '17',
562                 'LARGE' : '18',
563                 'LARGER' : '24',
564                 'HUGER' : '34',
565                 'MASSIVE' : '60',
566         }
567         font_names = {
568                 'MONOSPACE' : 'ArdourMono',
569         }
570
571     # Set up font substitution dictionary
572     # @FONT_XXXX@
573     for style in ['', 'BOLD', 'ITALIC']:
574         for sizename,points in iter(font_sizes.items()):
575             if (len (style)):
576                 key = "_".join (['FONT',style,sizename])
577                 fontstyle = " ".join ([basefont,style.lower(),points])
578             else:
579                 key = "_".join (['FONT',sizename])
580                 fontstyle = " ".join ([basefont,points])
581
582             dark_rc_subst_dict[key] = fontstyle
583             light_rc_subst_dict[key] = fontstyle
584             ui_conf_dict[key] = points
585             
586     # @FONT_SIZE_XXXX@
587     for sizename,points in iter(font_sizes.items()):
588             key = "_".join (['FONT_SIZE',sizename])
589             dark_rc_subst_dict[key] = points
590             light_rc_subst_dict[key] = points
591             ui_conf_dict[key] = points
592
593     # various font names, eg @BOLD_MONOSPACE@
594     for font_sym,text in iter(font_names.items()):
595         key = font_sym
596         dark_rc_subst_dict[key] = text
597         light_rc_subst_dict[key] = text
598         ui_conf_dict[key] = text
599
600     # RC files
601     dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
602         'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
603     dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
604     light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
605         'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
606     light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
607
608     obj              = bld(features = 'subst')
609     obj.source       = [ 'ardour3_ui_dark.rc.in' ]
610     obj.target       = 'ardour3_ui_dark.rc.pre'
611     obj.install_path = None
612     set_subst_dict(obj, dark_rc_subst_dict)
613
614     obj              = bld(features = 'subst')
615     obj.source       = [ 'ardour3_ui_light.rc.in' ]
616     obj.target       = 'ardour3_ui_light.rc.pre'
617     obj.install_path = None
618     set_subst_dict(obj, light_rc_subst_dict)
619
620     obj              = bld(features = 'subst')
621     obj.source       = [ 'ardour3_styles.rc.in' ]
622     obj.target       = 'ardour3_dark_styles.rc'
623     obj.install_path = None
624     set_subst_dict(obj, dark_rc_subst_dict)
625
626     obj              = bld(features = 'subst')
627     obj.source       = [ 'ardour3_styles.rc.in' ]
628     obj.target       = 'ardour3_light_styles.rc'
629     obj.install_path = None
630     set_subst_dict(obj, light_rc_subst_dict)
631
632     obj              = bld(features = 'subst')
633     obj.source       = [ 'ardour3_fonts.rc.in' ]
634     obj.target       = 'ardour3_dark_fonts.rc'
635     obj.install_path = None
636     set_subst_dict(obj, dark_rc_subst_dict)
637
638     obj              = bld(features = 'subst')
639     obj.source       = [ 'ardour3_fonts.rc.in' ]
640     obj.target       = 'ardour3_light_fonts.rc'
641     obj.install_path = None
642     set_subst_dict(obj, light_rc_subst_dict)
643
644     obj              = bld(rule = autowaf.copyfile) 
645     obj.source       = [ 'ardour3_widget_list.rc' ]
646     obj.target       = 'ardour3_widgets.rc'
647     obj.install_path = None
648
649     obj = bld (rule = include_processor)
650     obj.source = [ 'ardour3_ui_dark.rc.pre' ]
651     # find and add all ##include dependencies as sources
652     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
653     obj.target = 'ardour3_ui_dark.rc'
654     obj.install_path = bld.env['CONFDIR']
655
656     obj = bld (rule = include_processor)
657     obj.source = [ 'ardour3_ui_light.rc.pre' ]
658     # find and add all ##include dependencies as sources
659     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
660     obj.target = 'ardour3_ui_light.rc'
661     obj.install_path = bld.env['CONFDIR']
662
663     obj              = bld(features = 'subst')
664     obj.source       = [ 'ardour3_ui_default.conf.in' ]
665     obj.target       = 'ardour3_ui_default.conf'
666     obj.install_path = None
667     set_subst_dict(obj, ui_conf_dict)
668
669     # Menus
670     menus_argv = []
671     if bld.is_defined('GTKOSX'):
672         menus_argv = [ '-E', '-P', '-DGTKOSX' ]
673     else:
674         menus_argv = [ '-E', '-P' ]
675
676     # always build all versions of the menu definitions
677     # so that we can try them out with different program builds.
678     for program in [ 'ardour', 'trx' ]:
679         obj = bld(features = 'command-output')
680         obj.command = 'cpp'
681         obj.command_is_external = True
682         obj.no_inputs = True
683         obj.argv = menus_argv
684         obj.dep_vars = ['GTKOSX']
685         obj.stdin = program + '.menus.in'
686         obj.stdout = program + '.menus'
687         bld.install_files (bld.env['CONFDIR'], program + '.menus')
688
689     # Keybindings
690
691     # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
692     # 'SAE-us-nokeypad', 'ergonomic-us'
693
694     #
695     # explicitly state the use of perl here so that it works on windows too
696     # 
697     a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap <${SRC} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
698     for b in [ 'mnemonic-us' ] :
699         obj = bld(
700             target = b + '.bindings',
701             source = b + '.bindings.in',
702             rule = a_rule
703             )
704         obj.install_path = bld.env['CONFDIR']
705
706     # not modified at present
707     bld.install_files(bld.env['CONFDIR'], 'step_editing.bindings')
708     bld.install_files(bld.env['CONFDIR'], 'mixer.bindings')
709
710     # Icons/Images
711     bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
712     bld.install_files(os.path.join (bld.env['DATADIR'], 'pixmaps'), bld.path.ant_glob('pixmaps/*.xpm'))
713     bld.install_files(bld.env['DATADIR'], 'splash.png')
714     bld.install_files(bld.env['DATADIR'], 'small-splash.png')
715     bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
716
717     # Default UI configuration
718     bld.install_files(bld.env['CONFDIR'], 'ardour3_ui_default.conf')
719
720     # Default export stuff
721     bld.install_files(os.path.join(bld.env['CONFDIR'],' export'), bld.path.ant_glob('export/*.format'))
722
723     # i18n
724     if bld.is_defined('ENABLE_NLS'):
725         mo_files = bld.path.ant_glob('po/*.mo')
726         for mo in mo_files:
727             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
728             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
729                                         lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
730                            mo)
731
732 def i18n(bld):
733     autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
734                        'Paul Davis')
735
736 def i18n_pot(bld):
737     autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
738                        'Paul Davis')
739
740 def i18n_po(bld):
741     autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
742                        'Paul Davis')
743
744 def i18n_mo(bld):
745     autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
746                        'Paul Davis')