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',
257 'time_axis_view_item.cc',
263 'track_selection.cc',
264 'track_view_list.cc',
265 'transform_dialog.cc',
266 'transpose_dialog.cc',
269 'vca_master_strip.cc',
271 'visibility_group.cc',
273 # video-timeline related sources:
274 'video_image_frame.cc',
275 'add_video_dialog.cc',
276 'editor_videotimeline.cc',
280 'transcode_ffmpeg.cc',
281 'transcode_video_dialog.cc',
282 'video_server_dialog.cc',
284 'export_video_dialog.cc',
285 'export_video_infobox.cc',
286 'video_tool_paths.cc'
289 def enoify (major, minor):
290 # Code names based on
291 # https://en.wikipedia.org/wiki/Brian_Eno_discography
293 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
294 # (no Singles, no EPs, no Video Albums, no Production)
296 return "\\n\\\"E-No\\\""
299 return "\\n\\\"No Pussyfooting\\\""
301 return "\\n\\\"Here Come the Warm Jets\\\""
303 return "\\n\\\"Taking Tiger Mountain\\\""
305 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
307 return "\\n\\\"Discreet Music\\\""
309 return "\\n\\\"Another Green World\\\""
311 return "\\n\\\"Evening Star\\\""
313 return "\\n\\\"Cluster and Eno\\\""
316 return "\\n\\\"Before and After Science\\\""
318 return "\\n\\\"After the Heat\\\""
320 return "\\n\\\"Music for Airports\\\""
322 return "\\n\\\"Music for Films\\\""
324 return "\\n\\\"In a Land of Clear Colours\\\""
326 return "\\n\\\"The Plateaux of Mirror\\\""
328 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
330 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
332 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
334 return "\\n\\\"On Land\\\"" # 1982
335 elif minor == 10: # 6.0 ??
336 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
338 return "\\n\\\"More Music for Films\\\"" # 1983
340 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
342 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
344 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
348 autowaf.set_options(opt)
352 conf.load('compiler_cxx')
353 autowaf.configure(conf)
355 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
357 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
359 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
360 atleast_version='3.3.5', mandatory=False)
361 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
362 atleast_version='1.2.1')
363 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
364 atleast_version='2.10.1')
365 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
366 atleast_version='2.18')
367 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
368 atleast_version='2.18')
369 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
370 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
371 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
372 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
375 if sys.platform == 'darwin':
376 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
377 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
378 env = conf.env.derive (),
381 compile_filename='test.m',
386 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
387 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
389 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
391 conf.write_config_header('gtk2ardour-config.h', remove=False)
393 bak = conf.env['define_key']
394 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
395 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
396 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
397 conf.write_config_header('gtk2ardour-version.h')
398 conf.env['define_key'] = bak;
401 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
402 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
404 # Add a waf `feature' to allow compilation of things using winegcc
405 from waflib.TaskGen import feature
407 def set_winegcc(self):
408 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
409 self.env.CC = 'winegcc'
411 def _doPyp(infileName, deps = False):
414 re_spaces = re.compile("\s+")
416 if infileName == '-':
419 fd = open(infileName)
420 inLines = fd.readlines()
426 bits = re_spaces.split(line)
427 if bits[0] == '##include':
432 # assume included file comes from same place as source file
433 incName = os.path.join (os.path.dirname (infileName), incName);
434 outStr += _doPyp(incName)
445 def include_processor(task):
446 infileName = task.inputs[0].srcpath()
447 outfileName = os.path.join(out, task.outputs[0].bldpath())
448 fdOut = open (outfileName, "w")
449 fdOut.write (_doPyp(infileName))
453 def build_color_scheme(path, prefix):
457 if re.search ('^#@color', line):
458 line.strip() # remove newline
460 if len(color_scheme):
462 color_scheme += prefix
464 color_scheme += words[1]
466 color_scheme += words[2]
472 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
473 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
475 # Tool to dump lua-bindings (of gtk2ardour + libs)
476 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
477 obj = bld (features = 'cxx c cxxprogram')
478 obj.install_path = None
479 obj.source = list(gtk2_ardour_sources)
480 obj.target = 'luadoc'
481 obj.includes = ['.', '../libs']
482 obj.ldflags = ['-no-undefined']
495 'PACKAGE="' + I18N_PACKAGE + '"',
496 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
497 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
498 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
501 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
502 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
503 if bld.is_defined('HAVE_SUIL'):
504 obj.source += [ 'lv2_plugin_ui.cc' ]
505 obj.use += [ 'SUIL' ]
506 if bld.is_defined('LXVST_SUPPORT'):
507 obj.source += [ 'vst_plugin_ui.cc' ]
508 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
509 obj.defines += [ 'LXVST_SUPPORT' ]
512 # Tool to test libcanvas
513 if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
514 obj = bld (features = 'cxx c cxxprogram')
515 obj.install_path = None
516 obj.source = list(gtk2_ardour_sources)
517 obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
518 obj.target = 'canvas_test'
519 obj.includes = ['.', '../libs']
520 obj.ldflags = ['-no-undefined']
533 'PACKAGE="' + I18N_PACKAGE + '"',
534 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
535 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
536 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
539 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
540 # obj.source += [ 'canvas_test.cc', ]
541 obj.source += [ 'toolbar_test.cc', 'enums.cc']
544 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
545 # Windows VST support w/wine
546 # If we require VST support we build a stub main() and the FST library
547 # here using winegcc, and link it to the GTK front-end library
548 obj = bld (features = 'cxx c cxxprogram wine')
549 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
551 # XXX do we really need to explicitly link to all of these for the wine executable?
553 obj.use = [ 'libpbd',
564 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
565 obj.includes = [ '../libs/fst', '.' ]
566 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
567 obj.linkflags += bld.env['LDFLAGS']
568 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
569 obj.install_path = bld.env['DLLDIR']
570 # end of the wine executable
572 # now the shared library containing the GTK GUI for ardour
573 obj = bld (features = 'cxx c cxxshlib')
574 # operate on copy to avoid adding sources twice
575 obj.source = list(gtk2_ardour_sources)
576 obj.includes = [ '../libs/fst', '.' ]
577 obj.name = 'libgtk2_ardour'
578 obj.target = 'gtk2_ardour'
579 obj.cflags = [ '-fPIC' ]
582 # just the normal executable version of the GTK GUI
583 if bld.env['build_target'] == 'mingw':
584 obj = bld (features = 'cxx c cxxprogram winres')
586 obj = bld (features = 'cxx c cxxprogram')
587 # operate on copy to avoid adding sources twice
588 obj.source = list(gtk2_ardour_sources)
589 obj.target = 'ardour-' + str (bld.env['VERSION'])
591 obj.ldflags = ['-no-undefined']
593 if bld.is_defined('WINDOWS_VST_SUPPORT'):
594 # Windows VST support mingw
595 obj.includes += [ '../libs/fst' ]
597 # at this point, "obj" refers to either the normal native executable
598 # OR the shared library built for use with wine on linux.
600 obj.use = [ 'libpbd',
611 'PACKAGE="' + I18N_PACKAGE + '"',
612 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
613 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
614 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
616 obj.install_path = bld.env['DLLDIR']
618 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
620 if sys.platform == 'darwin':
621 obj.uselib += ' AUDIOUNITS OSX '
622 obj.use += ' libappleutility'
623 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
624 elif bld.env['build_target'] == 'mingw':
625 obj.source += [ 'bundle_env_mingw.cc' ]
626 obj.source += [ 'windows_icon.rc' ]
628 obj.source += [ 'bundle_env_linux.cc' ]
630 obj.includes += ['../libs']
632 obj.use += 'libptformat'
634 if bld.env['build_target'] == 'mingw':
635 obj.linkflags += ' -mwindows'
636 obj.use += [ 'PANGOFT2' ]
638 if bld.is_defined('HAVE_SUIL'):
639 obj.source += [ 'lv2_plugin_ui.cc' ]
640 obj.use += [ 'SUIL' ]
642 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
643 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
645 if bld.is_defined('NEED_INTL'):
646 obj.linkflags += ' -lintl'
648 if bld.is_defined('WINDOWS_VST_SUPPORT'):
649 obj.source += [ 'windows_vst_plugin_ui.cc' ]
650 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
651 if bld.env['build_target'] != 'mingw':
654 if bld.is_defined('LXVST_SUPPORT'):
655 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
656 obj.defines += [ 'LXVST_SUPPORT' ]
659 if bld.is_defined('MACVST_SUPPORT'):
660 obj.source += [ 'mac_vst_plugin_ui.mm' ]
661 obj.defines += [ 'MACVST_SUPPORT' ]
663 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
664 obj.source += [ 'vst_plugin_ui.cc' ]
666 if bld.is_defined('PHONE_HOME'):
667 obj.defines += [ 'PHONE_HOME' ]
669 if bld.is_defined('HAVE_COREAUDIO'):
670 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
671 obj.use += ' libappleutility '
673 if bld.is_defined('AUDIOUNIT_SUPPORT'):
674 obj.source += [ 'au_pluginui.mm' ]
678 wrapper_subst_dict = {
679 'INSTALL_PREFIX' : bld.env['PREFIX'],
680 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
681 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
682 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
683 'LIBS' : 'build/libs',
684 'VERSION' : str (bld.env['VERSION']),
685 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
688 def set_subst_dict(obj, dict):
690 setattr(obj, i, dict[i])
692 obj = bld(features = 'subst')
693 obj.source = 'ardev_common.sh.in'
694 obj.target = 'ardev_common_waf.sh'
695 obj.chmod = Utils.O755
696 obj.dict = wrapper_subst_dict
697 set_subst_dict(obj, wrapper_subst_dict)
699 obj = bld(features = 'subst')
700 obj.source = 'ardour.sh.in'
701 obj.target = 'ardour' + str (bld.env['MAJOR'])
702 obj.chmod = Utils.O755
703 obj.dict = wrapper_subst_dict
704 obj.install_path = bld.env['BINDIR']
705 set_subst_dict(obj, wrapper_subst_dict)
707 if bld.is_defined('WINDOWS_VST_SUPPORT'):
708 obj = bld(features = 'subst')
709 obj.source = '../vst/ardourvst.in'
710 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
711 obj.chmod = Utils.O755
712 obj.dict = wrapper_subst_dict
713 obj.install_path = bld.env['BINDIR']
714 set_subst_dict(obj, wrapper_subst_dict)
723 if sys.platform == 'darwin':
737 # There is no acceptable monospace font available on older versions of OS X
738 # and no API on those versions to load TTF files that will work with
739 # GTK/fontconfig/pango.
741 # In addition, the ArdourMono font gets clipped for some reason on OS X
743 # Moreover, Lucida Grande just seems to work even though it is not monospace
747 'MONOSPACE' : 'Monaco',
748 'CLOCKFONT' : 'Lucida Grande',
750 else: # Linux/X11 fonts
751 basefont = '' # unspecified - use system defaults
764 'MONOSPACE' : 'ArdourMono',
765 'CLOCKFONT' : 'ArdourMono',
768 # Set up font substitution dictionary
770 for style in ['', 'BOLD', 'ITALIC']:
771 for sizename,points in iter(font_sizes.items()):
773 key = "_".join (['FONT',style,sizename])
774 fontstyle = " ".join ([basefont,style.lower(),points])
776 key = "_".join (['FONT',sizename])
777 fontstyle = " ".join ([basefont,points])
779 font_subst_dict[key] = fontstyle
782 for sizename,points in iter(font_sizes.items()):
783 key = "_".join (['FONT_SIZE',sizename])
784 font_subst_dict[key] = points
786 # various font names, eg @BOLD_MONOSPACE@
787 for font_sym,text in iter(font_names.items()):
789 font_subst_dict[key] = text
793 obj = bld(features = 'subst')
794 obj.source = [ 'clearlooks.rc.in' ]
795 obj.target = 'clearlooks.rc'
796 obj.install_path = bld.env['CONFDIR']
797 set_subst_dict(obj, font_subst_dict)
799 obj = bld(features = 'subst')
800 obj.source = [ 'default_ui_config.in' ]
801 obj.target = 'default_ui_config'
802 obj.install_path = bld.env['CONFDIR']
803 set_subst_dict(obj, font_subst_dict)
807 if sys.platform == 'darwin':
808 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
810 menus_argv = [ '-E', '-P' ]
812 if bld.is_defined('PTFORMAT'):
813 menus_argv += [ '-DPTFORMAT' ]
815 # always build all versions of the menu definitions
816 # so that we can try them out with different program builds.
817 for program in [ 'ardour', 'trx' ]:
818 obj = bld(features = 'command-output')
820 obj.command_is_external = True
822 obj.argv = menus_argv
823 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
824 obj.stdin = program + '.menus.in'
825 obj.stdout = program + '.menus'
826 bld.install_files (bld.env['CONFDIR'], program + '.menus')
829 freedesktop_subst_dict = {
830 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
831 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
832 'VERSION': str (bld.env['VERSION']),
835 if bld.env['FREEDESKTOP']:
836 obj = bld(features = 'subst')
837 obj.source = 'ardour.desktop.in'
838 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
839 obj.chmod = Utils.O644
840 obj.dict = freedesktop_subst_dict
841 set_subst_dict(obj, freedesktop_subst_dict)
843 obj = bld(features = 'subst')
844 obj.source = 'ardour-mime-info.xml'
845 obj.target = 'ardour.xml'
846 obj.chmod = Utils.O644
848 # build appdata with translations
850 appdata_i18n_xmlin(bld)
851 obj = bld(features = 'subst')
852 obj.source = 'ardour.appdata.xml.in'
853 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
854 obj.chmod = Utils.O644
855 obj.dict = freedesktop_subst_dict
856 set_subst_dict(obj, freedesktop_subst_dict)
860 # NATIVE ARDOUR BINDING FILES
861 # explicitly state the use of perl here so that it works on windows too
863 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
864 for b in [ 'ardour' ] :
866 target = b + '.keys',
867 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
870 obj.install_path = bld.env['CONFDIR']
873 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
874 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
876 # Application/Product specific resources (icon, splash)
877 pgmname = bld.env['PROGRAM_NAME']
878 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
880 if bld.env['build_target'] == 'mingw':
881 # These icons need to overwrite the files already installed in the icons
882 # directory above. Do this in the external packaging scripts for now.
883 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
884 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
886 # Default UI configuration
887 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
888 # Color Themes. Find each color file for this program only
890 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
892 # Default export stuff
893 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
896 if bld.is_defined('ENABLE_NLS'):
897 mo_files = bld.path.ant_glob('po/*.mo')
899 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
900 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
904 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
905 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
907 appdata_i18n_pot(bld)
911 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
912 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
914 appdata_i18n_pot(bld)
917 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
918 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
923 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
924 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
927 def appdata_i18n_pot(bld):
928 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
929 'ardour.appdata.pot')
930 if bld.cmd == 'i18n_pot':
931 Logs.info('Generating pot file from Ardour appdata')
932 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
933 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
934 'ardour.appdata.xml.in.in')
935 Logs.info('Updating ' + potfile)
937 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
939 print ('Error processing appdata pot file - ignored')
940 elif bld.cmd == 'clean' and os.path.exists(potfile):
941 Logs.info('Removing Ardour appdata pot file')
944 def appdata_i18n_po(bld):
945 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
946 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
948 def appdata_i18n_mo(bld):
949 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
950 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
952 def appdata_i18n_xmlin(bld):
953 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
954 'ardour.appdata.xml.in')
955 if bld.cmd == 'build':
956 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
957 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
958 'ardour.appdata.xml.in.in')
959 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
960 mo_files = glob.glob(mo_glob)
961 Logs.info('Generating ' + adxmlinfile)
962 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
963 '-j', adxmlininfile] + mo_files)
964 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
965 Logs.info('Removing ' + adxmlinfile)
966 os.remove(adxmlinfile)