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 'mixer_group_tabs.cc',
148 'monitor_section.cc',
150 'normalize_dialog.cc',
157 'piano_roll_header.cc',
158 'playlist_selector.cc',
160 'plugin_selector.cc',
165 'port_matrix_body.cc',
166 'port_matrix_column_labels.cc',
167 'port_matrix_component.cc',
168 'port_matrix_grid.cc',
169 'port_matrix_labels.cc',
170 'port_matrix_row_labels.cc',
172 'progress_reporter.cc',
175 'quantize_dialog.cc',
176 'rc_option_editor.cc',
178 'region_gain_line.cc',
179 'region_layering_order_editor.cc',
180 'region_selection.cc',
184 'route_group_dialog.cc',
185 'route_group_menu.cc',
186 'route_params_ui.cc',
187 'route_processor_selection.cc',
188 'route_time_axis.cc',
190 'search_path_option.cc',
193 'session_import_dialog.cc',
194 'session_metadata_dialog.cc',
195 'session_option_editor.cc',
204 'strip_silence_dialog.cc',
205 'tape_region_view.cc',
210 'time_axis_view_item.cc',
213 'track_selection.cc',
214 'track_view_list.cc',
218 'volume_controller.cc',
223 def set_options(opt
):
224 autowaf
.set_options(opt
)
227 autowaf
.build_version_files(path_prefix
+'version.h', path_prefix
+'version.cc',
228 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
229 autowaf
.configure(conf
)
230 conf
.check_tool('compiler_cxx')
232 if re
.search ("linux", sys
.platform
) != None:
233 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
235 # TODO: Insert a sanity check for on OS X
236 # to ensure that CoreAudio is present....
237 # Really shouldn't these checks be in AutoWaf?
239 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC', atleast_version
='1.2.1')
240 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD', atleast_version
='2.10.1')
241 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK', atleast_version
='2.18')
242 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM', atleast_version
='2.18')
243 autowaf
.check_pkg(conf
, 'libgnomecanvas-2.0', uselib_store
='GNOMECANVAS', atleast_version
='2.0')
244 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6', uselib_store
='GNOMECANVASMM', atleast_version
='2.16')
245 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
247 conf
.check_tool('misc') # subst tool
249 conf
.write_config_header('gtk2ardour-config.h')
252 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
253 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
255 # Add a waf `feature' to allow compilation of things using winegcc
256 from TaskGen
import feature
258 def set_winegcc(self
):
259 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
260 self
.env
.CC
= 'winegcc'
263 # GTK front-end; if we're using VST we build this as a shared library, otherwise
264 # it's a normal executabale
265 if bld
.env
['VST_SUPPORT']:
266 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
268 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
271 obj
.source
= gtk2_ardour_sources
272 obj
.name
= 'gtk2_ardour'
273 if bld
.env
['VST_SUPPORT']:
274 obj
.target
= 'gtk2_ardour'
275 obj
.includes
+= ['../libs/fst']
277 obj
.target
= 'ardour-3.0'
278 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
279 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK GNOMECANVAS OGG ALSA CURL DL'
280 obj
.uselib
+= ' GTKMM GNOMECANVASMM OSX GTKOSX COREAUDIO'
281 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
282 libgtkmm2ext libtaglib'''
283 obj
.cflags
= ['-DPACKAGE="gtk2_ardour"']
284 obj
.cxxflags
= ['-DPACKAGE="gtk2_ardour"']
285 obj
.cxxflags
+= ['-DVERSIONSTRING="' + bld
.env
['VERSION'] + '"']
286 obj
.cxxflags
+= ['-DDATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"']
287 obj
.cxxflags
+= ['-DCONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"']
288 obj
.cxxflags
+= ['-DMODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"']
289 obj
.cxxflags
+= ['-DLOCALEDIR="' + os
.path
.join(
290 os
.path
.normpath(bld
.env
['DATADIR']), 'locale') + '"']
291 obj
.cxxflags
+= ['-DPROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"']
293 if bld
.env
['HAVE_SLV2']:
294 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
295 obj
.uselib
+= ' SLV2 '
297 if bld
.env
['FREESOUND']:
298 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
300 if bld
.env
['VST_SUPPORT']:
301 obj
.source
+= [ 'vst_pluginui.cc' ]
302 obj
.cxxflags
+= [ '-DVST_SUPPORT' ]
304 if bld
.env
['PHONE_HOME']:
305 obj
.cxxflags
+= [ '-DPHONE_HOME' ]
307 if bld
.env
['GTKOSX']:
308 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
309 obj
.source
+= [ 'cocoacarbon.mm' ]
311 if bld
.env
['AUDIOUNITS']:
312 obj
.source
+= [ 'au_pluginui.mm' ]
313 obj
.uselib_local
+= ' libappleutility '
316 obj
.source
+= [ 'x11.cc' ]
318 if bld
.env
['VST_SUPPORT']:
319 # If we require VST support we build a stub main() and the FST library here using
320 # winegcc, and link it to the GTK front-end library
321 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
324 ../libs/fst/fstinfofile.c
329 obj
.includes
= '../libs/fst'
330 obj
.target
= 'ardour-3.0-vst'
331 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
332 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
334 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp libgtkmm2ext libtaglib gtk2_ardour'''
338 wrapper_subst_dict
= {
339 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
340 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
341 'LIBS' : 'build/default/libs',
343 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
346 obj
= bld
.new_task_gen('subst')
347 obj
.source
= 'ardev_common.sh.in'
348 obj
.target
= 'ardev_common_waf.sh'
350 obj
.dict = wrapper_subst_dict
352 obj
= bld
.new_task_gen('subst')
353 obj
.source
= 'ardour.sh.in'
354 obj
.target
= 'ardour3'
356 obj
.dict = wrapper_subst_dict
357 obj
.install_path
= bld
.env
['BINDIR']
366 if bld
.env
['IS_OSX']: # OS X fonts
367 basefont
= "Lucida Grande"
380 else: # Linux/X11 fonts
395 # Set up font substitution dictionary
396 for style
in ['', 'BOLD', 'ITALIC']:
397 for sizename
,points
in iter(font_sizes
.items()):
399 key
= "_".join (['FONT',style
,sizename
])
400 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
402 key
= "_".join (['FONT',sizename
])
403 fontstyle
= " ".join ([basefont
,points
])
405 font_subst_dict
[key
] = fontstyle
407 # add normal monospace to font dict
408 font_subst_dict
['FONT_MONOSPACE_NORMAL'] = 'monospace 10'
411 obj
= bld
.new_task_gen('subst')
412 obj
.source
= 'ardour3_ui_dark.rc.in'
413 obj
.target
= 'ardour3_ui_dark.rc'
414 obj
.dict = font_subst_dict
415 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
417 obj
= bld
.new_task_gen('subst')
418 obj
.source
= 'ardour3_ui_light.rc.in'
419 obj
.target
= 'ardour3_ui_light.rc'
420 obj
.dict = font_subst_dict
421 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
423 obj
= bld
.new_task_gen('subst')
424 obj
.source
= 'ardour3_ui_dark_sae.rc.in'
425 obj
.target
= 'ardour3_ui_dark_sae.rc'
426 obj
.dict = font_subst_dict
427 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
429 obj
= bld
.new_task_gen('subst')
430 obj
.source
= 'ardour3_ui_light_sae.rc.in'
431 obj
.target
= 'ardour3_ui_light_sae.rc'
432 obj
.dict = font_subst_dict
433 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
437 if bld
.env
['GTKOSX']:
438 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
440 menus_argv
= [ '-E', '-P' ]
441 obj
= bld
.new_task_gen('command-output')
443 obj
.command_is_external
= True
445 obj
.argv
= menus_argv
446 obj
.stdin
= 'ardour.menus.in'
447 obj
.stdout
= 'ardour.menus'
448 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'ardour.menus')
452 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad', 'ergonomic-us'
454 for b
in [ 'mnemonic-us' ] :
455 obj
= bld
.new_task_gen (
456 target
= b
+ '.bindings',
457 source
= b
+ '.bindings.in',
458 rule
= '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld
.env
['WINDOWS_KEY']
460 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
462 # not modified at present
463 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'step_editing.bindings')
466 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
467 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
468 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
470 # Default UI configuration
471 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
474 if bld
.env
['ENABLE_NLS']:
475 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
477 lang
= os
.path
.basename (mo
).replace ('.mo', '')
478 bld
.install_as (os
.path
.join (bld
.env
['PREFIX'], 'share', 'locale', lang
, 'LC_MESSAGES', APPNAME
+ '.mo'), mo
)
481 autowaf
.build_i18n (bld
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)