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',
96 'editor_tempodisplay.cc',
100 'export_channel_selector.cc',
102 'export_file_notebook.cc',
103 'export_filename_selector.cc',
104 'export_format_dialog.cc',
105 'export_format_selector.cc',
106 'export_preset_selector.cc',
108 'export_timespan_selector.cc',
112 'floating_text_entry.cc',
114 'sfdb_freesound_mootcher.cc',
116 'generic_pluginui.cc',
118 'global_port_matrix.cc',
120 'gtk_pianokeyboard.c',
123 'insert_remove_time_dialog.cc',
124 'instrument_selector.cc',
125 'interthread_progress_window.cc',
134 'lua_script_manager.cc',
141 'midi_automation_line.cc',
142 'midi_channel_dialog.cc',
143 'midi_channel_selector.cc',
144 'midi_cut_buffer.cc',
145 'midi_export_dialog.cc',
146 'midi_list_editor.cc',
147 'midi_region_view.cc',
150 'midi_streamview.cc',
153 '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 'patch_change_widget.cc',
185 'piano_roll_header.cc',
187 'playlist_selector.cc',
190 'plugin_pin_dialog.cc',
191 'plugin_presets_ui.cc',
192 'plugin_setup_dialog.cc',
193 'plugin_selector.cc',
195 'plugin_dspload_ui.cc',
196 'plugin_dspload_window.cc',
200 'port_matrix_body.cc',
201 'port_matrix_column_labels.cc',
202 'port_matrix_component.cc',
203 'port_matrix_grid.cc',
204 'port_matrix_labels.cc',
205 'port_matrix_row_labels.cc',
207 'processor_selection.cc',
208 'patch_change_dialog.cc',
209 'progress_reporter.cc',
210 'pt_import_selector.cc',
212 'quantize_dialog.cc',
213 'rc_option_editor.cc',
215 'region_gain_line.cc',
216 'region_layering_order_editor.cc',
217 'region_selection.cc',
221 'route_group_dialog.cc',
222 'route_group_menu.cc',
223 'route_params_ui.cc',
224 'route_processor_selection.cc',
225 'route_time_axis.cc',
229 'save_template_dialog.cc',
230 'search_path_option.cc',
232 'script_selector.cc',
234 'selection_memento.cc',
236 'session_archive_dialog.cc',
238 'session_import_dialog.cc',
239 'session_metadata_dialog.cc',
240 'session_option_editor.cc',
242 'shuttle_control.cc',
243 'soundcloud_export_selector.cc',
250 'stereo_panner_editor.cc',
252 'strip_silence_dialog.cc',
253 'stripable_colorpicker.cc',
254 'stripable_time_axis.cc',
256 'tape_region_view.cc',
257 'template_dialog.cc',
262 'time_axis_view_item.cc',
267 'track_selection.cc',
268 'track_view_list.cc',
269 'transform_dialog.cc',
270 'transport_control.cc',
271 'transport_control_ui.cc',
272 'transport_masters_dialog.cc',
273 'transpose_dialog.cc',
276 'vca_master_strip.cc',
278 'visibility_group.cc',
280 # video-timeline related sources:
281 'video_image_frame.cc',
282 'add_video_dialog.cc',
283 'editor_videotimeline.cc',
287 'transcode_ffmpeg.cc',
288 'transcode_video_dialog.cc',
289 'video_server_dialog.cc',
291 'export_video_dialog.cc',
292 'export_video_infobox.cc'
295 def enoify (major, minor):
296 # Code names based on
297 # https://en.wikipedia.org/wiki/Brian_Eno_discography
299 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
300 # (no Singles, no EPs, no Video Albums, no Production)
302 return "\\n\\\"E-No\\\""
305 return "\\n\\\"No Pussyfooting\\\""
307 return "\\n\\\"Here Come the Warm Jets\\\""
309 return "\\n\\\"Taking Tiger Mountain\\\""
311 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
313 return "\\n\\\"Discreet Music\\\""
315 return "\\n\\\"Another Green World\\\""
317 return "\\n\\\"Evening Star\\\""
319 return "\\n\\\"Cluster and Eno\\\""
322 return "\\n\\\"Before and After Science\\\""
324 return "\\n\\\"After the Heat\\\""
326 return "\\n\\\"Music for Airports\\\""
328 return "\\n\\\"Music for Films\\\""
330 return "\\n\\\"In a Land of Clear Colours\\\""
332 return "\\n\\\"The Plateaux of Mirror\\\""
334 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
336 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
338 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
340 return "\\n\\\"On Land\\\"" # 1982
341 elif minor == 10: # 6.0 ??
342 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
344 return "\\n\\\"More Music for Films\\\"" # 1983
346 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
349 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
351 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
352 ### From now on, no more compilations, names are not suitable
354 return "\\n\\\"Thursday Afternoon\\\"" # 1985
356 return "\\n\\\"Music for Films III\\\"" # 1988 Collaborative
358 return "\\n\\\"Wrong Way Up\\\"" # 1990 Collaborative
360 return "\\n\\\"Nerve Net\\\"" # 1992
362 return "\\n\\\"The Shutov Assembly\\\"" # 1992
364 return "\\n\\\"Neroli\\\"" # 1993
366 return "\\n\\\"Headcandy\\\"" # 1994
370 autowaf.set_options(opt)
374 conf.load('compiler_cxx')
375 autowaf.configure(conf)
377 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
379 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
381 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
382 atleast_version='1.2.1')
383 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
384 atleast_version='2.10.1')
385 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
386 atleast_version='2.18')
387 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
388 atleast_version='2.18')
389 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
390 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
391 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
392 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
395 if sys.platform == 'darwin':
396 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
397 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
398 env = conf.env.derive (),
401 compile_filename='test.m',
406 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
407 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
409 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
411 conf.write_config_header('gtk2ardour-config.h', remove=False)
413 bak = conf.env['define_key']
414 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
415 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
416 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
417 conf.write_config_header('gtk2ardour-version.h')
418 conf.env['define_key'] = bak;
421 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
422 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
424 # Add a waf `feature' to allow compilation of things using winegcc
425 from waflib.TaskGen import feature
427 def set_winegcc(self):
428 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
429 self.env.CC = 'winegcc'
431 def _doPyp(infileName, deps = False):
434 re_spaces = re.compile("\s+")
436 if infileName == '-':
439 fd = open(infileName)
440 inLines = fd.readlines()
446 bits = re_spaces.split(line)
447 if bits[0] == '##include':
452 # assume included file comes from same place as source file
453 incName = os.path.join (os.path.dirname (infileName), incName);
454 outStr += _doPyp(incName)
465 def include_processor(task):
466 infileName = task.inputs[0].srcpath()
467 outfileName = os.path.join(out, task.outputs[0].bldpath())
468 fdOut = open (outfileName, "w")
469 fdOut.write (_doPyp(infileName))
473 def build_color_scheme(path, prefix):
477 if re.search ('^#@color', line):
478 line.strip() # remove newline
480 if len(color_scheme):
482 color_scheme += prefix
484 color_scheme += words[1]
486 color_scheme += words[2]
492 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
493 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
495 # Tool to dump lua-bindings (of gtk2ardour + libs)
496 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
497 obj = bld (features = 'cxx c cxxprogram')
498 obj.install_path = None
499 obj.source = list(gtk2_ardour_sources)
500 obj.target = 'luadoc'
501 obj.includes = ['.', '../libs']
502 obj.ldflags = ['-no-undefined']
517 'PACKAGE="' + I18N_PACKAGE + '"',
518 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
519 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
520 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
523 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
524 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
525 if bld.is_defined('HAVE_SUIL'):
526 obj.source += [ 'lv2_plugin_ui.cc' ]
527 obj.use += [ 'SUIL' ]
528 if bld.is_defined('LXVST_SUPPORT'):
529 obj.source += [ 'vst_plugin_ui.cc' ]
530 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
531 obj.defines += [ 'LXVST_SUPPORT' ]
534 # # Tool to test libcanvas
535 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
536 # obj = bld (features = 'cxx c cxxprogram')
537 # obj.install_path = None
538 # obj.source = list(gtk2_ardour_sources)
539 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
540 # obj.target = 'canvas_test'
541 # obj.includes = ['.', '../libs']
542 # obj.ldflags = ['-no-undefined']
555 # 'PACKAGE="' + I18N_PACKAGE + '"',
556 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
557 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
558 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
561 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
562 # # obj.source += [ 'canvas_test.cc', ]
563 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
566 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
567 # Windows VST support w/wine
568 # If we require VST support we build a stub main() and the FST library
569 # here using winegcc, and link it to the GTK front-end library
570 obj = bld (features = 'cxx c cxxprogram wine')
571 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
573 # XXX do we really need to explicitly link to all of these for the wine executable?
575 obj.use = [ 'libpbd',
588 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
589 obj.includes = [ '../libs/fst', '.' ]
590 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
591 obj.linkflags += bld.env['LDFLAGS']
592 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
593 obj.install_path = bld.env['DLLDIR']
594 # end of the wine executable
596 # now the shared library containing the GTK GUI for ardour
597 obj = bld (features = 'cxx c cxxshlib')
598 # operate on copy to avoid adding sources twice
599 obj.source = list(gtk2_ardour_sources)
600 obj.includes = [ '../libs/fst', '.' ]
601 obj.name = 'libgtk2_ardour'
602 obj.target = 'gtk2_ardour'
603 obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
606 # just the normal executable version of the GTK GUI
607 if bld.env['build_target'] == 'mingw':
608 obj = bld (features = 'cxx c cxxprogram winres')
610 obj = bld (features = 'cxx c cxxprogram')
611 # operate on copy to avoid adding sources twice
612 obj.source = list(gtk2_ardour_sources)
613 obj.target = 'ardour-' + str (bld.env['VERSION'])
615 obj.ldflags = ['-no-undefined']
617 if bld.is_defined('WINDOWS_VST_SUPPORT'):
618 # Windows VST support mingw
619 obj.includes += [ '../libs/fst' ]
621 # at this point, "obj" refers to either the normal native executable
622 # OR the shared library built for use with wine on linux.
624 obj.use = [ 'libpbd',
637 'PACKAGE="' + I18N_PACKAGE + '"',
638 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
639 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
640 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
642 obj.install_path = bld.env['DLLDIR']
644 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
646 if sys.platform == 'darwin':
647 obj.uselib += ' AUDIOUNITS OSX '
648 obj.use += ' libappleutility'
649 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
650 elif bld.env['build_target'] == 'mingw':
651 obj.source += [ 'bundle_env_mingw.cc' ]
652 obj.source += [ 'windows_icon.rc' ]
654 obj.source += [ 'bundle_env_linux.cc' ]
656 obj.includes += ['../libs']
658 obj.use += 'libptformat'
660 if bld.env['build_target'] == 'mingw':
661 obj.linkflags += ' -mwindows'
662 obj.use += [ 'PANGOFT2' ]
664 if bld.is_defined('HAVE_SUIL'):
665 obj.source += [ 'lv2_plugin_ui.cc' ]
666 obj.use += [ 'SUIL' ]
668 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
669 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
671 if bld.is_defined('NEED_INTL'):
672 obj.linkflags += ' -lintl'
674 if bld.is_defined('WINDOWS_VST_SUPPORT'):
675 obj.source += [ 'windows_vst_plugin_ui.cc' ]
676 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
677 if bld.env['build_target'] != 'mingw':
680 if bld.is_defined('LXVST_SUPPORT'):
681 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
682 obj.defines += [ 'LXVST_SUPPORT' ]
685 if bld.is_defined('MACVST_SUPPORT'):
686 obj.source += [ 'mac_vst_plugin_ui.mm' ]
687 obj.defines += [ 'MACVST_SUPPORT' ]
689 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
690 obj.source += [ 'vst_plugin_ui.cc' ]
692 if bld.is_defined('PHONE_HOME'):
693 obj.defines += [ 'PHONE_HOME' ]
695 if bld.is_defined('HAVE_COREAUDIO'):
696 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
697 obj.use += ' libappleutility '
699 if bld.is_defined('AUDIOUNIT_SUPPORT'):
700 obj.source += [ 'au_pluginui.mm' ]
704 wrapper_subst_dict = {
705 'INSTALL_PREFIX' : bld.env['PREFIX'],
706 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
707 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
708 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
709 'LIBS' : 'build/libs',
710 'VERSION' : str (bld.env['VERSION']),
711 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
714 def set_subst_dict(obj, dict):
716 setattr(obj, i, dict[i])
718 obj = bld(features = 'subst')
719 obj.source = 'ardev_common.sh.in'
720 obj.target = 'ardev_common_waf.sh'
721 obj.chmod = Utils.O755
722 obj.dict = wrapper_subst_dict
723 set_subst_dict(obj, wrapper_subst_dict)
725 obj = bld(features = 'subst')
726 obj.source = 'ardour.sh.in'
727 obj.target = 'ardour' + str (bld.env['MAJOR'])
728 obj.chmod = Utils.O755
729 obj.dict = wrapper_subst_dict
730 obj.install_path = bld.env['BINDIR']
731 set_subst_dict(obj, wrapper_subst_dict)
733 if bld.is_defined('WINDOWS_VST_SUPPORT'):
734 obj = bld(features = 'subst')
735 obj.source = '../vst/ardourvst.in'
736 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
737 obj.chmod = Utils.O755
738 obj.dict = wrapper_subst_dict
739 obj.install_path = bld.env['BINDIR']
740 set_subst_dict(obj, wrapper_subst_dict)
749 if sys.platform == 'darwin':
762 if bld.env['build_target'] in ['panther', 'tiger', 'leopard'] or (Options.options.ppc and bld.env['build_target'] == 'snowleopard'):
763 # CTFontManagerRegisterFontsForURL for ArdourMono is 10.6 or newer
764 # "Lucida Grande" is not mono-spaced, but works for most cases, except big-clock-window
766 'MONOSPACE' : 'Monaco',
767 'CLOCKFONT' : 'Lucida Grande',
771 'MONOSPACE' : 'Monaco',
772 'CLOCKFONT' : 'ArdourMono',
774 else: # Linux/X11 & Windows fonts
775 basefont = '' # unspecified - use system defaults
788 'MONOSPACE' : 'ArdourMono',
789 'CLOCKFONT' : 'ArdourMono',
792 # Set up font substitution dictionary
794 for style in ['', 'BOLD', 'ITALIC']:
795 for sizename,points in iter(font_sizes.items()):
797 key = "_".join (['FONT',style,sizename])
798 fontstyle = " ".join ([basefont,style.lower(),points])
800 key = "_".join (['FONT',sizename])
801 fontstyle = " ".join ([basefont,points])
803 font_subst_dict[key] = fontstyle
806 for sizename,points in iter(font_sizes.items()):
807 key = "_".join (['FONT_SIZE',sizename])
808 font_subst_dict[key] = points
810 # various font names, eg @BOLD_MONOSPACE@
811 for font_sym,text in iter(font_names.items()):
813 font_subst_dict[key] = text
817 obj = bld(features = 'subst')
818 obj.source = [ 'clearlooks.rc.in' ]
819 obj.target = 'clearlooks.rc'
820 obj.install_path = bld.env['CONFDIR']
821 set_subst_dict(obj, font_subst_dict)
823 obj = bld(features = 'subst')
824 obj.source = [ 'default_ui_config.in' ]
825 obj.target = 'default_ui_config'
826 obj.install_path = bld.env['CONFDIR']
827 set_subst_dict(obj, font_subst_dict)
831 if sys.platform == 'darwin':
832 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
834 menus_argv = [ '-E', '-P' ]
836 if bld.is_defined('MIXBUS'):
837 menus_argv += [ '-DMIXBUS' ]
839 if bld.is_defined('PTFORMAT'):
840 menus_argv += [ '-DPTFORMAT' ]
842 # always build all versions of the menu definitions
843 # so that we can try them out with different program builds.
844 for program in [ 'ardour', 'trx' ]:
845 obj = bld(features = 'command-output')
847 obj.command_is_external = True
849 obj.argv = menus_argv
850 obj.dep_vars = ['PTFORMAT', 'MIXBUS', 'WINDOWS']
851 obj.stdin = program + '.menus.in'
852 obj.stdout = program + '.menus'
853 bld.install_files (bld.env['CONFDIR'], program + '.menus')
856 freedesktop_subst_dict = {
857 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
858 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
859 'VERSION': str (bld.env['VERSION']),
860 'DATE': str (bld.env['DATE']),
863 if bld.env['FREEDESKTOP']:
864 obj = bld(features = 'subst')
865 obj.source = 'ardour.desktop.in'
866 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
867 obj.chmod = Utils.O644
868 obj.dict = freedesktop_subst_dict
869 set_subst_dict(obj, freedesktop_subst_dict)
871 obj = bld(features = 'subst')
872 obj.source = 'ardour-mime-info.xml'
873 obj.target = 'ardour.xml'
874 obj.chmod = Utils.O644
876 # build appdata with translations
878 appdata_i18n_xmlin(bld)
879 obj = bld(features = 'subst')
880 obj.source = 'ardour.appdata.xml.in'
881 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
882 obj.chmod = Utils.O644
883 obj.dict = freedesktop_subst_dict
884 set_subst_dict(obj, freedesktop_subst_dict)
888 # NATIVE ARDOUR BINDING FILES
889 # explicitly state the use of perl here so that it works on windows too
891 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
892 for b in [ 'ardour' ] :
894 target = b + '.keys',
895 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
898 obj.install_path = bld.env['CONFDIR']
901 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
902 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
904 # Application/Product specific resources (icon, splash)
905 pgmname = bld.env['PROGRAM_NAME']
906 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
908 if bld.env['build_target'] == 'mingw':
909 # These icons need to overwrite the files already installed in the icons
910 # directory above. Do this in the external packaging scripts for now.
911 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
912 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
914 # Default UI configuration
915 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
916 # Color Themes. Find each color file for this program only
918 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
920 # Default export stuff
921 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
924 if bld.is_defined('ENABLE_NLS'):
925 mo_files = bld.path.ant_glob('po/*.mo')
927 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
928 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
932 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
933 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
935 appdata_i18n_pot(bld)
939 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
940 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
942 appdata_i18n_pot(bld)
945 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
946 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
951 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
952 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
955 def appdata_i18n_pot(bld):
956 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
957 'ardour.appdata.pot')
958 if bld.cmd == 'i18n_pot':
959 Logs.info('Generating pot file from Ardour appdata')
960 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
961 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
962 'ardour.appdata.xml.in.in')
963 Logs.info('Updating ' + potfile)
965 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
967 print ('Error processing appdata pot file - ignored')
968 elif bld.cmd == 'clean' and os.path.exists(potfile):
969 Logs.info('Removing Ardour appdata pot file')
972 def appdata_i18n_po(bld):
973 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
974 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
976 def appdata_i18n_mo(bld):
977 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
978 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
980 def appdata_i18n_xmlin(bld):
981 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
982 'ardour.appdata.xml.in')
983 if bld.cmd == 'build':
984 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
985 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
986 'ardour.appdata.xml.in.in')
987 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
988 mo_files = glob.glob(mo_glob)
989 Logs.info('Generating ' + adxmlinfile)
990 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
991 '-j', adxmlininfile] + mo_files)
992 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
993 Logs.info('Removing ' + adxmlinfile)
994 os.remove(adxmlinfile)