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',
58 'color_theme_manager.cc',
61 'control_point_dialog.cc',
62 'control_slave_ui.cc',
66 'duplicate_routes_dialog.cc',
67 'edit_note_dialog.cc',
71 'editor_audio_import.cc',
72 'editor_pt_import.cc',
73 'editor_audiotrack.cc',
75 'editor_canvas_events.cc',
76 'editor_component.cc',
79 'editor_route_groups.cc',
80 'editor_export_audio.cc',
81 'editor_group_tabs.cc',
83 'editor_locations.cc',
91 'editor_selection.cc',
92 'editor_snapshots.cc',
94 'editor_tempodisplay.cc',
98 'export_channel_selector.cc',
100 'export_file_notebook.cc',
101 'export_filename_selector.cc',
102 'export_format_dialog.cc',
103 'export_format_selector.cc',
104 'export_preset_selector.cc',
106 'export_timespan_selector.cc',
110 'floating_text_entry.cc',
111 'sfdb_freesound_mootcher.cc',
113 'generic_pluginui.cc',
115 'global_port_matrix.cc',
117 'gtk_pianokeyboard.c',
120 'insert_remove_time_dialog.cc',
121 'instrument_selector.cc',
122 'interthread_progress_window.cc',
131 'lua_script_manager.cc',
138 'midi_automation_line.cc',
139 'midi_channel_dialog.cc',
140 'midi_channel_selector.cc',
141 'midi_cut_buffer.cc',
142 'midi_export_dialog.cc',
143 'midi_list_editor.cc',
144 'midi_region_view.cc',
147 'midi_streamview.cc',
150 'midi_velocity_dialog.cc',
152 'missing_file_dialog.cc',
153 'missing_plugin_dialog.cc',
154 'mixer_group_tabs.cc',
160 'monitor_section.cc',
161 'monitor_selector.cc',
163 'mono_panner_editor.cc',
166 'new_plugin_preset_dialog.cc',
167 'normalize_dialog.cc',
171 'note_select_dialog.cc',
178 'panner_interface.cc',
181 'piano_roll_header.cc',
183 'playlist_selector.cc',
185 'plugin_pin_dialog.cc',
186 'plugin_setup_dialog.cc',
187 'plugin_selector.cc',
192 'port_matrix_body.cc',
193 'port_matrix_column_labels.cc',
194 'port_matrix_component.cc',
195 'port_matrix_grid.cc',
196 'port_matrix_labels.cc',
197 'port_matrix_row_labels.cc',
199 'processor_selection.cc',
200 'patch_change_dialog.cc',
201 'progress_reporter.cc',
203 'quantize_dialog.cc',
204 'rc_option_editor.cc',
206 'region_gain_line.cc',
207 'region_layering_order_editor.cc',
208 'region_selection.cc',
212 'route_group_dialog.cc',
213 'route_group_menu.cc',
214 'route_params_ui.cc',
215 'route_processor_selection.cc',
216 'route_time_axis.cc',
220 'search_path_option.cc',
221 'script_selector.cc',
223 'selection_memento.cc',
225 'session_archive_dialog.cc',
227 'session_import_dialog.cc',
228 'session_metadata_dialog.cc',
229 'session_option_editor.cc',
231 'shuttle_control.cc',
232 'soundcloud_export_selector.cc',
239 'stereo_panner_editor.cc',
241 'strip_silence_dialog.cc',
242 'stripable_colorpicker.cc',
243 'stripable_time_axis.cc',
245 'tape_region_view.cc',
246 'template_dialog.cc',
251 'time_axis_view_item.cc',
256 'track_selection.cc',
257 'track_view_list.cc',
258 'transform_dialog.cc',
259 'transpose_dialog.cc',
262 'vca_master_strip.cc',
264 'visibility_group.cc',
266 # video-timeline related sources:
267 'video_image_frame.cc',
268 'add_video_dialog.cc',
269 'editor_videotimeline.cc',
273 'transcode_ffmpeg.cc',
274 'transcode_video_dialog.cc',
275 'video_server_dialog.cc',
277 'export_video_dialog.cc',
278 'export_video_infobox.cc',
279 'video_tool_paths.cc'
282 def enoify (major, minor):
283 # Code names based on
284 # https://en.wikipedia.org/wiki/Brian_Eno_discography
286 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
287 # (no Singles, no EPs, no Video Albums, no Production)
289 return "\\n\\\"E-No\\\""
292 return "\\n\\\"No Pussyfooting\\\""
294 return "\\n\\\"Here Come the Warm Jets\\\""
296 return "\\n\\\"Taking Tiger Mountain\\\""
298 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
300 return "\\n\\\"Discreet Music\\\""
302 return "\\n\\\"Another Green World\\\""
304 return "\\n\\\"Evening Star\\\""
306 return "\\n\\\"Cluster and Eno\\\""
309 return "\\n\\\"Before and After Science\\\""
311 return "\\n\\\"After the Heat\\\""
313 return "\\n\\\"Music for Airports\\\""
315 return "\\n\\\"Music for Films\\\""
317 return "\\n\\\"In a Land of Clear Colours\\\""
319 return "\\n\\\"The Plateaux of Mirror\\\""
321 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
323 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
325 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
327 return "\\n\\\"On Land\\\"" # 1982
328 elif minor == 10: # 6.0 ??
329 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
331 return "\\n\\\"More Music for Films\\\"" # 1983
333 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
335 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
337 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
341 autowaf.set_options(opt)
345 conf.load('compiler_cxx')
346 autowaf.configure(conf)
348 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
350 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
352 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
353 atleast_version='3.3.5', mandatory=False)
354 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
355 atleast_version='1.2.1')
356 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
357 atleast_version='2.10.1')
358 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
359 atleast_version='2.18')
360 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
361 atleast_version='2.18')
362 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
363 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
364 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
365 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
368 if sys.platform == 'darwin':
369 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
370 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
371 env = conf.env.derive (),
374 compile_filename='test.m',
379 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
380 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
382 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
384 conf.write_config_header('gtk2ardour-config.h', remove=False)
386 bak = conf.env['define_key']
387 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
388 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
389 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
390 conf.write_config_header('gtk2ardour-version.h')
391 conf.env['define_key'] = bak;
394 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
395 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
397 # Add a waf `feature' to allow compilation of things using winegcc
398 from waflib.TaskGen import feature
400 def set_winegcc(self):
401 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
402 self.env.CC = 'winegcc'
404 def _doPyp(infileName, deps = False):
407 re_spaces = re.compile("\s+")
409 if infileName == '-':
412 fd = open(infileName)
413 inLines = fd.readlines()
419 bits = re_spaces.split(line)
420 if bits[0] == '##include':
425 # assume included file comes from same place as source file
426 incName = os.path.join (os.path.dirname (infileName), incName);
427 outStr += _doPyp(incName)
438 def include_processor(task):
439 infileName = task.inputs[0].srcpath()
440 outfileName = os.path.join(out, task.outputs[0].bldpath())
441 fdOut = open (outfileName, "w")
442 fdOut.write (_doPyp(infileName))
446 def build_color_scheme(path, prefix):
450 if re.search ('^#@color', line):
451 line.strip() # remove newline
453 if len(color_scheme):
455 color_scheme += prefix
457 color_scheme += words[1]
459 color_scheme += words[2]
465 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
466 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
468 # Tool to dump lua-bindings (of gtk2ardour + libs)
469 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
470 obj = bld (features = 'cxx c cxxprogram')
471 obj.install_path = None
472 obj.source = list(gtk2_ardour_sources)
473 obj.target = 'luadoc'
474 obj.includes = ['.', '../libs']
475 obj.ldflags = ['-no-undefined']
490 'PACKAGE="' + I18N_PACKAGE + '"',
491 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
492 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
493 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
496 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
497 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
498 if bld.is_defined('HAVE_SUIL'):
499 obj.source += [ 'lv2_plugin_ui.cc' ]
500 obj.use += [ 'SUIL' ]
501 if bld.is_defined('LXVST_SUPPORT'):
502 obj.source += [ 'vst_plugin_ui.cc' ]
503 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
504 obj.defines += [ 'LXVST_SUPPORT' ]
507 # # Tool to test libcanvas
508 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
509 # obj = bld (features = 'cxx c cxxprogram')
510 # obj.install_path = None
511 # obj.source = list(gtk2_ardour_sources)
512 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
513 # obj.target = 'canvas_test'
514 # obj.includes = ['.', '../libs']
515 # obj.ldflags = ['-no-undefined']
528 # 'PACKAGE="' + I18N_PACKAGE + '"',
529 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
530 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
531 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
534 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
535 # # obj.source += [ 'canvas_test.cc', ]
536 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
539 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
540 # Windows VST support w/wine
541 # If we require VST support we build a stub main() and the FST library
542 # here using winegcc, and link it to the GTK front-end library
543 obj = bld (features = 'cxx c cxxprogram wine')
544 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
546 # XXX do we really need to explicitly link to all of these for the wine executable?
548 obj.use = [ 'libpbd',
561 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
562 obj.includes = [ '../libs/fst', '.' ]
563 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
564 obj.linkflags += bld.env['LDFLAGS']
565 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
566 obj.install_path = bld.env['DLLDIR']
567 # end of the wine executable
569 # now the shared library containing the GTK GUI for ardour
570 obj = bld (features = 'cxx c cxxshlib')
571 # operate on copy to avoid adding sources twice
572 obj.source = list(gtk2_ardour_sources)
573 obj.includes = [ '../libs/fst', '.' ]
574 obj.name = 'libgtk2_ardour'
575 obj.target = 'gtk2_ardour'
576 obj.cflags = [ '-fPIC' ]
579 # just the normal executable version of the GTK GUI
580 if bld.env['build_target'] == 'mingw':
581 obj = bld (features = 'cxx c cxxprogram winres')
583 obj = bld (features = 'cxx c cxxprogram')
584 # operate on copy to avoid adding sources twice
585 obj.source = list(gtk2_ardour_sources)
586 obj.target = 'ardour-' + str (bld.env['VERSION'])
588 obj.ldflags = ['-no-undefined']
590 if bld.is_defined('WINDOWS_VST_SUPPORT'):
591 # Windows VST support mingw
592 obj.includes += [ '../libs/fst' ]
594 # at this point, "obj" refers to either the normal native executable
595 # OR the shared library built for use with wine on linux.
597 obj.use = [ 'libpbd',
610 'PACKAGE="' + I18N_PACKAGE + '"',
611 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
612 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
613 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
615 obj.install_path = bld.env['DLLDIR']
617 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
619 if sys.platform == 'darwin':
620 obj.uselib += ' AUDIOUNITS OSX '
621 obj.use += ' libappleutility'
622 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
623 elif bld.env['build_target'] == 'mingw':
624 obj.source += [ 'bundle_env_mingw.cc' ]
625 obj.source += [ 'windows_icon.rc' ]
627 obj.source += [ 'bundle_env_linux.cc' ]
629 obj.includes += ['../libs']
631 obj.use += 'libptformat'
633 if bld.env['build_target'] == 'mingw':
634 obj.linkflags += ' -mwindows'
635 obj.use += [ 'PANGOFT2' ]
637 if bld.is_defined('HAVE_SUIL'):
638 obj.source += [ 'lv2_plugin_ui.cc' ]
639 obj.use += [ 'SUIL' ]
641 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
642 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
644 if bld.is_defined('NEED_INTL'):
645 obj.linkflags += ' -lintl'
647 if bld.is_defined('WINDOWS_VST_SUPPORT'):
648 obj.source += [ 'windows_vst_plugin_ui.cc' ]
649 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
650 if bld.env['build_target'] != 'mingw':
653 if bld.is_defined('LXVST_SUPPORT'):
654 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
655 obj.defines += [ 'LXVST_SUPPORT' ]
658 if bld.is_defined('MACVST_SUPPORT'):
659 obj.source += [ 'mac_vst_plugin_ui.mm' ]
660 obj.defines += [ 'MACVST_SUPPORT' ]
662 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
663 obj.source += [ 'vst_plugin_ui.cc' ]
665 if bld.is_defined('PHONE_HOME'):
666 obj.defines += [ 'PHONE_HOME' ]
668 if bld.is_defined('HAVE_COREAUDIO'):
669 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
670 obj.use += ' libappleutility '
672 if bld.is_defined('AUDIOUNIT_SUPPORT'):
673 obj.source += [ 'au_pluginui.mm' ]
677 wrapper_subst_dict = {
678 'INSTALL_PREFIX' : bld.env['PREFIX'],
679 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
680 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
681 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
682 'LIBS' : 'build/libs',
683 'VERSION' : str (bld.env['VERSION']),
684 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
687 def set_subst_dict(obj, dict):
689 setattr(obj, i, dict[i])
691 obj = bld(features = 'subst')
692 obj.source = 'ardev_common.sh.in'
693 obj.target = 'ardev_common_waf.sh'
694 obj.chmod = Utils.O755
695 obj.dict = wrapper_subst_dict
696 set_subst_dict(obj, wrapper_subst_dict)
698 obj = bld(features = 'subst')
699 obj.source = 'ardour.sh.in'
700 obj.target = 'ardour' + str (bld.env['MAJOR'])
701 obj.chmod = Utils.O755
702 obj.dict = wrapper_subst_dict
703 obj.install_path = bld.env['BINDIR']
704 set_subst_dict(obj, wrapper_subst_dict)
706 if bld.is_defined('WINDOWS_VST_SUPPORT'):
707 obj = bld(features = 'subst')
708 obj.source = '../vst/ardourvst.in'
709 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
710 obj.chmod = Utils.O755
711 obj.dict = wrapper_subst_dict
712 obj.install_path = bld.env['BINDIR']
713 set_subst_dict(obj, wrapper_subst_dict)
722 if sys.platform == 'darwin':
736 # There is no acceptable monospace font available on older versions of OS X
737 # and no API on those versions to load TTF files that will work with
738 # GTK/fontconfig/pango.
740 # In addition, the ArdourMono font gets clipped for some reason on OS X
742 # Moreover, Lucida Grande just seems to work even though it is not monospace
746 'MONOSPACE' : 'Monaco',
747 'CLOCKFONT' : 'Lucida Grande',
749 else: # Linux/X11 fonts
750 basefont = '' # unspecified - use system defaults
763 'MONOSPACE' : 'ArdourMono',
764 'CLOCKFONT' : 'ArdourMono',
767 # Set up font substitution dictionary
769 for style in ['', 'BOLD', 'ITALIC']:
770 for sizename,points in iter(font_sizes.items()):
772 key = "_".join (['FONT',style,sizename])
773 fontstyle = " ".join ([basefont,style.lower(),points])
775 key = "_".join (['FONT',sizename])
776 fontstyle = " ".join ([basefont,points])
778 font_subst_dict[key] = fontstyle
781 for sizename,points in iter(font_sizes.items()):
782 key = "_".join (['FONT_SIZE',sizename])
783 font_subst_dict[key] = points
785 # various font names, eg @BOLD_MONOSPACE@
786 for font_sym,text in iter(font_names.items()):
788 font_subst_dict[key] = text
792 obj = bld(features = 'subst')
793 obj.source = [ 'clearlooks.rc.in' ]
794 obj.target = 'clearlooks.rc'
795 obj.install_path = bld.env['CONFDIR']
796 set_subst_dict(obj, font_subst_dict)
798 obj = bld(features = 'subst')
799 obj.source = [ 'default_ui_config.in' ]
800 obj.target = 'default_ui_config'
801 obj.install_path = bld.env['CONFDIR']
802 set_subst_dict(obj, font_subst_dict)
806 if sys.platform == 'darwin':
807 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
809 menus_argv = [ '-E', '-P' ]
811 if bld.is_defined('PTFORMAT'):
812 menus_argv += [ '-DPTFORMAT' ]
814 # always build all versions of the menu definitions
815 # so that we can try them out with different program builds.
816 for program in [ 'ardour', 'trx' ]:
817 obj = bld(features = 'command-output')
819 obj.command_is_external = True
821 obj.argv = menus_argv
822 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
823 obj.stdin = program + '.menus.in'
824 obj.stdout = program + '.menus'
825 bld.install_files (bld.env['CONFDIR'], program + '.menus')
828 freedesktop_subst_dict = {
829 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
830 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
831 'VERSION': str (bld.env['VERSION']),
834 if bld.env['FREEDESKTOP']:
835 obj = bld(features = 'subst')
836 obj.source = 'ardour.desktop.in'
837 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
838 obj.chmod = Utils.O644
839 obj.dict = freedesktop_subst_dict
840 set_subst_dict(obj, freedesktop_subst_dict)
842 obj = bld(features = 'subst')
843 obj.source = 'ardour-mime-info.xml'
844 obj.target = 'ardour.xml'
845 obj.chmod = Utils.O644
847 # build appdata with translations
849 appdata_i18n_xmlin(bld)
850 obj = bld(features = 'subst')
851 obj.source = 'ardour.appdata.xml.in'
852 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
853 obj.chmod = Utils.O644
854 obj.dict = freedesktop_subst_dict
855 set_subst_dict(obj, freedesktop_subst_dict)
859 # NATIVE ARDOUR BINDING FILES
860 # explicitly state the use of perl here so that it works on windows too
862 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
863 for b in [ 'ardour' ] :
865 target = b + '.keys',
866 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
869 obj.install_path = bld.env['CONFDIR']
872 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
873 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
875 # Application/Product specific resources (icon, splash)
876 pgmname = bld.env['PROGRAM_NAME']
877 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
879 if bld.env['build_target'] == 'mingw':
880 # These icons need to overwrite the files already installed in the icons
881 # directory above. Do this in the external packaging scripts for now.
882 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
883 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
885 # Default UI configuration
886 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
887 # Color Themes. Find each color file for this program only
889 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
891 # Default export stuff
892 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
895 if bld.is_defined('ENABLE_NLS'):
896 mo_files = bld.path.ant_glob('po/*.mo')
898 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
899 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
903 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
904 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
906 appdata_i18n_pot(bld)
910 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
911 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
913 appdata_i18n_pot(bld)
916 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
917 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
922 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
923 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
926 def appdata_i18n_pot(bld):
927 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
928 'ardour.appdata.pot')
929 if bld.cmd == 'i18n_pot':
930 Logs.info('Generating pot file from Ardour appdata')
931 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
932 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
933 'ardour.appdata.xml.in.in')
934 Logs.info('Updating ' + potfile)
936 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
938 print ('Error processing appdata pot file - ignored')
939 elif bld.cmd == 'clean' and os.path.exists(potfile):
940 Logs.info('Removing Ardour appdata pot file')
943 def appdata_i18n_po(bld):
944 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
945 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
947 def appdata_i18n_mo(bld):
948 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
949 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
951 def appdata_i18n_xmlin(bld):
952 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
953 'ardour.appdata.xml.in')
954 if bld.cmd == 'build':
955 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
956 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
957 'ardour.appdata.xml.in.in')
958 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
959 mo_files = glob.glob(mo_glob)
960 Logs.info('Generating ' + adxmlinfile)
961 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
962 '-j', adxmlininfile] + mo_files)
963 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
964 Logs.info('Removing ' + adxmlinfile)
965 os.remove(adxmlinfile)