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