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',
261 'vca_master_strip.cc',
263 'visibility_group.cc',
265 # video-timeline related sources:
266 'video_image_frame.cc',
267 'add_video_dialog.cc',
268 'editor_videotimeline.cc',
272 'transcode_ffmpeg.cc',
273 'transcode_video_dialog.cc',
274 'video_server_dialog.cc',
276 'export_video_dialog.cc',
277 'export_video_infobox.cc',
278 'video_tool_paths.cc'
281 def enoify (major, minor):
282 # Code names based on
283 # https://en.wikipedia.org/wiki/Brian_Eno_discography
285 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
286 # (no Singles, no EPs, no Video Albums, no Production)
288 return "\\n\\\"E-No\\\""
291 return "\\n\\\"No Pussyfooting\\\""
293 return "\\n\\\"Here Come the Warm Jets\\\""
295 return "\\n\\\"Taking Tiger Mountain\\\""
297 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
299 return "\\n\\\"Discreet Music\\\""
301 return "\\n\\\"Another Green World\\\""
303 return "\\n\\\"Evening Star\\\""
305 return "\\n\\\"Cluster and Eno\\\""
308 return "\\n\\\"Before and After Science\\\""
310 return "\\n\\\"After the Heat\\\""
314 autowaf.set_options(opt)
318 conf.load('compiler_cxx')
319 autowaf.configure(conf)
321 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
323 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
325 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
326 atleast_version='3.3.5', mandatory=False)
327 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
328 atleast_version='1.2.1')
329 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
330 atleast_version='2.10.1')
331 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
332 atleast_version='2.18')
333 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
334 atleast_version='2.18')
335 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
336 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
337 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
340 if sys.platform == 'darwin':
341 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
342 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
343 env = conf.env.derive (),
346 compile_filename='test.m',
351 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
352 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
354 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
356 conf.write_config_header('gtk2ardour-config.h', remove=False)
358 bak = conf.env['define_key']
359 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
360 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
361 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
362 conf.write_config_header('gtk2ardour-version.h')
363 conf.env['define_key'] = bak;
366 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
367 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
369 # Add a waf `feature' to allow compilation of things using winegcc
370 from waflib.TaskGen import feature
372 def set_winegcc(self):
373 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
374 self.env.CC = 'winegcc'
376 def _doPyp(infileName, deps = False):
379 re_spaces = re.compile("\s+")
381 if infileName == '-':
384 fd = open(infileName)
385 inLines = fd.readlines()
391 bits = re_spaces.split(line)
392 if bits[0] == '##include':
397 # assume included file comes from same place as source file
398 incName = os.path.join (os.path.dirname (infileName), incName);
399 outStr += _doPyp(incName)
410 def include_processor(task):
411 infileName = task.inputs[0].srcpath()
412 outfileName = os.path.join(out, task.outputs[0].bldpath())
413 fdOut = open (outfileName, "w")
414 fdOut.write (_doPyp(infileName))
418 def build_color_scheme(path, prefix):
422 if re.search ('^#@color', line):
423 line.strip() # remove newline
425 if len(color_scheme):
427 color_scheme += prefix
429 color_scheme += words[1]
431 color_scheme += words[2]
437 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
438 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
440 # Tool to dump lua-bindings (of gtk2ardour + libs)
441 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
442 obj = bld (features = 'cxx c cxxprogram')
443 obj.install_path = None
444 obj.source = list(gtk2_ardour_sources)
445 obj.target = 'luadoc'
446 obj.includes = ['.', '../libs']
447 obj.ldflags = ['-no-undefined']
460 'PACKAGE="' + I18N_PACKAGE + '"',
461 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
462 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
463 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
466 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
467 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
468 if bld.is_defined('HAVE_SUIL'):
469 obj.source += [ 'lv2_plugin_ui.cc' ]
470 obj.use += [ 'SUIL' ]
471 if bld.is_defined('LXVST_SUPPORT'):
472 obj.source += [ 'vst_plugin_ui.cc' ]
473 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
474 obj.defines += [ 'LXVST_SUPPORT' ]
478 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
479 # Windows VST support w/wine
480 # If we require VST support we build a stub main() and the FST library
481 # here using winegcc, and link it to the GTK front-end library
482 obj = bld (features = 'cxx c cxxprogram wine')
483 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
485 # XXX do we really need to explicitly link to all of these for the wine executable?
487 obj.use = [ 'libpbd',
498 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
499 obj.includes = [ '../libs/fst', '.' ]
500 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
501 obj.linkflags += bld.env['LDFLAGS']
502 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
503 obj.install_path = bld.env['DLLDIR']
504 # end of the wine executable
506 # now the shared library containing the GTK GUI for ardour
507 obj = bld (features = 'cxx c cxxshlib')
508 # operate on copy to avoid adding sources twice
509 obj.source = list(gtk2_ardour_sources)
510 obj.includes = [ '../libs/fst', '.' ]
511 obj.name = 'libgtk2_ardour'
512 obj.target = 'gtk2_ardour'
513 obj.cflags = [ '-fPIC' ]
516 # just the normal executable version of the GTK GUI
517 if bld.env['build_target'] == 'mingw':
518 obj = bld (features = 'cxx c cxxprogram winres')
520 obj = bld (features = 'cxx c cxxprogram')
521 # operate on copy to avoid adding sources twice
522 obj.source = list(gtk2_ardour_sources)
523 obj.target = 'ardour-' + str (bld.env['VERSION'])
525 obj.ldflags = ['-no-undefined']
527 if bld.is_defined('WINDOWS_VST_SUPPORT'):
528 # Windows VST support mingw
529 obj.includes += [ '../libs/fst' ]
531 # at this point, "obj" refers to either the normal native executable
532 # OR the shared library built for use with wine on linux.
534 obj.use = [ 'libpbd',
545 'PACKAGE="' + I18N_PACKAGE + '"',
546 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
547 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
548 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
550 obj.install_path = bld.env['DLLDIR']
552 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
554 if sys.platform == 'darwin':
555 obj.uselib += ' AUDIOUNITS OSX '
556 obj.use += ' libappleutility'
557 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
558 elif bld.env['build_target'] == 'mingw':
559 obj.source += [ 'bundle_env_mingw.cc' ]
560 obj.source += [ 'windows_icon.rc' ]
562 obj.source += [ 'bundle_env_linux.cc' ]
564 obj.includes += ['../libs']
566 obj.use += 'libptformat'
568 if bld.env['build_target'] == 'mingw':
569 obj.linkflags += ' -mwindows'
571 if bld.is_defined('HAVE_SUIL'):
572 obj.source += [ 'lv2_plugin_ui.cc' ]
573 obj.use += [ 'SUIL' ]
575 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
576 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
578 if bld.is_defined('NEED_INTL'):
579 obj.linkflags += ' -lintl'
581 if bld.is_defined('WINDOWS_VST_SUPPORT'):
582 obj.source += [ 'windows_vst_plugin_ui.cc' ]
583 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
584 if bld.env['build_target'] != 'mingw':
587 if bld.is_defined('LXVST_SUPPORT'):
588 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
589 obj.defines += [ 'LXVST_SUPPORT' ]
592 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
593 obj.source += [ 'vst_plugin_ui.cc' ]
595 if bld.is_defined('PHONE_HOME'):
596 obj.defines += [ 'PHONE_HOME' ]
598 if bld.is_defined('HAVE_COREAUDIO'):
599 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
600 obj.use += ' libappleutility '
602 if bld.is_defined('AUDIOUNIT_SUPPORT'):
603 obj.source += [ 'au_pluginui.mm' ]
607 wrapper_subst_dict = {
608 'INSTALL_PREFIX' : bld.env['PREFIX'],
609 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
610 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
611 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
612 'LIBS' : 'build/libs',
613 'VERSION' : str (bld.env['VERSION']),
614 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
617 def set_subst_dict(obj, dict):
619 setattr(obj, i, dict[i])
621 obj = bld(features = 'subst')
622 obj.source = 'ardev_common.sh.in'
623 obj.target = 'ardev_common_waf.sh'
624 obj.chmod = Utils.O755
625 obj.dict = wrapper_subst_dict
626 set_subst_dict(obj, wrapper_subst_dict)
628 obj = bld(features = 'subst')
629 obj.source = 'ardour.sh.in'
630 obj.target = 'ardour' + str (bld.env['MAJOR'])
631 obj.chmod = Utils.O755
632 obj.dict = wrapper_subst_dict
633 obj.install_path = bld.env['BINDIR']
634 set_subst_dict(obj, wrapper_subst_dict)
636 if bld.is_defined('WINDOWS_VST_SUPPORT'):
637 obj = bld(features = 'subst')
638 obj.source = '../vst/ardourvst.in'
639 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
640 obj.chmod = Utils.O755
641 obj.dict = wrapper_subst_dict
642 obj.install_path = bld.env['BINDIR']
643 set_subst_dict(obj, wrapper_subst_dict)
652 if sys.platform == 'darwin':
666 # There is no acceptable monospace font available on older versions of OS X
667 # and no API on those versions to load TTF files that will work with
668 # GTK/fontconfig/pango.
670 # In addition, the ArdourMono font gets clipped for some reason on OS X
672 # Moreover, Lucida Grande just seems to work even though it is not monospace
676 'MONOSPACE' : 'Monaco',
677 'CLOCKFONT' : 'Lucida Grande',
679 else: # Linux/X11 fonts
680 basefont = '' # unspecified - use system defaults
693 'MONOSPACE' : 'ArdourMono',
694 'CLOCKFONT' : 'ArdourMono',
697 # Set up font substitution dictionary
699 for style in ['', 'BOLD', 'ITALIC']:
700 for sizename,points in iter(font_sizes.items()):
702 key = "_".join (['FONT',style,sizename])
703 fontstyle = " ".join ([basefont,style.lower(),points])
705 key = "_".join (['FONT',sizename])
706 fontstyle = " ".join ([basefont,points])
708 font_subst_dict[key] = fontstyle
711 for sizename,points in iter(font_sizes.items()):
712 key = "_".join (['FONT_SIZE',sizename])
713 font_subst_dict[key] = points
715 # various font names, eg @BOLD_MONOSPACE@
716 for font_sym,text in iter(font_names.items()):
718 font_subst_dict[key] = text
722 obj = bld(features = 'subst')
723 obj.source = [ 'clearlooks.rc.in' ]
724 obj.target = 'clearlooks.rc'
725 obj.install_path = bld.env['CONFDIR']
726 set_subst_dict(obj, font_subst_dict)
728 obj = bld(features = 'subst')
729 obj.source = [ 'default_ui_config.in' ]
730 obj.target = 'default_ui_config'
731 obj.install_path = bld.env['CONFDIR']
732 set_subst_dict(obj, font_subst_dict)
736 if sys.platform == 'darwin':
737 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
739 menus_argv = [ '-E', '-P' ]
741 if bld.is_defined('PTFORMAT'):
742 menus_argv += [ '-DPTFORMAT' ]
744 # always build all versions of the menu definitions
745 # so that we can try them out with different program builds.
746 for program in [ 'ardour', 'trx' ]:
747 obj = bld(features = 'command-output')
749 obj.command_is_external = True
751 obj.argv = menus_argv
752 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
753 obj.stdin = program + '.menus.in'
754 obj.stdout = program + '.menus'
755 bld.install_files (bld.env['CONFDIR'], program + '.menus')
758 freedesktop_subst_dict = {
759 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
760 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
761 'VERSION': str (bld.env['VERSION']),
764 if bld.env['FREEDESKTOP']:
765 obj = bld(features = 'subst')
766 obj.source = 'ardour.desktop.in'
767 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
768 obj.chmod = Utils.O644
769 obj.dict = freedesktop_subst_dict
770 set_subst_dict(obj, freedesktop_subst_dict)
772 obj = bld(features = 'subst')
773 obj.source = 'ardour-mime-info.xml'
774 obj.target = 'ardour.xml'
775 obj.chmod = Utils.O644
777 # build appdata with translations
779 appdata_i18n_xmlin(bld)
780 obj = bld(features = 'subst')
781 obj.source = 'ardour.appdata.xml.in'
782 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
783 obj.chmod = Utils.O644
784 obj.dict = freedesktop_subst_dict
785 set_subst_dict(obj, freedesktop_subst_dict)
789 # NATIVE ARDOUR BINDING FILES
790 # explicitly state the use of perl here so that it works on windows too
792 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
793 for b in [ 'ardour' ] :
795 target = b + '.keys',
796 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
799 obj.install_path = bld.env['CONFDIR']
802 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
803 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
805 # Application/Product specific resources (icon, splash)
806 pgmname = Options.options.program_name;
807 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
809 if bld.env['build_target'] == 'mingw':
810 # These icons need to overwrite the files already installed in the icons
811 # directory above. Do this in the external packaging scripts for now.
812 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
813 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
815 # Default UI configuration
816 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
818 bld.install_files(bld.env['CONFDIR'], 'dark.colors')
820 # Default export stuff
821 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
824 if bld.is_defined('ENABLE_NLS'):
825 mo_files = bld.path.ant_glob('po/*.mo')
827 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
828 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
832 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
833 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
835 appdata_i18n_pot(bld)
839 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
840 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
842 appdata_i18n_pot(bld)
845 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
846 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
851 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
852 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
855 def appdata_i18n_pot(bld):
856 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
857 'ardour.appdata.pot')
858 if bld.cmd == 'build':
859 Logs.info('Generating pot file from Ardour appdata')
860 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
861 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
862 'ardour.appdata.xml.in.in')
863 Logs.info('Updating ' + potfile)
864 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
865 elif bld.cmd == 'clean' and os.path.exists(potfile):
866 Logs.info('Removing Ardour appdata pot file')
869 def appdata_i18n_po(bld):
870 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
871 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
873 def appdata_i18n_mo(bld):
874 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
875 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
877 def appdata_i18n_xmlin(bld):
878 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
879 'ardour.appdata.xml.in')
880 if bld.cmd == 'build':
881 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
882 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
883 'ardour.appdata.xml.in.in')
884 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
885 mo_files = glob.glob(mo_glob)
886 Logs.info('Generating ' + adxmlinfile)
887 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
888 '-j', adxmlininfile] + mo_files)
889 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
890 Logs.info('Removing ' + adxmlinfile)
891 os.remove(adxmlinfile)