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