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',
72 'editor_audio_import.cc',
73 'editor_audiotrack.cc',
75 'editor_canvas_events.cc',
76 'editor_component.cc',
79 'editor_route_groups.cc',
80 'editor_export_audio.cc',
81 'editor_group_tabs.cc',
84 'editor_locations.cc',
94 'editor_selection.cc',
95 'editor_snapshots.cc',
97 'editor_tempodisplay.cc',
101 'export_channel_selector.cc',
103 'export_file_notebook.cc',
104 'export_filename_selector.cc',
105 'export_format_dialog.cc',
106 'export_format_selector.cc',
107 'export_preset_selector.cc',
108 'export_timespan_selector.cc',
113 'generic_pluginui.cc',
115 'global_port_matrix.cc',
117 'gtk-custom-hruler.c',
118 'gtk-custom-ruler.c',
119 'interthread_progress_window.cc',
130 'midi_automation_line.cc',
131 'midi_channel_selector.cc',
132 'midi_cut_buffer.cc',
133 'midi_list_editor.cc',
134 'midi_port_dialog.cc',
135 'midi_region_view.cc',
137 'midi_streamview.cc',
140 'mixer_group_tabs.cc',
143 'monitor_section.cc',
150 'piano_roll_header.cc',
151 'playlist_selector.cc',
153 'plugin_selector.cc',
157 'port_matrix_body.cc',
158 'port_matrix_column_labels.cc',
159 'port_matrix_component.cc',
160 'port_matrix_grid.cc',
161 'port_matrix_labels.cc',
162 'port_matrix_row_labels.cc',
166 'quantize_dialog.cc',
167 'rc_option_editor.cc',
169 'region_gain_line.cc',
170 'region_selection.cc',
174 'route_group_dialog.cc',
175 'route_group_menu.cc',
176 'route_params_ui.cc',
177 'route_processor_selection.cc',
178 'route_time_axis.cc',
182 'session_import_dialog.cc',
183 'session_metadata_dialog.cc',
184 'session_option_editor.cc',
191 'strip_silence_dialog.cc',
192 'tape_region_view.cc',
197 'time_axis_view_item.cc',
200 'track_selection.cc',
201 'track_view_list.cc',
205 'volume_controller.cc',
209 def set_options(opt
):
210 autowaf
.set_options(opt
)
213 autowaf
.build_version_files(path_prefix
+'version.h', path_prefix
+'version.cc',
214 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
215 autowaf
.configure(conf
)
216 conf
.check_tool('compiler_cxx')
218 if re
.search ("linux", sys
.platform
) != None:
219 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
221 # TODO: Insert a sanity check for on OS X
222 # to ensure that CoreAudio is present....
223 # Really shouldn't these checks be in AutoWaf?
225 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC', atleast_version
='1.2.1')
226 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD', atleast_version
='2.10.1')
227 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK', atleast_version
='2.12.1')
228 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM', atleast_version
='2.8')
229 autowaf
.check_pkg(conf
, 'libgnomecanvas-2.0', uselib_store
='GNOMECANVAS', atleast_version
='2.0')
230 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6', uselib_store
='GNOMECANVASMM', atleast_version
='2.12.0')
231 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
233 conf
.check_tool('misc') # subst tool
235 conf
.write_config_header('gtk2ardour-config.h')
238 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
239 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
241 # Add a waf `feature' to allow compilation of things using winegcc
242 from TaskGen
import feature
244 def set_winegcc(self
):
245 self
.env
.LINK_CXX
= self
.env
.LINK_CC
= 'wineg++'
246 self
.env
.CC
= 'winegcc'
249 # GTK front-end; if we're using VST we build this as a shared library, otherwise
250 # it's a normal executabale
251 if bld
.env
['VST_SUPPORT']:
252 obj
= bld
.new_task_gen(features
= 'cxx cc cshlib')
254 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
257 obj
.source
= gtk2_ardour_sources
258 obj
.name
= 'gtk2_ardour'
259 if bld
.env
['VST_SUPPORT']:
260 obj
.target
= 'gtk2_ardour'
261 obj
.includes
+= ['../libs/fst']
263 obj
.target
= 'ardour-3.0'
264 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
265 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK GNOMECANVAS OGG ALSA'
266 obj
.uselib
+= ' GTKMM GNOMECANVASMM OSX GTKOSX COREAUDIO'
267 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
268 libgtkmm2ext libtaglib'''
269 obj
.cflags
= ['-DPACKAGE="gtk2_ardour"']
270 obj
.cxxflags
= ['-DPACKAGE="gtk2_ardour"']
271 obj
.cxxflags
+= ['-DVERSIONSTRING="' + bld
.env
['VERSION'] + '"']
272 obj
.cxxflags
+= ['-DDATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"']
273 obj
.cxxflags
+= ['-DCONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"']
274 obj
.cxxflags
+= ['-DMODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"']
275 obj
.cxxflags
+= ['-DLOCALEDIR="' + os
.path
.join(
276 os
.path
.normpath(bld
.env
['DATADIR']), 'locale') + '"']
277 obj
.cxxflags
+= ['-DPROGRAM_NAME="' + bld
.env
['PROGRAM_NAME'] + '"']
279 if bld
.env
['HAVE_SLV2']:
280 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
281 obj
.uselib
+= ' SLV2 '
283 if bld
.env
['FREESOUND']:
284 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
286 if bld
.env
['VST_SUPPORT']:
287 obj
.source
+= [ 'vst_pluginui.cc' ]
288 obj
.cxxflags
+= [ '-DVST_SUPPORT' ]
290 if bld
.env
['GTKOSX']:
291 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
292 obj
.source
+= [ 'cocoacarbon.mm' ]
294 if bld
.env
['AUDIOUNITS']:
295 obj
.source
+= [ 'au_pluginui.mm' ]
296 obj
.uselib_local
+= ' libappleutility '
299 obj
.source
+= [ 'x11.cc' ]
301 if bld
.env
['VST_SUPPORT']:
302 # If we require VST support we build a stub main() and the FST library here using
303 # winegcc, and link it to the GTK front-end library
304 obj
= bld
.new_task_gen (features
= 'cxx cc cprogram wine')
307 ../libs/fst/fstinfofile.c
312 obj
.includes
= '../libs/fst'
313 obj
.target
= 'ardour-3.0-vst'
314 obj
.linkflags
= ['-mwindows', '-Wl,--export-dynamic']
315 obj
.defines
= ['_POSIX_SOURCE', 'USE_WS_PREFIX']
317 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp libgtkmm2ext libtaglib gtk2_ardour'''
321 wrapper_subst_dict
= {
322 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
323 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
324 'LIBS' : 'build/default/libs',
326 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
329 obj
= bld
.new_task_gen('subst')
330 obj
.source
= 'ardev_common.sh.in'
331 obj
.target
= 'ardev_common_waf.sh'
333 obj
.dict = wrapper_subst_dict
335 obj
= bld
.new_task_gen('subst')
336 obj
.source
= 'ardour.sh.in'
337 obj
.target
= 'ardour3'
339 obj
.dict = wrapper_subst_dict
340 obj
.install_path
= bld
.env
['BINDIR']
349 if bld
.env
['IS_OSX']: # OS X fonts
350 basefont
= "Lucida Grande"
363 else: # Linux/X11 fonts
378 # Set up font substitution dictionary
379 for style
in ['', 'BOLD', 'ITALIC']:
380 for sizename
,points
in font_sizes
.iteritems():
382 key
= "_".join (['FONT',style
,sizename
])
383 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
385 key
= "_".join (['FONT',sizename
])
386 fontstyle
= " ".join ([basefont
,points
])
388 font_subst_dict
[key
] = fontstyle
390 # add normal monospace to font dict
391 font_subst_dict
['FONT_MONOSPACE_NORMAL'] = 'monospace 10'
394 obj
= bld
.new_task_gen('subst')
395 obj
.source
= 'ardour3_ui_dark.rc.in'
396 obj
.target
= 'ardour3_ui_dark.rc'
397 obj
.dict = font_subst_dict
398 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
400 obj
= bld
.new_task_gen('subst')
401 obj
.source
= 'ardour3_ui_light.rc.in'
402 obj
.target
= 'ardour3_ui_light.rc'
403 obj
.dict = font_subst_dict
404 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
406 obj
= bld
.new_task_gen('subst')
407 obj
.source
= 'ardour3_ui_dark_sae.rc.in'
408 obj
.target
= 'ardour3_ui_dark_sae.rc'
409 obj
.dict = font_subst_dict
410 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
412 obj
= bld
.new_task_gen('subst')
413 obj
.source
= 'ardour3_ui_light_sae.rc.in'
414 obj
.target
= 'ardour3_ui_light_sae.rc'
415 obj
.dict = font_subst_dict
416 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
420 if bld
.env
['GTKOSX']:
421 menus_argv
= [ '-E', '-P', '-DGTKOSX' ]
423 menus_argv
= [ '-E', '-P' ]
424 obj
= bld
.new_task_gen('command-output')
426 obj
.command_is_external
= True
428 obj
.argv
= menus_argv
429 obj
.stdin
= 'ardour.menus.in'
430 obj
.stdout
= 'ardour.menus'
431 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'ardour.menus')
435 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad', 'ergonomic-us'
437 for b
in [ 'mnemonic-us' ] :
438 obj
= bld
.new_task_gen (
439 target
= b
+ '.bindings',
440 source
= b
+ '.bindings.in',
441 rule
= '../tools/fmt-bindings --winkey=%s --accelmap <${SRC} >${TGT}' % bld
.env
['windows_key']
443 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
446 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
447 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
448 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
450 # Default UI configuration
451 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
454 if bld
.env
['ENABLE_NLS']:
455 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
457 lang
= os
.path
.basename (mo
).replace ('.mo', '')
458 bld
.install_as (os
.path
.join (bld
.env
['PREFIX'], 'share', 'locale', lang
, 'LC_MESSAGES', APPNAME
+ '.mo'), mo
)
461 autowaf
.build_i18n (bld
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)