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',
35 'ardour_ui_dependents.cc',
36 'ardour_ui_dialogs.cc',
39 'ardour_ui_options.cc',
41 'audio_region_editor.cc',
42 'audio_region_view.cc',
43 'audio_streamview.cc',
45 'automation_controller.cc',
47 'automation_region_view.cc',
48 'automation_streamview.cc',
49 'automation_time_axis.cc',
55 'canvas-note-event.cc',
57 'canvas-program-change.cc',
58 'canvas-simpleline.c',
59 'canvas-simplerect.c',
64 'control_point_dialog.cc',
70 'edit_note_dialog.cc',
74 'editor_audio_import.cc',
75 'editor_audiotrack.cc',
77 'editor_canvas_events.cc',
78 'editor_component.cc',
81 'editor_route_groups.cc',
82 'editor_export_audio.cc',
83 'editor_group_tabs.cc',
86 'editor_locations.cc',
96 'editor_selection.cc',
97 'editor_snapshots.cc',
99 'editor_tempodisplay.cc',
103 'export_channel_selector.cc',
105 'export_file_notebook.cc',
106 'export_filename_selector.cc',
107 'export_format_dialog.cc',
108 'export_format_selector.cc',
109 'export_preset_selector.cc',
110 'export_timespan_selector.cc',
115 'generic_pluginui.cc',
117 'global_port_matrix.cc',
119 'gtk-custom-hruler.c',
120 'gtk-custom-ruler.c',
121 'gtk_pianokeyboard.c',
122 'insert_time_dialog.cc',
123 'interthread_progress_window.cc',
134 'midi_automation_line.cc',
135 'midi_channel_selector.cc',
136 'midi_cut_buffer.cc',
137 'midi_list_editor.cc',
138 'midi_port_dialog.cc',
139 'midi_region_view.cc',
141 'midi_streamview.cc',
144 'missing_file_dialog.cc',
145 'missing_plugin_dialog.cc',
146 'mixer_group_tabs.cc',
149 'monitor_section.cc',
152 'normalize_dialog.cc',
159 'piano_roll_header.cc',
160 'playlist_selector.cc',
162 'plugin_selector.cc',
167 'port_matrix_body.cc',
168 'port_matrix_column_labels.cc',
169 'port_matrix_component.cc',
170 'port_matrix_grid.cc',
171 'port_matrix_labels.cc',
172 'port_matrix_row_labels.cc',
174 'progress_reporter.cc',
177 'quantize_dialog.cc',
178 'rc_option_editor.cc',
180 'region_gain_line.cc',
181 'region_layering_order_editor.cc',
182 'region_selection.cc',
186 'route_group_dialog.cc',
187 'route_group_menu.cc',
188 'route_params_ui.cc',
189 'route_processor_selection.cc',
190 'route_time_axis.cc',
192 'search_path_option.cc',
195 'session_import_dialog.cc',
196 'session_metadata_dialog.cc',
197 'session_option_editor.cc',
206 'strip_silence_dialog.cc',
207 'tape_region_view.cc',
212 'time_axis_view_item.cc',
215 'track_selection.cc',
216 'track_view_list.cc',
220 'volume_controller.cc',
225 def set_options(opt
):
226 autowaf
.set_options(opt
)
229 autowaf
.build_version_files(path_prefix
+'version.h', path_prefix
+'version.cc',
230 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
231 autowaf
.configure(conf
)
232 conf
.check_tool('compiler_cxx')
234 if re
.search ("linux", sys
.platform
) != None:
235 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
237 # TODO: Insert a sanity check for on OS X
238 # to ensure that CoreAudio is present....
239 # Really shouldn't these checks be in AutoWaf?
241 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC', atleast_version
='1.2.1')
242 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD', atleast_version
='2.10.1')
243 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK', atleast_version
='2.18')
244 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM', atleast_version
='2.18')
245 autowaf
.check_pkg(conf
, 'libgnomecanvas-2.0', uselib_store
='GNOMECANVAS', atleast_version
='2.0')
246 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6', uselib_store
='GNOMECANVASMM', atleast_version
='2.16')
247 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
249 conf
.check_tool('misc') # subst tool
251 conf
.write_config_header('gtk2ardour-config.h')
254 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
255 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
257 # Add a waf `feature' to allow compilation of things using winegcc
258 from TaskGen
import feature
260 def set_winegcc(self
):
261 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
262 self
.env
.CC
= 'winegcc'
265 # GTK front-end; if we're using VST we build this as a shared library, otherwise
266 # it's a normal executabale
267 if bld
.env
['VST_SUPPORT']:
268 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
270 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
273 obj
.source
= gtk2_ardour_sources
274 obj
.name
= 'gtk2_ardour'
275 if bld
.env
['VST_SUPPORT']:
276 obj
.target
= 'gtk2_ardour'
277 obj
.includes
+= ['../libs/fst']
279 obj
.target
= 'ardour-3.0'
280 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
281 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK GNOMECANVAS OGG ALSA CURL DL'
282 obj
.uselib
+= ' GTKMM GNOMECANVASMM '
283 obj
.uselib
+= ' AUDIOUNITS OSX GTKOSX '
284 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
285 libgtkmm2ext libtaglib'''
286 if sys
.platform
== 'darwin':
287 obj
.uselib_local
+ ' libappleutility'
288 obj
.cflags
= ['-DPACKAGE="gtk2_ardour"']
289 obj
.cxxflags
= ['-DPACKAGE="gtk2_ardour"']
290 obj
.cxxflags
+= ['-DVERSIONSTRING="' + bld
.env
['VERSION'] + '"']
291 obj
.cxxflags
+= ['-DDATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"']
292 obj
.cxxflags
+= ['-DCONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"']
293 obj
.cxxflags
+= ['-DMODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"']
294 obj
.cxxflags
+= ['-DLOCALEDIR="' + os
.path
.join(
295 os
.path
.normpath(bld
.env
['DATADIR']), 'locale') + '"']
296 obj
.cxxflags
+= ['-DPROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"']
297 obj
.cxxflags
+= ['-I../libs']
299 if bld
.env
['HAVE_SLV2']:
300 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
301 obj
.uselib
+= ' SLV2 '
303 if bld
.env
['FREESOUND']:
304 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
306 if bld
.env
['VST_SUPPORT']:
307 obj
.source
+= [ 'vst_pluginui.cc' ]
308 obj
.cxxflags
+= [ '-DVST_SUPPORT' ]
310 if bld
.env
['PHONE_HOME']:
311 obj
.cxxflags
+= [ '-DPHONE_HOME' ]
313 if bld
.env
['COREAUDIO']:
314 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
315 obj
.source
+= [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
316 obj
.uselib_local
+= ' libappleutility '
318 obj
.source
+= [ 'x11.cc' ]
320 if bld
.env
['VST_SUPPORT']:
321 # If we require VST support we build a stub main() and the FST library here using
322 # winegcc, and link it to the GTK front-end library
323 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
326 ../libs/fst/fstinfofile.c
331 obj
.includes
= '../libs/fst'
332 obj
.target
= 'ardour-3.0-vst'
333 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
334 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
336 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp libgtkmm2ext libtaglib gtk2_ardour'''
340 wrapper_subst_dict
= {
341 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
342 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
343 'LIBS' : 'build/default/libs',
345 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
348 obj
= bld
.new_task_gen('subst')
349 obj
.source
= 'ardev_common.sh.in'
350 obj
.target
= 'ardev_common_waf.sh'
352 obj
.dict = wrapper_subst_dict
354 obj
= bld
.new_task_gen('subst')
355 obj
.source
= 'ardour.sh.in'
356 obj
.target
= 'ardour3'
358 obj
.dict = wrapper_subst_dict
359 obj
.install_path
= bld
.env
['BINDIR']
368 if bld
.env
['IS_OSX']: # OS X fonts
369 basefont
= "Lucida Grande"
382 else: # Linux/X11 fonts
397 # Set up font substitution dictionary
398 for style
in ['', 'BOLD', 'ITALIC']:
399 for sizename
,points
in iter(font_sizes
.items()):
401 key
= "_".join (['FONT',style
,sizename
])
402 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
404 key
= "_".join (['FONT',sizename
])
405 fontstyle
= " ".join ([basefont
,points
])
407 font_subst_dict
[key
] = fontstyle
409 # add normal monospace to font dict
410 font_subst_dict
['FONT_MONOSPACE_NORMAL'] = 'monospace 10'
413 obj
= bld
.new_task_gen('subst')
414 obj
.source
= 'ardour3_ui_dark.rc.in'
415 obj
.target
= 'ardour3_ui_dark.rc'
416 obj
.dict = font_subst_dict
417 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
419 obj
= bld
.new_task_gen('subst')
420 obj
.source
= 'ardour3_ui_light.rc.in'
421 obj
.target
= 'ardour3_ui_light.rc'
422 obj
.dict = font_subst_dict
423 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
425 obj
= bld
.new_task_gen('subst')
426 obj
.source
= 'ardour3_ui_dark_sae.rc.in'
427 obj
.target
= 'ardour3_ui_dark_sae.rc'
428 obj
.dict = font_subst_dict
429 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
431 obj
= bld
.new_task_gen('subst')
432 obj
.source
= 'ardour3_ui_light_sae.rc.in'
433 obj
.target
= 'ardour3_ui_light_sae.rc'
434 obj
.dict = font_subst_dict
435 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
439 if bld
.env
['GTKOSX']:
440 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
442 menus_argv
= [ '-E', '-P' ]
443 obj
= bld
.new_task_gen('command-output')
445 obj
.command_is_external
= True
447 obj
.argv
= menus_argv
448 obj
.stdin
= 'ardour.menus.in'
449 obj
.stdout
= 'ardour.menus'
450 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'ardour.menus')
454 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad', 'ergonomic-us'
456 for b
in [ 'mnemonic-us' ] :
457 obj
= bld
.new_task_gen (
458 target
= b
+ '.bindings',
459 source
= b
+ '.bindings.in',
460 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
462 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
464 # not modified at present
465 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'step_editing.bindings')
468 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
469 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
470 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
472 # Default UI configuration
473 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
475 # Default export stuff
476 bld
.install_files('${CONFIGDIR}/ardour3/export', 'export/*.format')
479 if bld
.env
['ENABLE_NLS']:
480 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
482 lang
= os
.path
.basename (mo
).replace ('.mo', '')
483 bld
.install_as (os
.path
.join (bld
.env
['PREFIX'], 'share', 'locale', lang
, 'LC_MESSAGES', APPNAME
+ '.mo'), mo
)
486 autowaf
.build_i18n (bld
, srcdir
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)