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_selector.cc',
137 'midi_cut_buffer.cc',
138 'midi_list_editor.cc',
139 'midi_port_dialog.cc',
140 'midi_region_view.cc',
142 'midi_streamview.cc',
145 'missing_file_dialog.cc',
146 'missing_plugin_dialog.cc',
147 'mixer_group_tabs.cc',
150 'monitor_section.cc',
154 'new_plugin_preset_dialog.cc',
155 'normalize_dialog.cc',
161 'piano_roll_header.cc',
162 'playlist_selector.cc',
164 'plugin_selector.cc',
169 'port_matrix_body.cc',
170 'port_matrix_column_labels.cc',
171 'port_matrix_component.cc',
172 'port_matrix_grid.cc',
173 'port_matrix_labels.cc',
174 'port_matrix_row_labels.cc',
176 'patch_change_dialog.cc',
177 'progress_reporter.cc',
180 'quantize_dialog.cc',
181 'rc_option_editor.cc',
183 'region_gain_line.cc',
184 'region_layering_order_editor.cc',
185 'region_selection.cc',
189 'route_group_dialog.cc',
190 'route_group_menu.cc',
191 'route_params_ui.cc',
192 'route_processor_selection.cc',
193 'route_time_axis.cc',
195 'search_path_option.cc',
198 'session_import_dialog.cc',
199 'session_metadata_dialog.cc',
200 'session_option_editor.cc',
202 'shuttle_control.cc',
212 'strip_silence_dialog.cc',
213 'tape_region_view.cc',
218 'time_axis_view_item.cc',
222 'track_selection.cc',
223 'track_view_list.cc',
224 'transpose_dialog.cc',
229 'volume_controller.cc',
234 def set_options(opt
):
235 autowaf
.set_options(opt
)
238 autowaf
.build_version_files(
239 path_prefix
+ 'version.h',
240 path_prefix
+ 'version.cc',
241 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
242 autowaf
.configure(conf
)
243 conf
.check_tool('compiler_cxx')
245 if re
.search ("linux", sys
.platform
) != None:
246 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
248 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
250 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC',
251 atleast_version
='1.2.1')
252 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD',
253 atleast_version
='2.10.1')
254 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK',
255 atleast_version
='2.18')
256 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM',
257 atleast_version
='2.18')
258 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6',
259 uselib_store
='GNOMECANVASMM', atleast_version
='2.16')
260 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
262 conf
.check_tool('misc') # subst tool
264 conf
.write_config_header('gtk2ardour-config.h')
267 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
268 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
270 # Add a waf `feature' to allow compilation of things using winegcc
271 from TaskGen
import feature
273 def set_winegcc(self
):
274 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
275 self
.env
.CC
= 'winegcc'
277 def build_color_scheme(path
, prefix
):
281 if re
.search ('^#@color', line
):
282 line
.strip() # remove newline
284 if len(color_scheme
):
286 color_scheme
+= prefix
288 color_scheme
+= words
[1]
290 color_scheme
+= words
[2]
296 # GTK front-end; if we're using VST we build this as a shared library,
297 # otherwise it's a normal executabale
298 if bld
.env
['VST_SUPPORT']:
299 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
301 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
304 obj
.source
= gtk2_ardour_sources
305 obj
.name
= 'gtk2_ardour'
306 if bld
.env
['VST_SUPPORT']:
307 obj
.target
= 'gtk2_ardour'
308 obj
.includes
+= ['../libs/fst']
310 obj
.target
= 'ardour-3.0'
311 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
312 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
313 obj
.uselib
+= ' GTKMM GNOMECANVASMM '
314 obj
.uselib
+= ' AUDIOUNITS OSX GTKOSX '
315 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
316 libgtkmm2ext libtaglib libgnomecanvas-2'''
317 if sys
.platform
== 'darwin':
318 obj
.uselib_local
+ ' libappleutility'
320 'PACKAGE="gtk2_ardour"',
321 'VERSIONSTRING="' + bld
.env
['VERSION'] + '"',
322 'DATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"',
323 'CONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"',
324 'MODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"',
325 'LOCALEDIR="' + os
.path
.join(os
.path
.normpath(bld
.env
['DATADIR']),
327 'PROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"'
329 obj
.includes
+= ['../libs']
331 if bld
.env
['HAVE_SUIL']:
332 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
333 obj
.uselib
+= ' SUIL '
334 elif bld
.env
['HAVE_SLV2']:
335 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
336 obj
.uselib
+= ' SLV2 '
338 if bld
.env
['FREESOUND']:
339 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
341 if bld
.env
['VST_SUPPORT']:
342 obj
.source
+= [ 'vst_pluginui.cc' ]
343 obj
.defines
+= [ 'VST_SUPPORT' ]
345 if bld
.env
['PHONE_HOME']:
346 obj
.defines
+= [ 'PHONE_HOME' ]
348 if bld
.env
['COREAUDIO']:
349 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
350 obj
.source
+= [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
351 obj
.uselib_local
+= ' libappleutility '
353 if bld
.env
['VST_SUPPORT']:
354 # If we require VST support we build a stub main() and the FST library
355 # here using winegcc, and link it to the GTK front-end library
356 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
359 ../libs/fst/fstinfofile.c
364 obj
.includes
= '../libs/fst'
365 obj
.target
= 'ardour-3.0-vst'
366 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
367 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
369 obj
.uselib_local
= ['libpbd','libmidipp','libtaglib','libardour',
370 'libardour_cp','libgtkmm2ext','libtaglib',
375 wrapper_subst_dict
= {
376 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
377 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
378 'LIBS' : 'build/default/libs',
380 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
383 obj
= bld
.new_task_gen('subst')
384 obj
.source
= 'ardev_common.sh.in'
385 obj
.target
= 'ardev_common_waf.sh'
387 obj
.dict = wrapper_subst_dict
389 obj
= bld
.new_task_gen('subst')
390 obj
.source
= 'ardour.sh.in'
391 obj
.target
= 'ardour3'
393 obj
.dict = wrapper_subst_dict
394 obj
.install_path
= bld
.env
['BINDIR']
398 dark_rc_subst_dict
= {}
399 light_rc_subst_dict
= {}
404 if bld
.env
['IS_OSX']: # OS X fonts
405 basefont
= "Lucida Grande"
418 else: # Linux/X11 fonts
419 basefont
= '' # unspecified - use system defaults
433 # Set up font substitution dictionary
435 for style
in ['', 'BOLD', 'ITALIC']:
436 for sizename
,points
in iter(font_sizes
.items()):
438 key
= "_".join (['FONT',style
,sizename
])
439 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
441 key
= "_".join (['FONT',sizename
])
442 fontstyle
= " ".join ([basefont
,points
])
444 dark_rc_subst_dict
[key
] = fontstyle
445 light_rc_subst_dict
[key
] = fontstyle
448 for sizename
,points
in iter(font_sizes
.items()):
449 key
= "_".join (['FONT_SIZE',sizename
])
450 dark_rc_subst_dict
[key
] = points
451 light_rc_subst_dict
[key
] = points
454 dark_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme(
455 'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
456 dark_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_DARK'
457 light_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme(
458 'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
459 light_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_LIGHT'
461 obj
= bld
.new_task_gen('subst')
462 obj
.source
= [ 'ardour3_ui_dark.rc.in' ]
463 obj
.target
= 'ardour3_ui_dark.rc'
464 obj
.dict = dark_rc_subst_dict
465 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
467 obj
= bld
.new_task_gen('subst')
468 obj
.source
= [ 'ardour3_ui_light.rc.in' ]
469 obj
.target
= 'ardour3_ui_light.rc'
470 obj
.dict = light_rc_subst_dict
471 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
473 obj
= bld
.new_task_gen('subst')
474 obj
.source
= [ 'ardour3_styles.rc.in' ]
475 obj
.target
= 'ardour3_dark_styles.rc'
476 obj
.dict = dark_rc_subst_dict
477 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
479 obj
= bld
.new_task_gen('subst')
480 obj
.source
= [ 'ardour3_styles.rc.in' ]
481 obj
.target
= 'ardour3_light_styles.rc'
482 obj
.dict = light_rc_subst_dict
483 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
485 obj
= bld
.new_task_gen('subst')
486 obj
.source
= [ 'ardour3_fonts.rc.in' ]
487 obj
.target
= 'ardour3_dark_fonts.rc'
488 obj
.dict = dark_rc_subst_dict
489 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
491 obj
= bld
.new_task_gen('subst')
492 obj
.source
= [ 'ardour3_fonts.rc.in' ]
493 obj
.target
= 'ardour3_light_fonts.rc'
494 obj
.dict = light_rc_subst_dict
495 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
497 obj
= bld
.new_task_gen('copy')
498 obj
.source
= [ 'ardour3_widget_list.rc' ]
499 obj
.target
= 'ardour3_widgets.rc'
500 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
504 if bld
.env
['GTKOSX']:
505 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
507 menus_argv
= [ '-E', '-P' ]
508 obj
= bld
.new_task_gen('command-output')
510 obj
.command_is_external
= True
512 obj
.argv
= menus_argv
513 obj
.stdin
= 'ardour.menus.in'
514 obj
.stdout
= 'ardour.menus'
515 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'),
520 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
521 # 'SAE-us-nokeypad', 'ergonomic-us'
523 for b
in [ 'mnemonic-us' ] :
524 obj
= bld
.new_task_gen (
525 target
= b
+ '.bindings',
526 source
= b
+ '.bindings.in',
527 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
529 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
531 # not modified at present
532 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'),
533 'step_editing.bindings')
536 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
537 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
538 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
540 # Default UI configuration
541 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
542 # Generic widget style mappings
543 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_widgets.rc')
545 # Default export stuff
546 bld
.install_files('${CONFIGDIR}/ardour3/export', 'export/*.format')
549 if bld
.env
['ENABLE_NLS']:
550 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
552 lang
= os
.path
.basename (mo
).replace ('.mo', '')
553 bld
.install_as (os
.path
.join(bld
.env
['PREFIX'], 'share', 'locale',
554 lang
, 'LC_MESSAGES', APPNAME
+ '.mo'),
558 autowaf
.build_i18n(bld
, srcdir
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)