2 from waflib.extras import autowaf as autowaf
3 from waflib import Options, TaskGen
4 import waflib.Logs as Logs, waflib.Utils as Utils
10 from waflib.Task import Task
11 from waflib.Tools import winres
20 from waflib import TaskGen
21 @TaskGen.extension('.m')
22 def m_hook(self, node):
23 """Alias .m files to be compiled the same as .c files, gcc will do the right thing."""
24 return self.create_compiled_task('c', node)
26 path_prefix = 'gtk2_ardour/'
28 gtk2_ardour_sources = [
31 'add_route_dialog.cc',
32 'ambiguous_file_dialog.cc',
43 'ardour_ui_dependents.cc',
44 'ardour_ui_dialogs.cc',
47 'ardour_ui_options.cc',
50 'audio_region_editor.cc',
51 'audio_region_view.cc',
52 'audio_streamview.cc',
54 'automation_controller.cc',
56 'automation_region_view.cc',
57 'automation_streamview.cc',
58 'automation_time_axis.cc',
60 'big_clock_window.cc',
64 'color_theme_manager.cc',
67 'control_point_dialog.cc',
68 'control_slave_ui.cc',
72 'duplicate_routes_dialog.cc',
73 'edit_note_dialog.cc',
77 'editor_audio_import.cc',
78 'editor_pt_import.cc',
79 'editor_audiotrack.cc',
81 'editor_canvas_events.cc',
82 'editor_component.cc',
85 'editor_route_groups.cc',
86 'editor_export_audio.cc',
87 'editor_group_tabs.cc',
89 'editor_locations.cc',
97 'editor_selection.cc',
98 'editor_snapshots.cc',
100 'editor_tempodisplay.cc',
104 'export_channel_selector.cc',
106 'export_file_notebook.cc',
107 'export_filename_selector.cc',
108 'export_format_dialog.cc',
109 'export_format_selector.cc',
110 'export_preset_selector.cc',
112 'export_timespan_selector.cc',
116 'floating_text_entry.cc',
117 'sfdb_freesound_mootcher.cc',
119 'generic_pluginui.cc',
121 'global_port_matrix.cc',
123 'gtk_pianokeyboard.c',
126 'insert_remove_time_dialog.cc',
127 'instrument_selector.cc',
128 'interthread_progress_window.cc',
137 'lua_script_manager.cc',
144 'midi_automation_line.cc',
145 'midi_channel_dialog.cc',
146 'midi_channel_selector.cc',
147 'midi_cut_buffer.cc',
148 'midi_export_dialog.cc',
149 'midi_list_editor.cc',
150 'midi_region_view.cc',
153 'midi_streamview.cc',
156 'midi_velocity_dialog.cc',
158 'missing_file_dialog.cc',
159 'missing_plugin_dialog.cc',
160 'mixer_group_tabs.cc',
166 'monitor_section.cc',
167 'monitor_selector.cc',
169 'mono_panner_editor.cc',
172 'new_plugin_preset_dialog.cc',
173 'normalize_dialog.cc',
177 'note_select_dialog.cc',
184 'panner_interface.cc',
187 'piano_roll_header.cc',
189 'playlist_selector.cc',
191 'plugin_pin_dialog.cc',
192 'plugin_setup_dialog.cc',
193 'plugin_selector.cc',
198 'port_matrix_body.cc',
199 'port_matrix_column_labels.cc',
200 'port_matrix_component.cc',
201 'port_matrix_grid.cc',
202 'port_matrix_labels.cc',
203 'port_matrix_row_labels.cc',
205 'processor_selection.cc',
206 'patch_change_dialog.cc',
207 'progress_reporter.cc',
210 'quantize_dialog.cc',
211 'rc_option_editor.cc',
213 'region_gain_line.cc',
214 'region_layering_order_editor.cc',
215 'region_selection.cc',
219 'route_group_dialog.cc',
220 'route_group_menu.cc',
221 'route_params_ui.cc',
222 'route_processor_selection.cc',
223 'route_time_axis.cc',
227 'search_path_option.cc',
228 'script_selector.cc',
230 'selection_memento.cc',
232 'session_archive_dialog.cc',
234 'session_import_dialog.cc',
235 'session_metadata_dialog.cc',
236 'session_option_editor.cc',
238 'shuttle_control.cc',
239 'soundcloud_export_selector.cc',
246 'stereo_panner_editor.cc',
248 'strip_silence_dialog.cc',
249 'stripable_colorpicker.cc',
250 'stripable_time_axis.cc',
252 'tape_region_view.cc',
253 'template_dialog.cc',
258 'time_axis_view_item.cc',
264 'track_selection.cc',
265 'track_view_list.cc',
266 'transform_dialog.cc',
267 'transpose_dialog.cc',
270 'vca_master_strip.cc',
272 'visibility_group.cc',
274 # video-timeline related sources:
275 'video_image_frame.cc',
276 'add_video_dialog.cc',
277 'editor_videotimeline.cc',
281 'transcode_ffmpeg.cc',
282 'transcode_video_dialog.cc',
283 'video_server_dialog.cc',
285 'export_video_dialog.cc',
286 'export_video_infobox.cc',
287 'video_tool_paths.cc'
290 def enoify (major, minor):
291 # Code names based on
292 # https://en.wikipedia.org/wiki/Brian_Eno_discography
294 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
295 # (no Singles, no EPs, no Video Albums, no Production)
297 return "\\n\\\"E-No\\\""
300 return "\\n\\\"No Pussyfooting\\\""
302 return "\\n\\\"Here Come the Warm Jets\\\""
304 return "\\n\\\"Taking Tiger Mountain\\\""
306 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
308 return "\\n\\\"Discreet Music\\\""
310 return "\\n\\\"Another Green World\\\""
312 return "\\n\\\"Evening Star\\\""
314 return "\\n\\\"Cluster and Eno\\\""
317 return "\\n\\\"Before and After Science\\\""
319 return "\\n\\\"After the Heat\\\""
321 return "\\n\\\"Music for Airports\\\""
323 return "\\n\\\"Music for Films\\\""
325 return "\\n\\\"In a Land of Clear Colours\\\""
327 return "\\n\\\"The Plateaux of Mirror\\\""
329 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
331 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
333 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
335 return "\\n\\\"On Land\\\"" # 1982
336 elif minor == 10: # 6.0 ??
337 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
339 return "\\n\\\"More Music for Films\\\"" # 1983
341 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
343 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
345 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
349 autowaf.set_options(opt)
353 conf.load('compiler_cxx')
354 autowaf.configure(conf)
356 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
358 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
360 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
361 atleast_version='3.3.5', mandatory=False)
362 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
363 atleast_version='1.2.1')
364 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
365 atleast_version='2.10.1')
366 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
367 atleast_version='2.18')
368 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
369 atleast_version='2.18')
370 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
371 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
372 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
373 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
376 if sys.platform == 'darwin':
377 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
378 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
379 env = conf.env.derive (),
382 compile_filename='test.m',
387 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
388 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
390 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
392 conf.write_config_header('gtk2ardour-config.h', remove=False)
394 bak = conf.env['define_key']
395 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
396 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
397 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
398 conf.write_config_header('gtk2ardour-version.h')
399 conf.env['define_key'] = bak;
402 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
403 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
405 # Add a waf `feature' to allow compilation of things using winegcc
406 from waflib.TaskGen import feature
408 def set_winegcc(self):
409 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
410 self.env.CC = 'winegcc'
412 def _doPyp(infileName, deps = False):
415 re_spaces = re.compile("\s+")
417 if infileName == '-':
420 fd = open(infileName)
421 inLines = fd.readlines()
427 bits = re_spaces.split(line)
428 if bits[0] == '##include':
433 # assume included file comes from same place as source file
434 incName = os.path.join (os.path.dirname (infileName), incName);
435 outStr += _doPyp(incName)
446 def include_processor(task):
447 infileName = task.inputs[0].srcpath()
448 outfileName = os.path.join(out, task.outputs[0].bldpath())
449 fdOut = open (outfileName, "w")
450 fdOut.write (_doPyp(infileName))
454 def build_color_scheme(path, prefix):
458 if re.search ('^#@color', line):
459 line.strip() # remove newline
461 if len(color_scheme):
463 color_scheme += prefix
465 color_scheme += words[1]
467 color_scheme += words[2]
473 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
474 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
476 # Tool to dump lua-bindings (of gtk2ardour + libs)
477 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
478 obj = bld (features = 'cxx c cxxprogram')
479 obj.install_path = None
480 obj.source = list(gtk2_ardour_sources)
481 obj.target = 'luadoc'
482 obj.includes = ['.', '../libs']
483 obj.ldflags = ['-no-undefined']
496 'PACKAGE="' + I18N_PACKAGE + '"',
497 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
498 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
499 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
502 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
503 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
504 if bld.is_defined('HAVE_SUIL'):
505 obj.source += [ 'lv2_plugin_ui.cc' ]
506 obj.use += [ 'SUIL' ]
507 if bld.is_defined('LXVST_SUPPORT'):
508 obj.source += [ 'vst_plugin_ui.cc' ]
509 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
510 obj.defines += [ 'LXVST_SUPPORT' ]
513 # Tool to test libcanvas
514 if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
515 obj = bld (features = 'cxx c cxxprogram')
516 obj.install_path = None
517 obj.source = list(gtk2_ardour_sources)
518 obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
519 obj.target = 'canvas_test'
520 obj.includes = ['.', '../libs']
521 obj.ldflags = ['-no-undefined']
534 'PACKAGE="' + I18N_PACKAGE + '"',
535 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
536 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
537 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
540 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
541 # obj.source += [ 'canvas_test.cc', ]
542 obj.source += [ 'toolbar_test.cc', 'enums.cc']
545 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
546 # Windows VST support w/wine
547 # If we require VST support we build a stub main() and the FST library
548 # here using winegcc, and link it to the GTK front-end library
549 obj = bld (features = 'cxx c cxxprogram wine')
550 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
552 # XXX do we really need to explicitly link to all of these for the wine executable?
554 obj.use = [ 'libpbd',
565 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
566 obj.includes = [ '../libs/fst', '.' ]
567 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
568 obj.linkflags += bld.env['LDFLAGS']
569 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
570 obj.install_path = bld.env['DLLDIR']
571 # end of the wine executable
573 # now the shared library containing the GTK GUI for ardour
574 obj = bld (features = 'cxx c cxxshlib')
575 # operate on copy to avoid adding sources twice
576 obj.source = list(gtk2_ardour_sources)
577 obj.includes = [ '../libs/fst', '.' ]
578 obj.name = 'libgtk2_ardour'
579 obj.target = 'gtk2_ardour'
580 obj.cflags = [ '-fPIC' ]
583 # just the normal executable version of the GTK GUI
584 if bld.env['build_target'] == 'mingw':
585 obj = bld (features = 'cxx c cxxprogram winres')
587 obj = bld (features = 'cxx c cxxprogram')
588 # operate on copy to avoid adding sources twice
589 obj.source = list(gtk2_ardour_sources)
590 obj.target = 'ardour-' + str (bld.env['VERSION'])
592 obj.ldflags = ['-no-undefined']
594 if bld.is_defined('WINDOWS_VST_SUPPORT'):
595 # Windows VST support mingw
596 obj.includes += [ '../libs/fst' ]
598 # at this point, "obj" refers to either the normal native executable
599 # OR the shared library built for use with wine on linux.
601 obj.use = [ 'libpbd',
612 'PACKAGE="' + I18N_PACKAGE + '"',
613 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
614 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
615 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
617 obj.install_path = bld.env['DLLDIR']
619 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
621 if sys.platform == 'darwin':
622 obj.uselib += ' AUDIOUNITS OSX '
623 obj.use += ' libappleutility'
624 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
625 elif bld.env['build_target'] == 'mingw':
626 obj.source += [ 'bundle_env_mingw.cc' ]
627 obj.source += [ 'windows_icon.rc' ]
629 obj.source += [ 'bundle_env_linux.cc' ]
631 obj.includes += ['../libs']
633 obj.use += 'libptformat'
635 if bld.env['build_target'] == 'mingw':
636 obj.linkflags += ' -mwindows'
637 obj.use += [ 'PANGOFT2' ]
639 if bld.is_defined('HAVE_SUIL'):
640 obj.source += [ 'lv2_plugin_ui.cc' ]
641 obj.use += [ 'SUIL' ]
643 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
644 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
646 if bld.is_defined('NEED_INTL'):
647 obj.linkflags += ' -lintl'
649 if bld.is_defined('WINDOWS_VST_SUPPORT'):
650 obj.source += [ 'windows_vst_plugin_ui.cc' ]
651 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
652 if bld.env['build_target'] != 'mingw':
655 if bld.is_defined('LXVST_SUPPORT'):
656 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
657 obj.defines += [ 'LXVST_SUPPORT' ]
660 if bld.is_defined('MACVST_SUPPORT'):
661 obj.source += [ 'mac_vst_plugin_ui.mm' ]
662 obj.defines += [ 'MACVST_SUPPORT' ]
664 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
665 obj.source += [ 'vst_plugin_ui.cc' ]
667 if bld.is_defined('PHONE_HOME'):
668 obj.defines += [ 'PHONE_HOME' ]
670 if bld.is_defined('HAVE_COREAUDIO'):
671 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
672 obj.use += ' libappleutility '
674 if bld.is_defined('AUDIOUNIT_SUPPORT'):
675 obj.source += [ 'au_pluginui.mm' ]
679 wrapper_subst_dict = {
680 'INSTALL_PREFIX' : bld.env['PREFIX'],
681 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
682 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
683 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
684 'LIBS' : 'build/libs',
685 'VERSION' : str (bld.env['VERSION']),
686 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
689 def set_subst_dict(obj, dict):
691 setattr(obj, i, dict[i])
693 obj = bld(features = 'subst')
694 obj.source = 'ardev_common.sh.in'
695 obj.target = 'ardev_common_waf.sh'
696 obj.chmod = Utils.O755
697 obj.dict = wrapper_subst_dict
698 set_subst_dict(obj, wrapper_subst_dict)
700 obj = bld(features = 'subst')
701 obj.source = 'ardour.sh.in'
702 obj.target = 'ardour' + str (bld.env['MAJOR'])
703 obj.chmod = Utils.O755
704 obj.dict = wrapper_subst_dict
705 obj.install_path = bld.env['BINDIR']
706 set_subst_dict(obj, wrapper_subst_dict)
708 if bld.is_defined('WINDOWS_VST_SUPPORT'):
709 obj = bld(features = 'subst')
710 obj.source = '../vst/ardourvst.in'
711 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
712 obj.chmod = Utils.O755
713 obj.dict = wrapper_subst_dict
714 obj.install_path = bld.env['BINDIR']
715 set_subst_dict(obj, wrapper_subst_dict)
724 if sys.platform == 'darwin':
738 # There is no acceptable monospace font available on older versions of OS X
739 # and no API on those versions to load TTF files that will work with
740 # GTK/fontconfig/pango.
742 # In addition, the ArdourMono font gets clipped for some reason on OS X
744 # Moreover, Lucida Grande just seems to work even though it is not monospace
748 'MONOSPACE' : 'Monaco',
749 'CLOCKFONT' : 'Lucida Grande',
751 else: # Linux/X11 fonts
752 basefont = '' # unspecified - use system defaults
765 'MONOSPACE' : 'ArdourMono',
766 'CLOCKFONT' : 'ArdourMono',
769 # Set up font substitution dictionary
771 for style in ['', 'BOLD', 'ITALIC']:
772 for sizename,points in iter(font_sizes.items()):
774 key = "_".join (['FONT',style,sizename])
775 fontstyle = " ".join ([basefont,style.lower(),points])
777 key = "_".join (['FONT',sizename])
778 fontstyle = " ".join ([basefont,points])
780 font_subst_dict[key] = fontstyle
783 for sizename,points in iter(font_sizes.items()):
784 key = "_".join (['FONT_SIZE',sizename])
785 font_subst_dict[key] = points
787 # various font names, eg @BOLD_MONOSPACE@
788 for font_sym,text in iter(font_names.items()):
790 font_subst_dict[key] = text
794 obj = bld(features = 'subst')
795 obj.source = [ 'clearlooks.rc.in' ]
796 obj.target = 'clearlooks.rc'
797 obj.install_path = bld.env['CONFDIR']
798 set_subst_dict(obj, font_subst_dict)
800 obj = bld(features = 'subst')
801 obj.source = [ 'default_ui_config.in' ]
802 obj.target = 'default_ui_config'
803 obj.install_path = bld.env['CONFDIR']
804 set_subst_dict(obj, font_subst_dict)
808 if sys.platform == 'darwin':
809 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
811 menus_argv = [ '-E', '-P' ]
813 if bld.is_defined('PTFORMAT'):
814 menus_argv += [ '-DPTFORMAT' ]
816 # always build all versions of the menu definitions
817 # so that we can try them out with different program builds.
818 for program in [ 'ardour', 'trx' ]:
819 obj = bld(features = 'command-output')
821 obj.command_is_external = True
823 obj.argv = menus_argv
824 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
825 obj.stdin = program + '.menus.in'
826 obj.stdout = program + '.menus'
827 bld.install_files (bld.env['CONFDIR'], program + '.menus')
830 freedesktop_subst_dict = {
831 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
832 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
833 'VERSION': str (bld.env['VERSION']),
836 if bld.env['FREEDESKTOP']:
837 obj = bld(features = 'subst')
838 obj.source = 'ardour.desktop.in'
839 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
840 obj.chmod = Utils.O644
841 obj.dict = freedesktop_subst_dict
842 set_subst_dict(obj, freedesktop_subst_dict)
844 obj = bld(features = 'subst')
845 obj.source = 'ardour-mime-info.xml'
846 obj.target = 'ardour.xml'
847 obj.chmod = Utils.O644
849 # build appdata with translations
851 appdata_i18n_xmlin(bld)
852 obj = bld(features = 'subst')
853 obj.source = 'ardour.appdata.xml.in'
854 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
855 obj.chmod = Utils.O644
856 obj.dict = freedesktop_subst_dict
857 set_subst_dict(obj, freedesktop_subst_dict)
861 # NATIVE ARDOUR BINDING FILES
862 # explicitly state the use of perl here so that it works on windows too
864 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
865 for b in [ 'ardour' ] :
867 target = b + '.keys',
868 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
871 obj.install_path = bld.env['CONFDIR']
874 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
875 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
877 # Application/Product specific resources (icon, splash)
878 pgmname = bld.env['PROGRAM_NAME']
879 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
881 if bld.env['build_target'] == 'mingw':
882 # These icons need to overwrite the files already installed in the icons
883 # directory above. Do this in the external packaging scripts for now.
884 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
885 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
887 # Default UI configuration
888 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
889 # Color Themes. Find each color file for this program only
891 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
893 # Default export stuff
894 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
897 if bld.is_defined('ENABLE_NLS'):
898 mo_files = bld.path.ant_glob('po/*.mo')
900 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
901 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
905 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
906 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
908 appdata_i18n_pot(bld)
912 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
913 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
915 appdata_i18n_pot(bld)
918 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
919 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
924 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
925 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
928 def appdata_i18n_pot(bld):
929 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
930 'ardour.appdata.pot')
931 if bld.cmd == 'i18n_pot':
932 Logs.info('Generating pot file from Ardour appdata')
933 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
934 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
935 'ardour.appdata.xml.in.in')
936 Logs.info('Updating ' + potfile)
938 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
940 print ('Error processing appdata pot file - ignored')
941 elif bld.cmd == 'clean' and os.path.exists(potfile):
942 Logs.info('Removing Ardour appdata pot file')
945 def appdata_i18n_po(bld):
946 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
947 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
949 def appdata_i18n_mo(bld):
950 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
951 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
953 def appdata_i18n_xmlin(bld):
954 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
955 'ardour.appdata.xml.in')
956 if bld.cmd == 'build':
957 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
958 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
959 'ardour.appdata.xml.in.in')
960 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
961 mo_files = glob.glob(mo_glob)
962 Logs.info('Generating ' + adxmlinfile)
963 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
964 '-j', adxmlininfile] + mo_files)
965 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
966 Logs.info('Removing ' + adxmlinfile)
967 os.remove(adxmlinfile)