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