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, 'fftw3f', uselib_store='FFTW35F',
382 atleast_version='3.3.5', mandatory=False)
383 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
384 atleast_version='1.2.1')
385 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
386 atleast_version='2.10.1')
387 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
388 atleast_version='2.18')
389 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
390 atleast_version='2.18')
391 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
392 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
393 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
394 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
397 if sys.platform == 'darwin':
398 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
399 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
400 env = conf.env.derive (),
403 compile_filename='test.m',
408 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
409 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
411 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
413 conf.write_config_header('gtk2ardour-config.h', remove=False)
415 bak = conf.env['define_key']
416 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
417 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
418 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
419 conf.write_config_header('gtk2ardour-version.h')
420 conf.env['define_key'] = bak;
423 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
424 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
426 # Add a waf `feature' to allow compilation of things using winegcc
427 from waflib.TaskGen import feature
429 def set_winegcc(self):
430 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
431 self.env.CC = 'winegcc'
433 def _doPyp(infileName, deps = False):
436 re_spaces = re.compile("\s+")
438 if infileName == '-':
441 fd = open(infileName)
442 inLines = fd.readlines()
448 bits = re_spaces.split(line)
449 if bits[0] == '##include':
454 # assume included file comes from same place as source file
455 incName = os.path.join (os.path.dirname (infileName), incName);
456 outStr += _doPyp(incName)
467 def include_processor(task):
468 infileName = task.inputs[0].srcpath()
469 outfileName = os.path.join(out, task.outputs[0].bldpath())
470 fdOut = open (outfileName, "w")
471 fdOut.write (_doPyp(infileName))
475 def build_color_scheme(path, prefix):
479 if re.search ('^#@color', line):
480 line.strip() # remove newline
482 if len(color_scheme):
484 color_scheme += prefix
486 color_scheme += words[1]
488 color_scheme += words[2]
494 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
495 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
497 # Tool to dump lua-bindings (of gtk2ardour + libs)
498 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
499 obj = bld (features = 'cxx c cxxprogram')
500 obj.install_path = None
501 obj.source = list(gtk2_ardour_sources)
502 obj.target = 'luadoc'
503 obj.includes = ['.', '../libs']
504 obj.ldflags = ['-no-undefined']
519 'PACKAGE="' + I18N_PACKAGE + '"',
520 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
521 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
522 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
525 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
526 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
527 if bld.is_defined('HAVE_SUIL'):
528 obj.source += [ 'lv2_plugin_ui.cc' ]
529 obj.use += [ 'SUIL' ]
530 if bld.is_defined('LXVST_SUPPORT'):
531 obj.source += [ 'vst_plugin_ui.cc' ]
532 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
533 obj.defines += [ 'LXVST_SUPPORT' ]
536 # # Tool to test libcanvas
537 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
538 # obj = bld (features = 'cxx c cxxprogram')
539 # obj.install_path = None
540 # obj.source = list(gtk2_ardour_sources)
541 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
542 # obj.target = 'canvas_test'
543 # obj.includes = ['.', '../libs']
544 # obj.ldflags = ['-no-undefined']
557 # 'PACKAGE="' + I18N_PACKAGE + '"',
558 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
559 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
560 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
563 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
564 # # obj.source += [ 'canvas_test.cc', ]
565 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
568 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
569 # Windows VST support w/wine
570 # If we require VST support we build a stub main() and the FST library
571 # here using winegcc, and link it to the GTK front-end library
572 obj = bld (features = 'cxx c cxxprogram wine')
573 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
575 # XXX do we really need to explicitly link to all of these for the wine executable?
577 obj.use = [ 'libpbd',
590 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
591 obj.includes = [ '../libs/fst', '.' ]
592 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
593 obj.linkflags += bld.env['LDFLAGS']
594 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
595 obj.install_path = bld.env['DLLDIR']
596 # end of the wine executable
598 # now the shared library containing the GTK GUI for ardour
599 obj = bld (features = 'cxx c cxxshlib')
600 # operate on copy to avoid adding sources twice
601 obj.source = list(gtk2_ardour_sources)
602 obj.includes = [ '../libs/fst', '.' ]
603 obj.name = 'libgtk2_ardour'
604 obj.target = 'gtk2_ardour'
605 obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
608 # just the normal executable version of the GTK GUI
609 if bld.env['build_target'] == 'mingw':
610 obj = bld (features = 'cxx c cxxprogram winres')
612 obj = bld (features = 'cxx c cxxprogram')
613 # operate on copy to avoid adding sources twice
614 obj.source = list(gtk2_ardour_sources)
615 obj.target = 'ardour-' + str (bld.env['VERSION'])
617 obj.ldflags = ['-no-undefined']
619 if bld.is_defined('WINDOWS_VST_SUPPORT'):
620 # Windows VST support mingw
621 obj.includes += [ '../libs/fst' ]
623 # at this point, "obj" refers to either the normal native executable
624 # OR the shared library built for use with wine on linux.
626 obj.use = [ 'libpbd',
639 'PACKAGE="' + I18N_PACKAGE + '"',
640 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
641 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
642 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
644 obj.install_path = bld.env['DLLDIR']
646 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
648 if sys.platform == 'darwin':
649 obj.uselib += ' AUDIOUNITS OSX '
650 obj.use += ' libappleutility'
651 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
652 elif bld.env['build_target'] == 'mingw':
653 obj.source += [ 'bundle_env_mingw.cc' ]
654 obj.source += [ 'windows_icon.rc' ]
656 obj.source += [ 'bundle_env_linux.cc' ]
658 obj.includes += ['../libs']
660 obj.use += 'libptformat'
662 if bld.env['build_target'] == 'mingw':
663 obj.linkflags += ' -mwindows'
664 obj.use += [ 'PANGOFT2' ]
666 if bld.is_defined('HAVE_SUIL'):
667 obj.source += [ 'lv2_plugin_ui.cc' ]
668 obj.use += [ 'SUIL' ]
670 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
671 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
673 if bld.is_defined('NEED_INTL'):
674 obj.linkflags += ' -lintl'
676 if bld.is_defined('WINDOWS_VST_SUPPORT'):
677 obj.source += [ 'windows_vst_plugin_ui.cc' ]
678 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
679 if bld.env['build_target'] != 'mingw':
682 if bld.is_defined('LXVST_SUPPORT'):
683 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
684 obj.defines += [ 'LXVST_SUPPORT' ]
687 if bld.is_defined('MACVST_SUPPORT'):
688 obj.source += [ 'mac_vst_plugin_ui.mm' ]
689 obj.defines += [ 'MACVST_SUPPORT' ]
691 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
692 obj.source += [ 'vst_plugin_ui.cc' ]
694 if bld.is_defined('PHONE_HOME'):
695 obj.defines += [ 'PHONE_HOME' ]
697 if bld.is_defined('HAVE_COREAUDIO'):
698 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
699 obj.use += ' libappleutility '
701 if bld.is_defined('AUDIOUNIT_SUPPORT'):
702 obj.source += [ 'au_pluginui.mm' ]
706 wrapper_subst_dict = {
707 'INSTALL_PREFIX' : bld.env['PREFIX'],
708 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
709 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
710 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
711 'LIBS' : 'build/libs',
712 'VERSION' : str (bld.env['VERSION']),
713 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
716 def set_subst_dict(obj, dict):
718 setattr(obj, i, dict[i])
720 obj = bld(features = 'subst')
721 obj.source = 'ardev_common.sh.in'
722 obj.target = 'ardev_common_waf.sh'
723 obj.chmod = Utils.O755
724 obj.dict = wrapper_subst_dict
725 set_subst_dict(obj, wrapper_subst_dict)
727 obj = bld(features = 'subst')
728 obj.source = 'ardour.sh.in'
729 obj.target = 'ardour' + str (bld.env['MAJOR'])
730 obj.chmod = Utils.O755
731 obj.dict = wrapper_subst_dict
732 obj.install_path = bld.env['BINDIR']
733 set_subst_dict(obj, wrapper_subst_dict)
735 if bld.is_defined('WINDOWS_VST_SUPPORT'):
736 obj = bld(features = 'subst')
737 obj.source = '../vst/ardourvst.in'
738 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
739 obj.chmod = Utils.O755
740 obj.dict = wrapper_subst_dict
741 obj.install_path = bld.env['BINDIR']
742 set_subst_dict(obj, wrapper_subst_dict)
751 if sys.platform == 'darwin':
764 if bld.env['build_target'] in ['panther', 'tiger', 'leopard'] or (Options.options.ppc and bld.env['build_target'] == 'snowleopard'):
765 # CTFontManagerRegisterFontsForURL for ArdourMono is 10.6 or newer
766 # "Lucida Grande" is not mono-spaced, but works for most cases, except big-clock-window
768 'MONOSPACE' : 'Monaco',
769 'CLOCKFONT' : 'Lucida Grande',
773 'MONOSPACE' : 'Monaco',
774 'CLOCKFONT' : 'ArdourMono',
776 else: # Linux/X11 & Windows fonts
777 basefont = '' # unspecified - use system defaults
790 'MONOSPACE' : 'ArdourMono',
791 'CLOCKFONT' : 'ArdourMono',
794 # Set up font substitution dictionary
796 for style in ['', 'BOLD', 'ITALIC']:
797 for sizename,points in iter(font_sizes.items()):
799 key = "_".join (['FONT',style,sizename])
800 fontstyle = " ".join ([basefont,style.lower(),points])
802 key = "_".join (['FONT',sizename])
803 fontstyle = " ".join ([basefont,points])
805 font_subst_dict[key] = fontstyle
808 for sizename,points in iter(font_sizes.items()):
809 key = "_".join (['FONT_SIZE',sizename])
810 font_subst_dict[key] = points
812 # various font names, eg @BOLD_MONOSPACE@
813 for font_sym,text in iter(font_names.items()):
815 font_subst_dict[key] = text
819 obj = bld(features = 'subst')
820 obj.source = [ 'clearlooks.rc.in' ]
821 obj.target = 'clearlooks.rc'
822 obj.install_path = bld.env['CONFDIR']
823 set_subst_dict(obj, font_subst_dict)
825 obj = bld(features = 'subst')
826 obj.source = [ 'default_ui_config.in' ]
827 obj.target = 'default_ui_config'
828 obj.install_path = bld.env['CONFDIR']
829 set_subst_dict(obj, font_subst_dict)
833 if sys.platform == 'darwin':
834 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
836 menus_argv = [ '-E', '-P' ]
838 if bld.is_defined('MIXBUS'):
839 menus_argv += [ '-DMIXBUS' ]
841 if bld.is_defined('PTFORMAT'):
842 menus_argv += [ '-DPTFORMAT' ]
844 # always build all versions of the menu definitions
845 # so that we can try them out with different program builds.
846 for program in [ 'ardour', 'trx' ]:
847 obj = bld(features = 'command-output')
849 obj.command_is_external = True
851 obj.argv = menus_argv
852 obj.dep_vars = ['PTFORMAT', 'MIXBUS', 'WINDOWS']
853 obj.stdin = program + '.menus.in'
854 obj.stdout = program + '.menus'
855 bld.install_files (bld.env['CONFDIR'], program + '.menus')
858 freedesktop_subst_dict = {
859 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
860 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
861 'VERSION': str (bld.env['VERSION']),
862 'DATE': str (bld.env['DATE']),
865 if bld.env['FREEDESKTOP']:
866 obj = bld(features = 'subst')
867 obj.source = 'ardour.desktop.in'
868 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
869 obj.chmod = Utils.O644
870 obj.dict = freedesktop_subst_dict
871 set_subst_dict(obj, freedesktop_subst_dict)
873 obj = bld(features = 'subst')
874 obj.source = 'ardour-mime-info.xml'
875 obj.target = 'ardour.xml'
876 obj.chmod = Utils.O644
878 # build appdata with translations
880 appdata_i18n_xmlin(bld)
881 obj = bld(features = 'subst')
882 obj.source = 'ardour.appdata.xml.in'
883 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
884 obj.chmod = Utils.O644
885 obj.dict = freedesktop_subst_dict
886 set_subst_dict(obj, freedesktop_subst_dict)
890 # NATIVE ARDOUR BINDING FILES
891 # explicitly state the use of perl here so that it works on windows too
893 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
894 for b in [ 'ardour' ] :
896 target = b + '.keys',
897 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
900 obj.install_path = bld.env['CONFDIR']
903 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
904 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
906 # Application/Product specific resources (icon, splash)
907 pgmname = bld.env['PROGRAM_NAME']
908 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
910 if bld.env['build_target'] == 'mingw':
911 # These icons need to overwrite the files already installed in the icons
912 # directory above. Do this in the external packaging scripts for now.
913 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
914 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
916 # Default UI configuration
917 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
918 # Color Themes. Find each color file for this program only
920 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
922 # Default export stuff
923 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
926 if bld.is_defined('ENABLE_NLS'):
927 mo_files = bld.path.ant_glob('po/*.mo')
929 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
930 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
934 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
935 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
937 appdata_i18n_pot(bld)
941 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
942 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
944 appdata_i18n_pot(bld)
947 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
948 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
953 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
954 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
957 def appdata_i18n_pot(bld):
958 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
959 'ardour.appdata.pot')
960 if bld.cmd == 'i18n_pot':
961 Logs.info('Generating pot file from Ardour appdata')
962 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
963 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
964 'ardour.appdata.xml.in.in')
965 Logs.info('Updating ' + potfile)
967 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
969 print ('Error processing appdata pot file - ignored')
970 elif bld.cmd == 'clean' and os.path.exists(potfile):
971 Logs.info('Removing Ardour appdata pot file')
974 def appdata_i18n_po(bld):
975 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
976 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
978 def appdata_i18n_mo(bld):
979 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
980 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
982 def appdata_i18n_xmlin(bld):
983 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
984 'ardour.appdata.xml.in')
985 if bld.cmd == 'build':
986 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
987 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
988 'ardour.appdata.xml.in.in')
989 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
990 mo_files = glob.glob(mo_glob)
991 Logs.info('Generating ' + adxmlinfile)
992 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
993 '-j', adxmlininfile] + mo_files)
994 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
995 Logs.info('Removing ' + adxmlinfile)
996 os.remove(adxmlinfile)