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