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',
39 'ardour_ui_access_web.cc',
40 'ardour_ui_dependents.cc',
41 'ardour_ui_dialogs.cc',
43 'ardour_ui_engine.cc',
46 'ardour_ui_options.cc',
47 'ardour_ui_session.cc',
48 'ardour_ui_startup.cc',
52 'audio_region_editor.cc',
53 'audio_region_view.cc',
54 'audio_streamview.cc',
56 'automation_controller.cc',
58 'automation_region_view.cc',
59 'automation_streamview.cc',
60 'automation_time_axis.cc',
62 'big_clock_window.cc',
63 'big_transport_window.cc',
66 'color_theme_manager.cc',
69 'control_point_dialog.cc',
70 'control_slave_ui.cc',
74 'duplicate_routes_dialog.cc',
75 'edit_note_dialog.cc',
79 'editor_audio_import.cc',
80 'editor_pt_import.cc',
81 'editor_audiotrack.cc',
83 'editor_canvas_events.cc',
84 'editor_component.cc',
87 'editor_route_groups.cc',
88 'editor_export_audio.cc',
89 'editor_group_tabs.cc',
91 'editor_locations.cc',
99 'editor_selection.cc',
100 'editor_snapshots.cc',
103 'editor_tempodisplay.cc',
107 'export_channel_selector.cc',
109 'export_file_notebook.cc',
110 'export_filename_selector.cc',
111 'export_format_dialog.cc',
112 'export_format_selector.cc',
113 'export_preset_selector.cc',
115 'export_timespan_selector.cc',
119 'floating_text_entry.cc',
121 'sfdb_freesound_mootcher.cc',
123 'generic_pluginui.cc',
125 'global_port_matrix.cc',
130 'insert_remove_time_dialog.cc',
131 'instrument_selector.cc',
132 'interthread_progress_window.cc',
141 'lua_script_manager.cc',
148 'midi_automation_line.cc',
149 'midi_channel_dialog.cc',
150 'midi_channel_selector.cc',
151 'midi_cut_buffer.cc',
152 'midi_export_dialog.cc',
153 'midi_list_editor.cc',
154 'midi_region_view.cc',
157 'midi_streamview.cc',
160 'midi_velocity_dialog.cc',
162 'missing_file_dialog.cc',
163 'missing_plugin_dialog.cc',
164 'mixer_group_tabs.cc',
170 'monitor_section.cc',
171 'monitor_selector.cc',
173 'mono_panner_editor.cc',
176 'new_plugin_preset_dialog.cc',
177 'new_user_wizard.cc',
178 'normalize_dialog.cc',
182 'note_select_dialog.cc',
189 'panner_interface.cc',
192 'patch_change_widget.cc',
193 'piano_roll_header.cc',
195 'playlist_selector.cc',
198 'plugin_pin_dialog.cc',
199 'plugin_presets_ui.cc',
200 'plugin_scan_dialog.cc',
201 'plugin_setup_dialog.cc',
202 'plugin_selector.cc',
204 'plugin_dspload_ui.cc',
205 'plugin_dspload_window.cc',
209 'port_matrix_body.cc',
210 'port_matrix_column_labels.cc',
211 'port_matrix_component.cc',
212 'port_matrix_grid.cc',
213 'port_matrix_labels.cc',
214 'port_matrix_row_labels.cc',
216 'processor_selection.cc',
217 'patch_change_dialog.cc',
218 'progress_reporter.cc',
219 'pt_import_selector.cc',
221 'quantize_dialog.cc',
222 'rc_option_editor.cc',
224 'region_gain_line.cc',
225 'region_layering_order_editor.cc',
226 'region_selection.cc',
230 'route_group_dialog.cc',
231 'route_group_menu.cc',
232 'route_params_ui.cc',
233 'route_processor_selection.cc',
234 'route_time_axis.cc',
238 'save_template_dialog.cc',
239 'search_path_option.cc',
241 'script_selector.cc',
243 'selection_memento.cc',
245 'session_archive_dialog.cc',
247 'session_import_dialog.cc',
248 'session_metadata_dialog.cc',
249 'session_option_editor.cc',
251 'shuttle_control.cc',
252 'soundcloud_export_selector.cc',
259 'stereo_panner_editor.cc',
261 'strip_silence_dialog.cc',
262 'stripable_colorpicker.cc',
263 'stripable_time_axis.cc',
265 'tape_region_view.cc',
266 'template_dialog.cc',
271 'time_axis_view_item.cc',
276 'track_selection.cc',
277 'track_view_list.cc',
278 'transform_dialog.cc',
279 'transport_control.cc',
280 'transport_control_ui.cc',
281 'transport_masters_dialog.cc',
282 'transpose_dialog.cc',
285 'vca_master_strip.cc',
287 'virtual_keyboard_window.cc',
288 'visibility_group.cc',
290 # video-timeline related sources:
291 'video_image_frame.cc',
292 'add_video_dialog.cc',
293 'editor_videotimeline.cc',
297 'transcode_ffmpeg.cc',
298 'transcode_video_dialog.cc',
299 'video_server_dialog.cc',
301 'export_video_dialog.cc',
302 'export_video_infobox.cc'
305 def enoify (major, minor):
306 # Code names based on
307 # https://en.wikipedia.org/wiki/Brian_Eno_discography
309 # sort Studio albums + Collaborative albums + Compilation albums by Month/Year.
310 # (no Singles, no EPs, no Video Albums, no Production)
312 return "\\n\\\"E-No\\\""
315 return "\\n\\\"No Pussyfooting\\\""
317 return "\\n\\\"Here Come the Warm Jets\\\""
319 return "\\n\\\"Taking Tiger Mountain\\\""
321 return "\\n\\\"Lady June's Linguistic Leprosy\\\""
323 return "\\n\\\"Discreet Music\\\""
325 return "\\n\\\"Another Green World\\\""
327 return "\\n\\\"Evening Star\\\""
329 return "\\n\\\"Cluster and Eno\\\""
332 return "\\n\\\"Before and After Science\\\""
334 return "\\n\\\"After the Heat\\\""
336 return "\\n\\\"Music for Airports\\\""
338 return "\\n\\\"Music for Films\\\""
340 return "\\n\\\"In a Land of Clear Colours\\\""
342 return "\\n\\\"The Plateaux of Mirror\\\""
344 return "\\n\\\"Possible Musics\\\"" # 1980 Collaborative
346 return "\\n\\\"My Life in the Bush of Ghosts\\\"" # 1981
348 return "\\n\\\"Music for Airplay\\\"" # 1981 Compilation
350 return "\\n\\\"On Land\\\"" # 1982
351 elif minor == 10: # 6.0 ??
352 return "\\n\\\"Atmospheres and Soundtracks\\\"" # 1983
354 return "\\n\\\"More Music for Films\\\"" # 1983
356 return "\\n\\\"Working Backwards\\\"" # 1984 Compilation
359 return "\\n\\\"The Pearl\\\"" # 1984 Collaborative
361 return "\\n\\\"Begegnungen\\\"" # 1984 Compilation
362 ### From now on, no more compilations, names are not suitable
364 return "\\n\\\"Thursday Afternoon\\\"" # 1985
366 return "\\n\\\"Music for Films III\\\"" # 1988 Collaborative
368 return "\\n\\\"Wrong Way Up\\\"" # 1990 Collaborative
370 return "\\n\\\"Nerve Net\\\"" # 1992
372 return "\\n\\\"The Shutov Assembly\\\"" # 1992
374 return "\\n\\\"Neroli\\\"" # 1993
376 return "\\n\\\"Headcandy\\\"" # 1994
380 autowaf.set_options(opt)
384 conf.load('compiler_cxx')
385 autowaf.configure(conf)
387 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
389 autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
391 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
392 atleast_version='1.2.1')
393 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
394 atleast_version='2.10.1')
395 autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
396 atleast_version='2.18')
397 autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
398 atleast_version='2.18')
399 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
400 autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
401 autowaf.check_pkg(conf, 'pangoft2', uselib_store='PANGOFT2', atleast_version='1.36.8', mandatory=False)
402 autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
405 if sys.platform == 'darwin':
406 retval = conf.run_c_code (code='#include <AppKit/NSWindow.h>\n\
407 int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n',
408 env = conf.env.derive (),
411 compile_filename='test.m',
416 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok')
417 conf.define ('HAVE_COCOA_LIVE_RESIZING', 1)
419 autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size')
421 conf.write_config_header('gtk2ardour-config.h', remove=False)
423 bak = conf.env['define_key']
424 conf.define('VERSIONSTRING', str (conf.env['VERSION']))
425 conf.define('CODENAME', enoify(int(conf.env['MAJOR']), int(conf.env['MINOR'])))
426 conf.env['define_key'] = ['VERSIONSTRING', 'CODENAME' ]
427 conf.write_config_header('gtk2ardour-version.h')
428 conf.env['define_key'] = bak;
431 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
432 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
434 # Add a waf `feature' to allow compilation of things using winegcc
435 from waflib.TaskGen import feature
437 def set_winegcc(self):
438 self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
439 self.env.CC = 'winegcc'
441 def _doPyp(infileName, deps = False):
444 re_spaces = re.compile("\s+")
446 if infileName == '-':
449 fd = open(infileName)
450 inLines = fd.readlines()
456 bits = re_spaces.split(line)
457 if bits[0] == '##include':
462 # assume included file comes from same place as source file
463 incName = os.path.join (os.path.dirname (infileName), incName);
464 outStr += _doPyp(incName)
475 def include_processor(task):
476 infileName = task.inputs[0].srcpath()
477 outfileName = os.path.join(out, task.outputs[0].bldpath())
478 fdOut = open (outfileName, "w")
479 fdOut.write (_doPyp(infileName))
483 def build_color_scheme(path, prefix):
487 if re.search ('^#@color', line):
488 line.strip() # remove newline
490 if len(color_scheme):
492 color_scheme += prefix
494 color_scheme += words[1]
496 color_scheme += words[2]
502 VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
503 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
505 # Tool to dump lua-bindings (of gtk2ardour + libs)
506 if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
507 obj = bld (features = 'cxx c cxxprogram')
508 obj.install_path = None
509 obj.source = list(gtk2_ardour_sources)
510 obj.target = 'luadoc'
511 obj.includes = ['.', '../libs']
512 obj.ldflags = ['-no-undefined']
527 'PACKAGE="' + I18N_PACKAGE + '"',
528 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
529 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
530 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
533 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
534 obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ]
535 if bld.is_defined('HAVE_SUIL'):
536 obj.source += [ 'lv2_plugin_ui.cc' ]
537 obj.use += [ 'SUIL' ]
538 if bld.is_defined('LXVST_SUPPORT'):
539 obj.source += [ 'vst_plugin_ui.cc' ]
540 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
541 obj.defines += [ 'LXVST_SUPPORT' ]
544 # # Tool to test libcanvas
545 # if re.search ("linux", sys.platform) != None and bld.env['CANVASTESTUI']:
546 # obj = bld (features = 'cxx c cxxprogram')
547 # obj.install_path = None
548 # obj.source = list(gtk2_ardour_sources)
549 # obj.source = [ 'ardour_button.cc', 'ui_config.cc', 'tooltips.cc' ]
550 # obj.target = 'canvas_test'
551 # obj.includes = ['.', '../libs']
552 # obj.ldflags = ['-no-undefined']
565 # 'PACKAGE="' + I18N_PACKAGE + '"',
566 # 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
567 # 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
568 # 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
571 # obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
572 # # obj.source += [ 'canvas_test.cc', ]
573 # obj.source += [ 'toolbar_test.cc', 'enums.cc']
576 if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
577 # Windows VST support w/wine
578 # If we require VST support we build a stub main() and the FST library
579 # here using winegcc, and link it to the GTK front-end library
580 obj = bld (features = 'cxx c cxxprogram wine')
581 obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
583 # XXX do we really need to explicitly link to all of these for the wine executable?
585 obj.use = [ 'libpbd',
598 obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
599 obj.includes = [ '../libs/fst', '.' ]
600 obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
601 obj.linkflags += bld.env['LDFLAGS']
602 obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
603 obj.install_path = bld.env['DLLDIR']
604 # end of the wine executable
606 # now the shared library containing the GTK GUI for ardour
607 obj = bld (features = 'cxx c cxxshlib')
608 # operate on copy to avoid adding sources twice
609 obj.source = list(gtk2_ardour_sources)
610 obj.includes = [ '../libs/fst', '.' ]
611 obj.name = 'libgtk2_ardour'
612 obj.target = 'gtk2_ardour'
613 obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
616 # just the normal executable version of the GTK GUI
617 if bld.env['build_target'] == 'mingw':
618 obj = bld (features = 'cxx c cxxprogram winres')
620 obj = bld (features = 'cxx c cxxprogram')
621 # operate on copy to avoid adding sources twice
622 obj.source = list(gtk2_ardour_sources)
623 obj.target = 'ardour-' + str (bld.env['VERSION'])
625 obj.ldflags = ['-no-undefined']
627 if bld.is_defined('WINDOWS_VST_SUPPORT'):
628 # Windows VST support mingw
629 obj.includes += [ '../libs/fst' ]
631 # at this point, "obj" refers to either the normal native executable
632 # OR the shared library built for use with wine on linux.
634 obj.use = [ 'libpbd',
647 'PACKAGE="' + I18N_PACKAGE + '"',
648 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
649 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
650 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
652 obj.install_path = bld.env['DLLDIR']
654 obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML '
656 if sys.platform == 'darwin':
657 obj.uselib += ' AUDIOUNITS OSX '
658 obj.use += ' libappleutility'
659 obj.source += [ 'cocoacarbon.mm', 'bundle_env_cocoa.cc' ]
660 elif bld.env['build_target'] == 'mingw':
661 obj.source += [ 'bundle_env_mingw.cc' ]
662 obj.source += [ 'windows_icon.rc' ]
664 obj.source += [ 'bundle_env_linux.cc' ]
666 obj.includes += ['../libs']
668 obj.use += 'libptformat'
670 if bld.env['build_target'] == 'mingw':
671 obj.linkflags += ' -mwindows'
672 obj.use += [ 'PANGOFT2' ]
674 if bld.is_defined('HAVE_SUIL'):
675 obj.source += [ 'lv2_plugin_ui.cc' ]
676 obj.use += [ 'SUIL' ]
678 if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
679 bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
681 if bld.is_defined('NEED_INTL'):
682 obj.linkflags += ' -lintl'
684 if bld.is_defined('WINDOWS_VST_SUPPORT'):
685 obj.source += [ 'windows_vst_plugin_ui.cc' ]
686 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
687 if bld.env['build_target'] != 'mingw':
690 if bld.is_defined('LXVST_SUPPORT'):
691 obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
692 obj.defines += [ 'LXVST_SUPPORT' ]
695 if bld.is_defined('MACVST_SUPPORT'):
696 obj.source += [ 'mac_vst_plugin_ui.mm' ]
697 obj.defines += [ 'MACVST_SUPPORT' ]
699 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT') or bld.is_defined ('MACVST_SUPPORT'):
700 obj.source += [ 'vst_plugin_ui.cc' ]
702 if bld.is_defined('PHONE_HOME'):
703 obj.defines += [ 'PHONE_HOME' ]
705 if bld.is_defined('HAVE_COREAUDIO'):
706 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
707 obj.use += ' libappleutility '
709 if bld.is_defined('AUDIOUNIT_SUPPORT'):
710 obj.source += [ 'au_pluginui.mm' ]
714 wrapper_subst_dict = {
715 'INSTALL_PREFIX' : bld.env['PREFIX'],
716 'LIBDIR' : os.path.normpath(bld.env['DLLDIR']),
717 'DATADIR' : os.path.normpath(bld.env['DATADIR']),
718 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
719 'LIBS' : 'build/libs',
720 'VERSION' : str (bld.env['VERSION']),
721 'EXECUTABLE' : 'build/gtk2_ardour/ardour-' + str (bld.env['VERSION'])
724 def set_subst_dict(obj, dict):
726 setattr(obj, i, dict[i])
728 obj = bld(features = 'subst')
729 obj.source = 'ardev_common.sh.in'
730 obj.target = 'ardev_common_waf.sh'
731 obj.chmod = Utils.O755
732 obj.dict = wrapper_subst_dict
733 set_subst_dict(obj, wrapper_subst_dict)
735 obj = bld(features = 'subst')
736 obj.source = 'ardour.sh.in'
737 obj.target = 'ardour' + str (bld.env['MAJOR'])
738 obj.chmod = Utils.O755
739 obj.dict = wrapper_subst_dict
740 obj.install_path = bld.env['BINDIR']
741 set_subst_dict(obj, wrapper_subst_dict)
743 if bld.is_defined('WINDOWS_VST_SUPPORT'):
744 obj = bld(features = 'subst')
745 obj.source = '../vst/ardourvst.in'
746 obj.target = 'ardourvst' + str (bld.env['MAJOR'])
747 obj.chmod = Utils.O755
748 obj.dict = wrapper_subst_dict
749 obj.install_path = bld.env['BINDIR']
750 set_subst_dict(obj, wrapper_subst_dict)
759 if sys.platform == 'darwin':
772 if bld.env['build_target'] in ['panther', 'tiger', 'leopard'] or (Options.options.ppc and bld.env['build_target'] == 'snowleopard'):
773 # CTFontManagerRegisterFontsForURL for ArdourMono is 10.6 or newer
774 # "Lucida Grande" is not mono-spaced, but works for most cases, except big-clock-window
776 'MONOSPACE' : 'Monaco',
777 'CLOCKFONT' : 'Lucida Grande',
781 'MONOSPACE' : 'Monaco',
782 'CLOCKFONT' : 'ArdourMono',
784 else: # Linux/X11 & Windows fonts
785 basefont = '' # unspecified - use system defaults
798 'MONOSPACE' : 'ArdourMono',
799 'CLOCKFONT' : 'ArdourMono',
802 # Set up font substitution dictionary
804 for style in ['', 'BOLD', 'ITALIC']:
805 for sizename,points in iter(font_sizes.items()):
807 key = "_".join (['FONT',style,sizename])
808 fontstyle = " ".join ([basefont,style.lower(),points])
810 key = "_".join (['FONT',sizename])
811 fontstyle = " ".join ([basefont,points])
813 font_subst_dict[key] = fontstyle
816 for sizename,points in iter(font_sizes.items()):
817 key = "_".join (['FONT_SIZE',sizename])
818 font_subst_dict[key] = points
820 # various font names, eg @BOLD_MONOSPACE@
821 for font_sym,text in iter(font_names.items()):
823 font_subst_dict[key] = text
825 font_subst_dict['FONTFAMILY'] = ''
828 obj = bld(features = 'subst')
829 obj.source = [ 'clearlooks.rc.in' ]
830 obj.target = 'clearlooks.rc'
831 obj.install_path = bld.env['CONFDIR']
832 set_subst_dict(obj, font_subst_dict)
834 font_subst_dict['FONTFAMILY'] = 'ArdourSans'
836 obj = bld(features = 'subst')
837 obj.source = [ 'clearlooks.rc.in' ]
838 obj.target = 'clearlooks.ardoursans.rc'
839 obj.install_path = bld.env['CONFDIR']
840 set_subst_dict(obj, font_subst_dict)
842 obj = bld(features = 'subst')
843 obj.source = [ 'default_ui_config.in' ]
844 obj.target = 'default_ui_config'
845 obj.install_path = bld.env['CONFDIR']
846 set_subst_dict(obj, font_subst_dict)
850 if sys.platform == 'darwin':
851 menus_argv = [ '-E', '-P', '-D__APPLE__', '-' ]
853 menus_argv = [ '-E', '-P' ]
855 if bld.is_defined('MIXBUS'):
856 menus_argv += [ '-DMIXBUS' ]
858 if bld.is_defined('PTFORMAT'):
859 menus_argv += [ '-DPTFORMAT' ]
861 # always build all versions of the menu definitions
862 # so that we can try them out with different program builds.
863 for program in [ 'ardour', 'trx' ]:
864 obj = bld(features = 'command-output')
866 obj.command_is_external = True
868 obj.argv = menus_argv
869 obj.dep_vars = ['PTFORMAT', 'MIXBUS', 'WINDOWS']
870 obj.stdin = program + '.menus.in'
871 obj.stdout = program + '.menus'
872 bld.install_files (bld.env['CONFDIR'], program + '.menus')
875 freedesktop_subst_dict = {
876 'ARDOUR_EXEC' : str (bld.env['lwrcase_dirname']),
877 'ARDOUR_ICON' : str (bld.env['lwrcase_dirname']),
878 'VERSION': str (bld.env['VERSION']),
879 'DATE': str (bld.env['DATE']),
882 if bld.env['FREEDESKTOP']:
883 obj = bld(features = 'subst')
884 obj.source = 'ardour.desktop.in'
885 obj.target = str (bld.env['lwrcase_dirname']) + '.desktop'
886 obj.chmod = Utils.O644
887 obj.dict = freedesktop_subst_dict
888 set_subst_dict(obj, freedesktop_subst_dict)
890 obj = bld(features = 'subst')
891 obj.source = 'ardour-mime-info.xml'
892 obj.target = 'ardour.xml'
893 obj.chmod = Utils.O644
895 # build appdata with translations
897 appdata_i18n_xmlin(bld)
898 obj = bld(features = 'subst')
899 obj.source = 'ardour.appdata.xml.in'
900 obj.target = str (bld.env['lwrcase_dirname']) + '.appdata.xml'
901 obj.chmod = Utils.O644
902 obj.dict = freedesktop_subst_dict
903 set_subst_dict(obj, freedesktop_subst_dict)
907 # NATIVE ARDOUR BINDING FILES
908 # explicitly state the use of perl here so that it works on windows too
910 a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
911 for b in [ 'ardour' ] :
913 target = b + '.keys',
914 source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
917 obj.install_path = bld.env['CONFDIR']
920 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/*.png'))
921 bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
922 bld.install_files(bld.env['DATADIR'], 'ArdourSerif.ttf')
924 # Application/Product specific resources (icon, splash)
925 pgmname = bld.env['PROGRAM_NAME']
926 bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
928 if bld.env['build_target'] == 'mingw':
929 # These icons need to overwrite the files already installed in the icons
930 # directory above. Do this in the external packaging scripts for now.
931 #bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), bld.path.ant_glob('icons/cursor_square/*.png'))
932 bld.install_files(os.path.join (bld.env['DATADIR'], 'icons'), 'icons/cursor_square/hotspots')
934 # Default UI configuration
935 bld.install_files(bld.env['CONFDIR'], 'default_ui_config')
936 # Color Themes. Find each color file for this program only
938 bld.install_files (os.path.join(bld.env['DATADIR'], 'themes'), bld.path.ant_glob ('themes/*-' + pgmname.lower() + '.colors'));
940 # Default export stuff
941 bld.install_files(os.path.join(bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
944 if bld.is_defined('ENABLE_NLS'):
945 mo_files = bld.path.ant_glob('po/*.mo')
947 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
948 bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
952 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
953 autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
955 appdata_i18n_pot(bld)
959 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
960 autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
962 appdata_i18n_pot(bld)
965 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
966 autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
971 I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
972 autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
975 def appdata_i18n_pot(bld):
976 potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
977 'ardour.appdata.pot')
978 if bld.cmd == 'i18n_pot':
979 Logs.info('Generating pot file from Ardour appdata')
980 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
981 adsource = os.path.join(bld.top_dir, 'gtk2_ardour',
982 'ardour.appdata.xml.in.in')
983 Logs.info('Updating ' + potfile)
985 subprocess.call(('itstool', '-i', itsfile, '-o', potfile, adsource))
987 print ('Error processing appdata pot file - ignored')
988 elif bld.cmd == 'clean' and os.path.exists(potfile):
989 Logs.info('Removing Ardour appdata pot file')
992 def appdata_i18n_po(bld):
993 autowaf.build_i18n_po(bld, bld.top_dir, os.path.join(
994 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
996 def appdata_i18n_mo(bld):
997 autowaf.build_i18n_mo(bld, bld.top_dir, os.path.join(
998 'gtk2_ardour', 'appdata'), 'ardour.appdata', 'dummy', 'dummy')
1000 def appdata_i18n_xmlin(bld):
1001 adxmlinfile = os.path.join(bld.top_dir, 'gtk2_ardour',
1002 'ardour.appdata.xml.in')
1003 if bld.cmd == 'build':
1004 itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
1005 adxmlininfile = os.path.join(bld.top_dir, 'gtk2_ardour',
1006 'ardour.appdata.xml.in.in')
1007 mo_glob = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', 'po', '*.mo')
1008 mo_files = glob.glob(mo_glob)
1009 Logs.info('Generating ' + adxmlinfile)
1010 subprocess.call(['itstool', '-i', itsfile, '-o', adxmlinfile,
1011 '-j', adxmlininfile] + mo_files)
1012 elif bld.cmd == 'clean' and os.path.exists(adxmlinfile):
1013 Logs.info('Removing ' + adxmlinfile)
1014 os.remove(adxmlinfile)