Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge...
[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         'clock_group.cc',
50         'configinfo.cc',
51         'control_point.cc',
52         'control_point_dialog.cc',
53         'curvetest.cc',
54         'debug.cc',
55         'edit_note_dialog.cc',
56         'editing.cc',
57         'editor.cc',
58         'editor_actions.cc',
59         'editor_audio_import.cc',
60         'editor_audiotrack.cc',
61         'editor_canvas.cc',
62         'editor_canvas_events.cc',
63         'editor_component.cc',
64         'editor_cursors.cc',
65         'editor_drag.cc',
66         'editor_route_groups.cc',
67         'editor_export_audio.cc',
68         'editor_group_tabs.cc',
69         'editor_keys.cc',
70         'editor_locations.cc',
71         'editor_markers.cc',
72         'editor_mixer.cc',
73         'editor_mouse.cc',
74         'editor_ops.cc',
75         'editor_regions.cc',
76         'editor_routes.cc',
77         'editor_rulers.cc',
78         'editor_selection.cc',
79         'editor_snapshots.cc',
80         'editor_summary.cc',
81         'editor_tempodisplay.cc',
82         'editor_timefx.cc',
83         'engine_dialog.cc',
84         'enums.cc',
85         'export_channel_selector.cc',
86         'export_dialog.cc',
87         'export_file_notebook.cc',
88         'export_filename_selector.cc',
89         'export_format_dialog.cc',
90         'export_format_selector.cc',
91         'export_preset_selector.cc',
92         'export_timespan_selector.cc',
93         'fft.cc',
94         'fft_graph.cc',
95         'fft_result.cc',
96         'sfdb_freesound_mootcher.cc',
97         'gain_meter.cc',
98         'generic_pluginui.cc',
99         'ghostregion.cc',
100         'global_port_matrix.cc',
101         'group_tabs.cc',
102         'gtk-custom-hruler.c',
103         'gtk-custom-ruler.c',
104         'gtk_pianokeyboard.c',
105         'gui_object.cc',
106         'insert_time_dialog.cc',
107         'interthread_progress_window.cc',
108         'io_selector.cc',
109         'hit.cc',
110         'keyboard.cc',
111         'keyeditor.cc',
112         'latency_gui.cc',
113         'led.cc',
114         'level_meter.cc',
115         'location_ui.cc',
116         'main.cc',
117         'main_clock.cc',
118         'marker.cc',
119         'midi_automation_line.cc',
120         'midi_channel_dialog.cc',
121         'midi_channel_selector.cc',
122         'midi_cut_buffer.cc',
123         'midi_export_dialog.cc',
124         'midi_list_editor.cc',
125         'midi_port_dialog.cc',
126         'midi_region_view.cc',
127         'midi_scroomer.cc',
128         'midi_selection.cc',
129         'midi_streamview.cc',
130         'midi_time_axis.cc',
131         'midi_tracer.cc',
132         'midi_velocity_dialog.cc',
133         'missing_file_dialog.cc',
134         'missing_plugin_dialog.cc',
135         'mixer_actor.cc',
136         'mixer_group_tabs.cc',
137         'mixer_strip.cc',
138         'mixer_ui.cc',
139         'meterbridge.cc',
140         'meter_strip.cc',
141         'meter_patterns.cc',
142         'monitor_section.cc',
143         'mono_panner.cc',
144         'mono_panner_editor.cc',
145         'mouse_cursors.cc',
146         'nag.cc',
147         'new_plugin_preset_dialog.cc',
148         'normalize_dialog.cc',
149         'note.cc',
150         'note_base.cc',
151         'note_player.cc',
152         'nsm.cc',
153         'nsmclient.cc',
154         'option_editor.cc',
155         'opts.cc',
156         'panner2d.cc',
157         'panner_editor.cc',
158         'panner_interface.cc',
159         'panner_ui.cc',
160         'patch_change.cc',
161         'piano_roll_header.cc',
162         'pingback.cc',
163         'playlist_selector.cc',
164         'plugin_eq_gui.cc',
165         'plugin_selector.cc',
166         'plugin_ui.cc',
167         'port_group.cc',
168         'port_insert_ui.cc',
169         'port_matrix.cc',
170         'port_matrix_body.cc',
171         'port_matrix_column_labels.cc',
172         'port_matrix_component.cc',
173         'port_matrix_grid.cc',
174         'port_matrix_labels.cc',
175         'port_matrix_row_labels.cc',
176         'processor_box.cc',
177         'patch_change_dialog.cc',
178         'progress_reporter.cc',
179         'prompter.cc',
180         'public_editor.cc',
181         'quantize_dialog.cc',
182         'rc_option_editor.cc',
183         'region_editor.cc',
184         'region_gain_line.cc',
185         'region_layering_order_editor.cc',
186         'region_selection.cc',
187         'region_view.cc',
188         'return_ui.cc',
189         'rhythm_ferret.cc',
190         'route_group_dialog.cc',
191         'route_group_menu.cc',
192         'route_params_ui.cc',
193         'route_processor_selection.cc',
194         'route_time_axis.cc',
195         'route_ui.cc',
196         'search_path_option.cc',
197         'selection.cc',
198         'send_ui.cc',
199         'session_dialog.cc',
200         'session_import_dialog.cc',
201         'session_metadata_dialog.cc',
202         'session_option_editor.cc',
203         'sfdb_ui.cc',
204         'shuttle_control.cc',
205         'splash.cc',
206         'speaker_dialog.cc',
207         'startup.cc',
208         'step_editor.cc',
209         'step_entry.cc',
210         'stereo_panner.cc',
211         'stereo_panner_editor.cc',
212         'streamview.cc',
213         'strip_silence_dialog.cc',
214         'sys_ex.cc',
215         'tape_region_view.cc',
216         'tempo_dialog.cc',
217         'tempo_lines.cc',
218         'theme_manager.cc',
219         'time_axis_view.cc',
220         'time_axis_view_item.cc',
221         'time_fx_dialog.cc',
222         'time_info_box.cc',
223         'time_selection.cc',
224         'track_selection.cc',
225         'track_view_list.cc',
226         'transpose_dialog.cc',
227         'ui_config.cc',
228         'utils.cc',
229         'verbose_cursor.cc',
230         'version.cc',
231         'visibility_group.cc',
232         'volume_controller.cc',
233         'window_manager.cc',
234 # video-timeline related sources:
235         'video_image_frame.cc',
236         'add_video_dialog.cc',
237         'editor_videotimeline.cc',
238         'video_timeline.cc',
239         'system_exec.cc',
240         'video_monitor.cc',
241         'transcode_ffmpeg.cc',
242         'transcode_video_dialog.cc',
243         'video_server_dialog.cc',
244         'utils_videotl.cc',
245         'export_video_dialog.cc',
246         'export_video_infobox.cc'
247 ]
248
249 def options(opt):
250     autowaf.set_options(opt)
251
252 def configure(conf):
253     conf.load('misc')
254     conf.load('compiler_cxx')
255     # we don't use hard-coded micro versions with ardour, so hard code it to zero
256     autowaf.build_version_files(
257         path_prefix + 'version.h',
258         path_prefix + 'version.cc',
259         'gtk2_ardour', conf.env['MAJOR'], conf.env['MINOR'], 0,
260         '', '')
261     autowaf.configure(conf)
262
263     if Options.options.dist_target == 'auto':
264         if re.search ("linux", sys.platform) != None:
265             autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
266
267     # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
268
269     autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
270                       mandatory=True)
271     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
272                       atleast_version='1.2.1')
273     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
274                       atleast_version='2.10.1')
275     autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
276                       atleast_version='2.18')
277     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
278                       atleast_version='2.18')
279     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
280     autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
281     autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
282
283     conf.write_config_header('gtk2ardour-config.h', remove=False)
284
285     # Boost headers
286     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
287     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
288
289 # Add a waf `feature' to allow compilation of things using winegcc
290 from waflib.TaskGen import feature
291 @feature("wine")
292 def set_winegcc(self):
293     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
294     self.env.CC = 'winegcc'
295
296 def _doPyp(infileName, deps = False):
297     outStr = ''
298     out = []
299     re_spaces = re.compile("\s+")
300
301     if infileName == '-':
302         fd = sys.stdin
303     else:
304         fd = open(infileName)
305     inLines = fd.readlines()
306     if fd != sys.stdin:
307         fd.close()
308         
309
310     for line in inLines:
311         bits = re_spaces.split(line)
312         if bits[0] == '##include':
313             incName = bits[1]
314             if (deps):
315                 out += [ incName ]
316             else:
317                 # assume included file comes from same place as source file
318                 incName = os.path.join (os.path.dirname (infileName), incName);
319                 outStr += _doPyp(incName)
320         else:
321             if not deps:
322                 outStr += line
323
324     # done
325     if deps:
326         return out
327     else:
328         return outStr
329
330 def include_processor(task):
331     infileName = task.inputs[0].srcpath()
332     outfileName = os.path.join(out, task.outputs[0].bldpath())
333     fdOut = open (outfileName, "w")
334     fdOut.write (_doPyp(infileName))
335     fdOut.close ()
336
337
338 def build_color_scheme(path, prefix):
339     f = open (path, 'r')
340     color_scheme = ''
341     for line in f:
342         if re.search ('^#@color', line):
343             line.strip() # remove newline
344             words = line.split()
345             if len(color_scheme):
346                 color_scheme += ';'
347             color_scheme += prefix
348             color_scheme += '_'
349             color_scheme += words[1]
350             color_scheme += ':'
351             color_scheme += words[2]
352     f.close()
353     return color_scheme
354
355 def build(bld):
356
357     VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
358
359     if bld.is_defined('WINDOWS_VST_SUPPORT'):
360         # If we require VST support we build a stub main() and the FST library
361         # here using winegcc, and link it to the GTK front-end library
362         obj = bld (features = 'cxx c cxxprogram wine')
363         obj.source = (
364             '../libs/fst/fst.c',
365             '../libs/fst/fstinfofile.c',
366             '../libs/fst/vsti.c',
367             '../libs/fst/vstwin.c',
368             '../vst/winmain.c',
369             )
370         #
371         # XXX do we really need to explicitly link to all of these for the wine executable?
372         #
373         obj.use          = [ 'libpbd',
374                              'libmidipp',
375                              'libardour',
376                              'libardour_cp',
377                              'libtimecode',
378                              'libmidipp',
379                              'libgtk2_ardour',
380                              'libgtkmm2ext',
381                              'libcanvas'
382                              ]
383         obj.target = 'ardour-' + bld.env['VERSION'] + '-vst.exe.so'
384         obj.includes  = [ '../libs/fst', '.' ]
385         obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
386         obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
387         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
388         # end of the wine executable
389
390         # now the shared library containing the GTK GUI for ardour
391         obj = bld (features = 'cxx c cxxshlib')
392         obj.source    = gtk2_ardour_sources
393         obj.includes  = [ '../libs/fst', '.' ]
394         obj.name      = 'libgtk2_ardour'
395         obj.target    = 'gtk2_ardour'
396     else:
397         # just the normal executable version of the GTK GUI
398         obj = bld (features = 'cxx c cxxprogram')
399         obj.source    = gtk2_ardour_sources
400         obj.target = 'ardour-' + bld.env['VERSION']
401         obj.includes = ['.']
402
403     # at this point, "obj" refers to either the normal native executable
404     # OR the shared library built for use with wine on linux.
405
406     obj.use      = [ 'libpbd',
407                      'libardour',
408                      'libardour_cp',
409                      'libtimecode',
410                      'libmidipp',
411                      'libgtkmm2ext',
412                      'libcanvas',
413                      ]
414
415     obj.defines = [
416         'PACKAGE="' + I18N_PACKAGE + '"',
417         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
418         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
419         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
420         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
421         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
422         ]
423     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
424     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL'
425     obj.uselib       += ' GTKMM CANVAS FFTW3F'
426     obj.uselib       += ' AUDIOUNITS OSX GTKOSX LO '
427
428     if bld.is_defined('USE_EXTERNAL_LIBS'):
429         obj.uselib += ' TAGLIB'
430     else:
431         obj.use += ('libtaglib')
432     if sys.platform == 'darwin':
433         obj.uselib += ' AUDIOUNITS OSX GTKOSX'
434         obj.use    += ' libappleutility'
435     obj.includes += ['../libs']
436
437     if bld.env['build_target'] == 'mingw':
438         if bld.env['DEBUG'] == False:
439             obj.linkflags = ['-mwindows']
440
441     if bld.is_defined('HAVE_SUIL'):
442         obj.source += [ 'lv2_plugin_ui.cc' ]
443         obj.use += [ 'SUIL' ]
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'        : bld.env['VERSION'],
481             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-' + bld.env['VERSION']
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                 'BIG' : '13',
527                 'BIGGER' : '17',
528                 'LARGE' : '18',
529                 'LARGER' : '28',
530                 'HUGER' : '36',
531                 'MASSIVE' : '60',
532         }
533         
534         # There is no acceptable monospace font available on older versions of OS X
535         # and no API on those versions to load TTF files that will work with 
536         # GTK/fontconfig/pango.
537         #
538         # In addition, the ArdourMono font gets clipped for some reason on OS X
539         #
540         # Moreover, Lucida Grande just seems to work even though it is not monospace
541         # so just use it.
542         #
543         font_names = {
544             'MONOSPACE' : 'Lucida Grande',
545         }
546     else: # Linux/X11 fonts
547         basefont = '' # unspecified - use system defaults
548         font_sizes = {
549                 'SMALLER' : '8',
550                 'SMALL' : '9',
551                 'NORMAL' : '10',
552                 'BIG' : '14',
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     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']
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')