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',
41 'ardour_ui_dependents.cc',
42 'ardour_ui_dialogs.cc',
45 'ardour_ui_options.cc',
48 'audio_region_editor.cc',
49 'audio_region_view.cc',
50 'audio_streamview.cc',
52 'automation_controller.cc',
54 'automation_region_view.cc',
55 'automation_streamview.cc',
56 'automation_time_axis.cc',
58 'big_clock_window.cc',
64 'control_point_dialog.cc',
68 'duplicate_routes_dialog.cc',
69 'edit_note_dialog.cc',
73 'editor_audio_import.cc',
74 'editor_pt_import.cc',
75 'editor_audiotrack.cc',
77 'editor_canvas_events.cc',
78 'editor_component.cc',
81 'editor_route_groups.cc',
82 'editor_export_audio.cc',
83 'editor_group_tabs.cc',
85 'editor_locations.cc',
93 'editor_selection.cc',
94 'editor_snapshots.cc',
96 'editor_tempodisplay.cc',
100 'export_channel_selector.cc',
102 'export_file_notebook.cc',
103 'export_filename_selector.cc',
104 'export_format_dialog.cc',
105 'export_format_selector.cc',
106 'export_preset_selector.cc',
108 'export_timespan_selector.cc',
112 'floating_text_entry.cc',
113 'sfdb_freesound_mootcher.cc',
115 'generic_pluginui.cc',
117 'global_port_matrix.cc',
119 'gtk_pianokeyboard.c',
121 'insert_remove_time_dialog.cc',
122 'instrument_selector.cc',
123 'interthread_progress_window.cc',
132 'lua_script_manager.cc',
138 'midi_automation_line.cc',
139 'midi_channel_dialog.cc',
140 'midi_channel_selector.cc',
141 'midi_cut_buffer.cc',
142 'midi_export_dialog.cc',
143 'midi_list_editor.cc',
144 'midi_port_dialog.cc',
145 'midi_region_view.cc',
148 'midi_streamview.cc',
151 'midi_velocity_dialog.cc',
152 'missing_file_dialog.cc',
153 'missing_plugin_dialog.cc',
155 'mixer_group_tabs.cc',
161 'monitor_section.cc',
162 'monitor_selector.cc',
164 'mono_panner_editor.cc',
167 'new_plugin_preset_dialog.cc',
168 'normalize_dialog.cc',
172 'note_select_dialog.cc',
179 'panner_interface.cc',
182 'piano_roll_header.cc',
184 'playlist_selector.cc',
186 'plugin_pin_dialog.cc',
187 'plugin_setup_dialog.cc',
188 'plugin_selector.cc',
193 'port_matrix_body.cc',
194 'port_matrix_column_labels.cc',
195 'port_matrix_component.cc',
196 'port_matrix_grid.cc',
197 'port_matrix_labels.cc',
198 'port_matrix_row_labels.cc',
200 'patch_change_dialog.cc',
201 'progress_reporter.cc',
204 'quantize_dialog.cc',
205 'rc_option_editor.cc',
207 'region_gain_line.cc',
208 'region_layering_order_editor.cc',
209 'region_selection.cc',
213 'route_group_dialog.cc',
214 'route_group_menu.cc',
215 'route_params_ui.cc',
216 'route_processor_selection.cc',
217 'route_time_axis.cc',
221 'search_path_option.cc',
222 'script_selector.cc',
224 'selection_memento.cc',
227 'session_import_dialog.cc',
228 'session_metadata_dialog.cc',
229 'session_option_editor.cc',
231 'shuttle_control.cc',
232 'soundcloud_export_selector.cc',
239 'stereo_panner_editor.cc',
241 'strip_silence_dialog.cc',
243 'tape_region_view.cc',
249 'time_axis_view_item.cc',
255 'track_selection.cc',
256 'track_view_list.cc',
257 'transform_dialog.cc',
258 'transpose_dialog.cc',
262 'visibility_group.cc',
264 # video-timeline related sources:
265 'video_image_frame.cc',
266 'add_video_dialog.cc',
267 'editor_videotimeline.cc',
270 'transcode_ffmpeg.cc',
271 'transcode_video_dialog.cc',
272 'video_server_dialog.cc',
274 'export_video_dialog.cc',
275 'export_video_infobox.cc',
276 'video_tool_paths.cc'
279 def enoify (major, minor):
280 # Code names based on
281 # https://en.wikipedia.org/wiki/Brian_Eno_discography
283 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
284 # (no Singles, no EPs, no Video Albums, no Production)
286 return "\\n\\\"E-No\\\""
289 return "\\n\\\"No Pussyfooting\\\""
291 return "\\n\\\"Here Come the Warm Jets\\\""
293 return "\\n\\\"Taking Tiger Mountain\\\""
295 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
297 return "\\n\\\"Discreet Music\\\""
299 return "\\n\\\"Another Green World\\\""
301 return "\\n\\\"Evening Star\\\""
303 return "\\n\\\"Cluster and Eno\\\""
305 return "\\n\\\"Before and After Science\\\""
309 autowaf.set_options(opt)
313 conf.load('compiler_cxx')
314 autowaf.configure(conf)
316 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
318 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
320 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
321 atleast_version='3.3.5', mandatory=False)
322 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
323 atleast_version='1.2.1')
324 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
325 atleast_version='2.10.1')
326 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
327 atleast_version='2.18')
328 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
329 atleast_version='2.18')
330 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
331 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
332 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
335 if sys.platform == 'darwin':
336 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
337 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
338 env = conf.env.derive (),
341 compile_filename='test.m',
346 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
347 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
349 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
351 conf.write_config_header('gtk2ardour-config.h', remove=False)
353 bak = conf.env['define_key']
354 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
355 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
356 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
357 conf.write_config_header('gtk2ardour-version.h')
358 conf.env['define_key'] = bak;
361 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
362 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
364 # Add a waf `feature' to allow compilation of things using winegcc
365 from waflib.TaskGen import feature
367 def set_winegcc(self):
368 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
369 self.env.CC = 'winegcc'
371 def _doPyp(infileName, deps = False):
374 re_spaces = re.compile("\s+")
376 if infileName == '-':
379 fd = open(infileName)
380 inLines = fd.readlines()
386 bits = re_spaces.split(line)
387 if bits[0] == '##include':
392 # assume included file comes from same place as source file
393 incName = os.path.join (os.path.dirname (infileName), incName);
394 outStr += _doPyp(incName)
405 def include_processor(task):
406 infileName = task.inputs[0].srcpath()
407 outfileName = os.path.join(out, task.outputs[0].bldpath())
408 fdOut = open (outfileName, "w")
409 fdOut.write (_doPyp(infileName))
413 def build_color_scheme(path, prefix):
417 if re.search ('^#@color', line):
418 line.strip() # remove newline
420 if len(color_scheme):
422 color_scheme += prefix
424 color_scheme += words[1]
426 color_scheme += words[2]
432 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
433 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
435 # Tool to dump lua-bindings (of gtk2ardour + libs)
436 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
437 obj = bld (features = 'cxx c cxxprogram')
438 obj.install_path = None
439 obj.source = list(gtk2_ardour_sources)
440 obj.target = 'luadoc'
441 obj.includes = ['.', '../libs']
442 obj.ldflags = ['-no-undefined']
455 'PACKAGE="' + I18N_PACKAGE + '"',
456 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
457 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
458 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
461 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
462 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
463 if bld.is_defined('HAVE_SUIL'):
464 obj.source += [ 'lv2_plugin_ui.cc' ]
465 obj.use += [ 'SUIL' ]
466 if bld.is_defined('LXVST_SUPPORT'):
467 obj.source += [ 'vst_plugin_ui.cc' ]
468 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
469 obj.defines += [ 'LXVST_SUPPORT' ]
473 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
474 # Windows VST support w/wine
475 # If we require VST support we build a stub main() and the FST library
476 # here using winegcc, and link it to the GTK front-end library
477 obj = bld (features = 'cxx c cxxprogram wine')
478 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
480 # XXX do we really need to explicitly link to all of these for the wine executable?
482 obj.use = [ 'libpbd',
493 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
494 obj.includes = [ '../libs/fst', '.' ]
495 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
496 obj.linkflags += bld.env['LDFLAGS']
497 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
498 obj.install_path = bld.env['DLLDIR']
499 # end of the wine executable
501 # now the shared library containing the GTK GUI for ardour
502 obj = bld (features = 'cxx c cxxshlib')
503 # operate on copy to avoid adding sources twice
504 obj.source = list(gtk2_ardour_sources)
505 obj.includes = [ '../libs/fst', '.' ]
506 obj.name = 'libgtk2_ardour'
507 obj.target = 'gtk2_ardour'
508 obj.cflags = [ '-fPIC' ]
511 # just the normal executable version of the GTK GUI
512 if bld.env['build_target'] == 'mingw':
513 obj = bld (features = 'cxx c cxxprogram winres')
515 obj = bld (features = 'cxx c cxxprogram')
516 # operate on copy to avoid adding sources twice
517 obj.source = list(gtk2_ardour_sources)
518 obj.target = 'ardour-' + str (bld.env['VERSION'])
520 obj.ldflags = ['-no-undefined']
522 if bld.is_defined('WINDOWS_VST_SUPPORT'):
523 # Windows VST support mingw
524 obj.includes += [ '../libs/fst' ]
526 # at this point, "obj" refers to either the normal native executable
527 # OR the shared library built for use with wine on linux.
529 obj.use = [ 'libpbd',
540 'PACKAGE="' + I18N_PACKAGE + '"',
541 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
542 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
543 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
545 obj.install_path = bld.env['DLLDIR']
547 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
549 if sys.platform == 'darwin':
550 obj.uselib += ' AUDIOUNITS OSX '
551 obj.use += ' libappleutility'
552 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
553 elif bld.env['build_target'] == 'mingw':
554 obj.source += [ 'bundle_env_mingw.cc' ]
555 obj.source += [ 'windows_icon.rc' ]
557 obj.source += [ 'bundle_env_linux.cc' ]
559 obj.includes += ['../libs']
561 obj.use += 'libptformat'
563 if bld.env['build_target'] == 'mingw':
564 obj.linkflags += ' -mwindows'
566 if bld.is_defined('HAVE_SUIL'):
567 obj.source += [ 'lv2_plugin_ui.cc' ]
568 obj.use += [ 'SUIL' ]
570 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
571 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
573 if bld.is_defined('NEED_INTL'):
574 obj.linkflags += ' -lintl'
576 if bld.is_defined('WINDOWS_VST_SUPPORT'):
577 obj.source += [ 'windows_vst_plugin_ui.cc' ]
578 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
579 if bld.env['build_target'] != 'mingw':
582 if bld.is_defined('LXVST_SUPPORT'):
583 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
584 obj.defines += [ 'LXVST_SUPPORT' ]
587 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
588 obj.source += [ 'vst_plugin_ui.cc' ]
590 if bld.is_defined('PHONE_HOME'):
591 obj.defines += [ 'PHONE_HOME' ]
593 if bld.is_defined('HAVE_COREAUDIO'):
594 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
595 obj.use += ' libappleutility '
597 if bld.is_defined('AUDIOUNIT_SUPPORT'):
598 obj.source += [ 'au_pluginui.mm' ]
602 wrapper_subst_dict = {
603 'INSTALL_PREFIX' : bld.env['PREFIX'],
604 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
605 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
606 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
607 'LIBS' : 'build/libs',
608 'VERSION' : str (bld.env['VERSION']),
609 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
612 def set_subst_dict(obj, dict):
614 setattr(obj, i, dict[i])
616 obj = bld(features = 'subst')
617 obj.source = 'ardev_common.sh.in'
618 obj.target = 'ardev_common_waf.sh'
619 obj.chmod = Utils.O755
620 obj.dict = wrapper_subst_dict
621 set_subst_dict(obj, wrapper_subst_dict)
623 obj = bld(features = 'subst')
624 obj.source = 'ardour.sh.in'
625 obj.target = 'ardour' + str (bld.env['MAJOR'])
626 obj.chmod = Utils.O755
627 obj.dict = wrapper_subst_dict
628 obj.install_path = bld.env['BINDIR']
629 set_subst_dict(obj, wrapper_subst_dict)
631 if bld.is_defined('WINDOWS_VST_SUPPORT'):
632 obj = bld(features = 'subst')
633 obj.source = '../vst/ardourvst.in'
634 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
635 obj.chmod = Utils.O755
636 obj.dict = wrapper_subst_dict
637 obj.install_path = bld.env['BINDIR']
638 set_subst_dict(obj, wrapper_subst_dict)
647 if sys.platform == 'darwin':
661 # There is no acceptable monospace font available on older versions of OS X
662 # and no API on those versions to load TTF files that will work with
663 # GTK/fontconfig/pango.
665 # In addition, the ArdourMono font gets clipped for some reason on OS X
667 # Moreover, Lucida Grande just seems to work even though it is not monospace
671 'MONOSPACE' : 'Monaco',
672 'CLOCKFONT' : 'Lucida Grande',
674 else: # Linux/X11 fonts
675 basefont = '' # unspecified - use system defaults
688 'MONOSPACE' : 'ArdourMono',
689 'CLOCKFONT' : 'ArdourMono',
692 # Set up font substitution dictionary
694 for style in ['', 'BOLD', 'ITALIC']:
695 for sizename,points in iter(font_sizes.items()):
697 key = "_".join (['FONT',style,sizename])
698 fontstyle = " ".join ([basefont,style.lower(),points])
700 key = "_".join (['FONT',sizename])
701 fontstyle = " ".join ([basefont,points])
703 font_subst_dict[key] = fontstyle
706 for sizename,points in iter(font_sizes.items()):
707 key = "_".join (['FONT_SIZE',sizename])
708 font_subst_dict[key] = points
710 # various font names, eg @BOLD_MONOSPACE@
711 for font_sym,text in iter(font_names.items()):
713 font_subst_dict[key] = text
717 obj = bld(features = 'subst')
718 obj.source = [ 'clearlooks.rc.in' ]
719 obj.target = 'clearlooks.rc'
720 obj.install_path = bld.env['CONFDIR']
721 set_subst_dict(obj, font_subst_dict)
723 obj = bld(features = 'subst')
724 obj.source = [ 'default_ui_config.in' ]
725 obj.target = 'default_ui_config'
726 obj.install_path = bld.env['CONFDIR']
727 set_subst_dict(obj, font_subst_dict)
731 if sys.platform == 'darwin':
732 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
734 menus_argv = [ '-E', '-P' ]
736 if bld.is_defined('PTFORMAT'):
737 menus_argv += [ '-DPTFORMAT' ]
739 # always build all versions of the menu definitions
740 # so that we can try them out with different program builds.
741 for program in [ 'ardour', 'trx' ]:
742 obj = bld(features = 'command-output')
744 obj.command_is_external = True
746 obj.argv = menus_argv
747 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
748 obj.stdin = program + '.menus.in'
749 obj.stdout = program + '.menus'
750 bld.install_files (bld.env['CONFDIR'], program + '.menus')
753 freedesktop_subst_dict = {
754 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
755 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
756 'VERSION': str (bld.env['VERSION']),
759 if bld.env['FREEDESKTOP']:
760 obj = bld(features = 'subst')
761 obj.source = 'ardour.desktop.in'
762 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
763 obj.chmod = Utils.O644
764 obj.dict = freedesktop_subst_dict
765 set_subst_dict(obj, freedesktop_subst_dict)
767 obj = bld(features = 'subst')
768 obj.source = 'ardour-mime-info.xml'
769 obj.target = 'ardour.xml'
770 obj.chmod = Utils.O644
772 # build appdata with translations
774 appdata_i18n_xmlin(bld)
775 obj = bld(features = 'subst')
776 obj.source = 'ardour.appdata.xml.in'
777 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
778 obj.chmod = Utils.O644
779 obj.dict = freedesktop_subst_dict
780 set_subst_dict(obj, freedesktop_subst_dict)
784 # NATIVE ARDOUR BINDING FILES
785 # explicitly state the use of perl here so that it works on windows too
787 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
788 for b in [ 'ardour' ] :
790 target = b + '.keys',
791 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
794 obj.install_path = bld.env['CONFDIR']
797 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
798 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
800 # Application/Product specific resources (icon, splash)
801 pgmname = Options.options.program_name;
802 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
804 if bld.env['build_target'] == 'mingw':
805 # These icons need to overwrite the files already installed in the icons
806 # directory above. Do this in the external packaging scripts for now.
807 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
808 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
810 # Default UI configuration
811 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
813 bld.install_files(bld.env['CONFDIR'], 'dark.colors')
815 # Default export stuff
816 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
819 if bld.is_defined('ENABLE_NLS'):
820 mo_files = bld.path.ant_glob('po/*.mo')
822 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
823 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
827 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
828 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
830 appdata_i18n_pot(bld)
834 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
835 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
837 appdata_i18n_pot(bld)
840 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
841 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
846 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
847 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
850 def appdata_i18n_pot(bld):
851 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
852 'ardour.appdata.pot')
853 if bld.cmd == 'build':
854 Logs.info('Generating pot file from Ardour appdata')
855 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
856 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
857 'ardour.appdata.xml.in.in')
858 Logs.info('Updating ' + potfile)
859 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
860 elif bld.cmd == 'clean' and os.path.exists(potfile):
861 Logs.info('Removing Ardour appdata pot file')
864 def appdata_i18n_po(bld):
865 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
866 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
868 def appdata_i18n_mo(bld):
869 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
870 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
872 def appdata_i18n_xmlin(bld):
873 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
874 'ardour.appdata.xml.in')
875 if bld.cmd == 'build':
876 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
877 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
878 'ardour.appdata.xml.in.in')
879 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
880 mo_files = glob.glob(mo_glob)
881 Logs.info('Generating ' + adxmlinfile)
882 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
883 '-j', adxmlininfile] + mo_files)
884 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
885 Logs.info('Removing ' + adxmlinfile)
886 os.remove(adxmlinfile)