9 from w18n
import build_i18n
11 # Version of this package (even if built as a child)
15 GTK2_ARDOUR_VERSION
= "%s.%s.%s" % (MAJOR
, MINOR
, MICRO
)
17 # Variables for 'waf dist'
18 APPNAME
= 'gtk2_ardour'
19 VERSION
= GTK2_ARDOUR_VERSION
25 path_prefix
= 'gtk2_ardour/'
27 gtk2_ardour_sources
= [
30 'add_midi_cc_track_dialog.cc',
31 'add_route_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-program-change.cc',
59 'canvas-simpleline.c',
60 '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',
82 'editor_hscroller.cc',
94 'editor_selection.cc',
95 'editor_selection_list.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',
129 'midi_channel_selector.cc',
130 'midi_cut_buffer.cc',
131 'midi_list_editor.cc',
132 'midi_port_dialog.cc',
133 'midi_region_view.cc',
135 'midi_streamview.cc',
137 'mixer_group_tabs.cc',
146 'piano_roll_header.cc',
147 'playlist_selector.cc',
149 'plugin_selector.cc',
153 'port_matrix_body.cc',
154 'port_matrix_column_labels.cc',
155 'port_matrix_component.cc',
156 'port_matrix_grid.cc',
157 'port_matrix_labels.cc',
158 'port_matrix_row_labels.cc',
162 'quantize_dialog.cc',
163 'rc_option_editor.cc',
164 'region_gain_line.cc',
165 'region_selection.cc',
169 'route_group_dialog.cc',
170 'route_group_menu.cc',
171 'route_params_ui.cc',
172 'route_processor_selection.cc',
173 'route_time_axis.cc',
177 'session_import_dialog.cc',
178 'session_metadata_dialog.cc',
179 'session_option_editor.cc',
186 'strip_silence_dialog.cc',
187 'tape_region_view.cc',
192 'time_axis_view_item.cc',
195 'track_selection.cc',
202 def set_options(opt
):
203 autowaf
.set_options(opt
)
206 autowaf
.build_version_files(path_prefix
+'version.h', path_prefix
+'version.cc',
207 'gtk2_ardour', MAJOR
, MINOR
, MICRO
)
208 autowaf
.configure(conf
)
209 conf
.check_tool('compiler_cxx')
211 if re
.search ("linux", sys
.platform
) != None:
212 autowaf
.check_pkg(conf
, 'alsa', uselib_store
='ALSA')
214 # TODO: Insert a sanity check for on OS X
215 # to ensure that CoreAudio is present....
216 # Really shouldn't these checks be in AutoWaf?
218 autowaf
.check_pkg(conf
, 'flac', uselib_store
='FLAC', atleast_version
='1.2.1')
219 autowaf
.check_pkg(conf
, 'gthread', uselib_store
='GTHREAD', atleast_version
='2.10.1')
220 autowaf
.check_pkg(conf
, 'gtk+-2.0', uselib_store
='GTK', atleast_version
='2.12.1')
221 autowaf
.check_pkg(conf
, 'gtkmm-2.4', uselib_store
='GTKMM', atleast_version
='2.8')
222 autowaf
.check_pkg(conf
, 'libgnomecanvas-2.0', uselib_store
='GNOMECANVAS', atleast_version
='2.0')
223 autowaf
.check_pkg(conf
, 'libgnomecanvasmm-2.6', uselib_store
='GNOMECANVASMM', atleast_version
='2.12.0')
224 autowaf
.check_pkg(conf
, 'ogg', uselib_store
='OGG', atleast_version
='1.1.2')
226 conf
.check_tool('misc') # subst tool
228 conf
.write_config_header('gtk2ardour-config.h')
231 autowaf
.check_header(conf
, 'boost/shared_ptr.hpp')
232 autowaf
.check_header(conf
, 'boost/weak_ptr.hpp')
236 obj
= bld
.new_task_gen(features
= 'cxx cc cprogram')
238 obj
.source
= gtk2_ardour_sources
239 obj
.name
= 'gtk2_ardour'
240 obj
.target
= 'ardour-3.0'
241 obj
.install_path
= os
.path
.join(bld
.env
['LIBDIR'], 'ardour3')
242 obj
.uselib
= 'UUID FLAC GLIBMM GTHREAD GTK GNOMECANVAS OGG ALSA'
243 obj
.uselib
+= ' GTKMM GNOMECANVASMM OSX GTKOSX COREAUDIO'
244 obj
.uselib_local
= '''libpbd libmidipp libtaglib libardour libardour_cp
245 libgtkmm2ext libtaglib'''
246 obj
.cflags
= ['-DPACKAGE="gtk2_ardour"']
247 obj
.cxxflags
= ['-DPACKAGE="gtk2_ardour"']
248 obj
.cxxflags
+= ['-DVERSIONSTRING="' + GTK2_ARDOUR_VERSION
+ '"']
249 obj
.cxxflags
+= ['-DDATA_DIR="' + os
.path
.normpath(bld
.env
['DATADIR']) + '"']
250 obj
.cxxflags
+= ['-DCONFIG_DIR="' + os
.path
.normpath(bld
.env
['CONFIGDIR']) + '"']
251 obj
.cxxflags
+= ['-DMODULE_DIR="' + os
.path
.normpath(bld
.env
['LIBDIR']) + '"']
252 obj
.cxxflags
+= ['-DLOCALEDIR="' + os
.path
.join(
253 os
.path
.normpath(bld
.env
['DATADIR']), 'locale') + '"']
255 if bld
.env
['HAVE_SLV2']:
256 obj
.source
+= [ 'lv2_plugin_ui.cc' ]
257 obj
.uselib
+= ' SLV2 '
259 if bld
.env
['FREESOUND']:
260 obj
.source
+= [ 'sfdb_freesound_mootcher.cc' ]
263 obj
.source
+= [ 'vst_pluginui.cc' ]
264 obj
.cxxflags
+= [ '-DVST_SUPPORT' ]
266 if bld
.env
['GTKOSX']:
267 TaskGen
.task_gen
.mappings
['.mm'] = TaskGen
.task_gen
.mappings
['.cc']
268 obj
.source
+= [ 'cocoacarbon.mm' ]
270 if bld
.env
['AUDIOUNITS']:
271 obj
.source
+= [ 'au_pluginui.mm' ]
272 obj
.uselib_local
+= ' libappleutility '
275 obj
.source
+= [ 'x11.cc' ]
279 wrapper_subst_dict
= {
280 'INSTALL_PREFIX' : bld
.env
['PREFIX'],
281 'LIBDIR' : os
.path
.normpath(bld
.env
['LIBDIRNAME']),
282 'LIBS' : 'build/default/libs',
284 'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
287 obj
= bld
.new_task_gen('subst')
288 obj
.source
= 'ardev_common.sh.in'
289 obj
.target
= 'ardev_common_waf.sh'
291 obj
.dict = wrapper_subst_dict
293 obj
= bld
.new_task_gen('subst')
294 obj
.source
= 'ardour.sh.in'
295 obj
.target
= 'ardour3'
297 obj
.dict = wrapper_subst_dict
298 obj
.install_path
= bld
.env
['BINDIR']
307 if bld
.env
['IS_OSX']: # OS X fonts
308 basefont
= "Lucida Grande"
321 else: # Linux/X11 fonts
336 # Set up font substitution dictionary
337 for style
in ['', 'BOLD', 'ITALIC']:
338 for sizename
,points
in font_sizes
.iteritems():
340 key
= "_".join (['FONT',style
,sizename
])
341 fontstyle
= " ".join ([basefont
,style
.lower(),points
])
343 key
= "_".join (['FONT',sizename
])
344 fontstyle
= " ".join ([basefont
,points
])
345 font_subst_dict
[key
] = fontstyle
348 obj
= bld
.new_task_gen('subst')
349 obj
.source
= 'ardour3_ui_dark.rc.in'
350 obj
.target
= 'ardour3_ui_dark.rc'
351 obj
.dict = font_subst_dict
352 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
354 obj
= bld
.new_task_gen('subst')
355 obj
.source
= 'ardour3_ui_light.rc.in'
356 obj
.target
= 'ardour3_ui_light.rc'
357 obj
.dict = font_subst_dict
358 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
360 obj
= bld
.new_task_gen('subst')
361 obj
.source
= 'ardour3_ui_dark_sae.rc.in'
362 obj
.target
= 'ardour3_ui_dark_sae.rc'
363 obj
.dict = font_subst_dict
364 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
366 obj
= bld
.new_task_gen('subst')
367 obj
.source
= 'ardour3_ui_light_sae.rc.in'
368 obj
.target
= 'ardour3_ui_light_sae.rc'
369 obj
.dict = font_subst_dict
370 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
374 if bld
.env
['GTKOSX']:
375 menus_argv
= [ '-E', '-P', '-DGTKOSX', '-DTOP_MENUBAR' ]
377 menus_argv
= [ '-E', '-P' ]
378 obj
= bld
.new_task_gen('command-output')
380 obj
.command_is_external
= True
382 obj
.argv
= menus_argv
383 obj
.stdin
= 'ardour.menus.in'
384 obj
.stdout
= 'ardour.menus'
385 bld
.install_files(os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3'), 'ardour.menus')
389 # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad', 'ergonomic-us'
391 for b
in [ 'mnemonic-us' ] :
392 obj
= bld
.new_task_gen (
393 target
= b
+ '.bindings',
394 source
= b
+ '.bindings.in',
395 rule
= '../tools/fmt-bindings --winkey=%s --accelmap <${SRC} >${TGT}' % bld
.env
['windows_key']
397 obj
.install_path
= os
.path
.join(bld
.env
['CONFIGDIR'], 'ardour3')
400 bld
.install_files('${DATADIR}/ardour3/icons', 'icons/*.png')
401 bld
.install_files('${DATADIR}/ardour3/pixmaps', 'pixmaps/*.xpm')
402 bld
.install_files('${DATADIR}/ardour3', 'splash.png')
404 # Default UI configuration
405 bld
.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
408 if bld
.env
['ENABLE_NLS']:
409 mo_files
= glob
.glob (os
.path
.join (bld
.get_curdir(), 'po/*.mo'))
411 lang
= os
.path
.basename (mo
).replace ('.mo', '')
412 bld
.install_as (os
.path
.join (bld
.env
['PREFIX'], 'share', 'locale', lang
, 'LC_MESSAGES', APPNAME
+ '.mo'), mo
)
415 build_i18n (bld
, 'gtk2_ardour', APPNAME
, gtk2_ardour_sources
)