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