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