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_selector.cc',
192 'port_matrix_body.cc',
193 'port_matrix_column_labels.cc',
194 'port_matrix_component.cc',
195 'port_matrix_grid.cc',
196 'port_matrix_labels.cc',
197 'port_matrix_row_labels.cc',
199 'patch_change_dialog.cc',
200 'progress_reporter.cc',
203 'quantize_dialog.cc',
204 'rc_option_editor.cc',
206 'region_gain_line.cc',
207 'region_layering_order_editor.cc',
208 'region_selection.cc',
212 'route_group_dialog.cc',
213 'route_group_menu.cc',
214 'route_params_ui.cc',
215 'route_processor_selection.cc',
216 'route_time_axis.cc',
220 'search_path_option.cc',
221 'script_selector.cc',
223 'selection_memento.cc',
226 'session_import_dialog.cc',
227 'session_metadata_dialog.cc',
228 'session_option_editor.cc',
230 'shuttle_control.cc',
231 'soundcloud_export_selector.cc',
238 'stereo_panner_editor.cc',
240 'strip_silence_dialog.cc',
242 'tape_region_view.cc',
247 'time_axis_view_item.cc',
253 'track_selection.cc',
254 'track_view_list.cc',
255 'transform_dialog.cc',
256 'transpose_dialog.cc',
260 'visibility_group.cc',
262 # video-timeline related sources:
263 'video_image_frame.cc',
264 'add_video_dialog.cc',
265 'editor_videotimeline.cc',
268 'transcode_ffmpeg.cc',
269 'transcode_video_dialog.cc',
270 'video_server_dialog.cc',
272 'export_video_dialog.cc',
273 'export_video_infobox.cc',
274 'video_tool_paths.cc'
277 def enoify (major, minor):
278 # Code names based on
279 # https://en.wikipedia.org/wiki/Brian_Eno_discography
281 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
282 # (no Singles, no EPs, no Video Albums, no Production)
284 return "\\n\\\"E-No\\\""
287 return "\\n\\\"No Pussyfooting\\\""
289 return "\\n\\\"Here Come the Warm Jets\\\""
291 return "\\n\\\"Taking Tiger Mountain\\\""
293 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
295 return "\\n\\\"Discreet Music\\\""
297 return "\\n\\\"Another Green World\\\""
299 return "\\n\\\"Evening Star\\\""
301 return "\\n\\\"Cluster and Eno\\\""
303 return "\\n\\\"Before and After Science\\\""
307 autowaf.set_options(opt)
311 conf.load('compiler_cxx')
312 autowaf.configure(conf)
314 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
316 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
318 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
319 atleast_version='3.3.5', mandatory=False)
320 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
321 atleast_version='1.2.1')
322 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
323 atleast_version='2.10.1')
324 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
325 atleast_version='2.18')
326 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
327 atleast_version='2.18')
328 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
329 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
330 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
333 if sys.platform == 'darwin':
334 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
335 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
336 env = conf.env.derive (),
339 compile_filename='test.m',
344 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
345 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
347 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
349 conf.write_config_header('gtk2ardour-config.h', remove=False)
351 bak = conf.env['define_key']
352 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
353 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
354 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
355 conf.write_config_header('gtk2ardour-version.h')
356 conf.env['define_key'] = bak;
359 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
360 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
362 # Add a waf `feature' to allow compilation of things using winegcc
363 from waflib.TaskGen import feature
365 def set_winegcc(self):
366 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
367 self.env.CC = 'winegcc'
369 def _doPyp(infileName, deps = False):
372 re_spaces = re.compile("\s+")
374 if infileName == '-':
377 fd = open(infileName)
378 inLines = fd.readlines()
384 bits = re_spaces.split(line)
385 if bits[0] == '##include':
390 # assume included file comes from same place as source file
391 incName = os.path.join (os.path.dirname (infileName), incName);
392 outStr += _doPyp(incName)
403 def include_processor(task):
404 infileName = task.inputs[0].srcpath()
405 outfileName = os.path.join(out, task.outputs[0].bldpath())
406 fdOut = open (outfileName, "w")
407 fdOut.write (_doPyp(infileName))
411 def build_color_scheme(path, prefix):
415 if re.search ('^#@color', line):
416 line.strip() # remove newline
418 if len(color_scheme):
420 color_scheme += prefix
422 color_scheme += words[1]
424 color_scheme += words[2]
430 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
431 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
433 # Tool to dump lua-bindings (of gtk2ardour + libs)
434 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
435 obj = bld (features = 'cxx c cxxprogram')
436 obj.install_path = None
437 obj.source = list(gtk2_ardour_sources)
438 obj.target = 'luadoc'
439 obj.includes = ['.', '../libs']
440 obj.ldflags = ['-no-undefined']
453 'PACKAGE="' + I18N_PACKAGE + '"',
454 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
455 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
456 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
459 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
460 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
461 if bld.is_defined('HAVE_SUIL'):
462 obj.source += [ 'lv2_plugin_ui.cc' ]
463 obj.use += [ 'SUIL' ]
464 if bld.is_defined('LXVST_SUPPORT'):
465 obj.source += [ 'vst_plugin_ui.cc' ]
466 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
467 obj.defines += [ 'LXVST_SUPPORT' ]
471 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
472 # Windows VST support w/wine
473 # If we require VST support we build a stub main() and the FST library
474 # here using winegcc, and link it to the GTK front-end library
475 obj = bld (features = 'cxx c cxxprogram wine')
476 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
478 # XXX do we really need to explicitly link to all of these for the wine executable?
480 obj.use = [ 'libpbd',
491 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
492 obj.includes = [ '../libs/fst', '.' ]
493 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
494 obj.linkflags += bld.env['LDFLAGS']
495 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
496 obj.install_path = bld.env['DLLDIR']
497 # end of the wine executable
499 # now the shared library containing the GTK GUI for ardour
500 obj = bld (features = 'cxx c cxxshlib')
501 # operate on copy to avoid adding sources twice
502 obj.source = list(gtk2_ardour_sources)
503 obj.includes = [ '../libs/fst', '.' ]
504 obj.name = 'libgtk2_ardour'
505 obj.target = 'gtk2_ardour'
506 obj.cflags = [ '-fPIC' ]
509 # just the normal executable version of the GTK GUI
510 if bld.env['build_target'] == 'mingw':
511 obj = bld (features = 'cxx c cxxprogram winres')
513 obj = bld (features = 'cxx c cxxprogram')
514 # operate on copy to avoid adding sources twice
515 obj.source = list(gtk2_ardour_sources)
516 obj.target = 'ardour-' + str (bld.env['VERSION'])
518 obj.ldflags = ['-no-undefined']
520 if bld.is_defined('WINDOWS_VST_SUPPORT'):
521 # Windows VST support mingw
522 obj.includes += [ '../libs/fst' ]
524 # at this point, "obj" refers to either the normal native executable
525 # OR the shared library built for use with wine on linux.
527 obj.use = [ 'libpbd',
538 'PACKAGE="' + I18N_PACKAGE + '"',
539 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
540 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
541 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
543 obj.install_path = bld.env['DLLDIR']
545 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
547 if sys.platform == 'darwin':
548 obj.uselib += ' AUDIOUNITS OSX '
549 obj.use += ' libappleutility'
550 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
551 elif bld.env['build_target'] == 'mingw':
552 obj.source += [ 'bundle_env_mingw.cc' ]
553 obj.source += [ 'windows_icon.rc' ]
555 obj.source += [ 'bundle_env_linux.cc' ]
557 obj.includes += ['../libs']
559 obj.use += 'libptformat'
561 if bld.env['build_target'] == 'mingw':
562 obj.linkflags += ' -mwindows'
564 if bld.is_defined('HAVE_SUIL'):
565 obj.source += [ 'lv2_plugin_ui.cc' ]
566 obj.use += [ 'SUIL' ]
568 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
569 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
571 if bld.is_defined('NEED_INTL'):
572 obj.linkflags += ' -lintl'
574 if bld.is_defined('WINDOWS_VST_SUPPORT'):
575 obj.source += [ 'windows_vst_plugin_ui.cc' ]
576 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
577 if bld.env['build_target'] != 'mingw':
580 if bld.is_defined('LXVST_SUPPORT'):
581 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
582 obj.defines += [ 'LXVST_SUPPORT' ]
585 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
586 obj.source += [ 'vst_plugin_ui.cc' ]
588 if bld.is_defined('PHONE_HOME'):
589 obj.defines += [ 'PHONE_HOME' ]
591 if bld.is_defined('HAVE_COREAUDIO'):
592 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
593 obj.use += ' libappleutility '
595 if bld.is_defined('AUDIOUNIT_SUPPORT'):
596 obj.source += [ 'au_pluginui.mm' ]
600 wrapper_subst_dict = {
601 'INSTALL_PREFIX' : bld.env['PREFIX'],
602 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
603 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
604 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
605 'LIBS' : 'build/libs',
606 'VERSION' : str (bld.env['VERSION']),
607 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
610 def set_subst_dict(obj, dict):
612 setattr(obj, i, dict[i])
614 obj = bld(features = 'subst')
615 obj.source = 'ardev_common.sh.in'
616 obj.target = 'ardev_common_waf.sh'
617 obj.chmod = Utils.O755
618 obj.dict = wrapper_subst_dict
619 set_subst_dict(obj, wrapper_subst_dict)
621 obj = bld(features = 'subst')
622 obj.source = 'ardour.sh.in'
623 obj.target = 'ardour' + str (bld.env['MAJOR'])
624 obj.chmod = Utils.O755
625 obj.dict = wrapper_subst_dict
626 obj.install_path = bld.env['BINDIR']
627 set_subst_dict(obj, wrapper_subst_dict)
629 if bld.is_defined('WINDOWS_VST_SUPPORT'):
630 obj = bld(features = 'subst')
631 obj.source = '../vst/ardourvst.in'
632 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
633 obj.chmod = Utils.O755
634 obj.dict = wrapper_subst_dict
635 obj.install_path = bld.env['BINDIR']
636 set_subst_dict(obj, wrapper_subst_dict)
645 if sys.platform == 'darwin':
659 # There is no acceptable monospace font available on older versions of OS X
660 # and no API on those versions to load TTF files that will work with
661 # GTK/fontconfig/pango.
663 # In addition, the ArdourMono font gets clipped for some reason on OS X
665 # Moreover, Lucida Grande just seems to work even though it is not monospace
669 'MONOSPACE' : 'Monaco',
670 'CLOCKFONT' : 'Lucida Grande',
672 else: # Linux/X11 fonts
673 basefont = '' # unspecified - use system defaults
686 'MONOSPACE' : 'ArdourMono',
687 'CLOCKFONT' : 'ArdourMono',
690 # Set up font substitution dictionary
692 for style in ['', 'BOLD', 'ITALIC']:
693 for sizename,points in iter(font_sizes.items()):
695 key = "_".join (['FONT',style,sizename])
696 fontstyle = " ".join ([basefont,style.lower(),points])
698 key = "_".join (['FONT',sizename])
699 fontstyle = " ".join ([basefont,points])
701 font_subst_dict[key] = fontstyle
704 for sizename,points in iter(font_sizes.items()):
705 key = "_".join (['FONT_SIZE',sizename])
706 font_subst_dict[key] = points
708 # various font names, eg @BOLD_MONOSPACE@
709 for font_sym,text in iter(font_names.items()):
711 font_subst_dict[key] = text
715 obj = bld(features = 'subst')
716 obj.source = [ 'clearlooks.rc.in' ]
717 obj.target = 'clearlooks.rc'
718 obj.install_path = bld.env['CONFDIR']
719 set_subst_dict(obj, font_subst_dict)
721 obj = bld(features = 'subst')
722 obj.source = [ 'default_ui_config.in' ]
723 obj.target = 'default_ui_config'
724 obj.install_path = bld.env['CONFDIR']
725 set_subst_dict(obj, font_subst_dict)
729 if sys.platform == 'darwin':
730 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
732 menus_argv = [ '-E', '-P' ]
734 if bld.is_defined('PTFORMAT'):
735 menus_argv += [ '-DPTFORMAT' ]
737 # always build all versions of the menu definitions
738 # so that we can try them out with different program builds.
739 for program in [ 'ardour', 'trx' ]:
740 obj = bld(features = 'command-output')
742 obj.command_is_external = True
744 obj.argv = menus_argv
745 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
746 obj.stdin = program + '.menus.in'
747 obj.stdout = program + '.menus'
748 bld.install_files (bld.env['CONFDIR'], program + '.menus')
751 freedesktop_subst_dict = {
752 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
753 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
754 'VERSION': str (bld.env['VERSION']),
757 if bld.env['FREEDESKTOP']:
758 obj = bld(features = 'subst')
759 obj.source = 'ardour.desktop.in'
760 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
761 obj.chmod = Utils.O644
762 obj.dict = freedesktop_subst_dict
763 set_subst_dict(obj, freedesktop_subst_dict)
765 obj = bld(features = 'subst')
766 obj.source = 'ardour-mime-info.xml'
767 obj.target = 'ardour.xml'
768 obj.chmod = Utils.O644
770 # build appdata with translations
772 appdata_i18n_xmlin(bld)
773 obj = bld(features = 'subst')
774 obj.source = 'ardour.appdata.xml.in'
775 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
776 obj.chmod = Utils.O644
777 obj.dict = freedesktop_subst_dict
778 set_subst_dict(obj, freedesktop_subst_dict)
782 # NATIVE ARDOUR BINDING FILES
783 # explicitly state the use of perl here so that it works on windows too
785 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
786 for b in [ 'ardour' ] :
788 target = b + '.keys',
789 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
792 obj.install_path = bld.env['CONFDIR']
795 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
796 bld.install_files(os.path.join (bld.env['DATADIR'], 'pixmaps'), bld.path.ant_glob('pixmaps/*.xpm'))
797 bld.install_files(bld.env['DATADIR'], 'splash.png')
798 bld.install_files(bld.env['DATADIR'], 'small-splash.png')
799 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
801 if bld.env['build_target'] == 'mingw':
802 # These icons need to overwrite the files already installed in the icons
803 # directory above. Do this in the external packaging scripts for now.
804 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
805 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
807 # Default UI configuration
808 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
810 bld.install_files(bld.env['CONFDIR'], 'dark.colors')
812 # Default export stuff
813 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
816 if bld.is_defined('ENABLE_NLS'):
817 mo_files = bld.path.ant_glob('po/*.mo')
819 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
820 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
824 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
825 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
827 appdata_i18n_pot(bld)
831 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
832 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
834 appdata_i18n_pot(bld)
837 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
838 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
843 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
844 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
847 def appdata_i18n_pot(bld):
848 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
849 'ardour.appdata.pot')
850 if bld.cmd == 'build':
851 Logs.info('Generating pot file from Ardour appdata')
852 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
853 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
854 'ardour.appdata.xml.in.in')
855 Logs.info('Updating ' + potfile)
856 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
857 elif bld.cmd == 'clean' and os.path.exists(potfile):
858 Logs.info('Removing Ardour appdata pot file')
861 def appdata_i18n_po(bld):
862 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
863 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
865 def appdata_i18n_mo(bld):
866 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
867 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
869 def appdata_i18n_xmlin(bld):
870 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
871 'ardour.appdata.xml.in')
872 if bld.cmd == 'build':
873 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
874 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
875 'ardour.appdata.xml.in.in')
876 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
877 mo_files = glob.glob(mo_glob)
878 Logs.info('Generating ' + adxmlinfile)
879 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
880 '-j', adxmlininfile] + mo_files)
881 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
882 Logs.info('Removing ' + adxmlinfile)
883 os.remove(adxmlinfile)