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