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',
62 'color_theme_manager.cc',
65 'control_point_dialog.cc',
69 'duplicate_routes_dialog.cc',
70 'edit_note_dialog.cc',
74 'editor_audio_import.cc',
75 'editor_pt_import.cc',
76 'editor_audiotrack.cc',
78 'editor_canvas_events.cc',
79 'editor_component.cc',
82 'editor_route_groups.cc',
83 'editor_export_audio.cc',
84 'editor_group_tabs.cc',
86 'editor_locations.cc',
94 'editor_selection.cc',
95 'editor_snapshots.cc',
97 'editor_tempodisplay.cc',
101 'export_channel_selector.cc',
103 'export_file_notebook.cc',
104 'export_filename_selector.cc',
105 'export_format_dialog.cc',
106 'export_format_selector.cc',
107 'export_preset_selector.cc',
109 'export_timespan_selector.cc',
113 'floating_text_entry.cc',
114 'sfdb_freesound_mootcher.cc',
116 'generic_pluginui.cc',
118 'global_port_matrix.cc',
120 'gtk_pianokeyboard.c',
122 'insert_remove_time_dialog.cc',
123 'instrument_selector.cc',
124 'interthread_progress_window.cc',
133 'lua_script_manager.cc',
139 'midi_automation_line.cc',
140 'midi_channel_dialog.cc',
141 'midi_channel_selector.cc',
142 'midi_cut_buffer.cc',
143 'midi_export_dialog.cc',
144 'midi_list_editor.cc',
145 'midi_port_dialog.cc',
146 'midi_region_view.cc',
149 'midi_streamview.cc',
152 'midi_velocity_dialog.cc',
153 'missing_file_dialog.cc',
154 'missing_plugin_dialog.cc',
156 'mixer_group_tabs.cc',
162 'monitor_section.cc',
163 'monitor_selector.cc',
165 'mono_panner_editor.cc',
168 'new_plugin_preset_dialog.cc',
169 'normalize_dialog.cc',
173 'note_select_dialog.cc',
180 'panner_interface.cc',
183 'piano_roll_header.cc',
185 'playlist_selector.cc',
187 'plugin_pin_dialog.cc',
188 'plugin_setup_dialog.cc',
189 'plugin_selector.cc',
194 'port_matrix_body.cc',
195 'port_matrix_column_labels.cc',
196 'port_matrix_component.cc',
197 'port_matrix_grid.cc',
198 'port_matrix_labels.cc',
199 'port_matrix_row_labels.cc',
201 'patch_change_dialog.cc',
202 'progress_reporter.cc',
205 'quantize_dialog.cc',
206 'rc_option_editor.cc',
208 'region_gain_line.cc',
209 'region_layering_order_editor.cc',
210 'region_selection.cc',
214 'route_group_dialog.cc',
215 'route_group_menu.cc',
216 'route_params_ui.cc',
217 'route_processor_selection.cc',
218 'route_time_axis.cc',
222 'search_path_option.cc',
223 'script_selector.cc',
225 'selection_memento.cc',
228 'session_import_dialog.cc',
229 'session_metadata_dialog.cc',
230 'session_option_editor.cc',
232 'shuttle_control.cc',
233 'soundcloud_export_selector.cc',
240 'stereo_panner_editor.cc',
242 'strip_silence_dialog.cc',
244 'tape_region_view.cc',
250 'time_axis_view_item.cc',
256 'track_selection.cc',
257 'track_view_list.cc',
258 'transform_dialog.cc',
259 'transpose_dialog.cc',
262 'vca_master_strip.cc',
264 'visibility_group.cc',
266 # video-timeline related sources:
267 'video_image_frame.cc',
268 'add_video_dialog.cc',
269 'editor_videotimeline.cc',
273 'transcode_ffmpeg.cc',
274 'transcode_video_dialog.cc',
275 'video_server_dialog.cc',
277 'export_video_dialog.cc',
278 'export_video_infobox.cc',
279 'video_tool_paths.cc'
282 def enoify (major, minor):
283 # Code names based on
284 # https://en.wikipedia.org/wiki/Brian_Eno_discography
286 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
287 # (no Singles, no EPs, no Video Albums, no Production)
289 return "\\n\\\"E-No\\\""
292 return "\\n\\\"No Pussyfooting\\\""
294 return "\\n\\\"Here Come the Warm Jets\\\""
296 return "\\n\\\"Taking Tiger Mountain\\\""
298 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
300 return "\\n\\\"Discreet Music\\\""
302 return "\\n\\\"Another Green World\\\""
304 return "\\n\\\"Evening Star\\\""
306 return "\\n\\\"Cluster and Eno\\\""
309 return "\\n\\\"Before and After Science\\\""
311 return "\\n\\\"After the Heat\\\""
315 autowaf.set_options(opt)
319 conf.load('compiler_cxx')
320 autowaf.configure(conf)
322 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
324 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
326 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
327 atleast_version='3.3.5', mandatory=False)
328 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
329 atleast_version='1.2.1')
330 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
331 atleast_version='2.10.1')
332 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
333 atleast_version='2.18')
334 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
335 atleast_version='2.18')
336 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
337 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
338 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
341 if sys.platform == 'darwin':
342 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
343 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
344 env = conf.env.derive (),
347 compile_filename='test.m',
352 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
353 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
355 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
357 conf.write_config_header('gtk2ardour-config.h', remove=False)
359 bak = conf.env['define_key']
360 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
361 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
362 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
363 conf.write_config_header('gtk2ardour-version.h')
364 conf.env['define_key'] = bak;
367 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
368 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
370 # Add a waf `feature' to allow compilation of things using winegcc
371 from waflib.TaskGen import feature
373 def set_winegcc(self):
374 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
375 self.env.CC = 'winegcc'
377 def _doPyp(infileName, deps = False):
380 re_spaces = re.compile("\s+")
382 if infileName == '-':
385 fd = open(infileName)
386 inLines = fd.readlines()
392 bits = re_spaces.split(line)
393 if bits[0] == '##include':
398 # assume included file comes from same place as source file
399 incName = os.path.join (os.path.dirname (infileName), incName);
400 outStr += _doPyp(incName)
411 def include_processor(task):
412 infileName = task.inputs[0].srcpath()
413 outfileName = os.path.join(out, task.outputs[0].bldpath())
414 fdOut = open (outfileName, "w")
415 fdOut.write (_doPyp(infileName))
419 def build_color_scheme(path, prefix):
423 if re.search ('^#@color', line):
424 line.strip() # remove newline
426 if len(color_scheme):
428 color_scheme += prefix
430 color_scheme += words[1]
432 color_scheme += words[2]
438 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
439 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
441 # Tool to dump lua-bindings (of gtk2ardour + libs)
442 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
443 obj = bld (features = 'cxx c cxxprogram')
444 obj.install_path = None
445 obj.source = list(gtk2_ardour_sources)
446 obj.target = 'luadoc'
447 obj.includes = ['.', '../libs']
448 obj.ldflags = ['-no-undefined']
461 'PACKAGE="' + I18N_PACKAGE + '"',
462 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
463 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
464 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
467 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
468 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
469 if bld.is_defined('HAVE_SUIL'):
470 obj.source += [ 'lv2_plugin_ui.cc' ]
471 obj.use += [ 'SUIL' ]
472 if bld.is_defined('LXVST_SUPPORT'):
473 obj.source += [ 'vst_plugin_ui.cc' ]
474 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
475 obj.defines += [ 'LXVST_SUPPORT' ]
479 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
480 # Windows VST support w/wine
481 # If we require VST support we build a stub main() and the FST library
482 # here using winegcc, and link it to the GTK front-end library
483 obj = bld (features = 'cxx c cxxprogram wine')
484 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
486 # XXX do we really need to explicitly link to all of these for the wine executable?
488 obj.use = [ 'libpbd',
499 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
500 obj.includes = [ '../libs/fst', '.' ]
501 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
502 obj.linkflags += bld.env['LDFLAGS']
503 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
504 obj.install_path = bld.env['DLLDIR']
505 # end of the wine executable
507 # now the shared library containing the GTK GUI for ardour
508 obj = bld (features = 'cxx c cxxshlib')
509 # operate on copy to avoid adding sources twice
510 obj.source = list(gtk2_ardour_sources)
511 obj.includes = [ '../libs/fst', '.' ]
512 obj.name = 'libgtk2_ardour'
513 obj.target = 'gtk2_ardour'
514 obj.cflags = [ '-fPIC' ]
517 # just the normal executable version of the GTK GUI
518 if bld.env['build_target'] == 'mingw':
519 obj = bld (features = 'cxx c cxxprogram winres')
521 obj = bld (features = 'cxx c cxxprogram')
522 # operate on copy to avoid adding sources twice
523 obj.source = list(gtk2_ardour_sources)
524 obj.target = 'ardour-' + str (bld.env['VERSION'])
526 obj.ldflags = ['-no-undefined']
528 if bld.is_defined('WINDOWS_VST_SUPPORT'):
529 # Windows VST support mingw
530 obj.includes += [ '../libs/fst' ]
532 # at this point, "obj" refers to either the normal native executable
533 # OR the shared library built for use with wine on linux.
535 obj.use = [ 'libpbd',
546 'PACKAGE="' + I18N_PACKAGE + '"',
547 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
548 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
549 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
551 obj.install_path = bld.env['DLLDIR']
553 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
555 if sys.platform == 'darwin':
556 obj.uselib += ' AUDIOUNITS OSX '
557 obj.use += ' libappleutility'
558 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
559 elif bld.env['build_target'] == 'mingw':
560 obj.source += [ 'bundle_env_mingw.cc' ]
561 obj.source += [ 'windows_icon.rc' ]
563 obj.source += [ 'bundle_env_linux.cc' ]
565 obj.includes += ['../libs']
567 obj.use += 'libptformat'
569 if bld.env['build_target'] == 'mingw':
570 obj.linkflags += ' -mwindows'
572 if bld.is_defined('HAVE_SUIL'):
573 obj.source += [ 'lv2_plugin_ui.cc' ]
574 obj.use += [ 'SUIL' ]
576 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
577 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
579 if bld.is_defined('NEED_INTL'):
580 obj.linkflags += ' -lintl'
582 if bld.is_defined('WINDOWS_VST_SUPPORT'):
583 obj.source += [ 'windows_vst_plugin_ui.cc' ]
584 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
585 if bld.env['build_target'] != 'mingw':
588 if bld.is_defined('LXVST_SUPPORT'):
589 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
590 obj.defines += [ 'LXVST_SUPPORT' ]
593 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
594 obj.source += [ 'vst_plugin_ui.cc' ]
596 if bld.is_defined('PHONE_HOME'):
597 obj.defines += [ 'PHONE_HOME' ]
599 if bld.is_defined('HAVE_COREAUDIO'):
600 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
601 obj.use += ' libappleutility '
603 if bld.is_defined('AUDIOUNIT_SUPPORT'):
604 obj.source += [ 'au_pluginui.mm' ]
608 wrapper_subst_dict = {
609 'INSTALL_PREFIX' : bld.env['PREFIX'],
610 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
611 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
612 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
613 'LIBS' : 'build/libs',
614 'VERSION' : str (bld.env['VERSION']),
615 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
618 def set_subst_dict(obj, dict):
620 setattr(obj, i, dict[i])
622 obj = bld(features = 'subst')
623 obj.source = 'ardev_common.sh.in'
624 obj.target = 'ardev_common_waf.sh'
625 obj.chmod = Utils.O755
626 obj.dict = wrapper_subst_dict
627 set_subst_dict(obj, wrapper_subst_dict)
629 obj = bld(features = 'subst')
630 obj.source = 'ardour.sh.in'
631 obj.target = 'ardour' + str (bld.env['MAJOR'])
632 obj.chmod = Utils.O755
633 obj.dict = wrapper_subst_dict
634 obj.install_path = bld.env['BINDIR']
635 set_subst_dict(obj, wrapper_subst_dict)
637 if bld.is_defined('WINDOWS_VST_SUPPORT'):
638 obj = bld(features = 'subst')
639 obj.source = '../vst/ardourvst.in'
640 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
641 obj.chmod = Utils.O755
642 obj.dict = wrapper_subst_dict
643 obj.install_path = bld.env['BINDIR']
644 set_subst_dict(obj, wrapper_subst_dict)
653 if sys.platform == 'darwin':
667 # There is no acceptable monospace font available on older versions of OS X
668 # and no API on those versions to load TTF files that will work with
669 # GTK/fontconfig/pango.
671 # In addition, the ArdourMono font gets clipped for some reason on OS X
673 # Moreover, Lucida Grande just seems to work even though it is not monospace
677 'MONOSPACE' : 'Monaco',
678 'CLOCKFONT' : 'Lucida Grande',
680 else: # Linux/X11 fonts
681 basefont = '' # unspecified - use system defaults
694 'MONOSPACE' : 'ArdourMono',
695 'CLOCKFONT' : 'ArdourMono',
698 # Set up font substitution dictionary
700 for style in ['', 'BOLD', 'ITALIC']:
701 for sizename,points in iter(font_sizes.items()):
703 key = "_".join (['FONT',style,sizename])
704 fontstyle = " ".join ([basefont,style.lower(),points])
706 key = "_".join (['FONT',sizename])
707 fontstyle = " ".join ([basefont,points])
709 font_subst_dict[key] = fontstyle
712 for sizename,points in iter(font_sizes.items()):
713 key = "_".join (['FONT_SIZE',sizename])
714 font_subst_dict[key] = points
716 # various font names, eg @BOLD_MONOSPACE@
717 for font_sym,text in iter(font_names.items()):
719 font_subst_dict[key] = text
723 obj = bld(features = 'subst')
724 obj.source = [ 'clearlooks.rc.in' ]
725 obj.target = 'clearlooks.rc'
726 obj.install_path = bld.env['CONFDIR']
727 set_subst_dict(obj, font_subst_dict)
729 obj = bld(features = 'subst')
730 obj.source = [ 'default_ui_config.in' ]
731 obj.target = 'default_ui_config'
732 obj.install_path = bld.env['CONFDIR']
733 set_subst_dict(obj, font_subst_dict)
737 if sys.platform == 'darwin':
738 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
740 menus_argv = [ '-E', '-P' ]
742 if bld.is_defined('PTFORMAT'):
743 menus_argv += [ '-DPTFORMAT' ]
745 # always build all versions of the menu definitions
746 # so that we can try them out with different program builds.
747 for program in [ 'ardour', 'trx' ]:
748 obj = bld(features = 'command-output')
750 obj.command_is_external = True
752 obj.argv = menus_argv
753 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
754 obj.stdin = program + '.menus.in'
755 obj.stdout = program + '.menus'
756 bld.install_files (bld.env['CONFDIR'], program + '.menus')
759 freedesktop_subst_dict = {
760 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
761 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
762 'VERSION': str (bld.env['VERSION']),
765 if bld.env['FREEDESKTOP']:
766 obj = bld(features = 'subst')
767 obj.source = 'ardour.desktop.in'
768 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
769 obj.chmod = Utils.O644
770 obj.dict = freedesktop_subst_dict
771 set_subst_dict(obj, freedesktop_subst_dict)
773 obj = bld(features = 'subst')
774 obj.source = 'ardour-mime-info.xml'
775 obj.target = 'ardour.xml'
776 obj.chmod = Utils.O644
778 # build appdata with translations
780 appdata_i18n_xmlin(bld)
781 obj = bld(features = 'subst')
782 obj.source = 'ardour.appdata.xml.in'
783 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
784 obj.chmod = Utils.O644
785 obj.dict = freedesktop_subst_dict
786 set_subst_dict(obj, freedesktop_subst_dict)
790 # NATIVE ARDOUR BINDING FILES
791 # explicitly state the use of perl here so that it works on windows too
793 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
794 for b in [ 'ardour' ] :
796 target = b + '.keys',
797 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
800 obj.install_path = bld.env['CONFDIR']
803 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
804 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
806 # Application/Product specific resources (icon, splash)
807 pgmname = Options.options.program_name;
808 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
810 if bld.env['build_target'] == 'mingw':
811 # These icons need to overwrite the files already installed in the icons
812 # directory above. Do this in the external packaging scripts for now.
813 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
814 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
816 # Default UI configuration
817 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
818 # Color Themes. Find each color file for this program, strip the program name
820 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + Options.options.program_name.lower() + '.colors'));
822 # Default export stuff
823 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
826 if bld.is_defined('ENABLE_NLS'):
827 mo_files = bld.path.ant_glob('po/*.mo')
829 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
830 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
834 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
835 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
837 appdata_i18n_pot(bld)
841 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
842 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
844 appdata_i18n_pot(bld)
847 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
848 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
853 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
854 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
857 def appdata_i18n_pot(bld):
858 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
859 'ardour.appdata.pot')
860 if bld.cmd == 'build':
861 Logs.info('Generating pot file from Ardour appdata')
862 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
863 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
864 'ardour.appdata.xml.in.in')
865 Logs.info('Updating ' + potfile)
866 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
867 elif bld.cmd == 'clean' and os.path.exists(potfile):
868 Logs.info('Removing Ardour appdata pot file')
871 def appdata_i18n_po(bld):
872 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
873 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
875 def appdata_i18n_mo(bld):
876 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
877 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
879 def appdata_i18n_xmlin(bld):
880 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
881 'ardour.appdata.xml.in')
882 if bld.cmd == 'build':
883 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
884 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
885 'ardour.appdata.xml.in.in')
886 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
887 mo_files = glob.glob(mo_glob)
888 Logs.info('Generating ' + adxmlinfile)
889 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
890 '-j', adxmlininfile] + mo_files)
891 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
892 Logs.info('Removing ' + adxmlinfile)
893 os.remove(adxmlinfile)