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