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',
156 'missing_file_dialog.cc',
157 'missing_plugin_dialog.cc',
158 'mixer_group_tabs.cc',
164 'monitor_section.cc',
165 'monitor_selector.cc',
167 'mono_panner_editor.cc',
170 'new_plugin_preset_dialog.cc',
171 'normalize_dialog.cc',
175 'note_select_dialog.cc',
182 'panner_interface.cc',
185 'piano_roll_header.cc',
187 'playlist_selector.cc',
189 'plugin_pin_dialog.cc',
190 'plugin_setup_dialog.cc',
191 'plugin_selector.cc',
196 'port_matrix_body.cc',
197 'port_matrix_column_labels.cc',
198 'port_matrix_component.cc',
199 'port_matrix_grid.cc',
200 'port_matrix_labels.cc',
201 'port_matrix_row_labels.cc',
203 'patch_change_dialog.cc',
204 'progress_reporter.cc',
207 'quantize_dialog.cc',
208 'rc_option_editor.cc',
210 'region_gain_line.cc',
211 'region_layering_order_editor.cc',
212 'region_selection.cc',
216 'route_group_dialog.cc',
217 'route_group_menu.cc',
218 'route_params_ui.cc',
219 'route_processor_selection.cc',
220 'route_time_axis.cc',
224 'search_path_option.cc',
225 'script_selector.cc',
227 'selection_memento.cc',
229 'session_archive_dialog.cc',
231 'session_import_dialog.cc',
232 'session_metadata_dialog.cc',
233 'session_option_editor.cc',
235 'shuttle_control.cc',
236 'soundcloud_export_selector.cc',
243 'stereo_panner_editor.cc',
245 'strip_silence_dialog.cc',
247 'tape_region_view.cc',
253 'time_axis_view_item.cc',
259 'track_selection.cc',
260 'track_view_list.cc',
261 'transform_dialog.cc',
262 'transpose_dialog.cc',
265 'vca_master_strip.cc',
267 'visibility_group.cc',
269 # video-timeline related sources:
270 'video_image_frame.cc',
271 'add_video_dialog.cc',
272 'editor_videotimeline.cc',
276 'transcode_ffmpeg.cc',
277 'transcode_video_dialog.cc',
278 'video_server_dialog.cc',
280 'export_video_dialog.cc',
281 'export_video_infobox.cc',
282 'video_tool_paths.cc'
285 def enoify (major, minor):
286 # Code names based on
287 # https://en.wikipedia.org/wiki/Brian_Eno_discography
289 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
290 # (no Singles, no EPs, no Video Albums, no Production)
292 return "\\n\\\"E-No\\\""
295 return "\\n\\\"No Pussyfooting\\\""
297 return "\\n\\\"Here Come the Warm Jets\\\""
299 return "\\n\\\"Taking Tiger Mountain\\\""
301 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
303 return "\\n\\\"Discreet Music\\\""
305 return "\\n\\\"Another Green World\\\""
307 return "\\n\\\"Evening Star\\\""
309 return "\\n\\\"Cluster and Eno\\\""
312 return "\\n\\\"Before and After Science\\\""
314 return "\\n\\\"After the Heat\\\""
316 return "\\n\\\"Music for Airports\\\""
318 return "\\n\\\"Music for Films\\\""
320 return "\\n\\\"In a Land of Clear Colours\\\""
322 return "\\n\\\"The Plateaux of Mirror\\\""
324 return "\\n\\\"Possible Musics\\\""
326 return "\\n\\\"My Life in the Bush of Ghosts\\\""
330 autowaf.set_options(opt)
334 conf.load('compiler_cxx')
335 autowaf.configure(conf)
337 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
339 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
341 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
342 atleast_version='3.3.5', mandatory=False)
343 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
344 atleast_version='1.2.1')
345 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
346 atleast_version='2.10.1')
347 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
348 atleast_version='2.18')
349 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
350 atleast_version='2.18')
351 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
352 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
353 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
354 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
357 if sys.platform == 'darwin':
358 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
359 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
360 env = conf.env.derive (),
363 compile_filename='test.m',
368 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
369 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
371 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
373 conf.write_config_header('gtk2ardour-config.h', remove=False)
375 bak = conf.env['define_key']
376 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
377 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
378 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
379 conf.write_config_header('gtk2ardour-version.h')
380 conf.env['define_key'] = bak;
383 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
384 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
386 # Add a waf `feature' to allow compilation of things using winegcc
387 from waflib.TaskGen import feature
389 def set_winegcc(self):
390 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
391 self.env.CC = 'winegcc'
393 def _doPyp(infileName, deps = False):
396 re_spaces = re.compile("\s+")
398 if infileName == '-':
401 fd = open(infileName)
402 inLines = fd.readlines()
408 bits = re_spaces.split(line)
409 if bits[0] == '##include':
414 # assume included file comes from same place as source file
415 incName = os.path.join (os.path.dirname (infileName), incName);
416 outStr += _doPyp(incName)
427 def include_processor(task):
428 infileName = task.inputs[0].srcpath()
429 outfileName = os.path.join(out, task.outputs[0].bldpath())
430 fdOut = open (outfileName, "w")
431 fdOut.write (_doPyp(infileName))
435 def build_color_scheme(path, prefix):
439 if re.search ('^#@color', line):
440 line.strip() # remove newline
442 if len(color_scheme):
444 color_scheme += prefix
446 color_scheme += words[1]
448 color_scheme += words[2]
454 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
455 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
457 # Tool to dump lua-bindings (of gtk2ardour + libs)
458 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
459 obj = bld (features = 'cxx c cxxprogram')
460 obj.install_path = None
461 obj.source = list(gtk2_ardour_sources)
462 obj.target = 'luadoc'
463 obj.includes = ['.', '../libs']
464 obj.ldflags = ['-no-undefined']
477 'PACKAGE="' + I18N_PACKAGE + '"',
478 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
479 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
480 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
483 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
484 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
485 if bld.is_defined('HAVE_SUIL'):
486 obj.source += [ 'lv2_plugin_ui.cc' ]
487 obj.use += [ 'SUIL' ]
488 if bld.is_defined('LXVST_SUPPORT'):
489 obj.source += [ 'vst_plugin_ui.cc' ]
490 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
491 obj.defines += [ 'LXVST_SUPPORT' ]
494 # Tool to test libcanvas
495 if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
496 obj = bld (features = 'cxx c cxxprogram')
497 obj.install_path = None
498 obj.source = list(gtk2_ardour_sources)
499 obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
500 obj.target = 'canvas_test'
501 obj.includes = ['.', '../libs']
502 obj.ldflags = ['-no-undefined']
515 'PACKAGE="' + I18N_PACKAGE + '"',
516 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
517 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
518 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
521 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
522 obj.source += [ 'canvas_test.cc', ]
525 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
526 # Windows VST support w/wine
527 # If we require VST support we build a stub main() and the FST library
528 # here using winegcc, and link it to the GTK front-end library
529 obj = bld (features = 'cxx c cxxprogram wine')
530 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
532 # XXX do we really need to explicitly link to all of these for the wine executable?
534 obj.use = [ 'libpbd',
545 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
546 obj.includes = [ '../libs/fst', '.' ]
547 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
548 obj.linkflags += bld.env['LDFLAGS']
549 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
550 obj.install_path = bld.env['DLLDIR']
551 # end of the wine executable
553 # now the shared library containing the GTK GUI for ardour
554 obj = bld (features = 'cxx c cxxshlib')
555 # operate on copy to avoid adding sources twice
556 obj.source = list(gtk2_ardour_sources)
557 obj.includes = [ '../libs/fst', '.' ]
558 obj.name = 'libgtk2_ardour'
559 obj.target = 'gtk2_ardour'
560 obj.cflags = [ '-fPIC' ]
563 # just the normal executable version of the GTK GUI
564 if bld.env['build_target'] == 'mingw':
565 obj = bld (features = 'cxx c cxxprogram winres')
567 obj = bld (features = 'cxx c cxxprogram')
568 # operate on copy to avoid adding sources twice
569 obj.source = list(gtk2_ardour_sources)
570 obj.target = 'ardour-' + str (bld.env['VERSION'])
572 obj.ldflags = ['-no-undefined']
574 if bld.is_defined('WINDOWS_VST_SUPPORT'):
575 # Windows VST support mingw
576 obj.includes += [ '../libs/fst' ]
578 # at this point, "obj" refers to either the normal native executable
579 # OR the shared library built for use with wine on linux.
581 obj.use = [ 'libpbd',
592 'PACKAGE="' + I18N_PACKAGE + '"',
593 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
594 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
595 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
597 obj.install_path = bld.env['DLLDIR']
599 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
601 if sys.platform == 'darwin':
602 obj.uselib += ' AUDIOUNITS OSX '
603 obj.use += ' libappleutility'
604 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
605 elif bld.env['build_target'] == 'mingw':
606 obj.source += [ 'bundle_env_mingw.cc' ]
607 obj.source += [ 'windows_icon.rc' ]
609 obj.source += [ 'bundle_env_linux.cc' ]
611 obj.includes += ['../libs']
613 obj.use += 'libptformat'
615 if bld.env['build_target'] == 'mingw':
616 obj.linkflags += ' -mwindows'
617 obj.use += [ 'PANGOFT2' ]
619 if bld.is_defined('HAVE_SUIL'):
620 obj.source += [ 'lv2_plugin_ui.cc' ]
621 obj.use += [ 'SUIL' ]
623 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
624 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
626 if bld.is_defined('NEED_INTL'):
627 obj.linkflags += ' -lintl'
629 if bld.is_defined('WINDOWS_VST_SUPPORT'):
630 obj.source += [ 'windows_vst_plugin_ui.cc' ]
631 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
632 if bld.env['build_target'] != 'mingw':
635 if bld.is_defined('LXVST_SUPPORT'):
636 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
637 obj.defines += [ 'LXVST_SUPPORT' ]
640 if bld.is_defined('MACVST_SUPPORT'):
641 obj.source += [ 'mac_vst_plugin_ui.mm' ]
642 obj.defines += [ 'MACVST_SUPPORT' ]
644 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
645 obj.source += [ 'vst_plugin_ui.cc' ]
647 if bld.is_defined('PHONE_HOME'):
648 obj.defines += [ 'PHONE_HOME' ]
650 if bld.is_defined('HAVE_COREAUDIO'):
651 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
652 obj.use += ' libappleutility '
654 if bld.is_defined('AUDIOUNIT_SUPPORT'):
655 obj.source += [ 'au_pluginui.mm' ]
659 wrapper_subst_dict = {
660 'INSTALL_PREFIX' : bld.env['PREFIX'],
661 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
662 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
663 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
664 'LIBS' : 'build/libs',
665 'VERSION' : str (bld.env['VERSION']),
666 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
669 def set_subst_dict(obj, dict):
671 setattr(obj, i, dict[i])
673 obj = bld(features = 'subst')
674 obj.source = 'ardev_common.sh.in'
675 obj.target = 'ardev_common_waf.sh'
676 obj.chmod = Utils.O755
677 obj.dict = wrapper_subst_dict
678 set_subst_dict(obj, wrapper_subst_dict)
680 obj = bld(features = 'subst')
681 obj.source = 'ardour.sh.in'
682 obj.target = 'ardour' + str (bld.env['MAJOR'])
683 obj.chmod = Utils.O755
684 obj.dict = wrapper_subst_dict
685 obj.install_path = bld.env['BINDIR']
686 set_subst_dict(obj, wrapper_subst_dict)
688 if bld.is_defined('WINDOWS_VST_SUPPORT'):
689 obj = bld(features = 'subst')
690 obj.source = '../vst/ardourvst.in'
691 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
692 obj.chmod = Utils.O755
693 obj.dict = wrapper_subst_dict
694 obj.install_path = bld.env['BINDIR']
695 set_subst_dict(obj, wrapper_subst_dict)
704 if sys.platform == 'darwin':
718 # There is no acceptable monospace font available on older versions of OS X
719 # and no API on those versions to load TTF files that will work with
720 # GTK/fontconfig/pango.
722 # In addition, the ArdourMono font gets clipped for some reason on OS X
724 # Moreover, Lucida Grande just seems to work even though it is not monospace
728 'MONOSPACE' : 'Monaco',
729 'CLOCKFONT' : 'Lucida Grande',
731 else: # Linux/X11 fonts
732 basefont = '' # unspecified - use system defaults
745 'MONOSPACE' : 'ArdourMono',
746 'CLOCKFONT' : 'ArdourMono',
749 # Set up font substitution dictionary
751 for style in ['', 'BOLD', 'ITALIC']:
752 for sizename,points in iter(font_sizes.items()):
754 key = "_".join (['FONT',style,sizename])
755 fontstyle = " ".join ([basefont,style.lower(),points])
757 key = "_".join (['FONT',sizename])
758 fontstyle = " ".join ([basefont,points])
760 font_subst_dict[key] = fontstyle
763 for sizename,points in iter(font_sizes.items()):
764 key = "_".join (['FONT_SIZE',sizename])
765 font_subst_dict[key] = points
767 # various font names, eg @BOLD_MONOSPACE@
768 for font_sym,text in iter(font_names.items()):
770 font_subst_dict[key] = text
774 obj = bld(features = 'subst')
775 obj.source = [ 'clearlooks.rc.in' ]
776 obj.target = 'clearlooks.rc'
777 obj.install_path = bld.env['CONFDIR']
778 set_subst_dict(obj, font_subst_dict)
780 obj = bld(features = 'subst')
781 obj.source = [ 'default_ui_config.in' ]
782 obj.target = 'default_ui_config'
783 obj.install_path = bld.env['CONFDIR']
784 set_subst_dict(obj, font_subst_dict)
788 if sys.platform == 'darwin':
789 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
791 menus_argv = [ '-E', '-P' ]
793 if bld.is_defined('PTFORMAT'):
794 menus_argv += [ '-DPTFORMAT' ]
796 # always build all versions of the menu definitions
797 # so that we can try them out with different program builds.
798 for program in [ 'ardour', 'trx' ]:
799 obj = bld(features = 'command-output')
801 obj.command_is_external = True
803 obj.argv = menus_argv
804 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
805 obj.stdin = program + '.menus.in'
806 obj.stdout = program + '.menus'
807 bld.install_files (bld.env['CONFDIR'], program + '.menus')
810 freedesktop_subst_dict = {
811 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
812 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
813 'VERSION': str (bld.env['VERSION']),
816 if bld.env['FREEDESKTOP']:
817 obj = bld(features = 'subst')
818 obj.source = 'ardour.desktop.in'
819 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
820 obj.chmod = Utils.O644
821 obj.dict = freedesktop_subst_dict
822 set_subst_dict(obj, freedesktop_subst_dict)
824 obj = bld(features = 'subst')
825 obj.source = 'ardour-mime-info.xml'
826 obj.target = 'ardour.xml'
827 obj.chmod = Utils.O644
829 # build appdata with translations
831 appdata_i18n_xmlin(bld)
832 obj = bld(features = 'subst')
833 obj.source = 'ardour.appdata.xml.in'
834 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
835 obj.chmod = Utils.O644
836 obj.dict = freedesktop_subst_dict
837 set_subst_dict(obj, freedesktop_subst_dict)
841 # NATIVE ARDOUR BINDING FILES
842 # explicitly state the use of perl here so that it works on windows too
844 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
845 for b in [ 'ardour' ] :
847 target = b + '.keys',
848 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
851 obj.install_path = bld.env['CONFDIR']
854 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
855 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
857 # Application/Product specific resources (icon, splash)
858 pgmname = Options.options.program_name;
859 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
861 if bld.env['build_target'] == 'mingw':
862 # These icons need to overwrite the files already installed in the icons
863 # directory above. Do this in the external packaging scripts for now.
864 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
865 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
867 # Default UI configuration
868 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
869 # Color Themes. Find each color file for this program only
871 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + Options.options.program_name.lower() + '.colors'));
873 # Default export stuff
874 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
877 if bld.is_defined('ENABLE_NLS'):
878 mo_files = bld.path.ant_glob('po/*.mo')
880 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
881 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
885 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
886 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
888 appdata_i18n_pot(bld)
892 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
893 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
895 appdata_i18n_pot(bld)
898 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
899 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
904 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
905 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
908 def appdata_i18n_pot(bld):
909 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
910 'ardour.appdata.pot')
911 if bld.cmd == 'i18n_pot':
912 Logs.info('Generating pot file from Ardour appdata')
913 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
914 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
915 'ardour.appdata.xml.in.in')
916 Logs.info('Updating ' + potfile)
918 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
920 print ('Error processing appdata pot file - ignored')
921 elif bld.cmd == 'clean' and os.path.exists(potfile):
922 Logs.info('Removing Ardour appdata pot file')
925 def appdata_i18n_po(bld):
926 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
927 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
929 def appdata_i18n_mo(bld):
930 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
931 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
933 def appdata_i18n_xmlin(bld):
934 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
935 'ardour.appdata.xml.in')
936 if bld.cmd == 'build':
937 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
938 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
939 'ardour.appdata.xml.in.in')
940 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
941 mo_files = glob.glob(mo_glob)
942 Logs.info('Generating ' + adxmlinfile)
943 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
944 '-j', adxmlininfile] + mo_files)
945 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
946 Logs.info('Removing ' + adxmlinfile)
947 os.remove(adxmlinfile)