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',
192 'plugin_dspload_ui.cc',
193 'plugin_dspload_window.cc',
197 'port_matrix_body.cc',
198 'port_matrix_column_labels.cc',
199 'port_matrix_component.cc',
200 'port_matrix_grid.cc',
201 'port_matrix_labels.cc',
202 'port_matrix_row_labels.cc',
204 'processor_selection.cc',
205 'patch_change_dialog.cc',
206 'progress_reporter.cc',
207 'pt_import_selector.cc',
209 'quantize_dialog.cc',
210 'rc_option_editor.cc',
212 'region_gain_line.cc',
213 'region_layering_order_editor.cc',
214 'region_selection.cc',
218 'route_group_dialog.cc',
219 'route_group_menu.cc',
220 'route_params_ui.cc',
221 'route_processor_selection.cc',
222 'route_time_axis.cc',
226 'save_template_dialog.cc',
227 'search_path_option.cc',
228 'script_selector.cc',
230 'selection_memento.cc',
232 'session_archive_dialog.cc',
234 'session_import_dialog.cc',
235 'session_metadata_dialog.cc',
236 'session_option_editor.cc',
238 'shuttle_control.cc',
239 'soundcloud_export_selector.cc',
246 'stereo_panner_editor.cc',
248 'strip_silence_dialog.cc',
249 'stripable_colorpicker.cc',
250 'stripable_time_axis.cc',
252 'tape_region_view.cc',
253 'template_dialog.cc',
258 'time_axis_view_item.cc',
263 'track_selection.cc',
264 'track_view_list.cc',
265 'transform_dialog.cc',
266 'transport_control.cc',
267 'transport_control_ui.cc',
268 'transport_masters_dialog.cc',
269 'transpose_dialog.cc',
272 'vca_master_strip.cc',
274 'visibility_group.cc',
276 # video-timeline related sources:
277 'video_image_frame.cc',
278 'add_video_dialog.cc',
279 'editor_videotimeline.cc',
283 'transcode_ffmpeg.cc',
284 'transcode_video_dialog.cc',
285 'video_server_dialog.cc',
287 'export_video_dialog.cc',
288 'export_video_infobox.cc',
289 'video_tool_paths.cc'
292 def enoify (major, minor):
293 # Code names based on
294 # https://en.wikipedia.org/wiki/Brian_Eno_discography
296 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
297 # (no Singles, no EPs, no Video Albums, no Production)
299 return "\\n\\\"E-No\\\""
302 return "\\n\\\"No Pussyfooting\\\""
304 return "\\n\\\"Here Come the Warm Jets\\\""
306 return "\\n\\\"Taking Tiger Mountain\\\""
308 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
310 return "\\n\\\"Discreet Music\\\""
312 return "\\n\\\"Another Green World\\\""
314 return "\\n\\\"Evening Star\\\""
316 return "\\n\\\"Cluster and Eno\\\""
319 return "\\n\\\"Before and After Science\\\""
321 return "\\n\\\"After the Heat\\\""
323 return "\\n\\\"Music for Airports\\\""
325 return "\\n\\\"Music for Films\\\""
327 return "\\n\\\"In a Land of Clear Colours\\\""
329 return "\\n\\\"The Plateaux of Mirror\\\""
331 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
333 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
335 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
337 return "\\n\\\"On Land\\\"" # 1982
338 elif minor == 10: # 6.0 ??
339 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
341 return "\\n\\\"More Music for Films\\\"" # 1983
343 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
346 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
348 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
349 ### From now on, no more compilations, names are not suitable
351 return "\\n\\\"Thursday Afternoon\\\"" # 1985
353 return "\\n\\\"Music for Films III\\\"" # 1988 Collaborative
355 return "\\n\\\"Wrong Way Up\\\"" # 1990 Collaborative
357 return "\\n\\\"Nerve Net\\\"" # 1992
359 return "\\n\\\"The Shutov Assembly\\\"" # 1992
361 return "\\n\\\"Neroli\\\"" # 1993
363 return "\\n\\\"Headcandy\\\"" # 1994
367 autowaf.set_options(opt)
371 conf.load('compiler_cxx')
372 autowaf.configure(conf)
374 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
376 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
378 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
379 atleast_version='3.3.5', mandatory=False)
380 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
381 atleast_version='1.2.1')
382 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
383 atleast_version='2.10.1')
384 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
385 atleast_version='2.18')
386 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
387 atleast_version='2.18')
388 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
389 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
390 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
391 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
394 if sys.platform == 'darwin':
395 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
396 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
397 env = conf.env.derive (),
400 compile_filename='test.m',
405 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
406 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
408 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
410 conf.write_config_header('gtk2ardour-config.h', remove=False)
412 bak = conf.env['define_key']
413 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
414 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
415 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
416 conf.write_config_header('gtk2ardour-version.h')
417 conf.env['define_key'] = bak;
420 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
421 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
423 # Add a waf `feature' to allow compilation of things using winegcc
424 from waflib.TaskGen import feature
426 def set_winegcc(self):
427 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
428 self.env.CC = 'winegcc'
430 def _doPyp(infileName, deps = False):
433 re_spaces = re.compile("\s+")
435 if infileName == '-':
438 fd = open(infileName)
439 inLines = fd.readlines()
445 bits = re_spaces.split(line)
446 if bits[0] == '##include':
451 # assume included file comes from same place as source file
452 incName = os.path.join (os.path.dirname (infileName), incName);
453 outStr += _doPyp(incName)
464 def include_processor(task):
465 infileName = task.inputs[0].srcpath()
466 outfileName = os.path.join(out, task.outputs[0].bldpath())
467 fdOut = open (outfileName, "w")
468 fdOut.write (_doPyp(infileName))
472 def build_color_scheme(path, prefix):
476 if re.search ('^#@color', line):
477 line.strip() # remove newline
479 if len(color_scheme):
481 color_scheme += prefix
483 color_scheme += words[1]
485 color_scheme += words[2]
491 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
492 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
494 # Tool to dump lua-bindings (of gtk2ardour + libs)
495 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
496 obj = bld (features = 'cxx c cxxprogram')
497 obj.install_path = None
498 obj.source = list(gtk2_ardour_sources)
499 obj.target = 'luadoc'
500 obj.includes = ['.', '../libs']
501 obj.ldflags = ['-no-undefined']
516 'PACKAGE="' + I18N_PACKAGE + '"',
517 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
518 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
519 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
522 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
523 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
524 if bld.is_defined('HAVE_SUIL'):
525 obj.source += [ 'lv2_plugin_ui.cc' ]
526 obj.use += [ 'SUIL' ]
527 if bld.is_defined('LXVST_SUPPORT'):
528 obj.source += [ 'vst_plugin_ui.cc' ]
529 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
530 obj.defines += [ 'LXVST_SUPPORT' ]
533 # # Tool to test libcanvas
534 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
535 # obj = bld (features = 'cxx c cxxprogram')
536 # obj.install_path = None
537 # obj.source = list(gtk2_ardour_sources)
538 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
539 # obj.target = 'canvas_test'
540 # obj.includes = ['.', '../libs']
541 # obj.ldflags = ['-no-undefined']
554 # 'PACKAGE="' + I18N_PACKAGE + '"',
555 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
556 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
557 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
560 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
561 # # obj.source += [ 'canvas_test.cc', ]
562 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
565 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
566 # Windows VST support w/wine
567 # If we require VST support we build a stub main() and the FST library
568 # here using winegcc, and link it to the GTK front-end library
569 obj = bld (features = 'cxx c cxxprogram wine')
570 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
572 # XXX do we really need to explicitly link to all of these for the wine executable?
574 obj.use = [ 'libpbd',
587 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
588 obj.includes = [ '../libs/fst', '.' ]
589 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
590 obj.linkflags += bld.env['LDFLAGS']
591 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
592 obj.install_path = bld.env['DLLDIR']
593 # end of the wine executable
595 # now the shared library containing the GTK GUI for ardour
596 obj = bld (features = 'cxx c cxxshlib')
597 # operate on copy to avoid adding sources twice
598 obj.source = list(gtk2_ardour_sources)
599 obj.includes = [ '../libs/fst', '.' ]
600 obj.name = 'libgtk2_ardour'
601 obj.target = 'gtk2_ardour'
602 obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
605 # just the normal executable version of the GTK GUI
606 if bld.env['build_target'] == 'mingw':
607 obj = bld (features = 'cxx c cxxprogram winres')
609 obj = bld (features = 'cxx c cxxprogram')
610 # operate on copy to avoid adding sources twice
611 obj.source = list(gtk2_ardour_sources)
612 obj.target = 'ardour-' + str (bld.env['VERSION'])
614 obj.ldflags = ['-no-undefined']
616 if bld.is_defined('WINDOWS_VST_SUPPORT'):
617 # Windows VST support mingw
618 obj.includes += [ '../libs/fst' ]
620 # at this point, "obj" refers to either the normal native executable
621 # OR the shared library built for use with wine on linux.
623 obj.use = [ 'libpbd',
636 'PACKAGE="' + I18N_PACKAGE + '"',
637 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
638 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
639 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
641 obj.install_path = bld.env['DLLDIR']
643 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
645 if sys.platform == 'darwin':
646 obj.uselib += ' AUDIOUNITS OSX '
647 obj.use += ' libappleutility'
648 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
649 elif bld.env['build_target'] == 'mingw':
650 obj.source += [ 'bundle_env_mingw.cc' ]
651 obj.source += [ 'windows_icon.rc' ]
653 obj.source += [ 'bundle_env_linux.cc' ]
655 obj.includes += ['../libs']
657 obj.use += 'libptformat'
659 if bld.env['build_target'] == 'mingw':
660 obj.linkflags += ' -mwindows'
661 obj.use += [ 'PANGOFT2' ]
663 if bld.is_defined('HAVE_SUIL'):
664 obj.source += [ 'lv2_plugin_ui.cc' ]
665 obj.use += [ 'SUIL' ]
667 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
668 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
670 if bld.is_defined('NEED_INTL'):
671 obj.linkflags += ' -lintl'
673 if bld.is_defined('WINDOWS_VST_SUPPORT'):
674 obj.source += [ 'windows_vst_plugin_ui.cc' ]
675 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
676 if bld.env['build_target'] != 'mingw':
679 if bld.is_defined('LXVST_SUPPORT'):
680 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
681 obj.defines += [ 'LXVST_SUPPORT' ]
684 if bld.is_defined('MACVST_SUPPORT'):
685 obj.source += [ 'mac_vst_plugin_ui.mm' ]
686 obj.defines += [ 'MACVST_SUPPORT' ]
688 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
689 obj.source += [ 'vst_plugin_ui.cc' ]
691 if bld.is_defined('PHONE_HOME'):
692 obj.defines += [ 'PHONE_HOME' ]
694 if bld.is_defined('HAVE_COREAUDIO'):
695 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
696 obj.use += ' libappleutility '
698 if bld.is_defined('AUDIOUNIT_SUPPORT'):
699 obj.source += [ 'au_pluginui.mm' ]
703 wrapper_subst_dict = {
704 'INSTALL_PREFIX' : bld.env['PREFIX'],
705 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
706 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
707 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
708 'LIBS' : 'build/libs',
709 'VERSION' : str (bld.env['VERSION']),
710 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
713 def set_subst_dict(obj, dict):
715 setattr(obj, i, dict[i])
717 obj = bld(features = 'subst')
718 obj.source = 'ardev_common.sh.in'
719 obj.target = 'ardev_common_waf.sh'
720 obj.chmod = Utils.O755
721 obj.dict = wrapper_subst_dict
722 set_subst_dict(obj, wrapper_subst_dict)
724 obj = bld(features = 'subst')
725 obj.source = 'ardour.sh.in'
726 obj.target = 'ardour' + str (bld.env['MAJOR'])
727 obj.chmod = Utils.O755
728 obj.dict = wrapper_subst_dict
729 obj.install_path = bld.env['BINDIR']
730 set_subst_dict(obj, wrapper_subst_dict)
732 if bld.is_defined('WINDOWS_VST_SUPPORT'):
733 obj = bld(features = 'subst')
734 obj.source = '../vst/ardourvst.in'
735 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
736 obj.chmod = Utils.O755
737 obj.dict = wrapper_subst_dict
738 obj.install_path = bld.env['BINDIR']
739 set_subst_dict(obj, wrapper_subst_dict)
748 if sys.platform == 'darwin':
761 if bld.env['build_target'] in ['panther', 'tiger', 'leopard'] or (Options.options.ppc and bld.env['build_target'] == 'snowleopard'):
762 # CTFontManagerRegisterFontsForURL for ArdourMono is 10.6 or newer
763 # "Lucida Grande" is not mono-spaced, but works for most cases, except big-clock-window
765 'MONOSPACE' : 'Monaco',
766 'CLOCKFONT' : 'Lucida Grande',
770 'MONOSPACE' : 'Monaco',
771 'CLOCKFONT' : 'ArdourMono',
773 else: # Linux/X11 & Windows fonts
774 basefont = '' # unspecified - use system defaults
787 'MONOSPACE' : 'ArdourMono',
788 'CLOCKFONT' : 'ArdourMono',
791 # Set up font substitution dictionary
793 for style in ['', 'BOLD', 'ITALIC']:
794 for sizename,points in iter(font_sizes.items()):
796 key = "_".join (['FONT',style,sizename])
797 fontstyle = " ".join ([basefont,style.lower(),points])
799 key = "_".join (['FONT',sizename])
800 fontstyle = " ".join ([basefont,points])
802 font_subst_dict[key] = fontstyle
805 for sizename,points in iter(font_sizes.items()):
806 key = "_".join (['FONT_SIZE',sizename])
807 font_subst_dict[key] = points
809 # various font names, eg @BOLD_MONOSPACE@
810 for font_sym,text in iter(font_names.items()):
812 font_subst_dict[key] = text
816 obj = bld(features = 'subst')
817 obj.source = [ 'clearlooks.rc.in' ]
818 obj.target = 'clearlooks.rc'
819 obj.install_path = bld.env['CONFDIR']
820 set_subst_dict(obj, font_subst_dict)
822 obj = bld(features = 'subst')
823 obj.source = [ 'default_ui_config.in' ]
824 obj.target = 'default_ui_config'
825 obj.install_path = bld.env['CONFDIR']
826 set_subst_dict(obj, font_subst_dict)
830 if sys.platform == 'darwin':
831 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
833 menus_argv = [ '-E', '-P' ]
835 if bld.is_defined('PTFORMAT'):
836 menus_argv += [ '-DPTFORMAT' ]
838 # always build all versions of the menu definitions
839 # so that we can try them out with different program builds.
840 for program in [ 'ardour', 'trx' ]:
841 obj = bld(features = 'command-output')
843 obj.command_is_external = True
845 obj.argv = menus_argv
846 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
847 obj.stdin = program + '.menus.in'
848 obj.stdout = program + '.menus'
849 bld.install_files (bld.env['CONFDIR'], program + '.menus')
852 freedesktop_subst_dict = {
853 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
854 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
855 'VERSION': str (bld.env['VERSION']),
856 'DATE': str (bld.env['DATE']),
859 if bld.env['FREEDESKTOP']:
860 obj = bld(features = 'subst')
861 obj.source = 'ardour.desktop.in'
862 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
863 obj.chmod = Utils.O644
864 obj.dict = freedesktop_subst_dict
865 set_subst_dict(obj, freedesktop_subst_dict)
867 obj = bld(features = 'subst')
868 obj.source = 'ardour-mime-info.xml'
869 obj.target = 'ardour.xml'
870 obj.chmod = Utils.O644
872 # build appdata with translations
874 appdata_i18n_xmlin(bld)
875 obj = bld(features = 'subst')
876 obj.source = 'ardour.appdata.xml.in'
877 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
878 obj.chmod = Utils.O644
879 obj.dict = freedesktop_subst_dict
880 set_subst_dict(obj, freedesktop_subst_dict)
884 # NATIVE ARDOUR BINDING FILES
885 # explicitly state the use of perl here so that it works on windows too
887 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
888 for b in [ 'ardour' ] :
890 target = b + '.keys',
891 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
894 obj.install_path = bld.env['CONFDIR']
897 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
898 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
900 # Application/Product specific resources (icon, splash)
901 pgmname = bld.env['PROGRAM_NAME']
902 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
904 if bld.env['build_target'] == 'mingw':
905 # These icons need to overwrite the files already installed in the icons
906 # directory above. Do this in the external packaging scripts for now.
907 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
908 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
910 # Default UI configuration
911 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
912 # Color Themes. Find each color file for this program only
914 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
916 # Default export stuff
917 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
920 if bld.is_defined('ENABLE_NLS'):
921 mo_files = bld.path.ant_glob('po/*.mo')
923 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
924 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
928 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
929 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
931 appdata_i18n_pot(bld)
935 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
936 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
938 appdata_i18n_pot(bld)
941 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
942 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
947 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
948 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
951 def appdata_i18n_pot(bld):
952 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
953 'ardour.appdata.pot')
954 if bld.cmd == 'i18n_pot':
955 Logs.info('Generating pot file from Ardour appdata')
956 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
957 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
958 'ardour.appdata.xml.in.in')
959 Logs.info('Updating ' + potfile)
961 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
963 print ('Error processing appdata pot file - ignored')
964 elif bld.cmd == 'clean' and os.path.exists(potfile):
965 Logs.info('Removing Ardour appdata pot file')
968 def appdata_i18n_po(bld):
969 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
970 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
972 def appdata_i18n_mo(bld):
973 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
974 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
976 def appdata_i18n_xmlin(bld):
977 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
978 'ardour.appdata.xml.in')
979 if bld.cmd == 'build':
980 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
981 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
982 'ardour.appdata.xml.in.in')
983 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
984 mo_files = glob.glob(mo_glob)
985 Logs.info('Generating ' + adxmlinfile)
986 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
987 '-j', adxmlininfile] + mo_files)
988 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
989 Logs.info('Removing ' + adxmlinfile)
990 os.remove(adxmlinfile)