Merge branch 'master' into windows
[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         'gain_meter.cc',
107         'generic_pluginui.cc',
108         'ghostregion.cc',
109         'global_port_matrix.cc',
110         'group_tabs.cc',
111         'gtk-custom-hruler.c',
112         'gtk-custom-ruler.c',
113         'gtk_pianokeyboard.c',
114         'gui_object.cc',
115         'insert_time_dialog.cc',
116         'interthread_progress_window.cc',
117         'io_selector.cc',
118         'keyboard.cc',
119         'keyeditor.cc',
120         'latency_gui.cc',
121         'led.cc',
122         'level_meter.cc',
123         'lineset.cc',
124         'location_ui.cc',
125         'main.cc',
126         'main_clock.cc',
127         'marker.cc',
128         'midi_automation_line.cc',
129         'midi_channel_dialog.cc',
130         'midi_channel_selector.cc',
131         'midi_cut_buffer.cc',
132         'midi_export_dialog.cc',
133         'midi_list_editor.cc',
134         'midi_port_dialog.cc',
135         'midi_region_view.cc',
136         'midi_scroomer.cc',
137         'midi_selection.cc',
138         'midi_streamview.cc',
139         'midi_time_axis.cc',
140         'midi_tracer.cc',
141         'midi_velocity_dialog.cc',
142         'missing_file_dialog.cc',
143         'missing_plugin_dialog.cc',
144         'mixer_actor.cc',
145         'mixer_group_tabs.cc',
146         'mixer_strip.cc',
147         'mixer_ui.cc',
148         'meterbridge.cc',
149         'meter_strip.cc',
150         'meter_patterns.cc',
151         'monitor_section.cc',
152         'mono_panner.cc',
153         'mono_panner_editor.cc',
154         'mouse_cursors.cc',
155         'nag.cc',
156         'new_plugin_preset_dialog.cc',
157         'normalize_dialog.cc',
158         'note_player.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         '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         'search_path_option.cc',
203         'selection.cc',
204         'send_ui.cc',
205         'session_import_dialog.cc',
206         'session_metadata_dialog.cc',
207         'session_option_editor.cc',
208         'sfdb_ui.cc',
209         'shuttle_control.cc',
210         'simpleline.cc',
211         'simplerect.cc',
212         'splash.cc',
213         'speaker_dialog.cc',
214         'startup.cc',
215         'step_editor.cc',
216         'step_entry.cc',
217         'stereo_panner.cc',
218         'stereo_panner_editor.cc',
219         'streamview.cc',
220         'strip_silence_dialog.cc',
221         'tape_region_view.cc',
222         'tempo_dialog.cc',
223         'tempo_lines.cc',
224         'theme_manager.cc',
225         'time_axis_view.cc',
226         'time_axis_view_item.cc',
227         'time_fx_dialog.cc',
228         'time_info_box.cc',
229         'time_selection.cc',
230         'track_selection.cc',
231         'track_view_list.cc',
232         'transpose_dialog.cc',
233         'ui_config.cc',
234         'utils.cc',
235         'verbose_cursor.cc',
236         'version.cc',
237         'visibility_group.cc',
238         'volume_controller.cc',
239         'waveview.cc',
240         'window_manager.cc',
241 # video-timeline related sources:
242         'video_image_frame.cc',
243         'add_video_dialog.cc',
244         'editor_videotimeline.cc',
245         'video_timeline.cc',
246         'system_exec.cc',
247         'video_monitor.cc',
248         'transcode_ffmpeg.cc',
249         'transcode_video_dialog.cc',
250         'video_server_dialog.cc',
251         'utils_videotl.cc',
252         'export_video_dialog.cc',
253         'export_video_infobox.cc'
254 ]
255
256 def options(opt):
257     autowaf.set_options(opt)
258
259 def configure(conf):
260     conf.load('misc')
261     conf.load('compiler_cxx')
262     # we don't use hard-coded micro versions with ardour, so hard code it to zero
263     autowaf.build_version_files(
264         path_prefix + 'version.h',
265         path_prefix + 'version.cc',
266         'gtk2_ardour', conf.env['MAJOR'], conf.env['MINOR'], 0)
267     autowaf.configure(conf)
268
269     if Options.options.dist_target == 'auto':
270         if re.search ("linux", sys.platform) != None:
271             autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
272
273     # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
274
275     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
276                       atleast_version='1.2.1')
277     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
278                       atleast_version='2.10.1')
279     autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
280                       atleast_version='2.18')
281     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
282                       atleast_version='2.18')
283     autowaf.check_pkg(conf, 'libgnomecanvas-2.0',
284                       uselib_store='GNOMECANVAS', atleast_version='2.30')
285     autowaf.check_pkg(conf, 'libgnomecanvasmm-2.6',
286                       uselib_store='GNOMECANVASMM', atleast_version='2.16')
287     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
288     autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
289     autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
290
291     conf.write_config_header('gtk2ardour-config.h', remove=False)
292
293     # Boost headers
294     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
295     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
296
297 # Add a waf `feature' to allow compilation of things using winegcc
298 from waflib.TaskGen import feature
299 @feature("wine")
300 def set_winegcc(self):
301     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
302     self.env.CC = 'winegcc'
303
304 def _doPyp(infileName, deps = False):
305     outStr = ''
306     out = []
307     re_spaces = re.compile("\s+")
308
309     if infileName == '-':
310         fd = sys.stdin
311     else:
312         fd = open(infileName)
313     inLines = fd.readlines()
314     if fd != sys.stdin:
315         fd.close()
316         
317
318     for line in inLines:
319         bits = re_spaces.split(line)
320         if bits[0] == '##include':
321             incName = bits[1]
322             if (deps):
323                 out += [ incName ]
324             else:
325                 # assume included file comes from same place as source file
326                 incName = os.path.join (os.path.dirname (infileName), incName);
327                 outStr += _doPyp(incName)
328         else:
329             if not deps:
330                 outStr += line
331
332     # done
333     if deps:
334         return out
335     else:
336         return outStr
337
338 def include_processor(task):
339     infileName = task.inputs[0].srcpath()
340     outfileName = os.path.join(out, task.outputs[0].bldpath())
341     fdOut = open (outfileName, "w")
342     fdOut.write (_doPyp(infileName))
343     fdOut.close ()
344
345
346 def build_color_scheme(path, prefix):
347     f = open (path, 'r')
348     color_scheme = ''
349     for line in f:
350         if re.search ('^#@color', line):
351             line.strip() # remove newline
352             words = line.split()
353             if len(color_scheme):
354                 color_scheme += ';'
355             color_scheme += prefix
356             color_scheme += '_'
357             color_scheme += words[1]
358             color_scheme += ':'
359             color_scheme += words[2]
360     f.close()
361     return color_scheme
362
363 def build(bld):
364
365     VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
366
367     if bld.is_defined('WINDOWS_VST_SUPPORT'):
368         # If we require VST support we build a stub main() and the FST library
369         # here using winegcc, and link it to the GTK front-end library
370         obj = bld(features = 'cxx c cxxprogram wine')
371         obj.source = '''
372                 ../libs/fst/fst.c
373                 ../libs/fst/fstinfofile.c
374                 ../libs/fst/vsti.c
375                 ../libs/fst/vstwin.c
376                 ../vst/winmain.c
377         '''
378         obj.uselib = 'ALSA'
379         obj.use          = [ 'libpbd',
380                              'libmidipp',
381                              'libtaglib',
382                              'libardour',
383                              'libardour_cp',
384                              'libgtk2_ardour',
385                              'libgtkmm2ext',
386                              'libtaglib']
387         obj.target = 'ardour-' + bld.env['VERSION'] + '-vst.exe.so'
388         obj.includes  = [ '../libs/fst', '.' ]
389         obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
390         obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
391         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
392         # end of the wine executable
393
394         # now the shared library containing the GTK GUI for ardour
395         obj = bld (features = 'cxx c cxxshlib')
396         obj.source    = gtk2_ardour_sources
397         obj.includes  = [ '../libs/fst', '.' ]
398         obj.name      = 'libgtk2_ardour'
399         obj.target    = 'gtk2_ardour'
400     else:
401         # just the normal executable version of the GTK GUI
402         obj = bld(features = 'cxx c cxxprogram')
403         obj.source    = gtk2_ardour_sources
404         obj.target = 'ardour-' + bld.env['VERSION']
405         obj.includes = ['.']
406
407     # continue with setup of obj, which could be a shared library
408     # or an executable.
409
410     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
411
412     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG ALSA CURL DL'
413     obj.uselib       += ' GTKMM GNOMECANVASMM GNOMECANVAS '
414     obj.uselib       += ' AUDIOUNITS OSX GTKOSX LO '
415     obj.use          = [ 'libpbd',
416                          'libmidipp',
417                          'libtaglib',
418                          'ardour',
419                          'libardour_cp',
420                          'libgtkmm2ext',
421                          'libtaglib' ]
422     if bld.env['build_target'] == 'mingw':
423         if bld.env['DEBUG'] == False:
424             obj.linkflags = ['-mwindows']
425     if sys.platform == 'darwin':
426         obj.use += ' libappleutility'
427     obj.defines     = [
428         'PACKAGE="' + I18N_PACKAGE + '"',
429         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
430         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
431         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
432         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
433         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
434         ]
435     obj.includes += ['../libs']
436
437     if bld.is_defined('HAVE_SUIL'):
438         obj.source += [ 'lv2_plugin_ui.cc' ]
439         obj.use += [ 'SUIL' ]
440
441     if bld.is_defined('FREESOUND'):
442         obj.source +=  [ 'sfdb_freesound_mootcher.cc' ]
443         obj.defines += [ 'FREESOUND' ]
444
445     if bld.is_defined('NEED_INTL'):
446         obj.linkflags = ' -lintl'
447
448     if bld.is_defined('WINDOWS_VST_SUPPORT'):
449         obj.source += [ 'windows_vst_plugin_ui.cc' ]
450         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
451         obj.use += [ 'X11' ]
452         
453     if bld.is_defined('LXVST_SUPPORT'):
454         obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
455         obj.defines += [ 'LXVST_SUPPORT' ]
456         obj.use += [ 'X11' ]
457
458     if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
459         obj.source += [ 'vst_plugin_ui.cc' ]
460         
461     if bld.is_defined('PHONE_HOME'):
462         obj.defines += [ 'PHONE_HOME' ]
463
464     if bld.is_defined('HAVE_COREAUDIO'):
465         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
466         obj.source += [ 'cocoacarbon.mm' ]
467         obj.use += ' libappleutility '
468
469     if bld.is_defined('AUDIOUNIT_SUPPORT'):
470         obj.source += [ 'au_pluginui.mm' ]
471
472     # Wrappers
473
474     wrapper_subst_dict = {
475             'INSTALL_PREFIX' : bld.env['PREFIX'],
476             'LIBDIR'         : os.path.normpath(bld.env['LIBDIR']),
477             'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
478             'SYSCONFDIR'     : os.path.normpath(bld.env['SYSCONFDIR']),
479             'LIBS'           : 'build/libs',
480             'VERSION'        : bld.env['VERSION'],
481             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-' + bld.env['VERSION']
482     }
483
484     def set_subst_dict(obj, dict):
485         for i in dict:
486             setattr(obj, i, dict[i])
487
488     obj              = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
489     obj.source       = 'ardev_common.sh.in'
490     obj.target       = 'ardev_common_waf.sh'
491     obj.chmod        = Utils.O755
492     obj.dict         = wrapper_subst_dict
493     set_subst_dict(obj, wrapper_subst_dict)
494
495     obj              = bld(features = 'subst')
496     obj.source       = 'ardour.sh.in'
497     obj.target       = 'ardour3'
498     obj.chmod        = Utils.O755
499     obj.dict         = wrapper_subst_dict
500     obj.install_path = bld.env['BINDIR']
501     set_subst_dict(obj, wrapper_subst_dict)
502
503     if bld.is_defined('WINDOWS_VST_SUPPORT'):
504         obj              = bld(features = 'subst')
505         obj.source       = '../vst/ardourvst.in'
506         obj.target       = 'ardourvst3'
507         obj.chmod        = Utils.O755
508         obj.dict         = wrapper_subst_dict
509         obj.install_path = bld.env['BINDIR']
510         set_subst_dict(obj, wrapper_subst_dict)
511
512     # Font configuration
513
514     dark_rc_subst_dict = {}
515     light_rc_subst_dict = {}
516     font_sizes      = {}
517     base_font       = ""
518
519     # Set up font sizes
520     if bld.is_defined('GTKOSX'): # OS X fonts
521         basefont = ""
522         font_sizes = {
523                 'SMALLER' : '9',
524                 'SMALL' : '10',
525                 'NORMAL' : '11',
526                 'BIGGER' : '17',
527                 'LARGE' : '18',
528                 'LARGER' : '28',
529                 'HUGER' : '36',
530                 'MASSIVE' : '60',
531         }
532         
533         # There is no acceptable monospace font available on older versions of OS X
534         # and no API on those versions to load TTF files that will work with 
535         # GTK/fontconfig/pango.
536         #
537         # In addition, the ArdourMono font gets clipped for some reason on OS X
538         #
539         # Moreover, Lucida Grande just seems to work even though it is not monospace
540         # so just use it.
541         #
542         font_names = {
543             'MONOSPACE' : 'Lucida Grande',
544         }
545     else: # Linux/X11 fonts
546         basefont = '' # unspecified - use system defaults
547         font_sizes = {
548                 'SMALLER' : '8',
549                 'SMALL' : '9',
550                 'NORMAL' : '10',
551                 'BIGGER' : '17',
552                 'LARGE' : '18',
553                 'LARGER' : '24',
554                 'HUGER' : '34',
555                 'MASSIVE' : '60',
556         }
557         font_names = {
558                 'MONOSPACE' : 'ArdourMono',
559         }
560
561     # Set up font substitution dictionary
562     # @FONT_XXXX@
563     for style in ['', 'BOLD', 'ITALIC']:
564         for sizename,points in iter(font_sizes.items()):
565             if (len (style)):
566                 key = "_".join (['FONT',style,sizename])
567                 fontstyle = " ".join ([basefont,style.lower(),points])
568             else:
569                 key = "_".join (['FONT',sizename])
570                 fontstyle = " ".join ([basefont,points])
571
572             dark_rc_subst_dict[key] = fontstyle
573             light_rc_subst_dict[key] = fontstyle
574
575     # @FONT_SIZE_XXXX@
576     for sizename,points in iter(font_sizes.items()):
577             key = "_".join (['FONT_SIZE',sizename])
578             dark_rc_subst_dict[key] = points
579             light_rc_subst_dict[key] = points
580
581     # various font names, eg @BOLD_MONOSPACE@
582     for font_sym,text in iter(font_names.items()):
583         key = font_sym
584         dark_rc_subst_dict[key] = text
585         light_rc_subst_dict[key] = text
586
587     # RC files
588     dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
589         'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
590     dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
591     light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
592         'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
593     light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
594
595     obj              = bld(features = 'subst')
596     obj.source       = [ 'ardour3_ui_dark.rc.in' ]
597     obj.target       = 'ardour3_ui_dark.rc.pre'
598     obj.install_path = None
599     set_subst_dict(obj, dark_rc_subst_dict)
600
601     obj              = bld(features = 'subst')
602     obj.source       = [ 'ardour3_ui_light.rc.in' ]
603     obj.target       = 'ardour3_ui_light.rc.pre'
604     obj.install_path = None
605     set_subst_dict(obj, light_rc_subst_dict)
606
607     obj              = bld(features = 'subst')
608     obj.source       = [ 'ardour3_styles.rc.in' ]
609     obj.target       = 'ardour3_dark_styles.rc'
610     obj.install_path = None
611     set_subst_dict(obj, dark_rc_subst_dict)
612
613     obj              = bld(features = 'subst')
614     obj.source       = [ 'ardour3_styles.rc.in' ]
615     obj.target       = 'ardour3_light_styles.rc'
616     obj.install_path = None
617     set_subst_dict(obj, light_rc_subst_dict)
618
619     obj              = bld(features = 'subst')
620     obj.source       = [ 'ardour3_fonts.rc.in' ]
621     obj.target       = 'ardour3_dark_fonts.rc'
622     obj.install_path = None
623     set_subst_dict(obj, dark_rc_subst_dict)
624
625     obj              = bld(features = 'subst')
626     obj.source       = [ 'ardour3_fonts.rc.in' ]
627     obj.target       = 'ardour3_light_fonts.rc'
628     obj.install_path = None
629     set_subst_dict(obj, light_rc_subst_dict)
630
631     obj              = bld(rule = 'cp ${SRC} ${TGT}')
632     obj.source       = [ 'ardour3_widget_list.rc' ]
633     obj.target       = 'ardour3_widgets.rc'
634     obj.install_path = None
635
636     obj = bld (rule = include_processor)
637     obj.source = [ 'ardour3_ui_dark.rc.pre' ]
638     # find and add all ##include dependencies as sources
639     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
640     obj.target = 'ardour3_ui_dark.rc'
641     obj.install_path = '${SYSCONFDIR}/ardour3'
642
643     obj = bld (rule = include_processor)
644     obj.source = [ 'ardour3_ui_light.rc.pre' ]
645     # find and add all ##include dependencies as sources
646     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
647     obj.target = 'ardour3_ui_light.rc'
648     obj.install_path = '${SYSCONFDIR}/ardour3'
649
650     # Menus
651     menus_argv = []
652     if bld.is_defined('GTKOSX'):
653         menus_argv = [ '-E', '-P', '-DGTKOSX', '-DNOVIDEOTIMELINE' ]
654     else:
655         menus_argv = [ '-E', '-P' ]
656
657     obj = bld(features = 'command-output')
658     obj.command = 'cpp'
659     obj.command_is_external = True
660     obj.no_inputs = True
661     obj.argv = menus_argv
662     obj.stdin = 'ardour.menus.in'
663     obj.stdout = 'ardour.menus'
664     obj.dep_vars = ['GTKOSX']
665     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
666                       'ardour.menus')
667
668     # Keybindings
669
670     # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
671     # 'SAE-us-nokeypad', 'ergonomic-us'
672
673     for b in [ 'mnemonic-us' ] :
674         obj = bld(
675             target = b + '.bindings',
676             source = b + '.bindings.in',
677             rule = '../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap <${SRC} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
678             )
679         obj.install_path = os.path.join(bld.env['SYSCONFDIR'], 'ardour3')
680
681     # not modified at present
682     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
683                       'step_editing.bindings')
684     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
685                       'mixer.bindings')
686
687     # Icons/Images
688     bld.install_files('${DATADIR}/ardour3/icons', bld.path.ant_glob('icons/*.png'))
689     bld.install_files('${DATADIR}/ardour3/pixmaps', bld.path.ant_glob('pixmaps/*.xpm'))
690     bld.install_files('${DATADIR}/ardour3', 'splash.png')
691     bld.install_files('${DATADIR}/ardour3', 'ArdourMono.ttf')
692
693     # Default UI configuration
694     bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_ui_default.conf')
695
696     # Default export stuff
697     bld.install_files('${SYSCONFDIR}/ardour3/export', bld.path.ant_glob('export/*.format'))
698
699     # i18n
700     if bld.is_defined('ENABLE_NLS'):
701         mo_files = bld.path.ant_glob('po/*.mo')
702         for mo in mo_files:
703             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
704             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
705                                         lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
706                            mo)
707
708 def i18n(bld):
709     autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
710                        'Paul Davis')
711
712 def i18n_pot(bld):
713     autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
714                        'Paul Davis')
715
716 def i18n_po(bld):
717     autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
718                        'Paul Davis')
719
720 def i18n_mo(bld):
721     autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
722                        'Paul Davis')