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
19 path_prefix = 'gtk2_ardour/'
21 gtk2_ardour_sources = [
24 'add_route_dialog.cc',
25 'ambiguous_file_dialog.cc',
34 'ardour_ui_dependents.cc',
35 'ardour_ui_dialogs.cc',
38 'ardour_ui_options.cc',
41 'audio_region_editor.cc',
42 'audio_region_view.cc',
43 'audio_streamview.cc',
45 'automation_controller.cc',
47 'automation_region_view.cc',
48 'automation_streamview.cc',
49 'automation_time_axis.cc',
51 'big_clock_window.cc',
57 'control_point_dialog.cc',
61 'duplicate_routes_dialog.cc',
62 'edit_note_dialog.cc',
66 'editor_audio_import.cc',
67 'editor_pt_import.cc',
68 'editor_audiotrack.cc',
70 'editor_canvas_events.cc',
71 'editor_component.cc',
74 'editor_route_groups.cc',
75 'editor_export_audio.cc',
76 'editor_group_tabs.cc',
78 'editor_locations.cc',
86 'editor_selection.cc',
87 'editor_snapshots.cc',
89 'editor_tempodisplay.cc',
93 'export_channel_selector.cc',
95 'export_file_notebook.cc',
96 'export_filename_selector.cc',
97 'export_format_dialog.cc',
98 'export_format_selector.cc',
99 'export_preset_selector.cc',
101 'export_timespan_selector.cc',
105 'floating_text_entry.cc',
106 'sfdb_freesound_mootcher.cc',
108 'generic_pluginui.cc',
110 'global_port_matrix.cc',
112 'gtk_pianokeyboard.c',
114 'insert_remove_time_dialog.cc',
115 'instrument_selector.cc',
116 'interthread_progress_window.cc',
125 'lua_script_manager.cc',
131 'midi_automation_line.cc',
132 'midi_channel_dialog.cc',
133 'midi_channel_selector.cc',
134 'midi_cut_buffer.cc',
135 'midi_export_dialog.cc',
136 'midi_list_editor.cc',
137 'midi_port_dialog.cc',
138 'midi_region_view.cc',
141 'midi_streamview.cc',
144 'midi_velocity_dialog.cc',
145 'missing_file_dialog.cc',
146 'missing_plugin_dialog.cc',
148 'mixer_group_tabs.cc',
154 'monitor_section.cc',
155 'monitor_selector.cc',
157 'mono_panner_editor.cc',
160 'new_plugin_preset_dialog.cc',
161 'normalize_dialog.cc',
165 'note_select_dialog.cc',
172 'panner_interface.cc',
175 'piano_roll_header.cc',
177 'playlist_selector.cc',
179 'plugin_selector.cc',
184 'port_matrix_body.cc',
185 'port_matrix_column_labels.cc',
186 'port_matrix_component.cc',
187 'port_matrix_grid.cc',
188 'port_matrix_labels.cc',
189 'port_matrix_row_labels.cc',
191 'patch_change_dialog.cc',
192 'progress_reporter.cc',
195 'quantize_dialog.cc',
196 'rc_option_editor.cc',
198 'region_gain_line.cc',
199 'region_layering_order_editor.cc',
200 'region_selection.cc',
204 'route_group_dialog.cc',
205 'route_group_menu.cc',
206 'route_params_ui.cc',
207 'route_processor_selection.cc',
208 'route_time_axis.cc',
212 'search_path_option.cc',
213 'script_selector.cc',
215 'selection_memento.cc',
218 'session_import_dialog.cc',
219 'session_metadata_dialog.cc',
220 'session_option_editor.cc',
222 'shuttle_control.cc',
223 'soundcloud_export_selector.cc',
230 'stereo_panner_editor.cc',
232 'strip_silence_dialog.cc',
234 'tape_region_view.cc',
239 'time_axis_view_item.cc',
245 'track_selection.cc',
246 'track_view_list.cc',
247 'transform_dialog.cc',
248 'transpose_dialog.cc',
252 'visibility_group.cc',
254 # video-timeline related sources:
255 'video_image_frame.cc',
256 'add_video_dialog.cc',
257 'editor_videotimeline.cc',
260 'transcode_ffmpeg.cc',
261 'transcode_video_dialog.cc',
262 'video_server_dialog.cc',
264 'export_video_dialog.cc',
265 'export_video_infobox.cc',
266 'video_tool_paths.cc'
269 def enoify (major, minor):
270 # Code names based on
271 # https://en.wikipedia.org/wiki/Brian_Eno_discography
273 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
274 # (no Singles, no EPs, no Video Albums, no Production)
276 return "\\n\\\"E-No\\\""
279 return "\\n\\\"No Pussyfooting\\\""
281 return "\\n\\\"Here Come the Warm Jets\\\""
283 return "\\n\\\"Taking Tiger Mountain\\\""
285 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
287 return "\\n\\\"Discreet Music\\\""
289 return "\\n\\\"Another Green World\\\""
291 return "\\n\\\"Evening Star\\\""
293 return "\\n\\\"Cluster and Eno\\\""
295 return "\\n\\\"Before and After Science\\\""
299 autowaf.set_options(opt)
303 conf.load('compiler_cxx')
304 autowaf.configure(conf)
306 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
308 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
310 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
311 atleast_version='3.3.5', mandatory=False)
312 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
313 atleast_version='1.2.1')
314 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
315 atleast_version='2.10.1')
316 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
317 atleast_version='2.18')
318 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
319 atleast_version='2.18')
320 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
321 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
322 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
324 conf.write_config_header('gtk2ardour-config.h', remove=False)
326 bak = conf.env['define_key']
327 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
328 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
329 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
330 conf.write_config_header('gtk2ardour-version.h')
331 conf.env['define_key'] = bak;
334 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
335 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
337 # Add a waf `feature' to allow compilation of things using winegcc
338 from waflib.TaskGen import feature
340 def set_winegcc(self):
341 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
342 self.env.CC = 'winegcc'
344 def _doPyp(infileName, deps = False):
347 re_spaces = re.compile("\s+")
349 if infileName == '-':
352 fd = open(infileName)
353 inLines = fd.readlines()
359 bits = re_spaces.split(line)
360 if bits[0] == '##include':
365 # assume included file comes from same place as source file
366 incName = os.path.join (os.path.dirname (infileName), incName);
367 outStr += _doPyp(incName)
378 def include_processor(task):
379 infileName = task.inputs[0].srcpath()
380 outfileName = os.path.join(out, task.outputs[0].bldpath())
381 fdOut = open (outfileName, "w")
382 fdOut.write (_doPyp(infileName))
386 def build_color_scheme(path, prefix):
390 if re.search ('^#@color', line):
391 line.strip() # remove newline
393 if len(color_scheme):
395 color_scheme += prefix
397 color_scheme += words[1]
399 color_scheme += words[2]
405 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
406 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
408 # Tool to dump lua-bindings (of gtk2ardour + libs)
409 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
410 obj = bld (features = 'cxx c cxxprogram')
411 obj.install_path = None
412 obj.source = list(gtk2_ardour_sources)
413 obj.target = 'luadoc'
414 obj.includes = ['.', '../libs']
415 obj.ldflags = ['-no-undefined']
428 'PACKAGE="' + I18N_PACKAGE + '"',
429 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
430 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
431 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
434 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
435 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
436 if bld.is_defined('HAVE_SUIL'):
437 obj.source += [ 'lv2_plugin_ui.cc' ]
438 obj.use += [ 'SUIL' ]
439 if bld.is_defined('LXVST_SUPPORT'):
440 obj.source += [ 'vst_plugin_ui.cc' ]
441 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
442 obj.defines += [ 'LXVST_SUPPORT' ]
446 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
447 # Windows VST support w/wine
448 # If we require VST support we build a stub main() and the FST library
449 # here using winegcc, and link it to the GTK front-end library
450 obj = bld (features = 'cxx c cxxprogram wine')
451 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
453 # XXX do we really need to explicitly link to all of these for the wine executable?
455 obj.use = [ 'libpbd',
466 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
467 obj.includes = [ '../libs/fst', '.' ]
468 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
469 obj.linkflags += bld.env['LDFLAGS']
470 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
471 obj.install_path = bld.env['DLLDIR']
472 # end of the wine executable
474 # now the shared library containing the GTK GUI for ardour
475 obj = bld (features = 'cxx c cxxshlib')
476 # operate on copy to avoid adding sources twice
477 obj.source = list(gtk2_ardour_sources)
478 obj.includes = [ '../libs/fst', '.' ]
479 obj.name = 'libgtk2_ardour'
480 obj.target = 'gtk2_ardour'
481 obj.cflags = [ '-fPIC' ]
484 # just the normal executable version of the GTK GUI
485 if bld.env['build_target'] == 'mingw':
486 obj = bld (features = 'cxx c cxxprogram winres')
488 obj = bld (features = 'cxx c cxxprogram')
489 # operate on copy to avoid adding sources twice
490 obj.source = list(gtk2_ardour_sources)
491 obj.target = 'ardour-' + str (bld.env['VERSION'])
493 obj.ldflags = ['-no-undefined']
495 if bld.is_defined('WINDOWS_VST_SUPPORT'):
496 # Windows VST support mingw
497 obj.includes += [ '../libs/fst' ]
499 # at this point, "obj" refers to either the normal native executable
500 # OR the shared library built for use with wine on linux.
502 obj.use = [ 'libpbd',
513 'PACKAGE="' + I18N_PACKAGE + '"',
514 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
515 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
516 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
518 obj.install_path = bld.env['DLLDIR']
520 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
522 if sys.platform == 'darwin':
523 obj.uselib += ' AUDIOUNITS OSX '
524 obj.use += ' libappleutility'
525 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
526 elif bld.env['build_target'] == 'mingw':
527 obj.source += [ 'bundle_env_mingw.cc' ]
528 obj.source += [ 'windows_icon.rc' ]
530 obj.source += [ 'bundle_env_linux.cc' ]
532 obj.includes += ['../libs']
534 obj.use += 'libptformat'
536 if bld.env['build_target'] == 'mingw':
537 obj.linkflags += ' -mwindows'
539 if bld.is_defined('HAVE_SUIL'):
540 obj.source += [ 'lv2_plugin_ui.cc' ]
541 obj.use += [ 'SUIL' ]
543 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
544 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
546 if bld.is_defined('NEED_INTL'):
547 obj.linkflags += ' -lintl'
549 if bld.is_defined('WINDOWS_VST_SUPPORT'):
550 obj.source += [ 'windows_vst_plugin_ui.cc' ]
551 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
552 if bld.env['build_target'] != 'mingw':
555 if bld.is_defined('LXVST_SUPPORT'):
556 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
557 obj.defines += [ 'LXVST_SUPPORT' ]
560 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
561 obj.source += [ 'vst_plugin_ui.cc' ]
563 if bld.is_defined('PHONE_HOME'):
564 obj.defines += [ 'PHONE_HOME' ]
566 if bld.is_defined('HAVE_COREAUDIO'):
567 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
568 obj.use += ' libappleutility '
570 if bld.is_defined('AUDIOUNIT_SUPPORT'):
571 obj.source += [ 'au_pluginui.mm' ]
575 wrapper_subst_dict = {
576 'INSTALL_PREFIX' : bld.env['PREFIX'],
577 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
578 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
579 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
580 'LIBS' : 'build/libs',
581 'VERSION' : str (bld.env['VERSION']),
582 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
585 def set_subst_dict(obj, dict):
587 setattr(obj, i, dict[i])
589 obj = bld(features = 'subst')
590 obj.source = 'ardev_common.sh.in'
591 obj.target = 'ardev_common_waf.sh'
592 obj.chmod = Utils.O755
593 obj.dict = wrapper_subst_dict
594 set_subst_dict(obj, wrapper_subst_dict)
596 obj = bld(features = 'subst')
597 obj.source = 'ardour.sh.in'
598 obj.target = 'ardour' + str (bld.env['MAJOR'])
599 obj.chmod = Utils.O755
600 obj.dict = wrapper_subst_dict
601 obj.install_path = bld.env['BINDIR']
602 set_subst_dict(obj, wrapper_subst_dict)
604 if bld.is_defined('WINDOWS_VST_SUPPORT'):
605 obj = bld(features = 'subst')
606 obj.source = '../vst/ardourvst.in'
607 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
608 obj.chmod = Utils.O755
609 obj.dict = wrapper_subst_dict
610 obj.install_path = bld.env['BINDIR']
611 set_subst_dict(obj, wrapper_subst_dict)
620 if sys.platform == 'darwin':
634 # There is no acceptable monospace font available on older versions of OS X
635 # and no API on those versions to load TTF files that will work with
636 # GTK/fontconfig/pango.
638 # In addition, the ArdourMono font gets clipped for some reason on OS X
640 # Moreover, Lucida Grande just seems to work even though it is not monospace
644 'MONOSPACE' : 'Monaco',
645 'CLOCKFONT' : 'Lucida Grande',
647 else: # Linux/X11 fonts
648 basefont = '' # unspecified - use system defaults
661 'MONOSPACE' : 'ArdourMono',
662 'CLOCKFONT' : 'ArdourMono',
665 # Set up font substitution dictionary
667 for style in ['', 'BOLD', 'ITALIC']:
668 for sizename,points in iter(font_sizes.items()):
670 key = "_".join (['FONT',style,sizename])
671 fontstyle = " ".join ([basefont,style.lower(),points])
673 key = "_".join (['FONT',sizename])
674 fontstyle = " ".join ([basefont,points])
676 font_subst_dict[key] = fontstyle
679 for sizename,points in iter(font_sizes.items()):
680 key = "_".join (['FONT_SIZE',sizename])
681 font_subst_dict[key] = points
683 # various font names, eg @BOLD_MONOSPACE@
684 for font_sym,text in iter(font_names.items()):
686 font_subst_dict[key] = text
690 obj = bld(features = 'subst')
691 obj.source = [ 'clearlooks.rc.in' ]
692 obj.target = 'clearlooks.rc'
693 obj.install_path = bld.env['CONFDIR']
694 set_subst_dict(obj, font_subst_dict)
696 obj = bld(features = 'subst')
697 obj.source = [ 'default_ui_config.in' ]
698 obj.target = 'default_ui_config'
699 obj.install_path = bld.env['CONFDIR']
700 set_subst_dict(obj, font_subst_dict)
704 if sys.platform == 'darwin':
705 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
707 menus_argv = [ '-E', '-P' ]
709 if bld.is_defined('PTFORMAT'):
710 menus_argv += [ '-DPTFORMAT' ]
712 # always build all versions of the menu definitions
713 # so that we can try them out with different program builds.
714 for program in [ 'ardour', 'trx' ]:
715 obj = bld(features = 'command-output')
717 obj.command_is_external = True
719 obj.argv = menus_argv
720 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
721 obj.stdin = program + '.menus.in'
722 obj.stdout = program + '.menus'
723 bld.install_files (bld.env['CONFDIR'], program + '.menus')
726 freedesktop_subst_dict = {
727 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
728 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
729 'VERSION': str (bld.env['VERSION']),
732 if bld.env['FREEDESKTOP']:
733 obj = bld(features = 'subst')
734 obj.source = 'ardour.desktop.in'
735 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
736 obj.chmod = Utils.O644
737 obj.dict = freedesktop_subst_dict
738 set_subst_dict(obj, freedesktop_subst_dict)
740 obj = bld(features = 'subst')
741 obj.source = 'ardour-mime-info.xml'
742 obj.target = 'ardour.xml'
743 obj.chmod = Utils.O644
745 # build appdata with translations
747 appdata_i18n_xmlin(bld)
748 obj = bld(features = 'subst')
749 obj.source = 'ardour.appdata.xml.in'
750 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
751 obj.chmod = Utils.O644
752 obj.dict = freedesktop_subst_dict
753 set_subst_dict(obj, freedesktop_subst_dict)
757 # NATIVE ARDOUR BINDING FILES
758 # explicitly state the use of perl here so that it works on windows too
760 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
761 for b in [ 'ardour' ] :
763 target = b + '.keys',
764 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
767 obj.install_path = bld.env['CONFDIR']
769 # not modified at present
770 bld.install_files(bld.env['CONFDIR'], 'dark.colors')
773 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
774 bld.install_files(os.path.join (bld.env['DATADIR'], 'pixmaps'), bld.path.ant_glob('pixmaps/*.xpm'))
775 bld.install_files(bld.env['DATADIR'], 'splash.png')
776 bld.install_files(bld.env['DATADIR'], 'small-splash.png')
777 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
779 if bld.env['build_target'] == 'mingw':
780 # These icons need to overwrite the files already installed in the icons
781 # directory above. Do this in the external packaging scripts for now.
782 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
783 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
785 # Default UI configuration
786 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
788 bld.install_files(bld.env['CONFDIR'], 'dark.colors')
790 # Default export stuff
791 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
794 if bld.is_defined('ENABLE_NLS'):
795 mo_files = bld.path.ant_glob('po/*.mo')
797 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
798 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
802 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
803 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
805 appdata_i18n_pot(bld)
809 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
810 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
812 appdata_i18n_pot(bld)
815 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
816 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
821 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
822 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
825 def appdata_i18n_pot(bld):
826 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
827 'ardour.appdata.pot')
828 if bld.cmd == 'build':
829 Logs.info('Generating pot file from Ardour appdata')
830 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
831 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
832 'ardour.appdata.xml.in.in')
833 Logs.info('Updating ' + potfile)
834 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
835 elif bld.cmd == 'clean' and os.path.exists(potfile):
836 Logs.info('Removing Ardour appdata pot file')
839 def appdata_i18n_po(bld):
840 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
841 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
843 def appdata_i18n_mo(bld):
844 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
845 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
847 def appdata_i18n_xmlin(bld):
848 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
849 'ardour.appdata.xml.in')
850 if bld.cmd == 'build':
851 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
852 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
853 'ardour.appdata.xml.in.in')
854 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
855 mo_files = glob.glob(mo_glob)
856 Logs.info('Generating ' + adxmlinfile)
857 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
858 '-j', adxmlininfile] + mo_files)
859 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
860 Logs.info('Removing ' + adxmlinfile)
861 os.remove(adxmlinfile)