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