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',
43 'ardour_ui_dependents.cc',
44 'ardour_ui_dialogs.cc',
47 'ardour_ui_options.cc',
50 'audio_region_editor.cc',
51 'audio_region_view.cc',
52 'audio_streamview.cc',
54 'automation_controller.cc',
56 'automation_region_view.cc',
57 'automation_streamview.cc',
58 'automation_time_axis.cc',
60 'big_clock_window.cc',
64 'color_theme_manager.cc',
67 'control_point_dialog.cc',
68 'control_slave_ui.cc',
72 'duplicate_routes_dialog.cc',
73 'edit_note_dialog.cc',
77 'editor_audio_import.cc',
78 'editor_pt_import.cc',
79 'editor_audiotrack.cc',
81 'editor_canvas_events.cc',
82 'editor_component.cc',
85 'editor_route_groups.cc',
86 'editor_export_audio.cc',
87 'editor_group_tabs.cc',
89 'editor_locations.cc',
97 'editor_selection.cc',
98 'editor_snapshots.cc',
100 'editor_tempodisplay.cc',
104 'export_channel_selector.cc',
106 'export_file_notebook.cc',
107 'export_filename_selector.cc',
108 'export_format_dialog.cc',
109 'export_format_selector.cc',
110 'export_preset_selector.cc',
112 'export_timespan_selector.cc',
116 'floating_text_entry.cc',
117 'sfdb_freesound_mootcher.cc',
119 'generic_pluginui.cc',
121 'global_port_matrix.cc',
123 'gtk_pianokeyboard.c',
125 'insert_remove_time_dialog.cc',
126 'instrument_selector.cc',
127 'interthread_progress_window.cc',
136 'lua_script_manager.cc',
142 'midi_automation_line.cc',
143 'midi_channel_dialog.cc',
144 'midi_channel_selector.cc',
145 'midi_cut_buffer.cc',
146 'midi_export_dialog.cc',
147 'midi_list_editor.cc',
148 'midi_region_view.cc',
151 'midi_streamview.cc',
154 'midi_velocity_dialog.cc',
155 'missing_file_dialog.cc',
156 'missing_plugin_dialog.cc',
157 'mixer_group_tabs.cc',
163 'monitor_section.cc',
164 'monitor_selector.cc',
166 'mono_panner_editor.cc',
169 'new_plugin_preset_dialog.cc',
170 'normalize_dialog.cc',
174 'note_select_dialog.cc',
181 'panner_interface.cc',
184 'piano_roll_header.cc',
186 'playlist_selector.cc',
188 'plugin_pin_dialog.cc',
189 'plugin_setup_dialog.cc',
190 'plugin_selector.cc',
195 'port_matrix_body.cc',
196 'port_matrix_column_labels.cc',
197 'port_matrix_component.cc',
198 'port_matrix_grid.cc',
199 'port_matrix_labels.cc',
200 'port_matrix_row_labels.cc',
202 'patch_change_dialog.cc',
203 'progress_reporter.cc',
206 'quantize_dialog.cc',
207 'rc_option_editor.cc',
209 'region_gain_line.cc',
210 'region_layering_order_editor.cc',
211 'region_selection.cc',
215 'route_group_dialog.cc',
216 'route_group_menu.cc',
217 'route_params_ui.cc',
218 'route_processor_selection.cc',
219 'route_time_axis.cc',
223 'search_path_option.cc',
224 'script_selector.cc',
226 'selection_memento.cc',
228 'session_archive_dialog.cc',
230 'session_import_dialog.cc',
231 'session_metadata_dialog.cc',
232 'session_option_editor.cc',
234 'shuttle_control.cc',
235 'soundcloud_export_selector.cc',
242 'stereo_panner_editor.cc',
244 'strip_silence_dialog.cc',
246 'tape_region_view.cc',
252 'time_axis_view_item.cc',
258 'track_selection.cc',
259 'track_view_list.cc',
260 'transform_dialog.cc',
261 'transpose_dialog.cc',
264 'vca_master_strip.cc',
266 'visibility_group.cc',
268 # video-timeline related sources:
269 'video_image_frame.cc',
270 'add_video_dialog.cc',
271 'editor_videotimeline.cc',
275 'transcode_ffmpeg.cc',
276 'transcode_video_dialog.cc',
277 'video_server_dialog.cc',
279 'export_video_dialog.cc',
280 'export_video_infobox.cc',
281 'video_tool_paths.cc'
284 def enoify (major, minor):
285 # Code names based on
286 # https://en.wikipedia.org/wiki/Brian_Eno_discography
288 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
289 # (no Singles, no EPs, no Video Albums, no Production)
291 return "\\n\\\"E-No\\\""
294 return "\\n\\\"No Pussyfooting\\\""
296 return "\\n\\\"Here Come the Warm Jets\\\""
298 return "\\n\\\"Taking Tiger Mountain\\\""
300 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
302 return "\\n\\\"Discreet Music\\\""
304 return "\\n\\\"Another Green World\\\""
306 return "\\n\\\"Evening Star\\\""
308 return "\\n\\\"Cluster and Eno\\\""
311 return "\\n\\\"Before and After Science\\\""
313 return "\\n\\\"After the Heat\\\""
315 return "\\n\\\"Music for Airports\\\""
317 return "\\n\\\"Music for Films\\\""
319 return "\\n\\\"In a Land of Clear Colours\\\""
321 return "\\n\\\"The Plateaux of Mirror\\\""
323 return "\\n\\\"Possible Musics\\\""
325 return "\\n\\\"My Life in the Bush of Ghosts\\\""
329 autowaf.set_options(opt)
333 conf.load('compiler_cxx')
334 autowaf.configure(conf)
336 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
338 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
340 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
341 atleast_version='3.3.5', mandatory=False)
342 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
343 atleast_version='1.2.1')
344 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
345 atleast_version='2.10.1')
346 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
347 atleast_version='2.18')
348 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
349 atleast_version='2.18')
350 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
351 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
352 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
353 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
356 if sys.platform == 'darwin':
357 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
358 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
359 env = conf.env.derive (),
362 compile_filename='test.m',
367 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
368 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
370 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
372 conf.write_config_header('gtk2ardour-config.h', remove=False)
374 bak = conf.env['define_key']
375 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
376 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
377 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
378 conf.write_config_header('gtk2ardour-version.h')
379 conf.env['define_key'] = bak;
382 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
383 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
385 # Add a waf `feature' to allow compilation of things using winegcc
386 from waflib.TaskGen import feature
388 def set_winegcc(self):
389 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
390 self.env.CC = 'winegcc'
392 def _doPyp(infileName, deps = False):
395 re_spaces = re.compile("\s+")
397 if infileName == '-':
400 fd = open(infileName)
401 inLines = fd.readlines()
407 bits = re_spaces.split(line)
408 if bits[0] == '##include':
413 # assume included file comes from same place as source file
414 incName = os.path.join (os.path.dirname (infileName), incName);
415 outStr += _doPyp(incName)
426 def include_processor(task):
427 infileName = task.inputs[0].srcpath()
428 outfileName = os.path.join(out, task.outputs[0].bldpath())
429 fdOut = open (outfileName, "w")
430 fdOut.write (_doPyp(infileName))
434 def build_color_scheme(path, prefix):
438 if re.search ('^#@color', line):
439 line.strip() # remove newline
441 if len(color_scheme):
443 color_scheme += prefix
445 color_scheme += words[1]
447 color_scheme += words[2]
453 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
454 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
456 # Tool to dump lua-bindings (of gtk2ardour + libs)
457 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
458 obj = bld (features = 'cxx c cxxprogram')
459 obj.install_path = None
460 obj.source = list(gtk2_ardour_sources)
461 obj.target = 'luadoc'
462 obj.includes = ['.', '../libs']
463 obj.ldflags = ['-no-undefined']
476 'PACKAGE="' + I18N_PACKAGE + '"',
477 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
478 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
479 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
482 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
483 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
484 if bld.is_defined('HAVE_SUIL'):
485 obj.source += [ 'lv2_plugin_ui.cc' ]
486 obj.use += [ 'SUIL' ]
487 if bld.is_defined('LXVST_SUPPORT'):
488 obj.source += [ 'vst_plugin_ui.cc' ]
489 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
490 obj.defines += [ 'LXVST_SUPPORT' ]
494 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
495 # Windows VST support w/wine
496 # If we require VST support we build a stub main() and the FST library
497 # here using winegcc, and link it to the GTK front-end library
498 obj = bld (features = 'cxx c cxxprogram wine')
499 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
501 # XXX do we really need to explicitly link to all of these for the wine executable?
503 obj.use = [ 'libpbd',
514 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
515 obj.includes = [ '../libs/fst', '.' ]
516 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
517 obj.linkflags += bld.env['LDFLAGS']
518 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
519 obj.install_path = bld.env['DLLDIR']
520 # end of the wine executable
522 # now the shared library containing the GTK GUI for ardour
523 obj = bld (features = 'cxx c cxxshlib')
524 # operate on copy to avoid adding sources twice
525 obj.source = list(gtk2_ardour_sources)
526 obj.includes = [ '../libs/fst', '.' ]
527 obj.name = 'libgtk2_ardour'
528 obj.target = 'gtk2_ardour'
529 obj.cflags = [ '-fPIC' ]
532 # just the normal executable version of the GTK GUI
533 if bld.env['build_target'] == 'mingw':
534 obj = bld (features = 'cxx c cxxprogram winres')
536 obj = bld (features = 'cxx c cxxprogram')
537 # operate on copy to avoid adding sources twice
538 obj.source = list(gtk2_ardour_sources)
539 obj.target = 'ardour-' + str (bld.env['VERSION'])
541 obj.ldflags = ['-no-undefined']
543 if bld.is_defined('WINDOWS_VST_SUPPORT'):
544 # Windows VST support mingw
545 obj.includes += [ '../libs/fst' ]
547 # at this point, "obj" refers to either the normal native executable
548 # OR the shared library built for use with wine on linux.
550 obj.use = [ 'libpbd',
561 'PACKAGE="' + I18N_PACKAGE + '"',
562 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
563 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
564 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
566 obj.install_path = bld.env['DLLDIR']
568 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
570 if sys.platform == 'darwin':
571 obj.uselib += ' AUDIOUNITS OSX '
572 obj.use += ' libappleutility'
573 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
574 elif bld.env['build_target'] == 'mingw':
575 obj.source += [ 'bundle_env_mingw.cc' ]
576 obj.source += [ 'windows_icon.rc' ]
578 obj.source += [ 'bundle_env_linux.cc' ]
580 obj.includes += ['../libs']
582 obj.use += 'libptformat'
584 if bld.env['build_target'] == 'mingw':
585 obj.linkflags += ' -mwindows'
586 obj.use += [ 'PANGOFT2' ]
588 if bld.is_defined('HAVE_SUIL'):
589 obj.source += [ 'lv2_plugin_ui.cc' ]
590 obj.use += [ 'SUIL' ]
592 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
593 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
595 if bld.is_defined('NEED_INTL'):
596 obj.linkflags += ' -lintl'
598 if bld.is_defined('WINDOWS_VST_SUPPORT'):
599 obj.source += [ 'windows_vst_plugin_ui.cc' ]
600 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
601 if bld.env['build_target'] != 'mingw':
604 if bld.is_defined('LXVST_SUPPORT'):
605 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
606 obj.defines += [ 'LXVST_SUPPORT' ]
609 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
610 obj.source += [ 'vst_plugin_ui.cc' ]
612 if bld.is_defined('PHONE_HOME'):
613 obj.defines += [ 'PHONE_HOME' ]
615 if bld.is_defined('HAVE_COREAUDIO'):
616 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
617 obj.use += ' libappleutility '
619 if bld.is_defined('AUDIOUNIT_SUPPORT'):
620 obj.source += [ 'au_pluginui.mm' ]
624 wrapper_subst_dict = {
625 'INSTALL_PREFIX' : bld.env['PREFIX'],
626 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
627 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
628 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
629 'LIBS' : 'build/libs',
630 'VERSION' : str (bld.env['VERSION']),
631 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
634 def set_subst_dict(obj, dict):
636 setattr(obj, i, dict[i])
638 obj = bld(features = 'subst')
639 obj.source = 'ardev_common.sh.in'
640 obj.target = 'ardev_common_waf.sh'
641 obj.chmod = Utils.O755
642 obj.dict = wrapper_subst_dict
643 set_subst_dict(obj, wrapper_subst_dict)
645 obj = bld(features = 'subst')
646 obj.source = 'ardour.sh.in'
647 obj.target = 'ardour' + str (bld.env['MAJOR'])
648 obj.chmod = Utils.O755
649 obj.dict = wrapper_subst_dict
650 obj.install_path = bld.env['BINDIR']
651 set_subst_dict(obj, wrapper_subst_dict)
653 if bld.is_defined('WINDOWS_VST_SUPPORT'):
654 obj = bld(features = 'subst')
655 obj.source = '../vst/ardourvst.in'
656 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
657 obj.chmod = Utils.O755
658 obj.dict = wrapper_subst_dict
659 obj.install_path = bld.env['BINDIR']
660 set_subst_dict(obj, wrapper_subst_dict)
669 if sys.platform == 'darwin':
683 # There is no acceptable monospace font available on older versions of OS X
684 # and no API on those versions to load TTF files that will work with
685 # GTK/fontconfig/pango.
687 # In addition, the ArdourMono font gets clipped for some reason on OS X
689 # Moreover, Lucida Grande just seems to work even though it is not monospace
693 'MONOSPACE' : 'Monaco',
694 'CLOCKFONT' : 'Lucida Grande',
696 else: # Linux/X11 fonts
697 basefont = '' # unspecified - use system defaults
710 'MONOSPACE' : 'ArdourMono',
711 'CLOCKFONT' : 'ArdourMono',
714 # Set up font substitution dictionary
716 for style in ['', 'BOLD', 'ITALIC']:
717 for sizename,points in iter(font_sizes.items()):
719 key = "_".join (['FONT',style,sizename])
720 fontstyle = " ".join ([basefont,style.lower(),points])
722 key = "_".join (['FONT',sizename])
723 fontstyle = " ".join ([basefont,points])
725 font_subst_dict[key] = fontstyle
728 for sizename,points in iter(font_sizes.items()):
729 key = "_".join (['FONT_SIZE',sizename])
730 font_subst_dict[key] = points
732 # various font names, eg @BOLD_MONOSPACE@
733 for font_sym,text in iter(font_names.items()):
735 font_subst_dict[key] = text
739 obj = bld(features = 'subst')
740 obj.source = [ 'clearlooks.rc.in' ]
741 obj.target = 'clearlooks.rc'
742 obj.install_path = bld.env['CONFDIR']
743 set_subst_dict(obj, font_subst_dict)
745 obj = bld(features = 'subst')
746 obj.source = [ 'default_ui_config.in' ]
747 obj.target = 'default_ui_config'
748 obj.install_path = bld.env['CONFDIR']
749 set_subst_dict(obj, font_subst_dict)
753 if sys.platform == 'darwin':
754 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
756 menus_argv = [ '-E', '-P' ]
758 if bld.is_defined('PTFORMAT'):
759 menus_argv += [ '-DPTFORMAT' ]
761 # always build all versions of the menu definitions
762 # so that we can try them out with different program builds.
763 for program in [ 'ardour', 'trx' ]:
764 obj = bld(features = 'command-output')
766 obj.command_is_external = True
768 obj.argv = menus_argv
769 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
770 obj.stdin = program + '.menus.in'
771 obj.stdout = program + '.menus'
772 bld.install_files (bld.env['CONFDIR'], program + '.menus')
775 freedesktop_subst_dict = {
776 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
777 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
778 'VERSION': str (bld.env['VERSION']),
781 if bld.env['FREEDESKTOP']:
782 obj = bld(features = 'subst')
783 obj.source = 'ardour.desktop.in'
784 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
785 obj.chmod = Utils.O644
786 obj.dict = freedesktop_subst_dict
787 set_subst_dict(obj, freedesktop_subst_dict)
789 obj = bld(features = 'subst')
790 obj.source = 'ardour-mime-info.xml'
791 obj.target = 'ardour.xml'
792 obj.chmod = Utils.O644
794 # build appdata with translations
796 appdata_i18n_xmlin(bld)
797 obj = bld(features = 'subst')
798 obj.source = 'ardour.appdata.xml.in'
799 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
800 obj.chmod = Utils.O644
801 obj.dict = freedesktop_subst_dict
802 set_subst_dict(obj, freedesktop_subst_dict)
806 # NATIVE ARDOUR BINDING FILES
807 # explicitly state the use of perl here so that it works on windows too
809 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
810 for b in [ 'ardour' ] :
812 target = b + '.keys',
813 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
816 obj.install_path = bld.env['CONFDIR']
819 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
820 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
822 # Application/Product specific resources (icon, splash)
823 pgmname = Options.options.program_name;
824 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
826 if bld.env['build_target'] == 'mingw':
827 # These icons need to overwrite the files already installed in the icons
828 # directory above. Do this in the external packaging scripts for now.
829 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
830 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
832 # Default UI configuration
833 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
834 # Color Themes. Find each color file for this program only
836 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + Options.options.program_name.lower() + '.colors'));
838 # Default export stuff
839 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
842 if bld.is_defined('ENABLE_NLS'):
843 mo_files = bld.path.ant_glob('po/*.mo')
845 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
846 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
850 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
851 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
853 appdata_i18n_pot(bld)
857 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
858 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
860 appdata_i18n_pot(bld)
863 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
864 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
869 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
870 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
873 def appdata_i18n_pot(bld):
874 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
875 'ardour.appdata.pot')
876 if bld.cmd == 'i18n_pot':
877 Logs.info('Generating pot file from Ardour appdata')
878 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
879 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
880 'ardour.appdata.xml.in.in')
881 Logs.info('Updating ' + potfile)
883 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
885 print ('Error processing appdata pot file - ignored')
886 elif bld.cmd == 'clean' and os.path.exists(potfile):
887 Logs.info('Removing Ardour appdata pot file')
890 def appdata_i18n_po(bld):
891 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
892 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
894 def appdata_i18n_mo(bld):
895 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
896 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
898 def appdata_i18n_xmlin(bld):
899 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
900 'ardour.appdata.xml.in')
901 if bld.cmd == 'build':
902 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
903 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
904 'ardour.appdata.xml.in.in')
905 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
906 mo_files = glob.glob(mo_glob)
907 Logs.info('Generating ' + adxmlinfile)
908 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
909 '-j', adxmlininfile] + mo_files)
910 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
911 Logs.info('Removing ' + adxmlinfile)
912 os.remove(adxmlinfile)