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