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',
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 'piano_roll_header.cc',
184 'playlist_selector.cc',
186 'plugin_pin_dialog.cc',
187 'plugin_setup_dialog.cc',
188 'plugin_selector.cc',
193 'port_matrix_body.cc',
194 'port_matrix_column_labels.cc',
195 'port_matrix_component.cc',
196 'port_matrix_grid.cc',
197 'port_matrix_labels.cc',
198 'port_matrix_row_labels.cc',
200 'processor_selection.cc',
201 'patch_change_dialog.cc',
202 'progress_reporter.cc',
205 'quantize_dialog.cc',
206 'rc_option_editor.cc',
208 'region_gain_line.cc',
209 'region_layering_order_editor.cc',
210 'region_selection.cc',
214 'route_group_dialog.cc',
215 'route_group_menu.cc',
216 'route_params_ui.cc',
217 'route_processor_selection.cc',
218 'route_time_axis.cc',
222 'search_path_option.cc',
223 'script_selector.cc',
225 'selection_memento.cc',
227 'session_archive_dialog.cc',
229 'session_import_dialog.cc',
230 'session_metadata_dialog.cc',
231 'session_option_editor.cc',
233 'shuttle_control.cc',
234 'soundcloud_export_selector.cc',
241 'stereo_panner_editor.cc',
243 'strip_silence_dialog.cc',
244 'stripable_colorpicker.cc',
245 'stripable_time_axis.cc',
247 'tape_region_view.cc',
248 'template_dialog.cc',
253 'time_axis_view_item.cc',
258 'track_selection.cc',
259 'track_view_list.cc',
260 'transform_dialog.cc',
261 'transpose_dialog.cc',
264 'vca_master_strip.cc',
266 'visibility_group.cc',
268 # video-timeline related sources:
269 'video_image_frame.cc',
270 'add_video_dialog.cc',
271 'editor_videotimeline.cc',
275 'transcode_ffmpeg.cc',
276 'transcode_video_dialog.cc',
277 'video_server_dialog.cc',
279 'export_video_dialog.cc',
280 'export_video_infobox.cc',
281 'video_tool_paths.cc'
284 def enoify (major, minor):
285 # Code names based on
286 # https://en.wikipedia.org/wiki/Brian_Eno_discography
288 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
289 # (no Singles, no EPs, no Video Albums, no Production)
291 return "\\n\\\"E-No\\\""
294 return "\\n\\\"No Pussyfooting\\\""
296 return "\\n\\\"Here Come the Warm Jets\\\""
298 return "\\n\\\"Taking Tiger Mountain\\\""
300 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
302 return "\\n\\\"Discreet Music\\\""
304 return "\\n\\\"Another Green World\\\""
306 return "\\n\\\"Evening Star\\\""
308 return "\\n\\\"Cluster and Eno\\\""
311 return "\\n\\\"Before and After Science\\\""
313 return "\\n\\\"After the Heat\\\""
315 return "\\n\\\"Music for Airports\\\""
317 return "\\n\\\"Music for Films\\\""
319 return "\\n\\\"In a Land of Clear Colours\\\""
321 return "\\n\\\"The Plateaux of Mirror\\\""
323 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
325 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
327 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
329 return "\\n\\\"On Land\\\"" # 1982
330 elif minor == 10: # 6.0 ??
331 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
333 return "\\n\\\"More Music for Films\\\"" # 1983
335 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
337 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
339 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
343 autowaf.set_options(opt)
347 conf.load('compiler_cxx')
348 autowaf.configure(conf)
350 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
352 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
354 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
355 atleast_version='3.3.5', mandatory=False)
356 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
357 atleast_version='1.2.1')
358 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
359 atleast_version='2.10.1')
360 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
361 atleast_version='2.18')
362 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
363 atleast_version='2.18')
364 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
365 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
366 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
367 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
370 if sys.platform == 'darwin':
371 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
372 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
373 env = conf.env.derive (),
376 compile_filename='test.m',
381 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
382 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
384 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
386 conf.write_config_header('gtk2ardour-config.h', remove=False)
388 bak = conf.env['define_key']
389 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
390 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
391 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
392 conf.write_config_header('gtk2ardour-version.h')
393 conf.env['define_key'] = bak;
396 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
397 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
399 # Add a waf `feature' to allow compilation of things using winegcc
400 from waflib.TaskGen import feature
402 def set_winegcc(self):
403 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
404 self.env.CC = 'winegcc'
406 def _doPyp(infileName, deps = False):
409 re_spaces = re.compile("\s+")
411 if infileName == '-':
414 fd = open(infileName)
415 inLines = fd.readlines()
421 bits = re_spaces.split(line)
422 if bits[0] == '##include':
427 # assume included file comes from same place as source file
428 incName = os.path.join (os.path.dirname (infileName), incName);
429 outStr += _doPyp(incName)
440 def include_processor(task):
441 infileName = task.inputs[0].srcpath()
442 outfileName = os.path.join(out, task.outputs[0].bldpath())
443 fdOut = open (outfileName, "w")
444 fdOut.write (_doPyp(infileName))
448 def build_color_scheme(path, prefix):
452 if re.search ('^#@color', line):
453 line.strip() # remove newline
455 if len(color_scheme):
457 color_scheme += prefix
459 color_scheme += words[1]
461 color_scheme += words[2]
467 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
468 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
470 # Tool to dump lua-bindings (of gtk2ardour + libs)
471 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
472 obj = bld (features = 'cxx c cxxprogram')
473 obj.install_path = None
474 obj.source = list(gtk2_ardour_sources)
475 obj.target = 'luadoc'
476 obj.includes = ['.', '../libs']
477 obj.ldflags = ['-no-undefined']
491 'PACKAGE="' + I18N_PACKAGE + '"',
492 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
493 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
494 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
497 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
498 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
499 if bld.is_defined('HAVE_SUIL'):
500 obj.source += [ 'lv2_plugin_ui.cc' ]
501 obj.use += [ 'SUIL' ]
502 if bld.is_defined('LXVST_SUPPORT'):
503 obj.source += [ 'vst_plugin_ui.cc' ]
504 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
505 obj.defines += [ 'LXVST_SUPPORT' ]
508 # # Tool to test libcanvas
509 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
510 # obj = bld (features = 'cxx c cxxprogram')
511 # obj.install_path = None
512 # obj.source = list(gtk2_ardour_sources)
513 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
514 # obj.target = 'canvas_test'
515 # obj.includes = ['.', '../libs']
516 # obj.ldflags = ['-no-undefined']
529 # 'PACKAGE="' + I18N_PACKAGE + '"',
530 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
531 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
532 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
535 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
536 # # obj.source += [ 'canvas_test.cc', ]
537 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
540 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
541 # Windows VST support w/wine
542 # If we require VST support we build a stub main() and the FST library
543 # here using winegcc, and link it to the GTK front-end library
544 obj = bld (features = 'cxx c cxxprogram wine')
545 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
547 # XXX do we really need to explicitly link to all of these for the wine executable?
549 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',
609 'PACKAGE="' + I18N_PACKAGE + '"',
610 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
611 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
612 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
614 obj.install_path = bld.env['DLLDIR']
616 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
618 if sys.platform == 'darwin':
619 obj.uselib += ' AUDIOUNITS OSX '
620 obj.use += ' libappleutility'
621 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
622 elif bld.env['build_target'] == 'mingw':
623 obj.source += [ 'bundle_env_mingw.cc' ]
624 obj.source += [ 'windows_icon.rc' ]
626 obj.source += [ 'bundle_env_linux.cc' ]
628 obj.includes += ['../libs']
630 obj.use += 'libptformat'
632 if bld.env['build_target'] == 'mingw':
633 obj.linkflags += ' -mwindows'
634 obj.use += [ 'PANGOFT2' ]
636 if bld.is_defined('HAVE_SUIL'):
637 obj.source += [ 'lv2_plugin_ui.cc' ]
638 obj.use += [ 'SUIL' ]
640 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
641 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
643 if bld.is_defined('NEED_INTL'):
644 obj.linkflags += ' -lintl'
646 if bld.is_defined('WINDOWS_VST_SUPPORT'):
647 obj.source += [ 'windows_vst_plugin_ui.cc' ]
648 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
649 if bld.env['build_target'] != 'mingw':
652 if bld.is_defined('LXVST_SUPPORT'):
653 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
654 obj.defines += [ 'LXVST_SUPPORT' ]
657 if bld.is_defined('MACVST_SUPPORT'):
658 obj.source += [ 'mac_vst_plugin_ui.mm' ]
659 obj.defines += [ 'MACVST_SUPPORT' ]
661 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
662 obj.source += [ 'vst_plugin_ui.cc' ]
664 if bld.is_defined('PHONE_HOME'):
665 obj.defines += [ 'PHONE_HOME' ]
667 if bld.is_defined('HAVE_COREAUDIO'):
668 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
669 obj.use += ' libappleutility '
671 if bld.is_defined('AUDIOUNIT_SUPPORT'):
672 obj.source += [ 'au_pluginui.mm' ]
676 wrapper_subst_dict = {
677 'INSTALL_PREFIX' : bld.env['PREFIX'],
678 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
679 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
680 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
681 'LIBS' : 'build/libs',
682 'VERSION' : str (bld.env['VERSION']),
683 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
686 def set_subst_dict(obj, dict):
688 setattr(obj, i, dict[i])
690 obj = bld(features = 'subst')
691 obj.source = 'ardev_common.sh.in'
692 obj.target = 'ardev_common_waf.sh'
693 obj.chmod = Utils.O755
694 obj.dict = wrapper_subst_dict
695 set_subst_dict(obj, wrapper_subst_dict)
697 obj = bld(features = 'subst')
698 obj.source = 'ardour.sh.in'
699 obj.target = 'ardour' + str (bld.env['MAJOR'])
700 obj.chmod = Utils.O755
701 obj.dict = wrapper_subst_dict
702 obj.install_path = bld.env['BINDIR']
703 set_subst_dict(obj, wrapper_subst_dict)
705 if bld.is_defined('WINDOWS_VST_SUPPORT'):
706 obj = bld(features = 'subst')
707 obj.source = '../vst/ardourvst.in'
708 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
709 obj.chmod = Utils.O755
710 obj.dict = wrapper_subst_dict
711 obj.install_path = bld.env['BINDIR']
712 set_subst_dict(obj, wrapper_subst_dict)
721 if sys.platform == 'darwin':
735 # There is no acceptable monospace font available on older versions of OS X
736 # and no API on those versions to load TTF files that will work with
737 # GTK/fontconfig/pango.
739 # In addition, the ArdourMono font gets clipped for some reason on OS X
741 # Moreover, Lucida Grande just seems to work even though it is not monospace
745 'MONOSPACE' : 'Monaco',
746 'CLOCKFONT' : 'Lucida Grande',
748 else: # Linux/X11 fonts
749 basefont = '' # unspecified - use system defaults
762 'MONOSPACE' : 'ArdourMono',
763 'CLOCKFONT' : 'ArdourMono',
766 # Set up font substitution dictionary
768 for style in ['', 'BOLD', 'ITALIC']:
769 for sizename,points in iter(font_sizes.items()):
771 key = "_".join (['FONT',style,sizename])
772 fontstyle = " ".join ([basefont,style.lower(),points])
774 key = "_".join (['FONT',sizename])
775 fontstyle = " ".join ([basefont,points])
777 font_subst_dict[key] = fontstyle
780 for sizename,points in iter(font_sizes.items()):
781 key = "_".join (['FONT_SIZE',sizename])
782 font_subst_dict[key] = points
784 # various font names, eg @BOLD_MONOSPACE@
785 for font_sym,text in iter(font_names.items()):
787 font_subst_dict[key] = text
791 obj = bld(features = 'subst')
792 obj.source = [ 'clearlooks.rc.in' ]
793 obj.target = 'clearlooks.rc'
794 obj.install_path = bld.env['CONFDIR']
795 set_subst_dict(obj, font_subst_dict)
797 obj = bld(features = 'subst')
798 obj.source = [ 'default_ui_config.in' ]
799 obj.target = 'default_ui_config'
800 obj.install_path = bld.env['CONFDIR']
801 set_subst_dict(obj, font_subst_dict)
805 if sys.platform == 'darwin':
806 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
808 menus_argv = [ '-E', '-P' ]
810 if bld.is_defined('PTFORMAT'):
811 menus_argv += [ '-DPTFORMAT' ]
813 # always build all versions of the menu definitions
814 # so that we can try them out with different program builds.
815 for program in [ 'ardour', 'trx' ]:
816 obj = bld(features = 'command-output')
818 obj.command_is_external = True
820 obj.argv = menus_argv
821 obj.dep_vars = ['PTFORMAT', 'GTKOSX', 'WINDOWS']
822 obj.stdin = program + '.menus.in'
823 obj.stdout = program + '.menus'
824 bld.install_files (bld.env['CONFDIR'], program + '.menus')
827 freedesktop_subst_dict = {
828 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
829 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
830 'VERSION': str (bld.env['VERSION']),
833 if bld.env['FREEDESKTOP']:
834 obj = bld(features = 'subst')
835 obj.source = 'ardour.desktop.in'
836 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
837 obj.chmod = Utils.O644
838 obj.dict = freedesktop_subst_dict
839 set_subst_dict(obj, freedesktop_subst_dict)
841 obj = bld(features = 'subst')
842 obj.source = 'ardour-mime-info.xml'
843 obj.target = 'ardour.xml'
844 obj.chmod = Utils.O644
846 # build appdata with translations
848 appdata_i18n_xmlin(bld)
849 obj = bld(features = 'subst')
850 obj.source = 'ardour.appdata.xml.in'
851 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
852 obj.chmod = Utils.O644
853 obj.dict = freedesktop_subst_dict
854 set_subst_dict(obj, freedesktop_subst_dict)
858 # NATIVE ARDOUR BINDING FILES
859 # explicitly state the use of perl here so that it works on windows too
861 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
862 for b in [ 'ardour' ] :
864 target = b + '.keys',
865 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
868 obj.install_path = bld.env['CONFDIR']
871 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
872 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
874 # Application/Product specific resources (icon, splash)
875 pgmname = bld.env['PROGRAM_NAME']
876 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
878 if bld.env['build_target'] == 'mingw':
879 # These icons need to overwrite the files already installed in the icons
880 # directory above. Do this in the external packaging scripts for now.
881 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
882 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
884 # Default UI configuration
885 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
886 # Color Themes. Find each color file for this program only
888 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
890 # Default export stuff
891 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
894 if bld.is_defined('ENABLE_NLS'):
895 mo_files = bld.path.ant_glob('po/*.mo')
897 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
898 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
902 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
903 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
905 appdata_i18n_pot(bld)
909 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
910 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
912 appdata_i18n_pot(bld)
915 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
916 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
921 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
922 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
925 def appdata_i18n_pot(bld):
926 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
927 'ardour.appdata.pot')
928 if bld.cmd == 'i18n_pot':
929 Logs.info('Generating pot file from Ardour appdata')
930 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
931 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
932 'ardour.appdata.xml.in.in')
933 Logs.info('Updating ' + potfile)
935 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
937 print ('Error processing appdata pot file - ignored')
938 elif bld.cmd == 'clean' and os.path.exists(potfile):
939 Logs.info('Removing Ardour appdata pot file')
942 def appdata_i18n_po(bld):
943 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
944 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
946 def appdata_i18n_mo(bld):
947 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
948 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
950 def appdata_i18n_xmlin(bld):
951 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
952 'ardour.appdata.xml.in')
953 if bld.cmd == 'build':
954 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
955 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
956 'ardour.appdata.xml.in.in')
957 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
958 mo_files = glob.glob(mo_glob)
959 Logs.info('Generating ' + adxmlinfile)
960 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
961 '-j', adxmlininfile] + mo_files)
962 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
963 Logs.info('Removing ' + adxmlinfile)
964 os.remove(adxmlinfile)