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',
124 'insert_time_dialog.cc',
125 'interthread_progress_window.cc',
136 'midi_automation_line.cc',
137 'midi_channel_dialog.cc',
138 'midi_channel_selector.cc',
139 'midi_cut_buffer.cc',
140 'midi_list_editor.cc',
141 'midi_port_dialog.cc',
142 'midi_region_view.cc',
144 'midi_streamview.cc',
147 'missing_file_dialog.cc',
148 'missing_plugin_dialog.cc',
149 'mixer_group_tabs.cc',
152 'monitor_section.cc',
156 'new_plugin_preset_dialog.cc',
157 'normalize_dialog.cc',
163 'piano_roll_header.cc',
164 'playlist_selector.cc',
166 'plugin_selector.cc',
171 'port_matrix_body.cc',
172 'port_matrix_column_labels.cc',
173 'port_matrix_component.cc',
174 'port_matrix_grid.cc',
175 'port_matrix_labels.cc',
176 'port_matrix_row_labels.cc',
178 'patch_change_dialog.cc',
179 'progress_reporter.cc',
182 'quantize_dialog.cc',
183 'rc_option_editor.cc',
185 'region_gain_line.cc',
186 'region_layering_order_editor.cc',
187 'region_selection.cc',
191 'route_group_dialog.cc',
192 'route_group_menu.cc',
193 'route_params_ui.cc',
194 'route_processor_selection.cc',
195 'route_time_axis.cc',
197 'search_path_option.cc',
200 'session_import_dialog.cc',
201 'session_metadata_dialog.cc',
202 'session_option_editor.cc',
204 'shuttle_control.cc',
214 'strip_silence_dialog.cc',
215 'tape_region_view.cc',
220 'time_axis_view_item.cc',
224 'track_selection.cc',
225 'track_view_list.cc',
226 'transpose_dialog.cc',
231 'volume_controller.cc',
236 def set_options(opt
):
237 autowaf
.set_options(opt
)
240 autowaf
.build_version_files(
241 path_prefix
+ 'version.h',
242 path_prefix
+ 'version.cc',
243 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
244 autowaf
.configure(conf
)
245 conf
.check_tool('compiler_cxx')
247 if re
.search ("linux", sys
.platform
) != None:
248 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
250 # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
252 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC',
253 atleast_version
='1.2.1')
254 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD',
255 atleast_version
='2.10.1')
256 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK',
257 atleast_version
='2.18')
258 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM',
259 atleast_version
='2.18')
260 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6',
261 uselib_store
='GNOMECANVASMM', atleast_version
='2.16')
262 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
264 conf
.check_tool('misc') # subst tool
266 conf
.write_config_header('gtk2ardour-config.h')
269 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
270 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
272 # Add a waf `feature' to allow compilation of things using winegcc
273 from TaskGen
import feature
275 def set_winegcc(self
):
276 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
277 self
.env
.CC
= 'winegcc'
279 def build_color_scheme(path
, prefix
):
283 if re
.search ('^#@color', line
):
284 line
.strip() # remove newline
286 if len(color_scheme
):
288 color_scheme
+= prefix
290 color_scheme
+= words
[1]
292 color_scheme
+= words
[2]
298 # GTK front-end; if we're using VST we build this as a shared library,
299 # otherwise it's a normal executabale
300 if bld
.env
['VST_SUPPORT']:
301 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
303 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
306 obj
.source
= gtk2_ardour_sources
307 obj
.name
= 'gtk2_ardour'
308 if bld
.env
['VST_SUPPORT']:
309 obj
.target
= 'gtk2_ardour'
310 obj
.includes
+= ['../libs/fst']
312 obj
.target
= 'ardour-3.0'
313 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
314 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
315 obj
.uselib
+= ' GTKMM GNOMECANVASMM '
316 obj
.uselib
+= ' AUDIOUNITS OSX GTKOSX '
317 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
318 libgtkmm2ext libtaglib libgnomecanvas-2'''
319 if sys
.platform
== 'darwin':
320 obj
.uselib_local
+ ' libappleutility'
322 'PACKAGE="gtk2_ardour"',
323 'VERSIONSTRING="' + bld
.env
['VERSION'] + '"',
324 'DATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"',
325 'CONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"',
326 'MODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"',
327 'LOCALEDIR="' + os
.path
.join(os
.path
.normpath(bld
.env
['DATADIR']),
329 'PROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"'
331 obj
.includes
+= ['../libs']
333 if bld
.env
['HAVE_SUIL']:
334 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
335 obj
.uselib
+= ' SUIL '
336 elif bld
.env
['HAVE_SLV2']:
337 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
338 obj
.uselib
+= ' SLV2 '
340 if bld
.env
['FREESOUND']:
341 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
343 if bld
.env
['VST_SUPPORT']:
344 obj
.source
+= [ 'vst_pluginui.cc' ]
345 obj
.defines
+= [ 'VST_SUPPORT' ]
347 if bld
.env
['PHONE_HOME']:
348 obj
.defines
+= [ 'PHONE_HOME' ]
350 if bld
.env
['COREAUDIO']:
351 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
352 obj
.source
+= [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
353 obj
.uselib_local
+= ' libappleutility '
355 if bld
.env
['VST_SUPPORT']:
356 # If we require VST support we build a stub main() and the FST library
357 # here using winegcc, and link it to the GTK front-end library
358 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
361 ../libs/fst/fstinfofile.c
366 obj
.includes
= '../libs/fst'
367 obj
.target
= 'ardour-3.0-vst'
368 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
369 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
371 obj
.uselib_local
= ['libpbd','libmidipp','libtaglib','libardour',
372 'libardour_cp','libgtkmm2ext','libtaglib',
377 wrapper_subst_dict
= {
378 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
379 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
380 'LIBS' : 'build/default/libs',
382 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
385 obj
= bld
.new_task_gen('subst')
386 obj
.source
= 'ardev_common.sh.in'
387 obj
.target
= 'ardev_common_waf.sh'
389 obj
.dict = wrapper_subst_dict
391 obj
= bld
.new_task_gen('subst')
392 obj
.source
= 'ardour.sh.in'
393 obj
.target
= 'ardour3'
395 obj
.dict = wrapper_subst_dict
396 obj
.install_path
= bld
.env
['BINDIR']
400 dark_rc_subst_dict
= {}
401 light_rc_subst_dict
= {}
406 if bld
.env
['IS_OSX']: # OS X fonts
407 basefont
= "Lucida Grande"
420 else: # Linux/X11 fonts
421 basefont
= '' # unspecified - use system defaults
435 # Set up font substitution dictionary
437 for style
in ['', 'BOLD', 'ITALIC']:
438 for sizename
,points
in iter(font_sizes
.items()):
440 key
= "_".join (['FONT',style
,sizename
])
441 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
443 key
= "_".join (['FONT',sizename
])
444 fontstyle
= " ".join ([basefont
,points
])
446 dark_rc_subst_dict
[key
] = fontstyle
447 light_rc_subst_dict
[key
] = fontstyle
450 for sizename
,points
in iter(font_sizes
.items()):
451 key
= "_".join (['FONT_SIZE',sizename
])
452 dark_rc_subst_dict
[key
] = points
453 light_rc_subst_dict
[key
] = points
456 dark_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme(
457 'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
458 dark_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_DARK'
459 light_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme(
460 'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
461 light_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_LIGHT'
463 obj
= bld
.new_task_gen('subst')
464 obj
.source
= [ 'ardour3_ui_dark.rc.in' ]
465 obj
.target
= 'ardour3_ui_dark.rc'
466 obj
.dict = dark_rc_subst_dict
467 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
469 obj
= bld
.new_task_gen('subst')
470 obj
.source
= [ 'ardour3_ui_light.rc.in' ]
471 obj
.target
= 'ardour3_ui_light.rc'
472 obj
.dict = light_rc_subst_dict
473 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
475 obj
= bld
.new_task_gen('subst')
476 obj
.source
= [ 'ardour3_styles.rc.in' ]
477 obj
.target
= 'ardour3_dark_styles.rc'
478 obj
.dict = dark_rc_subst_dict
479 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
481 obj
= bld
.new_task_gen('subst')
482 obj
.source
= [ 'ardour3_styles.rc.in' ]
483 obj
.target
= 'ardour3_light_styles.rc'
484 obj
.dict = light_rc_subst_dict
485 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
487 obj
= bld
.new_task_gen('subst')
488 obj
.source
= [ 'ardour3_fonts.rc.in' ]
489 obj
.target
= 'ardour3_dark_fonts.rc'
490 obj
.dict = dark_rc_subst_dict
491 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
493 obj
= bld
.new_task_gen('subst')
494 obj
.source
= [ 'ardour3_fonts.rc.in' ]
495 obj
.target
= 'ardour3_light_fonts.rc'
496 obj
.dict = light_rc_subst_dict
497 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
499 obj
= bld
.new_task_gen('copy')
500 obj
.source
= [ 'ardour3_widget_list.rc' ]
501 obj
.target
= 'ardour3_widgets.rc'
502 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
506 if bld
.env
['GTKOSX']:
507 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
509 menus_argv
= [ '-E', '-P' ]
510 obj
= bld
.new_task_gen('command-output')
512 obj
.command_is_external
= True
514 obj
.argv
= menus_argv
515 obj
.stdin
= 'ardour.menus.in'
516 obj
.stdout
= 'ardour.menus'
517 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'),
522 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
523 # 'SAE-us-nokeypad', 'ergonomic-us'
525 for b
in [ 'mnemonic-us' ] :
526 obj
= bld
.new_task_gen (
527 target
= b
+ '.bindings',
528 source
= b
+ '.bindings.in',
529 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
531 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
533 # not modified at present
534 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'),
535 'step_editing.bindings')
538 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
539 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
540 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
542 # Default UI configuration
543 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
544 # Generic widget style mappings
545 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_widgets.rc')
547 # Default export stuff
548 bld
.install_files('${CONFIGDIR}/ardour3/export', 'export/*.format')
551 if bld
.env
['ENABLE_NLS']:
552 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
554 lang
= os
.path
.basename (mo
).replace ('.mo', '')
555 bld
.install_as (os
.path
.join(bld
.env
['PREFIX'], 'share', 'locale',
556 lang
, 'LC_MESSAGES', APPNAME
+ '.mo'),
560 autowaf
.build_i18n(bld
, srcdir
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)