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',
40 'ardour_ui_access_web.cc',
41 'ardour_ui_dependents.cc',
42 'ardour_ui_dialogs.cc',
44 'ardour_ui_engine.cc',
47 'ardour_ui_options.cc',
48 'ardour_ui_session.cc',
49 'ardour_ui_startup.cc',
53 'audio_region_editor.cc',
54 'audio_region_view.cc',
55 'audio_streamview.cc',
57 'automation_controller.cc',
59 'automation_region_view.cc',
60 'automation_streamview.cc',
61 'automation_time_axis.cc',
63 'big_clock_window.cc',
64 'big_transport_window.cc',
67 'color_theme_manager.cc',
70 'control_point_dialog.cc',
71 'control_slave_ui.cc',
75 'duplicate_routes_dialog.cc',
76 'edit_note_dialog.cc',
80 'editor_audio_import.cc',
81 'editor_pt_import.cc',
82 'editor_audiotrack.cc',
84 'editor_canvas_events.cc',
85 'editor_component.cc',
88 'editor_route_groups.cc',
89 'editor_export_audio.cc',
90 'editor_group_tabs.cc',
92 'editor_locations.cc',
100 'editor_selection.cc',
101 'editor_snapshots.cc',
104 'editor_tempodisplay.cc',
108 'export_channel_selector.cc',
110 'export_file_notebook.cc',
111 'export_filename_selector.cc',
112 'export_format_dialog.cc',
113 'export_format_selector.cc',
114 'export_preset_selector.cc',
116 'export_timespan_selector.cc',
120 'floating_text_entry.cc',
122 'sfdb_freesound_mootcher.cc',
124 'generic_pluginui.cc',
126 'global_port_matrix.cc',
131 'insert_remove_time_dialog.cc',
132 'instrument_selector.cc',
133 'interthread_progress_window.cc',
142 'lua_script_manager.cc',
149 'midi_automation_line.cc',
150 'midi_channel_dialog.cc',
151 'midi_channel_selector.cc',
152 'midi_cut_buffer.cc',
153 'midi_export_dialog.cc',
154 'midi_list_editor.cc',
155 'midi_region_view.cc',
158 'midi_streamview.cc',
161 'midi_velocity_dialog.cc',
163 'missing_file_dialog.cc',
164 'missing_plugin_dialog.cc',
165 'mixer_group_tabs.cc',
171 'monitor_section.cc',
172 'monitor_selector.cc',
174 'mono_panner_editor.cc',
177 'new_plugin_preset_dialog.cc',
178 'new_user_wizard.cc',
179 'normalize_dialog.cc',
183 'note_select_dialog.cc',
190 'panner_interface.cc',
193 'patch_change_widget.cc',
194 'piano_roll_header.cc',
196 'playlist_selector.cc',
199 'plugin_pin_dialog.cc',
200 'plugin_presets_ui.cc',
201 'plugin_scan_dialog.cc',
202 'plugin_setup_dialog.cc',
203 'plugin_selector.cc',
205 'plugin_dspload_ui.cc',
206 'plugin_dspload_window.cc',
210 'port_matrix_body.cc',
211 'port_matrix_column_labels.cc',
212 'port_matrix_component.cc',
213 'port_matrix_grid.cc',
214 'port_matrix_labels.cc',
215 'port_matrix_row_labels.cc',
217 'processor_selection.cc',
218 'patch_change_dialog.cc',
219 'progress_reporter.cc',
220 'pt_import_selector.cc',
222 'quantize_dialog.cc',
223 'rc_option_editor.cc',
225 'region_gain_line.cc',
226 'region_layering_order_editor.cc',
227 'region_selection.cc',
231 'route_group_dialog.cc',
232 'route_group_menu.cc',
233 'route_params_ui.cc',
234 'route_processor_selection.cc',
235 'route_time_axis.cc',
239 'save_template_dialog.cc',
240 'search_path_option.cc',
242 'script_selector.cc',
244 'selection_memento.cc',
246 'session_archive_dialog.cc',
248 'session_import_dialog.cc',
249 'session_metadata_dialog.cc',
250 'session_option_editor.cc',
252 'shuttle_control.cc',
253 'soundcloud_export_selector.cc',
260 'stereo_panner_editor.cc',
262 'strip_silence_dialog.cc',
263 'stripable_colorpicker.cc',
264 'stripable_time_axis.cc',
266 'tape_region_view.cc',
267 'template_dialog.cc',
272 'time_axis_view_item.cc',
277 'track_selection.cc',
278 'track_view_list.cc',
279 'transform_dialog.cc',
280 'transport_control.cc',
281 'transport_control_ui.cc',
282 'transport_masters_dialog.cc',
283 'transpose_dialog.cc',
286 'vca_master_strip.cc',
288 'virtual_keyboard_window.cc',
289 'visibility_group.cc',
291 # video-timeline related sources:
292 'video_image_frame.cc',
293 'add_video_dialog.cc',
294 'editor_videotimeline.cc',
298 'transcode_ffmpeg.cc',
299 'transcode_video_dialog.cc',
300 'video_server_dialog.cc',
302 'export_video_dialog.cc',
303 'export_video_infobox.cc'
306 def enoify (major, minor):
307 # Code names based on
308 # https://en.wikipedia.org/wiki/Brian_Eno_discography
310 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
311 # (no Singles, no EPs, no Video Albums, no Production)
313 return "\\n\\\"E-No\\\""
316 return "\\n\\\"No Pussyfooting\\\""
318 return "\\n\\\"Here Come the Warm Jets\\\""
320 return "\\n\\\"Taking Tiger Mountain\\\""
322 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
324 return "\\n\\\"Discreet Music\\\""
326 return "\\n\\\"Another Green World\\\""
328 return "\\n\\\"Evening Star\\\""
330 return "\\n\\\"Cluster and Eno\\\""
333 return "\\n\\\"Before and After Science\\\""
335 return "\\n\\\"After the Heat\\\""
337 return "\\n\\\"Music for Airports\\\""
339 return "\\n\\\"Music for Films\\\""
341 return "\\n\\\"In a Land of Clear Colours\\\""
343 return "\\n\\\"The Plateaux of Mirror\\\""
345 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
347 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
349 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
351 return "\\n\\\"On Land\\\"" # 1982
352 elif minor == 10: # 6.0 ??
353 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
355 return "\\n\\\"More Music for Films\\\"" # 1983
357 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
360 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
362 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
363 ### From now on, no more compilations, names are not suitable
365 return "\\n\\\"Thursday Afternoon\\\"" # 1985
367 return "\\n\\\"Music for Films III\\\"" # 1988 Collaborative
369 return "\\n\\\"Wrong Way Up\\\"" # 1990 Collaborative
371 return "\\n\\\"Nerve Net\\\"" # 1992
373 return "\\n\\\"The Shutov Assembly\\\"" # 1992
375 return "\\n\\\"Neroli\\\"" # 1993
377 return "\\n\\\"Headcandy\\\"" # 1994
381 autowaf.set_options(opt)
385 conf.load('compiler_cxx')
386 autowaf.configure(conf)
388 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
390 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
392 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
393 atleast_version='1.2.1')
394 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
395 atleast_version='2.10.1')
396 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
397 atleast_version='2.18')
398 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
399 atleast_version='2.18')
400 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
401 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
402 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
403 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
405 if conf.env.CC_NAME == 'gcc' and Options.options.strict:
406 conf.define('GLIB_DISABLE_DEPRECATION_WARNINGS', 1)
407 for var in ['CFLAGS', 'CXXFLAGS']:
408 for lib in ['GTK', 'GTKMM']:
409 for d in conf.env['INCLUDES_' + lib]:
410 conf.env.append_value(var, ['-isystem', d])
412 if sys.platform == 'darwin':
413 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
414 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
415 env = conf.env.derive (),
418 compile_filename='test.m',
423 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
424 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
426 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
428 conf.write_config_header('gtk2ardour-config.h', remove=False)
430 bak = conf.env['define_key']
431 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
432 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
433 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
434 conf.write_config_header('gtk2ardour-version.h')
435 conf.env['define_key'] = bak;
438 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
439 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
441 # Add a waf `feature' to allow compilation of things using winegcc
442 from waflib.TaskGen import feature
444 def set_winegcc(self):
445 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
446 self.env.CC = 'winegcc'
448 def _doPyp(infileName, deps = False):
451 re_spaces = re.compile("\s+")
453 if infileName == '-':
456 fd = open(infileName)
457 inLines = fd.readlines()
463 bits = re_spaces.split(line)
464 if bits[0] == '##include':
469 # assume included file comes from same place as source file
470 incName = os.path.join (os.path.dirname (infileName), incName);
471 outStr += _doPyp(incName)
482 def include_processor(task):
483 infileName = task.inputs[0].srcpath()
484 outfileName = os.path.join(out, task.outputs[0].bldpath())
485 fdOut = open (outfileName, "w")
486 fdOut.write (_doPyp(infileName))
490 def build_color_scheme(path, prefix):
494 if re.search ('^#@color', line):
495 line.strip() # remove newline
497 if len(color_scheme):
499 color_scheme += prefix
501 color_scheme += words[1]
503 color_scheme += words[2]
509 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
510 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
512 # Tool to dump lua-bindings (of gtk2ardour + libs)
513 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
514 obj = bld (features = 'cxx c cxxprogram')
515 obj.install_path = None
516 obj.source = list(gtk2_ardour_sources)
517 obj.target = 'luadoc'
518 obj.includes = ['.', '../libs']
519 obj.ldflags = ['-no-undefined']
534 'PACKAGE="' + I18N_PACKAGE + '"',
535 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
536 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
537 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
540 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
541 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
542 if bld.is_defined('HAVE_SUIL'):
543 obj.source += [ 'lv2_plugin_ui.cc' ]
544 obj.use += [ 'SUIL' ]
545 if bld.is_defined('LXVST_SUPPORT'):
546 obj.source += [ 'vst_plugin_ui.cc' ]
547 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
548 obj.defines += [ 'LXVST_SUPPORT' ]
551 # # Tool to test libcanvas
552 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
553 # obj = bld (features = 'cxx c cxxprogram')
554 # obj.install_path = None
555 # obj.source = list(gtk2_ardour_sources)
556 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
557 # obj.target = 'canvas_test'
558 # obj.includes = ['.', '../libs']
559 # obj.ldflags = ['-no-undefined']
572 # 'PACKAGE="' + I18N_PACKAGE + '"',
573 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
574 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
575 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
578 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
579 # # obj.source += [ 'canvas_test.cc', ]
580 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
583 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
584 # Windows VST support w/wine
585 # If we require VST support we build a stub main() and the FST library
586 # here using winegcc, and link it to the GTK front-end library
587 obj = bld (features = 'cxx c cxxprogram wine')
588 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
590 # XXX do we really need to explicitly link to all of these for the wine executable?
592 obj.use = [ 'libpbd',
605 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
606 obj.includes = [ '../libs/fst', '.' ]
607 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
608 obj.linkflags += bld.env['LDFLAGS']
609 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
610 obj.install_path = bld.env['DLLDIR']
611 # end of the wine executable
613 # now the shared library containing the GTK GUI for ardour
614 obj = bld (features = 'cxx c cxxshlib')
615 # operate on copy to avoid adding sources twice
616 obj.source = list(gtk2_ardour_sources)
617 obj.includes = [ '../libs/fst', '.' ]
618 obj.name = 'libgtk2_ardour'
619 obj.target = 'gtk2_ardour'
620 obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
623 # just the normal executable version of the GTK GUI
624 if bld.env['build_target'] == 'mingw':
625 obj = bld (features = 'cxx c cxxprogram winres')
627 obj = bld (features = 'cxx c cxxprogram')
628 # operate on copy to avoid adding sources twice
629 obj.source = list(gtk2_ardour_sources)
630 obj.target = 'ardour-' + str (bld.env['VERSION'])
632 obj.ldflags = ['-no-undefined']
634 if bld.is_defined('WINDOWS_VST_SUPPORT'):
635 # Windows VST support mingw
636 obj.includes += [ '../libs/fst' ]
638 # at this point, "obj" refers to either the normal native executable
639 # OR the shared library built for use with wine on linux.
641 obj.use = [ 'libpbd',
654 'PACKAGE="' + I18N_PACKAGE + '"',
655 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
656 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
657 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
659 obj.install_path = bld.env['DLLDIR']
661 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
663 if sys.platform == 'darwin':
664 obj.uselib += ' AUDIOUNITS OSX '
665 obj.use += ' libappleutility'
666 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
667 elif bld.env['build_target'] == 'mingw':
668 obj.source += [ 'bundle_env_mingw.cc' ]
669 obj.source += [ 'windows_icon.rc' ]
671 obj.source += [ 'bundle_env_linux.cc' ]
673 obj.includes += ['../libs']
675 obj.use += 'libptformat'
677 if bld.env['build_target'] == 'mingw':
678 obj.linkflags += ' -mwindows'
679 obj.use += [ 'PANGOFT2' ]
681 if bld.is_defined('HAVE_SUIL'):
682 obj.source += [ 'lv2_plugin_ui.cc' ]
683 obj.use += [ 'SUIL' ]
685 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
686 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
688 if bld.is_defined('NEED_INTL'):
689 obj.linkflags += ' -lintl'
691 if bld.is_defined('WINDOWS_VST_SUPPORT'):
692 obj.source += [ 'windows_vst_plugin_ui.cc' ]
693 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
694 if bld.env['build_target'] != 'mingw':
697 if bld.is_defined('LXVST_SUPPORT'):
698 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
699 obj.defines += [ 'LXVST_SUPPORT' ]
702 if bld.is_defined('MACVST_SUPPORT'):
703 obj.source += [ 'mac_vst_plugin_ui.mm' ]
704 obj.defines += [ 'MACVST_SUPPORT' ]
706 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
707 obj.source += [ 'vst_plugin_ui.cc' ]
709 if bld.is_defined('PHONE_HOME'):
710 obj.defines += [ 'PHONE_HOME' ]
712 if bld.is_defined('HAVE_COREAUDIO'):
713 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
714 obj.use += ' libappleutility '
716 if bld.is_defined('AUDIOUNIT_SUPPORT'):
717 obj.source += [ 'au_pluginui.mm' ]
721 wrapper_subst_dict = {
722 'INSTALL_PREFIX' : bld.env['PREFIX'],
723 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
724 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
725 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
726 'LIBS' : 'build/libs',
727 'VERSION' : str (bld.env['VERSION']),
728 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
731 def set_subst_dict(obj, dict):
733 setattr(obj, i, dict[i])
735 obj = bld(features = 'subst')
736 obj.source = 'ardev_common.sh.in'
737 obj.target = 'ardev_common_waf.sh'
738 obj.chmod = Utils.O755
739 obj.dict = wrapper_subst_dict
740 set_subst_dict(obj, wrapper_subst_dict)
742 obj = bld(features = 'subst')
743 obj.source = 'ardour.sh.in'
744 obj.target = 'ardour' + str (bld.env['MAJOR'])
745 obj.chmod = Utils.O755
746 obj.dict = wrapper_subst_dict
747 obj.install_path = bld.env['BINDIR']
748 set_subst_dict(obj, wrapper_subst_dict)
750 if bld.is_defined('WINDOWS_VST_SUPPORT'):
751 obj = bld(features = 'subst')
752 obj.source = '../vst/ardourvst.in'
753 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
754 obj.chmod = Utils.O755
755 obj.dict = wrapper_subst_dict
756 obj.install_path = bld.env['BINDIR']
757 set_subst_dict(obj, wrapper_subst_dict)
766 if sys.platform == 'darwin':
779 if bld.env['build_target'] in ['panther', 'tiger', 'leopard'] or (Options.options.ppc and bld.env['build_target'] == 'snowleopard'):
780 # CTFontManagerRegisterFontsForURL for ArdourMono is 10.6 or newer
781 # "Lucida Grande" is not mono-spaced, but works for most cases, except big-clock-window
783 'MONOSPACE' : 'Monaco',
784 'CLOCKFONT' : 'Lucida Grande',
788 'MONOSPACE' : 'Monaco',
789 'CLOCKFONT' : 'ArdourMono',
791 else: # Linux/X11 & Windows fonts
792 basefont = '' # unspecified - use system defaults
805 'MONOSPACE' : 'ArdourMono',
806 'CLOCKFONT' : 'ArdourMono',
809 # Set up font substitution dictionary
811 for style in ['', 'BOLD', 'ITALIC']:
812 for sizename,points in iter(font_sizes.items()):
814 key = "_".join (['FONT',style,sizename])
815 fontstyle = " ".join ([basefont,style.lower(),points])
817 key = "_".join (['FONT',sizename])
818 fontstyle = " ".join ([basefont,points])
820 font_subst_dict[key] = fontstyle
823 for sizename,points in iter(font_sizes.items()):
824 key = "_".join (['FONT_SIZE',sizename])
825 font_subst_dict[key] = points
827 # various font names, eg @BOLD_MONOSPACE@
828 for font_sym,text in iter(font_names.items()):
830 font_subst_dict[key] = text
832 font_subst_dict['FONTFAMILY'] = ''
835 obj = bld(features = 'subst')
836 obj.source = [ 'clearlooks.rc.in' ]
837 obj.target = 'clearlooks.rc'
838 obj.install_path = bld.env['CONFDIR']
839 set_subst_dict(obj, font_subst_dict)
841 font_subst_dict['FONTFAMILY'] = 'ArdourSans'
843 obj = bld(features = 'subst')
844 obj.source = [ 'clearlooks.rc.in' ]
845 obj.target = 'clearlooks.ardoursans.rc'
846 obj.install_path = bld.env['CONFDIR']
847 set_subst_dict(obj, font_subst_dict)
849 obj = bld(features = 'subst')
850 obj.source = [ 'default_ui_config.in' ]
851 obj.target = 'default_ui_config'
852 obj.install_path = bld.env['CONFDIR']
853 set_subst_dict(obj, font_subst_dict)
857 if sys.platform == 'darwin':
858 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
860 menus_argv = [ '-E', '-P' ]
862 if bld.is_defined('MIXBUS'):
863 menus_argv += [ '-DMIXBUS' ]
865 if bld.is_defined('PTFORMAT'):
866 menus_argv += [ '-DPTFORMAT' ]
868 # always build all versions of the menu definitions
869 # so that we can try them out with different program builds.
870 for program in [ 'ardour', 'trx' ]:
871 obj = bld(features = 'command-output')
873 obj.command_is_external = True
875 obj.argv = menus_argv
876 obj.dep_vars = ['PTFORMAT', 'MIXBUS', 'WINDOWS']
877 obj.stdin = program + '.menus.in'
878 obj.stdout = program + '.menus'
879 bld.install_files (bld.env['CONFDIR'], program + '.menus')
882 freedesktop_subst_dict = {
883 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
884 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
885 'VERSION': str (bld.env['VERSION']),
886 'DATE': str (bld.env['DATE']),
889 if bld.env['FREEDESKTOP']:
890 obj = bld(features = 'subst')
891 obj.source = 'ardour.desktop.in'
892 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
893 obj.chmod = Utils.O644
894 obj.dict = freedesktop_subst_dict
895 set_subst_dict(obj, freedesktop_subst_dict)
897 obj = bld(features = 'subst')
898 obj.source = 'ardour-mime-info.xml'
899 obj.target = 'ardour.xml'
900 obj.chmod = Utils.O644
902 # build appdata with translations
904 appdata_i18n_xmlin(bld)
905 obj = bld(features = 'subst')
906 obj.source = 'ardour.appdata.xml.in'
907 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
908 obj.chmod = Utils.O644
909 obj.dict = freedesktop_subst_dict
910 set_subst_dict(obj, freedesktop_subst_dict)
914 # NATIVE ARDOUR BINDING FILES
915 # explicitly state the use of perl here so that it works on windows too
917 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
918 for b in [ 'ardour' ] :
920 target = b + '.keys',
921 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
924 obj.install_path = bld.env['CONFDIR']
927 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
928 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
929 bld.install_files(bld.env['DATADIR'], 'ArdourSans.ttf')
931 # Application/Product specific resources (icon, splash)
932 pgmname = bld.env['PROGRAM_NAME']
933 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
935 if bld.env['build_target'] == 'mingw':
936 # These icons need to overwrite the files already installed in the icons
937 # directory above. Do this in the external packaging scripts for now.
938 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
939 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
941 # Default UI configuration
942 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
943 # Color Themes. Find each color file for this program only
945 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
947 # Default export stuff
948 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
951 if bld.is_defined('ENABLE_NLS'):
952 mo_files = bld.path.ant_glob('po/*.mo')
954 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
955 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
959 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
960 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
962 appdata_i18n_pot(bld)
966 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
967 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
969 appdata_i18n_pot(bld)
972 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
973 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
978 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
979 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
982 def appdata_i18n_pot(bld):
983 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
984 'ardour.appdata.pot')
985 if bld.cmd == 'i18n_pot':
986 Logs.info('Generating pot file from Ardour appdata')
987 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
988 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
989 'ardour.appdata.xml.in.in')
990 Logs.info('Updating ' + potfile)
992 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
994 print ('Error processing appdata pot file - ignored')
995 elif bld.cmd == 'clean' and os.path.exists(potfile):
996 Logs.info('Removing Ardour appdata pot file')
999 def appdata_i18n_po(bld):
1000 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
1001 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
1003 def appdata_i18n_mo(bld):
1004 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
1005 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
1007 def appdata_i18n_xmlin(bld):
1008 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
1009 'ardour.appdata.xml.in')
1010 if bld.cmd == 'build':
1011 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
1012 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
1013 'ardour.appdata.xml.in.in')
1014 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
1015 mo_files = glob.glob(mo_glob)
1016 Logs.info('Generating ' + adxmlinfile)
1017 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
1018 '-j', adxmlininfile] + mo_files)
1019 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
1020 Logs.info('Removing ' + adxmlinfile)
1021 os.remove(adxmlinfile)