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