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