Merge branch 'export-dialog' into cairocanvas
[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 shutil
7 import sys
8 import re
9 import time
10 from waflib.Task import Task
11
12 I18N_PACKAGE = 'gtk2_ardour3'
13
14 # Mandatory variables
15 top = '.'
16 out = 'build'
17
18 path_prefix = 'gtk2_ardour/'
19
20 gtk2_ardour_sources = [
21         'about.cc',
22         'actions.cc',
23         'add_route_dialog.cc',
24         'ambiguous_file_dialog.cc',
25         'analysis_window.cc',
26         'ardour_button.cc',
27         'ardour_dialog.cc',
28         'ardour_dropdown.cc',
29         'ardour_ui.cc',
30         'ardour_ui2.cc',
31         'ardour_ui_dependents.cc',
32         'ardour_ui_dialogs.cc',
33         'ardour_ui_ed.cc',
34         'ardour_ui_mixer.cc',
35         'ardour_ui_options.cc',
36         'ardour_window.cc',
37         'audio_clock.cc',
38         'audio_region_editor.cc',
39         'audio_region_view.cc',
40         'audio_streamview.cc',
41         'audio_time_axis.cc',
42         'automation_controller.cc',
43         'automation_line.cc',
44         'automation_region_view.cc',
45         'automation_streamview.cc',
46         'automation_time_axis.cc',
47         'axis_view.cc',
48         'big_clock_window.cc',
49         'bundle_manager.cc',
50         'button_joiner.cc',
51         'clock_group.cc',
52         'configinfo.cc',
53         'control_point.cc',
54         'control_point_dialog.cc',
55         'curvetest.cc',
56         'debug.cc',
57         'edit_note_dialog.cc',
58         'editing.cc',
59         'editor.cc',
60         'editor_actions.cc',
61         'editor_audio_import.cc',
62         'editor_audiotrack.cc',
63         'editor_canvas.cc',
64         'editor_canvas_events.cc',
65         'editor_component.cc',
66         'editor_cursors.cc',
67         'editor_drag.cc',
68         'editor_route_groups.cc',
69         'editor_export_audio.cc',
70         'editor_group_tabs.cc',
71         'editor_keys.cc',
72         'editor_locations.cc',
73         'editor_markers.cc',
74         'editor_mixer.cc',
75         'editor_mouse.cc',
76         'editor_ops.cc',
77         'editor_regions.cc',
78         'editor_routes.cc',
79         'editor_rulers.cc',
80         'editor_selection.cc',
81         'editor_snapshots.cc',
82         'editor_summary.cc',
83         'editor_tempodisplay.cc',
84         'editor_timefx.cc',
85         'engine_dialog.cc',
86         'enums.cc',
87         'export_channel_selector.cc',
88         'export_dialog.cc',
89         'export_file_notebook.cc',
90         'export_filename_selector.cc',
91         'export_format_dialog.cc',
92         'export_format_selector.cc',
93         'export_preset_selector.cc',
94         'export_timespan_selector.cc',
95         'fft.cc',
96         'fft_graph.cc',
97         'fft_result.cc',
98         'sfdb_freesound_mootcher.cc',
99         'gain_meter.cc',
100         'generic_pluginui.cc',
101         'ghostregion.cc',
102         'global_port_matrix.cc',
103         'group_tabs.cc',
104         'gtk-custom-hruler.c',
105         'gtk-custom-ruler.c',
106         'gtk_pianokeyboard.c',
107         'gui_object.cc',
108         'insert_time_dialog.cc',
109         'interthread_progress_window.cc',
110         'io_selector.cc',
111         'hit.cc',
112         'keyboard.cc',
113         'keyeditor.cc',
114         'latency_gui.cc',
115         'led.cc',
116         'level_meter.cc',
117         'location_ui.cc',
118         'main.cc',
119         'main_clock.cc',
120         'marker.cc',
121         'midi_automation_line.cc',
122         'midi_channel_dialog.cc',
123         'midi_channel_selector.cc',
124         'midi_cut_buffer.cc',
125         'midi_export_dialog.cc',
126         'midi_list_editor.cc',
127         'midi_port_dialog.cc',
128         'midi_region_view.cc',
129         'midi_scroomer.cc',
130         'midi_selection.cc',
131         'midi_streamview.cc',
132         'midi_time_axis.cc',
133         'midi_tracer.cc',
134         'midi_velocity_dialog.cc',
135         'missing_file_dialog.cc',
136         'missing_plugin_dialog.cc',
137         'mixer_actor.cc',
138         'mixer_group_tabs.cc',
139         'mixer_strip.cc',
140         'mixer_ui.cc',
141         'meterbridge.cc',
142         'meter_strip.cc',
143         'meter_patterns.cc',
144         'monitor_section.cc',
145         'mono_panner.cc',
146         'mono_panner_editor.cc',
147         'mouse_cursors.cc',
148         'nag.cc',
149         'new_plugin_preset_dialog.cc',
150         'normalize_dialog.cc',
151         'note.cc',
152         'note_base.cc',
153         'note_player.cc',
154         'nsm.cc',
155         'nsmclient.cc',
156         'option_editor.cc',
157         'opts.cc',
158         'panner2d.cc',
159         'panner_editor.cc',
160         'panner_interface.cc',
161         'panner_ui.cc',
162         'patch_change.cc',
163         'piano_roll_header.cc',
164         'pingback.cc',
165         'playlist_selector.cc',
166         'plugin_eq_gui.cc',
167         'plugin_selector.cc',
168         'plugin_ui.cc',
169         'port_group.cc',
170         'port_insert_ui.cc',
171         'port_matrix.cc',
172         'port_matrix_body.cc',
173         'port_matrix_column_labels.cc',
174         'port_matrix_component.cc',
175         'port_matrix_grid.cc',
176         'port_matrix_labels.cc',
177         'port_matrix_row_labels.cc',
178         'processor_box.cc',
179         'patch_change_dialog.cc',
180         'progress_reporter.cc',
181         'prompter.cc',
182         'public_editor.cc',
183         'quantize_dialog.cc',
184         'rc_option_editor.cc',
185         'region_editor.cc',
186         'region_gain_line.cc',
187         'region_layering_order_editor.cc',
188         'region_selection.cc',
189         'region_view.cc',
190         'return_ui.cc',
191         'rhythm_ferret.cc',
192         'route_group_dialog.cc',
193         'route_group_menu.cc',
194         'route_params_ui.cc',
195         'route_processor_selection.cc',
196         'route_time_axis.cc',
197         'route_ui.cc',
198         'search_path_option.cc',
199         'selection.cc',
200         'send_ui.cc',
201         'session_dialog.cc',
202         'session_import_dialog.cc',
203         'session_metadata_dialog.cc',
204         'session_option_editor.cc',
205         'sfdb_ui.cc',
206         'shuttle_control.cc',
207         'soundcloud_export_selector.cc',
208         'splash.cc',
209         'speaker_dialog.cc',
210         'startup.cc',
211         'step_editor.cc',
212         'step_entry.cc',
213         'stereo_panner.cc',
214         'stereo_panner_editor.cc',
215         'streamview.cc',
216         'strip_silence_dialog.cc',
217         'sys_ex.cc',
218         'tape_region_view.cc',
219         'tempo_dialog.cc',
220         'tempo_lines.cc',
221         'theme_manager.cc',
222         'time_axis_view.cc',
223         'time_axis_view_item.cc',
224         'time_fx_dialog.cc',
225         'time_info_box.cc',
226         'time_selection.cc',
227         'track_selection.cc',
228         'track_view_list.cc',
229         'transpose_dialog.cc',
230         'ui_config.cc',
231         'utils.cc',
232         'verbose_cursor.cc',
233         'version.cc',
234         'visibility_group.cc',
235         'volume_controller.cc',
236         'window_manager.cc',
237 # video-timeline related sources:
238         'video_image_frame.cc',
239         'add_video_dialog.cc',
240         'editor_videotimeline.cc',
241         'video_timeline.cc',
242         'video_monitor.cc',
243         'transcode_ffmpeg.cc',
244         'transcode_video_dialog.cc',
245         'video_server_dialog.cc',
246         'utils_videotl.cc',
247         'export_video_dialog.cc',
248         'export_video_infobox.cc'
249 ]
250
251 def options(opt):
252     autowaf.set_options(opt)
253
254 def configure(conf):
255     conf.load('misc')
256     conf.load('compiler_cxx')
257     # we don't use hard-coded micro versions with ardour, so hard code it to zero
258     autowaf.build_version_files(
259         path_prefix + 'version.h',
260         path_prefix + 'version.cc',
261         'gtk2_ardour', conf.env['MAJOR'], conf.env['MINOR'], 0,
262         '', '')
263     autowaf.configure(conf)
264
265     if Options.options.dist_target == 'auto':
266         if re.search ("linux", sys.platform) != None:
267             autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
268
269     # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
270
271     autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
272                       mandatory=True)
273     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
274                       atleast_version='1.2.1')
275     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
276                       atleast_version='2.10.1')
277     autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
278                       atleast_version='2.18')
279     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
280                       atleast_version='2.18')
281     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
282     autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
283     autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
284
285     conf.write_config_header('gtk2ardour-config.h', remove=False)
286
287     # Boost headers
288     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
289     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
290
291 # Add a waf `feature' to allow compilation of things using winegcc
292 from waflib.TaskGen import feature
293 @feature("wine")
294 def set_winegcc(self):
295     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
296     self.env.CC = 'winegcc'
297
298 def _doPyp(infileName, deps = False):
299     outStr = ''
300     out = []
301     re_spaces = re.compile("\s+")
302
303     if infileName == '-':
304         fd = sys.stdin
305     else:
306         fd = open(infileName)
307     inLines = fd.readlines()
308     if fd != sys.stdin:
309         fd.close()
310         
311
312     for line in inLines:
313         bits = re_spaces.split(line)
314         if bits[0] == '##include':
315             incName = bits[1]
316             if (deps):
317                 out += [ incName ]
318             else:
319                 # assume included file comes from same place as source file
320                 incName = os.path.join (os.path.dirname (infileName), incName);
321                 outStr += _doPyp(incName)
322         else:
323             if not deps:
324                 outStr += line
325
326     # done
327     if deps:
328         return out
329     else:
330         return outStr
331
332 def include_processor(task):
333     infileName = task.inputs[0].srcpath()
334     outfileName = os.path.join(out, task.outputs[0].bldpath())
335     fdOut = open (outfileName, "w")
336     fdOut.write (_doPyp(infileName))
337     fdOut.close ()
338
339
340 def build_color_scheme(path, prefix):
341     f = open (path, 'r')
342     color_scheme = ''
343     for line in f:
344         if re.search ('^#@color', line):
345             line.strip() # remove newline
346             words = line.split()
347             if len(color_scheme):
348                 color_scheme += ';'
349             color_scheme += prefix
350             color_scheme += '_'
351             color_scheme += words[1]
352             color_scheme += ':'
353             color_scheme += words[2]
354     f.close()
355     return color_scheme
356
357 def build(bld):
358
359     VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
360
361     if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
362         # Windows VST support w/wine
363         # If we require VST support we build a stub main() and the FST library
364         # here using winegcc, and link it to the GTK front-end library
365         obj = bld (features = 'cxx c cxxprogram wine')
366         obj.source = (
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 = bld.env['DLLDIR']
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         obj.ldflags = ['-no-undefined']
403
404         if bld.is_defined('WINDOWS_VST_SUPPORT'):
405         # Windows VST support mingw
406             obj.source += [ '../vst/winmain.c' ]
407             obj.includes += [ '../libs/fst' ]
408
409     # at this point, "obj" refers to either the normal native executable
410     # OR the shared library built for use with wine on linux.
411
412     obj.use      = [ 'libpbd',
413                      'libardour',
414                      'libardour_cp',
415                      'libtimecode',
416                      'libmidipp',
417                      'libgtkmm2ext',
418                      'libcanvas',
419                      ]
420
421     obj.defines = [
422         'PACKAGE="' + I18N_PACKAGE + '"',
423         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
424         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
425         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
426         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
427         ]
428     obj.install_path = bld.env['DLLDIR']
429     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL'
430     obj.uselib       += ' GTKMM CANVAS FFTW3F'
431     obj.uselib       += ' AUDIOUNITS OSX GTKOSX LO '
432     obj.uselib       += ' TAGLIB '
433
434     if sys.platform == 'darwin':
435         obj.uselib += ' AUDIOUNITS OSX GTKOSX'
436         obj.use    += ' libappleutility'
437         obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
438     elif bld.env['build_target'] == 'mingw':
439         obj.source += [ 'bundle_env_mingw.cc' ]
440     else:
441         obj.source += [ 'bundle_env_linux.cc' ]
442
443     obj.includes += ['../libs']
444
445     if bld.env['build_target'] == 'mingw':
446         if bld.env['DEBUG'] == False:
447             obj.linkflags = ['-mwindows']
448
449     if bld.is_defined('HAVE_SUIL'):
450         obj.source += [ 'lv2_plugin_ui.cc' ]
451         obj.use += [ 'SUIL' ]
452
453     if bld.is_defined('NEED_INTL'):
454         obj.linkflags = ' -lintl'
455
456     if bld.is_defined('WINDOWS_VST_SUPPORT'):
457         obj.source += [ 'windows_vst_plugin_ui.cc' ]
458         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
459         if bld.env['build_target'] != 'mingw':
460             obj.use += [ 'X11' ]
461         
462     if bld.is_defined('LXVST_SUPPORT'):
463         obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
464         obj.defines += [ 'LXVST_SUPPORT' ]
465         obj.use += [ 'X11' ]
466
467     if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
468         obj.source += [ 'vst_plugin_ui.cc' ]
469         
470     if bld.is_defined('PHONE_HOME'):
471         obj.defines += [ 'PHONE_HOME' ]
472
473     if bld.is_defined('HAVE_COREAUDIO'):
474         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
475         obj.use += ' libappleutility '
476
477     if bld.is_defined('AUDIOUNIT_SUPPORT'):
478         obj.source += [ 'au_pluginui.mm' ]
479
480     # Wrappers
481
482         print 'DLL = ' + bld.env['DLLDIR'], '\n'
483         print 'DATADIR = ' + bld.env['DATADIR'], '\n'
484         print 'CONF = ' + bld.env['CONFDIR'], '\n'
485
486     wrapper_subst_dict = {
487             'INSTALL_PREFIX' : bld.env['PREFIX'],
488             'LIBDIR'         : os.path.normpath(bld.env['DLLDIR']),
489             'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
490             'SYSCONFDIR'     : os.path.normpath(bld.env['CONFDIR']),
491             'LIBS'           : 'build/libs',
492             'VERSION'        : bld.env['VERSION'],
493             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-' + bld.env['VERSION']
494     }
495
496     def set_subst_dict(obj, dict):
497         for i in dict:
498             setattr(obj, i, dict[i])
499
500     obj              = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
501     obj.source       = 'ardev_common.sh.in'
502     obj.target       = 'ardev_common_waf.sh'
503     obj.chmod        = Utils.O755
504     obj.dict         = wrapper_subst_dict
505     set_subst_dict(obj, wrapper_subst_dict)
506
507     obj              = bld(features = 'subst')
508     obj.source       = 'ardour.sh.in'
509     obj.target       = 'ardour3'
510     obj.chmod        = Utils.O755
511     obj.dict         = wrapper_subst_dict
512     obj.install_path = bld.env['BINDIR']
513     set_subst_dict(obj, wrapper_subst_dict)
514
515     if bld.is_defined('WINDOWS_VST_SUPPORT'):
516         obj              = bld(features = 'subst')
517         obj.source       = '../vst/ardourvst.in'
518         obj.target       = 'ardourvst3'
519         obj.chmod        = Utils.O755
520         obj.dict         = wrapper_subst_dict
521         obj.install_path = bld.env['BINDIR']
522         set_subst_dict(obj, wrapper_subst_dict)
523
524     # Font configuration
525
526     dark_rc_subst_dict = {}
527     light_rc_subst_dict = {}
528     font_sizes      = {}
529     base_font       = ""
530
531     # Set up font sizes
532     if bld.is_defined('GTKOSX'): # OS X fonts
533         basefont = ""
534         font_sizes = {
535                 'SMALLER' : '9',
536                 'SMALL' : '10',
537                 'NORMAL' : '11',
538                 'BIG' : '13',
539                 'BIGGER' : '17',
540                 'LARGE' : '18',
541                 'LARGER' : '28',
542                 'HUGER' : '36',
543                 'MASSIVE' : '60',
544         }
545         
546         # There is no acceptable monospace font available on older versions of OS X
547         # and no API on those versions to load TTF files that will work with 
548         # GTK/fontconfig/pango.
549         #
550         # In addition, the ArdourMono font gets clipped for some reason on OS X
551         #
552         # Moreover, Lucida Grande just seems to work even though it is not monospace
553         # so just use it.
554         #
555         font_names = {
556             'MONOSPACE' : 'Lucida Grande',
557         }
558     else: # Linux/X11 fonts
559         basefont = '' # unspecified - use system defaults
560         font_sizes = {
561                 'SMALLER' : '8',
562                 'SMALL' : '9',
563                 'NORMAL' : '10',
564                 'BIG' : '14',
565                 'BIGGER' : '17',
566                 'LARGE' : '18',
567                 'LARGER' : '24',
568                 'HUGER' : '34',
569                 'MASSIVE' : '60',
570         }
571         font_names = {
572                 'MONOSPACE' : 'ArdourMono',
573         }
574
575     # Set up font substitution dictionary
576     # @FONT_XXXX@
577     for style in ['', 'BOLD', 'ITALIC']:
578         for sizename,points in iter(font_sizes.items()):
579             if (len (style)):
580                 key = "_".join (['FONT',style,sizename])
581                 fontstyle = " ".join ([basefont,style.lower(),points])
582             else:
583                 key = "_".join (['FONT',sizename])
584                 fontstyle = " ".join ([basefont,points])
585
586             dark_rc_subst_dict[key] = fontstyle
587             light_rc_subst_dict[key] = fontstyle
588
589     # @FONT_SIZE_XXXX@
590     for sizename,points in iter(font_sizes.items()):
591             key = "_".join (['FONT_SIZE',sizename])
592             dark_rc_subst_dict[key] = points
593             light_rc_subst_dict[key] = points
594
595     # various font names, eg @BOLD_MONOSPACE@
596     for font_sym,text in iter(font_names.items()):
597         key = font_sym
598         dark_rc_subst_dict[key] = text
599         light_rc_subst_dict[key] = text
600
601     # RC files
602     dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
603         'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
604     dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
605     light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
606         'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
607     light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
608
609     obj              = bld(features = 'subst')
610     obj.source       = [ 'ardour3_ui_dark.rc.in' ]
611     obj.target       = 'ardour3_ui_dark.rc.pre'
612     obj.install_path = None
613     set_subst_dict(obj, dark_rc_subst_dict)
614
615     obj              = bld(features = 'subst')
616     obj.source       = [ 'ardour3_ui_light.rc.in' ]
617     obj.target       = 'ardour3_ui_light.rc.pre'
618     obj.install_path = None
619     set_subst_dict(obj, light_rc_subst_dict)
620
621     obj              = bld(features = 'subst')
622     obj.source       = [ 'ardour3_styles.rc.in' ]
623     obj.target       = 'ardour3_dark_styles.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_styles.rc.in' ]
629     obj.target       = 'ardour3_light_styles.rc'
630     obj.install_path = None
631     set_subst_dict(obj, light_rc_subst_dict)
632
633     obj              = bld(features = 'subst')
634     obj.source       = [ 'ardour3_fonts.rc.in' ]
635     obj.target       = 'ardour3_dark_fonts.rc'
636     obj.install_path = None
637     set_subst_dict(obj, dark_rc_subst_dict)
638
639     obj              = bld(features = 'subst')
640     obj.source       = [ 'ardour3_fonts.rc.in' ]
641     obj.target       = 'ardour3_light_fonts.rc'
642     obj.install_path = None
643     set_subst_dict(obj, light_rc_subst_dict)
644
645     obj              = bld(rule = autowaf.copyfile) 
646     obj.source       = [ 'ardour3_widget_list.rc' ]
647     obj.target       = 'ardour3_widgets.rc'
648     obj.install_path = None
649
650     obj = bld (rule = include_processor)
651     obj.source = [ 'ardour3_ui_dark.rc.pre' ]
652     # find and add all ##include dependencies as sources
653     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
654     obj.target = 'ardour3_ui_dark.rc'
655     obj.install_path = bld.env['CONFDIR']
656
657     obj = bld (rule = include_processor)
658     obj.source = [ 'ardour3_ui_light.rc.pre' ]
659     # find and add all ##include dependencies as sources
660     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
661     obj.target = 'ardour3_ui_light.rc'
662     obj.install_path = bld.env['CONFDIR']
663
664     # Menus
665     menus_argv = []
666     if bld.is_defined('GTKOSX'):
667         menus_argv = [ '-E', '-P', '-DGTKOSX' ]
668     else:
669         menus_argv = [ '-E', '-P' ]
670
671     # always build all versions of the menu definitions
672     # so that we can try them out with different program builds.
673     for program in [ 'ardour', 'trx' ]:
674         obj = bld(features = 'command-output')
675         obj.command = 'cpp'
676         obj.command_is_external = True
677         obj.no_inputs = True
678         obj.argv = menus_argv
679         obj.dep_vars = ['GTKOSX']
680         obj.stdin = program + '.menus.in'
681         obj.stdout = program + '.menus'
682         bld.install_files (bld.env['CONFDIR'], program + '.menus')
683
684     # Keybindings
685
686     # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
687     # 'SAE-us-nokeypad', 'ergonomic-us'
688
689     #
690     # explicitly state the use of perl here so that it works on windows too
691     # 
692     a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap <${SRC} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
693     for b in [ 'mnemonic-us' ] :
694         obj = bld(
695             target = b + '.bindings',
696             source = b + '.bindings.in',
697             rule = a_rule
698             )
699         obj.install_path = bld.env['CONFDIR']
700
701     # not modified at present
702     bld.install_files(bld.env['CONFDIR'], 'step_editing.bindings')
703     bld.install_files(bld.env['CONFDIR'], 'mixer.bindings')
704
705     # Icons/Images
706     bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
707     bld.install_files(os.path.join (bld.env['DATADIR'], 'pixmaps'), bld.path.ant_glob('pixmaps/*.xpm'))
708     bld.install_files(bld.env['DATADIR'], 'splash.png')
709     bld.install_files(bld.env['DATADIR'], 'small-splash.png')
710     bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
711
712     # Default UI configuration
713     bld.install_files(bld.env['CONFDIR'], 'ardour3_ui_default.conf')
714
715     # Default export stuff
716     bld.install_files(os.path.join(bld.env['CONFDIR'],' export'), bld.path.ant_glob('export/*.format'))
717
718     # i18n
719     if bld.is_defined('ENABLE_NLS'):
720         mo_files = bld.path.ant_glob('po/*.mo')
721         for mo in mo_files:
722             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
723             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
724                                         lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
725                            mo)
726
727 def i18n(bld):
728     autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
729                        'Paul Davis')
730
731 def i18n_pot(bld):
732     autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
733                        'Paul Davis')
734
735 def i18n_po(bld):
736     autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
737                        'Paul Davis')
738
739 def i18n_mo(bld):
740     autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
741                        'Paul Davis')