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