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