10 # Version of this package (even if built as a child)
14 GTK2_ARDOUR_VERSION
= "%s.%s.%s" % (MAJOR
, MINOR
, MICRO
)
16 # Variables for 'waf dist'
17 APPNAME
= 'gtk2_ardour'
18 VERSION
= GTK2_ARDOUR_VERSION
24 path_prefix
= 'gtk2_ardour/'
26 gtk2_ardour_sources
= [
29 'add_midi_cc_track_dialog.cc',
30 'add_route_dialog.cc',
31 'ambiguous_file_dialog.cc',
36 'ardour_ui_dependents.cc',
37 'ardour_ui_dialogs.cc',
40 'ardour_ui_options.cc',
42 'audio_region_editor.cc',
43 'audio_region_view.cc',
44 'audio_streamview.cc',
46 'automation_controller.cc',
48 'automation_region_view.cc',
49 'automation_streamview.cc',
50 'automation_time_axis.cc',
56 'canvas-note-event.cc',
58 'canvas_patch_change.cc',
59 'canvas-simpleline.c',
60 'canvas-simplerect.c',
66 'control_point_dialog.cc',
72 'edit_note_dialog.cc',
76 'editor_audio_import.cc',
77 'editor_audiotrack.cc',
79 'editor_canvas_events.cc',
80 'editor_component.cc',
83 'editor_route_groups.cc',
84 'editor_export_audio.cc',
85 'editor_group_tabs.cc',
87 'editor_locations.cc',
97 'editor_selection.cc',
98 'editor_snapshots.cc',
100 'editor_tempodisplay.cc',
104 'export_channel_selector.cc',
106 'export_file_notebook.cc',
107 'export_filename_selector.cc',
108 'export_format_dialog.cc',
109 'export_format_selector.cc',
110 'export_preset_selector.cc',
111 'export_timespan_selector.cc',
116 'generic_pluginui.cc',
118 'global_port_matrix.cc',
120 'gtk-custom-hruler.c',
121 'gtk-custom-ruler.c',
122 'gtk_pianokeyboard.c',
123 'insert_time_dialog.cc',
124 'interthread_progress_window.cc',
135 'midi_automation_line.cc',
136 'midi_channel_dialog.cc',
137 'midi_channel_selector.cc',
138 'midi_cut_buffer.cc',
139 'midi_list_editor.cc',
140 'midi_port_dialog.cc',
141 'midi_region_view.cc',
143 'midi_streamview.cc',
146 'missing_file_dialog.cc',
147 'missing_plugin_dialog.cc',
148 'mixer_group_tabs.cc',
151 'monitor_section.cc',
155 'new_plugin_preset_dialog.cc',
156 'normalize_dialog.cc',
162 'piano_roll_header.cc',
163 'playlist_selector.cc',
165 'plugin_selector.cc',
170 'port_matrix_body.cc',
171 'port_matrix_column_labels.cc',
172 'port_matrix_component.cc',
173 'port_matrix_grid.cc',
174 'port_matrix_labels.cc',
175 'port_matrix_row_labels.cc',
177 'patch_change_dialog.cc',
178 'progress_reporter.cc',
181 'quantize_dialog.cc',
182 'rc_option_editor.cc',
184 'region_gain_line.cc',
185 'region_layering_order_editor.cc',
186 'region_selection.cc',
190 'route_group_dialog.cc',
191 'route_group_menu.cc',
192 'route_params_ui.cc',
193 'route_processor_selection.cc',
194 'route_time_axis.cc',
196 'search_path_option.cc',
199 'session_import_dialog.cc',
200 'session_metadata_dialog.cc',
201 'session_option_editor.cc',
203 'shuttle_control.cc',
213 'strip_silence_dialog.cc',
214 'tape_region_view.cc',
219 'time_axis_view_item.cc',
223 'track_selection.cc',
224 'track_view_list.cc',
225 'transpose_dialog.cc',
230 'volume_controller.cc',
235 def set_options(opt
):
236 autowaf
.set_options(opt
)
239 autowaf
.build_version_files(
240 path_prefix
+ 'version.h',
241 path_prefix
+ 'version.cc',
242 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
243 autowaf
.configure(conf
)
244 conf
.check_tool('compiler_cxx')
246 if re
.search ("linux", sys
.platform
) != None:
247 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
249 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
251 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC',
252 atleast_version
='1.2.1')
253 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD',
254 atleast_version
='2.10.1')
255 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK',
256 atleast_version
='2.18')
257 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM',
258 atleast_version
='2.18')
259 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6',
260 uselib_store
='GNOMECANVASMM', atleast_version
='2.16')
261 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
263 conf
.check_tool('misc') # subst tool
265 conf
.write_config_header('gtk2ardour-config.h')
268 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
269 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
271 # Add a waf `feature' to allow compilation of things using winegcc
272 from TaskGen
import feature
274 def set_winegcc(self
):
275 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
276 self
.env
.CC
= 'winegcc'
278 def build_color_scheme(path
, prefix
):
282 if re
.search ('^#@color', line
):
283 line
.strip() # remove newline
285 if len(color_scheme
):
287 color_scheme
+= prefix
289 color_scheme
+= words
[1]
291 color_scheme
+= words
[2]
297 # GTK front-end; if we're using VST we build this as a shared library,
298 # otherwise it's a normal executabale
299 if bld
.env
['VST_SUPPORT']:
300 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
302 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
305 obj
.source
= gtk2_ardour_sources
306 obj
.name
= 'gtk2_ardour'
307 if bld
.env
['VST_SUPPORT']:
308 obj
.target
= 'gtk2_ardour'
309 obj
.includes
+= ['../libs/fst']
311 obj
.target
= 'ardour-3.0'
312 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
313 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
314 obj
.uselib
+= ' GTKMM GNOMECANVASMM '
315 obj
.uselib
+= ' AUDIOUNITS OSX GTKOSX '
316 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
317 libgtkmm2ext libtaglib libgnomecanvas-2'''
318 if sys
.platform
== 'darwin':
319 obj
.uselib_local
+ ' libappleutility'
321 'PACKAGE="gtk2_ardour"',
322 'VERSIONSTRING="' + bld
.env
['VERSION'] + '"',
323 'DATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"',
324 'CONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"',
325 'MODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"',
326 'LOCALEDIR="' + os
.path
.join(os
.path
.normpath(bld
.env
['DATADIR']),
328 'PROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"'
330 obj
.includes
+= ['../libs']
332 if bld
.env
['HAVE_SUIL']:
333 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
334 obj
.uselib
+= ' SUIL '
335 elif bld
.env
['HAVE_SLV2']:
336 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
337 obj
.uselib
+= ' SLV2 '
339 if bld
.env
['FREESOUND']:
340 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
342 if bld
.env
['VST_SUPPORT']:
343 obj
.source
+= [ 'vst_pluginui.cc' ]
344 obj
.defines
+= [ 'VST_SUPPORT' ]
346 if bld
.env
['PHONE_HOME']:
347 obj
.defines
+= [ 'PHONE_HOME' ]
349 if bld
.env
['COREAUDIO']:
350 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
351 obj
.source
+= [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
352 obj
.uselib_local
+= ' libappleutility '
354 if bld
.env
['VST_SUPPORT']:
355 # If we require VST support we build a stub main() and the FST library
356 # here using winegcc, and link it to the GTK front-end library
357 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
360 ../libs/fst/fstinfofile.c
365 obj
.includes
= '../libs/fst'
366 obj
.target
= 'ardour-3.0-vst'
367 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
368 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
370 obj
.uselib_local
= ['libpbd','libmidipp','libtaglib','libardour',
371 'libardour_cp','libgtkmm2ext','libtaglib',
376 wrapper_subst_dict
= {
377 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
378 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
379 'LIBS' : 'build/default/libs',
381 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
384 obj
= bld
.new_task_gen('subst')
385 obj
.source
= 'ardev_common.sh.in'
386 obj
.target
= 'ardev_common_waf.sh'
388 obj
.dict = wrapper_subst_dict
390 obj
= bld
.new_task_gen('subst')
391 obj
.source
= 'ardour.sh.in'
392 obj
.target
= 'ardour3'
394 obj
.dict = wrapper_subst_dict
395 obj
.install_path
= bld
.env
['BINDIR']
399 dark_rc_subst_dict
= {}
400 light_rc_subst_dict
= {}
405 if bld
.env
['IS_OSX']: # OS X fonts
406 basefont
= "Lucida Grande"
419 else: # Linux/X11 fonts
420 basefont
= '' # unspecified - use system defaults
434 # Set up font substitution dictionary
436 for style
in ['', 'BOLD', 'ITALIC']:
437 for sizename
,points
in iter(font_sizes
.items()):
439 key
= "_".join (['FONT',style
,sizename
])
440 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
442 key
= "_".join (['FONT',sizename
])
443 fontstyle
= " ".join ([basefont
,points
])
445 dark_rc_subst_dict
[key
] = fontstyle
446 light_rc_subst_dict
[key
] = fontstyle
449 for sizename
,points
in iter(font_sizes
.items()):
450 key
= "_".join (['FONT_SIZE',sizename
])
451 dark_rc_subst_dict
[key
] = points
452 light_rc_subst_dict
[key
] = points
455 dark_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme(
456 'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
457 dark_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_DARK'
458 light_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme(
459 'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
460 light_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_LIGHT'
462 obj
= bld
.new_task_gen('subst')
463 obj
.source
= [ 'ardour3_ui_dark.rc.in' ]
464 obj
.target
= 'ardour3_ui_dark.rc'
465 obj
.dict = dark_rc_subst_dict
466 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
468 obj
= bld
.new_task_gen('subst')
469 obj
.source
= [ 'ardour3_ui_light.rc.in' ]
470 obj
.target
= 'ardour3_ui_light.rc'
471 obj
.dict = light_rc_subst_dict
472 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
474 obj
= bld
.new_task_gen('subst')
475 obj
.source
= [ 'ardour3_styles.rc.in' ]
476 obj
.target
= 'ardour3_dark_styles.rc'
477 obj
.dict = dark_rc_subst_dict
478 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
480 obj
= bld
.new_task_gen('subst')
481 obj
.source
= [ 'ardour3_styles.rc.in' ]
482 obj
.target
= 'ardour3_light_styles.rc'
483 obj
.dict = light_rc_subst_dict
484 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
486 obj
= bld
.new_task_gen('subst')
487 obj
.source
= [ 'ardour3_fonts.rc.in' ]
488 obj
.target
= 'ardour3_dark_fonts.rc'
489 obj
.dict = dark_rc_subst_dict
490 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
492 obj
= bld
.new_task_gen('subst')
493 obj
.source
= [ 'ardour3_fonts.rc.in' ]
494 obj
.target
= 'ardour3_light_fonts.rc'
495 obj
.dict = light_rc_subst_dict
496 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
498 obj
= bld
.new_task_gen('copy')
499 obj
.source
= [ 'ardour3_widget_list.rc' ]
500 obj
.target
= 'ardour3_widgets.rc'
501 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
505 if bld
.env
['GTKOSX']:
506 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
508 menus_argv
= [ '-E', '-P' ]
509 obj
= bld
.new_task_gen('command-output')
511 obj
.command_is_external
= True
513 obj
.argv
= menus_argv
514 obj
.stdin
= 'ardour.menus.in'
515 obj
.stdout
= 'ardour.menus'
516 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'),
521 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
522 # 'SAE-us-nokeypad', 'ergonomic-us'
524 for b
in [ 'mnemonic-us' ] :
525 obj
= bld
.new_task_gen (
526 target
= b
+ '.bindings',
527 source
= b
+ '.bindings.in',
528 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
530 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
532 # not modified at present
533 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'),
534 'step_editing.bindings')
537 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
538 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
539 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
541 # Default UI configuration
542 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
543 # Generic widget style mappings
544 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_widgets.rc')
546 # Default export stuff
547 bld
.install_files('${CONFIGDIR}/ardour3/export', 'export/*.format')
550 if bld
.env
['ENABLE_NLS']:
551 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
553 lang
= os
.path
.basename (mo
).replace ('.mo', '')
554 bld
.install_as (os
.path
.join(bld
.env
['PREFIX'], 'share', 'locale',
555 lang
, 'LC_MESSAGES', APPNAME
+ '.mo'),
559 autowaf
.build_i18n(bld
, srcdir
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)