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',
69 'edit_note_dialog.cc',
73 'editor_audio_import.cc',
74 'editor_audiotrack.cc',
76 'editor_canvas_events.cc',
77 'editor_component.cc',
80 'editor_route_groups.cc',
81 'editor_export_audio.cc',
82 'editor_group_tabs.cc',
85 'editor_locations.cc',
95 'editor_selection.cc',
96 'editor_snapshots.cc',
98 'editor_tempodisplay.cc',
102 'export_channel_selector.cc',
104 'export_file_notebook.cc',
105 'export_filename_selector.cc',
106 'export_format_dialog.cc',
107 'export_format_selector.cc',
108 'export_preset_selector.cc',
109 'export_timespan_selector.cc',
114 'generic_pluginui.cc',
116 'global_port_matrix.cc',
118 'gtk-custom-hruler.c',
119 'gtk-custom-ruler.c',
120 'gtk_pianokeyboard.c',
121 'insert_time_dialog.cc',
122 'interthread_progress_window.cc',
133 'midi_automation_line.cc',
134 'midi_channel_selector.cc',
135 'midi_cut_buffer.cc',
136 'midi_list_editor.cc',
137 'midi_port_dialog.cc',
138 'midi_region_view.cc',
140 'midi_streamview.cc',
143 'mixer_group_tabs.cc',
146 'monitor_section.cc',
153 'piano_roll_header.cc',
154 'playlist_selector.cc',
156 'plugin_selector.cc',
160 'port_matrix_body.cc',
161 'port_matrix_column_labels.cc',
162 'port_matrix_component.cc',
163 'port_matrix_grid.cc',
164 'port_matrix_labels.cc',
165 'port_matrix_row_labels.cc',
169 'quantize_dialog.cc',
170 'rc_option_editor.cc',
172 'region_gain_line.cc',
173 'region_selection.cc',
177 'route_group_dialog.cc',
178 'route_group_menu.cc',
179 'route_params_ui.cc',
180 'route_processor_selection.cc',
181 'route_time_axis.cc',
185 'session_import_dialog.cc',
186 'session_metadata_dialog.cc',
187 'session_option_editor.cc',
196 'strip_silence_dialog.cc',
197 'tape_region_view.cc',
202 'time_axis_view_item.cc',
205 'track_selection.cc',
206 'track_view_list.cc',
210 'volume_controller.cc',
214 def set_options(opt
):
215 autowaf
.set_options(opt
)
218 autowaf
.build_version_files(path_prefix
+'version.h', path_prefix
+'version.cc',
219 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
220 autowaf
.configure(conf
)
221 conf
.check_tool('compiler_cxx')
223 if re
.search ("linux", sys
.platform
) != None:
224 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
226 # TODO: Insert a sanity check for on OS X
227 # to ensure that CoreAudio is present....
228 # Really shouldn't these checks be in AutoWaf?
230 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC', atleast_version
='1.2.1')
231 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD', atleast_version
='2.10.1')
232 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK', atleast_version
='2.12.1')
233 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM', atleast_version
='2.8')
234 autowaf
.check_pkg(conf
, 'libgnomecanvas-2.0', uselib_store
='GNOMECANVAS', atleast_version
='2.0')
235 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6', uselib_store
='GNOMECANVASMM', atleast_version
='2.12.0')
236 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
238 conf
.check_tool('misc') # subst tool
240 conf
.write_config_header('gtk2ardour-config.h')
243 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
244 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
246 # Add a waf `feature' to allow compilation of things using winegcc
247 from TaskGen
import feature
249 def set_winegcc(self
):
250 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
251 self
.env
.CC
= 'winegcc'
254 # GTK front-end; if we're using VST we build this as a shared library, otherwise
255 # it's a normal executabale
256 if bld
.env
['VST_SUPPORT']:
257 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
259 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
262 obj
.source
= gtk2_ardour_sources
263 obj
.name
= 'gtk2_ardour'
264 if bld
.env
['VST_SUPPORT']:
265 obj
.target
= 'gtk2_ardour'
266 obj
.includes
+= ['../libs/fst']
268 obj
.target
= 'ardour-3.0'
269 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
270 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK GNOMECANVAS OGG ALSA CURL DL'
271 obj
.uselib
+= ' GTKMM GNOMECANVASMM OSX GTKOSX COREAUDIO'
272 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
273 libgtkmm2ext libtaglib'''
274 obj
.cflags
= ['-DPACKAGE="gtk2_ardour"']
275 obj
.cxxflags
= ['-DPACKAGE="gtk2_ardour"']
276 obj
.cxxflags
+= ['-DVERSIONSTRING="' + bld
.env
['VERSION'] + '"']
277 obj
.cxxflags
+= ['-DDATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"']
278 obj
.cxxflags
+= ['-DCONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"']
279 obj
.cxxflags
+= ['-DMODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"']
280 obj
.cxxflags
+= ['-DLOCALEDIR="' + os
.path
.join(
281 os
.path
.normpath(bld
.env
['DATADIR']), 'locale') + '"']
282 obj
.cxxflags
+= ['-DPROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"']
284 if bld
.env
['HAVE_SLV2']:
285 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
286 obj
.uselib
+= ' SLV2 '
288 if bld
.env
['FREESOUND']:
289 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
291 if bld
.env
['VST_SUPPORT']:
292 obj
.source
+= [ 'vst_pluginui.cc' ]
293 obj
.cxxflags
+= [ '-DVST_SUPPORT' ]
295 if bld
.env
['PHONE_HOME']:
296 obj
.cxxflags
+= [ '-DPHONE_HOME' ]
298 if bld
.env
['GTKOSX']:
299 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
300 obj
.source
+= [ 'cocoacarbon.mm' ]
302 if bld
.env
['AUDIOUNITS']:
303 obj
.source
+= [ 'au_pluginui.mm' ]
304 obj
.uselib_local
+= ' libappleutility '
307 obj
.source
+= [ 'x11.cc' ]
309 if bld
.env
['VST_SUPPORT']:
310 # If we require VST support we build a stub main() and the FST library here using
311 # winegcc, and link it to the GTK front-end library
312 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
315 ../libs/fst/fstinfofile.c
320 obj
.includes
= '../libs/fst'
321 obj
.target
= 'ardour-3.0-vst'
322 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
323 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
325 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp libgtkmm2ext libtaglib gtk2_ardour'''
329 wrapper_subst_dict
= {
330 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
331 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
332 'LIBS' : 'build/default/libs',
334 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
337 obj
= bld
.new_task_gen('subst')
338 obj
.source
= 'ardev_common.sh.in'
339 obj
.target
= 'ardev_common_waf.sh'
341 obj
.dict = wrapper_subst_dict
343 obj
= bld
.new_task_gen('subst')
344 obj
.source
= 'ardour.sh.in'
345 obj
.target
= 'ardour3'
347 obj
.dict = wrapper_subst_dict
348 obj
.install_path
= bld
.env
['BINDIR']
357 if bld
.env
['IS_OSX']: # OS X fonts
358 basefont
= "Lucida Grande"
371 else: # Linux/X11 fonts
386 # Set up font substitution dictionary
387 for style
in ['', 'BOLD', 'ITALIC']:
388 for sizename
,points
in font_sizes
.iteritems():
390 key
= "_".join (['FONT',style
,sizename
])
391 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
393 key
= "_".join (['FONT',sizename
])
394 fontstyle
= " ".join ([basefont
,points
])
396 font_subst_dict
[key
] = fontstyle
398 # add normal monospace to font dict
399 font_subst_dict
['FONT_MONOSPACE_NORMAL'] = 'monospace 10'
402 obj
= bld
.new_task_gen('subst')
403 obj
.source
= 'ardour3_ui_dark.rc.in'
404 obj
.target
= 'ardour3_ui_dark.rc'
405 obj
.dict = font_subst_dict
406 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
408 obj
= bld
.new_task_gen('subst')
409 obj
.source
= 'ardour3_ui_light.rc.in'
410 obj
.target
= 'ardour3_ui_light.rc'
411 obj
.dict = font_subst_dict
412 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
414 obj
= bld
.new_task_gen('subst')
415 obj
.source
= 'ardour3_ui_dark_sae.rc.in'
416 obj
.target
= 'ardour3_ui_dark_sae.rc'
417 obj
.dict = font_subst_dict
418 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
420 obj
= bld
.new_task_gen('subst')
421 obj
.source
= 'ardour3_ui_light_sae.rc.in'
422 obj
.target
= 'ardour3_ui_light_sae.rc'
423 obj
.dict = font_subst_dict
424 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
428 if bld
.env
['GTKOSX']:
429 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
431 menus_argv
= [ '-E', '-P' ]
432 obj
= bld
.new_task_gen('command-output')
434 obj
.command_is_external
= True
436 obj
.argv
= menus_argv
437 obj
.stdin
= 'ardour.menus.in'
438 obj
.stdout
= 'ardour.menus'
439 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'ardour.menus')
443 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad', 'ergonomic-us'
445 for b
in [ 'mnemonic-us' ] :
446 obj
= bld
.new_task_gen (
447 target
= b
+ '.bindings',
448 source
= b
+ '.bindings.in',
449 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
451 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
453 # not modified at present
454 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'step_editing.bindings')
457 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
458 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
459 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
461 # Default UI configuration
462 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
465 if bld
.env
['ENABLE_NLS']:
466 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
468 lang
= os
.path
.basename (mo
).replace ('.mo', '')
469 bld
.install_as (os
.path
.join (bld
.env
['PREFIX'], 'share', 'locale', lang
, 'LC_MESSAGES', APPNAME
+ '.mo'), mo
)
472 autowaf
.build_i18n (bld
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)