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',
38 'ardour_ui_dependents.cc',
39 'ardour_ui_dialogs.cc',
42 'ardour_ui_options.cc',
45 'audio_region_editor.cc',
46 'audio_region_view.cc',
47 'audio_streamview.cc',
49 'automation_controller.cc',
51 'automation_region_view.cc',
52 'automation_streamview.cc',
53 'automation_time_axis.cc',
55 'big_clock_window.cc',
56 'big_transport_window.cc',
59 'color_theme_manager.cc',
62 'control_point_dialog.cc',
63 'control_slave_ui.cc',
67 'duplicate_routes_dialog.cc',
68 'edit_note_dialog.cc',
72 'editor_audio_import.cc',
73 'editor_pt_import.cc',
74 'editor_audiotrack.cc',
76 'editor_canvas_events.cc',
77 'editor_component.cc',
80 'editor_route_groups.cc',
81 'editor_export_audio.cc',
82 'editor_group_tabs.cc',
84 'editor_locations.cc',
92 'editor_selection.cc',
93 'editor_snapshots.cc',
95 'editor_tempodisplay.cc',
99 'export_channel_selector.cc',
101 'export_file_notebook.cc',
102 'export_filename_selector.cc',
103 'export_format_dialog.cc',
104 'export_format_selector.cc',
105 'export_preset_selector.cc',
107 'export_timespan_selector.cc',
111 'floating_text_entry.cc',
112 'sfdb_freesound_mootcher.cc',
114 'generic_pluginui.cc',
116 'global_port_matrix.cc',
118 'gtk_pianokeyboard.c',
121 'insert_remove_time_dialog.cc',
122 'instrument_selector.cc',
123 'interthread_progress_window.cc',
132 '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_region_view.cc',
148 'midi_streamview.cc',
151 'midi_velocity_dialog.cc',
153 'missing_file_dialog.cc',
154 '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 'patch_change_widget.cc',
183 'piano_roll_header.cc',
185 '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 'processor_selection.cc',
203 'patch_change_dialog.cc',
204 '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 'save_template_dialog.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',
246 'stripable_colorpicker.cc',
247 'stripable_time_axis.cc',
249 'tape_region_view.cc',
250 'template_dialog.cc',
255 'time_axis_view_item.cc',
260 'track_selection.cc',
261 'track_view_list.cc',
262 'transform_dialog.cc',
263 'transport_control.cc',
264 'transport_control_ui.cc',
265 'transport_masters_dialog.cc',
266 'transpose_dialog.cc',
269 'vca_master_strip.cc',
271 'visibility_group.cc',
273 # video-timeline related sources:
274 'video_image_frame.cc',
275 'add_video_dialog.cc',
276 'editor_videotimeline.cc',
280 'transcode_ffmpeg.cc',
281 'transcode_video_dialog.cc',
282 'video_server_dialog.cc',
284 'export_video_dialog.cc',
285 'export_video_infobox.cc',
286 'video_tool_paths.cc'
289 def enoify (major, minor):
290 # Code names based on
291 # https://en.wikipedia.org/wiki/Brian_Eno_discography
293 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
294 # (no Singles, no EPs, no Video Albums, no Production)
296 return "\\n\\\"E-No\\\""
299 return "\\n\\\"No Pussyfooting\\\""
301 return "\\n\\\"Here Come the Warm Jets\\\""
303 return "\\n\\\"Taking Tiger Mountain\\\""
305 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
307 return "\\n\\\"Discreet Music\\\""
309 return "\\n\\\"Another Green World\\\""
311 return "\\n\\\"Evening Star\\\""
313 return "\\n\\\"Cluster and Eno\\\""
316 return "\\n\\\"Before and After Science\\\""
318 return "\\n\\\"After the Heat\\\""
320 return "\\n\\\"Music for Airports\\\""
322 return "\\n\\\"Music for Films\\\""
324 return "\\n\\\"In a Land of Clear Colours\\\""
326 return "\\n\\\"The Plateaux of Mirror\\\""
328 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
330 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
332 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
334 return "\\n\\\"On Land\\\"" # 1982
335 elif minor == 10: # 6.0 ??
336 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
338 return "\\n\\\"More Music for Films\\\"" # 1983
340 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
343 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
345 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
346 ### From now on, no more compilations, names are not suitable
348 return "\\n\\\"Thursday Afternoon\\\"" # 1985
350 return "\\n\\\"Music for Films III\\\"" # 1988 Collaborative
352 return "\\n\\\"Wrong Way Up\\\"" # 1990 Collaborative
354 return "\\n\\\"Nerve Net\\\"" # 1992
356 return "\\n\\\"The Shutov Assembly\\\"" # 1992
358 return "\\n\\\"Neroli\\\"" # 1993
360 return "\\n\\\"Headcandy\\\"" # 1994
364 autowaf.set_options(opt)
368 conf.load('compiler_cxx')
369 autowaf.configure(conf)
371 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
373 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
375 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
376 atleast_version='3.3.5', mandatory=False)
377 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
378 atleast_version='1.2.1')
379 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
380 atleast_version='2.10.1')
381 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
382 atleast_version='2.18')
383 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
384 atleast_version='2.18')
385 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
386 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
387 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
388 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
391 if sys.platform == 'darwin':
392 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
393 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
394 env = conf.env.derive (),
397 compile_filename='test.m',
402 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
403 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
405 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
407 conf.write_config_header('gtk2ardour-config.h', remove=False)
409 bak = conf.env['define_key']
410 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
411 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
412 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
413 conf.write_config_header('gtk2ardour-version.h')
414 conf.env['define_key'] = bak;
417 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
418 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
420 # Add a waf `feature' to allow compilation of things using winegcc
421 from waflib.TaskGen import feature
423 def set_winegcc(self):
424 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
425 self.env.CC = 'winegcc'
427 def _doPyp(infileName, deps = False):
430 re_spaces = re.compile("\s+")
432 if infileName == '-':
435 fd = open(infileName)
436 inLines = fd.readlines()
442 bits = re_spaces.split(line)
443 if bits[0] == '##include':
448 # assume included file comes from same place as source file
449 incName = os.path.join (os.path.dirname (infileName), incName);
450 outStr += _doPyp(incName)
461 def include_processor(task):
462 infileName = task.inputs[0].srcpath()
463 outfileName = os.path.join(out, task.outputs[0].bldpath())
464 fdOut = open (outfileName, "w")
465 fdOut.write (_doPyp(infileName))
469 def build_color_scheme(path, prefix):
473 if re.search ('^#@color', line):
474 line.strip() # remove newline
476 if len(color_scheme):
478 color_scheme += prefix
480 color_scheme += words[1]
482 color_scheme += words[2]
488 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
489 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
491 # Tool to dump lua-bindings (of gtk2ardour + libs)
492 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
493 obj = bld (features = 'cxx c cxxprogram')
494 obj.install_path = None
495 obj.source = list(gtk2_ardour_sources)
496 obj.target = 'luadoc'
497 obj.includes = ['.', '../libs']
498 obj.ldflags = ['-no-undefined']
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']) + '"',
519 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
520 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
521 if bld.is_defined('HAVE_SUIL'):
522 obj.source += [ 'lv2_plugin_ui.cc' ]
523 obj.use += [ 'SUIL' ]
524 if bld.is_defined('LXVST_SUPPORT'):
525 obj.source += [ 'vst_plugin_ui.cc' ]
526 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
527 obj.defines += [ 'LXVST_SUPPORT' ]
530 # # Tool to test libcanvas
531 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
532 # obj = bld (features = 'cxx c cxxprogram')
533 # obj.install_path = None
534 # obj.source = list(gtk2_ardour_sources)
535 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
536 # obj.target = 'canvas_test'
537 # obj.includes = ['.', '../libs']
538 # obj.ldflags = ['-no-undefined']
551 # 'PACKAGE="' + I18N_PACKAGE + '"',
552 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
553 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
554 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
557 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
558 # # obj.source += [ 'canvas_test.cc', ]
559 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
562 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
563 # Windows VST support w/wine
564 # If we require VST support we build a stub main() and the FST library
565 # here using winegcc, and link it to the GTK front-end library
566 obj = bld (features = 'cxx c cxxprogram wine')
567 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
569 # XXX do we really need to explicitly link to all of these for the wine executable?
571 obj.use = [ 'libpbd',
584 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
585 obj.includes = [ '../libs/fst', '.' ]
586 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
587 obj.linkflags += bld.env['LDFLAGS']
588 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
589 obj.install_path = bld.env['DLLDIR']
590 # end of the wine executable
592 # now the shared library containing the GTK GUI for ardour
593 obj = bld (features = 'cxx c cxxshlib')
594 # operate on copy to avoid adding sources twice
595 obj.source = list(gtk2_ardour_sources)
596 obj.includes = [ '../libs/fst', '.' ]
597 obj.name = 'libgtk2_ardour'
598 obj.target = 'gtk2_ardour'
599 obj.cflags = [ '-fPIC' ]
602 # just the normal executable version of the GTK GUI
603 if bld.env['build_target'] == 'mingw':
604 obj = bld (features = 'cxx c cxxprogram winres')
606 obj = bld (features = 'cxx c cxxprogram')
607 # operate on copy to avoid adding sources twice
608 obj.source = list(gtk2_ardour_sources)
609 obj.target = 'ardour-' + str (bld.env['VERSION'])
611 obj.ldflags = ['-no-undefined']
613 if bld.is_defined('WINDOWS_VST_SUPPORT'):
614 # Windows VST support mingw
615 obj.includes += [ '../libs/fst' ]
617 # at this point, "obj" refers to either the normal native executable
618 # OR the shared library built for use with wine on linux.
620 obj.use = [ 'libpbd',
633 'PACKAGE="' + I18N_PACKAGE + '"',
634 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
635 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
636 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
638 obj.install_path = bld.env['DLLDIR']
640 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
642 if sys.platform == 'darwin':
643 obj.uselib += ' AUDIOUNITS OSX '
644 obj.use += ' libappleutility'
645 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
646 elif bld.env['build_target'] == 'mingw':
647 obj.source += [ 'bundle_env_mingw.cc' ]
648 obj.source += [ 'windows_icon.rc' ]
650 obj.source += [ 'bundle_env_linux.cc' ]
652 obj.includes += ['../libs']
654 obj.use += 'libptformat'
656 if bld.env['build_target'] == 'mingw':
657 obj.linkflags += ' -mwindows'
658 obj.use += [ 'PANGOFT2' ]
660 if bld.is_defined('HAVE_SUIL'):
661 obj.source += [ 'lv2_plugin_ui.cc' ]
662 obj.use += [ 'SUIL' ]
664 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
665 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
667 if bld.is_defined('NEED_INTL'):
668 obj.linkflags += ' -lintl'
670 if bld.is_defined('WINDOWS_VST_SUPPORT'):
671 obj.source += [ 'windows_vst_plugin_ui.cc' ]
672 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
673 if bld.env['build_target'] != 'mingw':
676 if bld.is_defined('LXVST_SUPPORT'):
677 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
678 obj.defines += [ 'LXVST_SUPPORT' ]
681 if bld.is_defined('MACVST_SUPPORT'):
682 obj.source += [ 'mac_vst_plugin_ui.mm' ]
683 obj.defines += [ 'MACVST_SUPPORT' ]
685 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
686 obj.source += [ 'vst_plugin_ui.cc' ]
688 if bld.is_defined('PHONE_HOME'):
689 obj.defines += [ 'PHONE_HOME' ]
691 if bld.is_defined('HAVE_COREAUDIO'):
692 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
693 obj.use += ' libappleutility '
695 if bld.is_defined('AUDIOUNIT_SUPPORT'):
696 obj.source += [ 'au_pluginui.mm' ]
700 wrapper_subst_dict = {
701 'INSTALL_PREFIX' : bld.env['PREFIX'],
702 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
703 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
704 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
705 'LIBS' : 'build/libs',
706 'VERSION' : str (bld.env['VERSION']),
707 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
710 def set_subst_dict(obj, dict):
712 setattr(obj, i, dict[i])
714 obj = bld(features = 'subst')
715 obj.source = 'ardev_common.sh.in'
716 obj.target = 'ardev_common_waf.sh'
717 obj.chmod = Utils.O755
718 obj.dict = wrapper_subst_dict
719 set_subst_dict(obj, wrapper_subst_dict)
721 obj = bld(features = 'subst')
722 obj.source = 'ardour.sh.in'
723 obj.target = 'ardour' + str (bld.env['MAJOR'])
724 obj.chmod = Utils.O755
725 obj.dict = wrapper_subst_dict
726 obj.install_path = bld.env['BINDIR']
727 set_subst_dict(obj, wrapper_subst_dict)
729 if bld.is_defined('WINDOWS_VST_SUPPORT'):
730 obj = bld(features = 'subst')
731 obj.source = '../vst/ardourvst.in'
732 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
733 obj.chmod = Utils.O755
734 obj.dict = wrapper_subst_dict
735 obj.install_path = bld.env['BINDIR']
736 set_subst_dict(obj, wrapper_subst_dict)
745 if sys.platform == 'darwin':
758 if bld.env['build_target'] in ['panther', 'tiger', 'leopard'] or (Options.options.ppc and bld.env['build_target'] == 'snowleopard'):
759 # CTFontManagerRegisterFontsForURL for ArdourMono is 10.6 or newer
760 # "Lucida Grande" is not mono-spaced, but works for most cases, except big-clock-window
762 'MONOSPACE' : 'Monaco',
763 'CLOCKFONT' : 'Lucida Grande',
767 'MONOSPACE' : 'Monaco',
768 'CLOCKFONT' : 'ArdourMono',
770 else: # Linux/X11 & Windows fonts
771 basefont = '' # unspecified - use system defaults
784 'MONOSPACE' : 'ArdourMono',
785 'CLOCKFONT' : 'ArdourMono',
788 # Set up font substitution dictionary
790 for style in ['', 'BOLD', 'ITALIC']:
791 for sizename,points in iter(font_sizes.items()):
793 key = "_".join (['FONT',style,sizename])
794 fontstyle = " ".join ([basefont,style.lower(),points])
796 key = "_".join (['FONT',sizename])
797 fontstyle = " ".join ([basefont,points])
799 font_subst_dict[key] = fontstyle
802 for sizename,points in iter(font_sizes.items()):
803 key = "_".join (['FONT_SIZE',sizename])
804 font_subst_dict[key] = points
806 # various font names, eg @BOLD_MONOSPACE@
807 for font_sym,text in iter(font_names.items()):
809 font_subst_dict[key] = text
813 obj = bld(features = 'subst')
814 obj.source = [ 'clearlooks.rc.in' ]
815 obj.target = 'clearlooks.rc'
816 obj.install_path = bld.env['CONFDIR']
817 set_subst_dict(obj, font_subst_dict)
819 obj = bld(features = 'subst')
820 obj.source = [ 'default_ui_config.in' ]
821 obj.target = 'default_ui_config'
822 obj.install_path = bld.env['CONFDIR']
823 set_subst_dict(obj, font_subst_dict)
827 if sys.platform == 'darwin':
828 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
830 menus_argv = [ '-E', '-P' ]
832 if bld.is_defined('PTFORMAT'):
833 menus_argv += [ '-DPTFORMAT' ]
835 # always build all versions of the menu definitions
836 # so that we can try them out with different program builds.
837 for program in [ 'ardour', 'trx' ]:
838 obj = bld(features = 'command-output')
840 obj.command_is_external = True
842 obj.argv = menus_argv
843 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
844 obj.stdin = program + '.menus.in'
845 obj.stdout = program + '.menus'
846 bld.install_files (bld.env['CONFDIR'], program + '.menus')
849 freedesktop_subst_dict = {
850 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
851 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
852 'VERSION': str (bld.env['VERSION']),
855 if bld.env['FREEDESKTOP']:
856 obj = bld(features = 'subst')
857 obj.source = 'ardour.desktop.in'
858 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
859 obj.chmod = Utils.O644
860 obj.dict = freedesktop_subst_dict
861 set_subst_dict(obj, freedesktop_subst_dict)
863 obj = bld(features = 'subst')
864 obj.source = 'ardour-mime-info.xml'
865 obj.target = 'ardour.xml'
866 obj.chmod = Utils.O644
868 # build appdata with translations
870 appdata_i18n_xmlin(bld)
871 obj = bld(features = 'subst')
872 obj.source = 'ardour.appdata.xml.in'
873 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
874 obj.chmod = Utils.O644
875 obj.dict = freedesktop_subst_dict
876 set_subst_dict(obj, freedesktop_subst_dict)
880 # NATIVE ARDOUR BINDING FILES
881 # explicitly state the use of perl here so that it works on windows too
883 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
884 for b in [ 'ardour' ] :
886 target = b + '.keys',
887 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
890 obj.install_path = bld.env['CONFDIR']
893 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
894 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
896 # Application/Product specific resources (icon, splash)
897 pgmname = bld.env['PROGRAM_NAME']
898 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
900 if bld.env['build_target'] == 'mingw':
901 # These icons need to overwrite the files already installed in the icons
902 # directory above. Do this in the external packaging scripts for now.
903 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
904 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
906 # Default UI configuration
907 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
908 # Color Themes. Find each color file for this program only
910 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
912 # Default export stuff
913 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
916 if bld.is_defined('ENABLE_NLS'):
917 mo_files = bld.path.ant_glob('po/*.mo')
919 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
920 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
924 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
925 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
927 appdata_i18n_pot(bld)
931 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
932 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
934 appdata_i18n_pot(bld)
937 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
938 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
943 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
944 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
947 def appdata_i18n_pot(bld):
948 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
949 'ardour.appdata.pot')
950 if bld.cmd == 'i18n_pot':
951 Logs.info('Generating pot file from Ardour appdata')
952 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
953 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
954 'ardour.appdata.xml.in.in')
955 Logs.info('Updating ' + potfile)
957 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
959 print ('Error processing appdata pot file - ignored')
960 elif bld.cmd == 'clean' and os.path.exists(potfile):
961 Logs.info('Removing Ardour appdata pot file')
964 def appdata_i18n_po(bld):
965 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
966 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
968 def appdata_i18n_mo(bld):
969 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
970 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
972 def appdata_i18n_xmlin(bld):
973 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
974 'ardour.appdata.xml.in')
975 if bld.cmd == 'build':
976 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
977 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
978 'ardour.appdata.xml.in.in')
979 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
980 mo_files = glob.glob(mo_glob)
981 Logs.info('Generating ' + adxmlinfile)
982 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
983 '-j', adxmlininfile] + mo_files)
984 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
985 Logs.info('Removing ' + adxmlinfile)
986 os.remove(adxmlinfile)