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',
211 'strip_silence_dialog.cc',
212 'tape_region_view.cc',
217 'time_axis_view_item.cc',
220 'track_selection.cc',
221 'track_view_list.cc',
225 'volume_controller.cc',
230 def set_options(opt
):
231 autowaf
.set_options(opt
)
234 autowaf
.build_version_files(path_prefix
+'version.h', path_prefix
+'version.cc',
235 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
236 autowaf
.configure(conf
)
237 conf
.check_tool('compiler_cxx')
239 if re
.search ("linux", sys
.platform
) != None:
240 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
242 # TODO: Insert a sanity check for on OS X
243 # to ensure that CoreAudio is present....
244 # Really shouldn't these checks be in AutoWaf?
246 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC', atleast_version
='1.2.1')
247 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD', atleast_version
='2.10.1')
248 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK', atleast_version
='2.18')
249 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM', atleast_version
='2.18')
250 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6', uselib_store
='GNOMECANVASMM', atleast_version
='2.16')
251 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
253 conf
.check_tool('misc') # subst tool
255 conf
.write_config_header('gtk2ardour-config.h')
258 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
259 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
261 # Add a waf `feature' to allow compilation of things using winegcc
262 from TaskGen
import feature
264 def set_winegcc(self
):
265 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
266 self
.env
.CC
= 'winegcc'
268 def build_color_scheme(path
, prefix
):
272 if re
.search ('^#@color', line
):
273 line
.strip() # remove newline
275 if len(color_scheme
):
277 color_scheme
+= prefix
279 color_scheme
+= words
[1]
281 color_scheme
+= words
[2]
287 # GTK front-end; if we're using VST we build this as a shared library, otherwise
288 # it's a normal executabale
289 if bld
.env
['VST_SUPPORT']:
290 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
292 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
295 obj
.source
= gtk2_ardour_sources
296 obj
.name
= 'gtk2_ardour'
297 if bld
.env
['VST_SUPPORT']:
298 obj
.target
= 'gtk2_ardour'
299 obj
.includes
+= ['../libs/fst']
301 obj
.target
= 'ardour-3.0'
302 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
303 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
304 obj
.uselib
+= ' GTKMM GNOMECANVASMM '
305 obj
.uselib
+= ' AUDIOUNITS OSX GTKOSX '
306 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
307 libgtkmm2ext libtaglib libgnomecanvas-2'''
308 if sys
.platform
== 'darwin':
309 obj
.uselib_local
+ ' libappleutility'
310 obj
.cflags
= ['-DPACKAGE="gtk2_ardour"']
311 obj
.cxxflags
= ['-DPACKAGE="gtk2_ardour"']
312 obj
.cxxflags
+= ['-DVERSIONSTRING="' + bld
.env
['VERSION'] + '"']
313 obj
.cxxflags
+= ['-DDATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"']
314 obj
.cxxflags
+= ['-DCONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"']
315 obj
.cxxflags
+= ['-DMODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"']
316 obj
.cxxflags
+= ['-DLOCALEDIR="' + os
.path
.join(
317 os
.path
.normpath(bld
.env
['DATADIR']), 'locale') + '"']
318 obj
.cxxflags
+= ['-DPROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"']
319 obj
.cxxflags
+= ['-I../libs']
321 if bld
.env
['HAVE_SLV2']:
322 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
323 obj
.uselib
+= ' SLV2 '
325 if bld
.env
['FREESOUND']:
326 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
328 if bld
.env
['VST_SUPPORT']:
329 obj
.source
+= [ 'vst_pluginui.cc' ]
330 obj
.cxxflags
+= [ '-DVST_SUPPORT' ]
332 if bld
.env
['PHONE_HOME']:
333 obj
.cxxflags
+= [ '-DPHONE_HOME' ]
335 if bld
.env
['COREAUDIO']:
336 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
337 obj
.source
+= [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
338 obj
.uselib_local
+= ' libappleutility '
340 obj
.source
+= [ 'x11.cc' ]
342 if bld
.env
['VST_SUPPORT']:
343 # If we require VST support we build a stub main() and the FST library here using
344 # winegcc, and link it to the GTK front-end library
345 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
348 ../libs/fst/fstinfofile.c
353 obj
.includes
= '../libs/fst'
354 obj
.target
= 'ardour-3.0-vst'
355 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
356 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
358 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp libgtkmm2ext libtaglib gtk2_ardour'''
362 wrapper_subst_dict
= {
363 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
364 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
365 'LIBS' : 'build/default/libs',
367 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
370 obj
= bld
.new_task_gen('subst')
371 obj
.source
= 'ardev_common.sh.in'
372 obj
.target
= 'ardev_common_waf.sh'
374 obj
.dict = wrapper_subst_dict
376 obj
= bld
.new_task_gen('subst')
377 obj
.source
= 'ardour.sh.in'
378 obj
.target
= 'ardour3'
380 obj
.dict = wrapper_subst_dict
381 obj
.install_path
= bld
.env
['BINDIR']
385 dark_rc_subst_dict
= {}
386 light_rc_subst_dict
= {}
391 if bld
.env
['IS_OSX']: # OS X fonts
392 basefont
= "Lucida Grande"
405 else: # Linux/X11 fonts
406 basefont
= '' # unspecified - use system defaults
420 # Set up font substitution dictionary
421 for style
in ['', 'BOLD', 'ITALIC']:
422 for sizename
,points
in iter(font_sizes
.items()):
424 key
= "_".join (['FONT',style
,sizename
])
425 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
427 key
= "_".join (['FONT',sizename
])
428 fontstyle
= " ".join ([basefont
,points
])
430 dark_rc_subst_dict
[key
] = fontstyle
431 light_rc_subst_dict
[key
] = fontstyle
434 dark_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme ('gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
435 dark_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_DARK'
436 light_rc_subst_dict
['COLOR_SCHEME'] = build_color_scheme ('gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
437 light_rc_subst_dict
['COLPREFIX'] = 'ARDOUR_LIGHT'
439 obj
= bld
.new_task_gen('subst')
440 obj
.source
= 'ardour3_ui_dark.rc.in'
441 obj
.target
= 'ardour3_ui_dark.rc'
442 obj
.dict = dark_rc_subst_dict
443 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
445 obj
= bld
.new_task_gen('subst')
446 obj
.source
= 'ardour3_ui_light.rc.in'
447 obj
.target
= 'ardour3_ui_light.rc'
448 obj
.dict = light_rc_subst_dict
449 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
453 if bld
.env
['GTKOSX']:
454 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
456 menus_argv
= [ '-E', '-P' ]
457 obj
= bld
.new_task_gen('command-output')
459 obj
.command_is_external
= True
461 obj
.argv
= menus_argv
462 obj
.stdin
= 'ardour.menus.in'
463 obj
.stdout
= 'ardour.menus'
464 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'ardour.menus')
468 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad', 'ergonomic-us'
470 for b
in [ 'mnemonic-us' ] :
471 obj
= bld
.new_task_gen (
472 target
= b
+ '.bindings',
473 source
= b
+ '.bindings.in',
474 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
476 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
478 # not modified at present
479 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'step_editing.bindings')
482 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
483 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
484 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
486 # Default UI configuration
487 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
489 # Default export stuff
490 bld
.install_files('${CONFIGDIR}/ardour3/export', 'export/*.format')
493 if bld
.env
['ENABLE_NLS']:
494 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
496 lang
= os
.path
.basename (mo
).replace ('.mo', '')
497 bld
.install_as (os
.path
.join (bld
.env
['PREFIX'], 'share', 'locale', lang
, 'LC_MESSAGES', APPNAME
+ '.mo'), mo
)
500 autowaf
.build_i18n (bld
, srcdir
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)