7 Import('env install_prefix final_prefix config_prefix libraries i18n ardour_version')
10 gtkmmtests = env.Copy()
13 # this defines the version number of the GTK interface to ardour
16 domain = 'gtk2_ardour'
18 gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
19 gtkardour.Append(CCFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
20 gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
21 gtkardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
22 gtkardour.Append(CPPPATH="#/") # for top level svn_revision.h
23 #gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
24 gtkardour.Append(PACKAGE=domain)
25 gtkardour.Append(POTFILE=domain + '.pot')
27 if gtkardour['IS_OSX']:
28 gtkardour.Append (LINKFLAGS="-Xlinker -headerpad -Xlinker 2048")
32 libraries['ardour_cp'],
42 libraries['gtkmm2ext'],
44 libraries['libgnomecanvas2'],
45 libraries['libgnomecanvasmm'],
50 libraries['samplerate'],
52 libraries['sndfile-ardour'],
55 libraries['vamphost'],
60 gtkmmtests.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
73 if gtkardour['DMALLOC']:
74 gtkardour.Merge([libraries['dmalloc']])
75 gtkardour.Append(CCFLAGS='-DUSE_DMALLOC')
77 if gtkardour['FFT_ANALYSIS']:
78 gtkardour.Merge ([libraries['fftw3f']])
79 gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
81 if gtkardour['RUBBERBAND']:
82 gtkardour.Merge ([ libraries['rubberband'] ])
84 gtkardour.Merge ([ libraries['soundtouch'] ])
86 skipped_files=Split("""
90 audiounit_files=Split("""
94 gtkosx_files=Split("""
102 gtkardour_files=Split("""
109 ardour_ui_dependents.cc
115 audio_region_editor.cc
119 automation_gain_line.cc
121 automation_pan_line.cc
122 automation_time_axis.cc
124 boolean_automation_line.cc
134 editor_audio_import.cc
137 editor_canvas_events.cc
140 editor_edit_groups.cc
141 editor_export_audio.cc
151 editor_region_list.cc
156 editor_selection_list.cc
157 editor_tempodisplay.cc
162 export_range_markers_dialog.cc
163 export_region_dialog.cc
164 export_session_dialog.cc
165 gain_automation_time_axis.cc
172 imageframe_socket_handler.cc
173 imageframe_time_axis.cc
174 imageframe_time_axis_group.cc
175 imageframe_time_axis_view.cc
185 marker_time_axis_view.cc
190 new_session_dialog.cc
193 pan_automation_time_axis.cc
202 redirect_automation_line.cc
203 redirect_automation_time_axis.cc
210 route_redirect_selection.cc
224 time_axis_view_item.cc
233 fft_analysis_files=Split("""
239 pixmap_files = glob.glob('pixmaps/*.xpm')
240 icon_files = glob.glob ('icons/*.png')
242 intl_files = gtkardour_files + glob.glob('*.h')
244 evtest_files=Split("""
248 mtest_files=Split("""
257 itest_files=Split("""
261 stest_files=Split("""
271 vst_files = [ 'vst_pluginui.cc' ]
274 extra_sources += vst_files
275 gtkardour.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
278 gtkardour.Append (CCFLAGS="-DHAVE_SLV2")
279 gtkardour.Merge ([libraries['slv2']])
282 if gtkardour['GTKOSX']:
283 extra_sources += gtkosx_files
284 gtkardour.Append (CCFLAGS="-DTOP_MENUBAR -DGTKOSX")
285 gtkardour.Append (LINKFLAGS=" -framework AppKit -framework CoreAudioKit")
287 if gtkardour['AUDIOUNITS']:
288 extra_sources += audiounit_files
289 gtkardour.Append(CCFLAGS='-DHAVE_AUDIOUNITS')
290 gtkardour.Merge([libraries['appleutility']])
293 extra_sources += x11_files
296 if env['FFT_ANALYSIS']:
297 extra_sources += fft_analysis_files
299 intl_files += extra_sources
301 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
302 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
304 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
306 gtkardour.Append(CXXFLAGS=versionflag)
308 executable = 'ardour-' + ardour_version
310 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
311 ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources)
313 evest = gtkmmtests.Program(target = 'evtest', source = evtest_files)
314 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
315 itest = gtkardour.Program(target = 'itest', source = itest_files)
316 rcu = gtkardour.Program(target = 'rcu', source = rcu_files)
317 tt = gtkmmtests.Program(target = 'tt', source = tt_files)
321 if gtkardour['IS_OSX']:
323 # OS X font rendering is different even with X11
338 basefont = "Lucida Grande"
342 # Linux/X11 font rendering
345 if gtkardour['OLDFONTS']:
374 for style in ['', 'BOLD', 'ITALIC']:
375 for sizename,points in font_sizes.iteritems():
377 key = "_".join (['FONT',style,sizename])
378 fontstyle = " ".join ([basefont,style.lower(),points])
380 key = "_".join (['FONT',sizename])
381 fontstyle = " ".join ([basefont,points])
383 key = '%' + key + '%'
384 my_font_dict[key] = fontstyle
386 ardour_dark_theme = env.SubstInFile ('ardour2_ui_dark.rc', 'ardour2_ui_dark.rc.in', SUBST_DICT = my_font_dict)
387 ardour_light_theme = env.SubstInFile ('ardour2_ui_light.rc', 'ardour2_ui_light.rc.in', SUBST_DICT = my_font_dict)
392 # null substitution just to avoid ardour.bindings being in svn
395 keybindings_dict = { }
397 if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']:
399 # Command(Meta), Alt(Mod1), Ctrl, Shift
400 # **** as of february 4th 2008, OUR VERSION OF *****
402 # NSCommand (aka "Command" aka "Apple" aka "Cauliflower") -> Meta
403 # NSAlternate (aka "Option") -> Mod1
405 keybindings_dict['%PRIMARY%'] = 'Meta'
406 keybindings_dict['%SECONDARY%'] = 'Mod1'
407 keybindings_dict['%TERTIARY%'] = 'Shift'
408 keybindings_dict['%LEVEL4%'] = 'Ctrl'
409 keybindings_dict['%WINDOW%'] = 'Mod1'
412 # Ctrl, Alt, Shift, Mod4(Super/Windows/Hyper)
414 keybindings_dict['%PRIMARY%'] = 'Ctrl'
415 keybindings_dict['%SECONDARY%'] = 'Alt'
416 keybindings_dict['%TERTIARY%'] = 'Shift'
417 keybindings_dict['%LEVEL4%'] = env['WINDOWS_KEY']
418 keybindings_dict['%WINDOW%'] = 'Alt'
420 for b in [ 'SAE-de', 'mnemonic-us', 'ergonomic-us' ]:
421 target_file = b + '.bindings'
422 src_file = target_file + '.in'
423 Default (env.SubstInFile (target_file, src_file, SUBST_DICT = keybindings_dict))
425 my_subst_dict['%INSTALL_PREFIX%'] = final_prefix
426 my_subst_dict['%LIBDIR%'] = env['LIBDIR']
427 my_subst_dict['%VERSION%'] = ardour_version
429 ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
430 env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))
432 ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT = my_subst_dict);
433 env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755))
437 Default(ardour_dark_theme)
438 Default(ardour_light_theme)
442 # the library - into the library dir
443 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardourlib))
447 Default (env.VersionedExecutable ('tagged_executable', ardour))
453 # the executable - into the library dir
454 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardour))
455 # the script - into the bin dir
456 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))
459 i18n (gtkardour, gtkardour_files+skipped_files+fft_analysis_files, env)
461 # configuration files
462 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_dark_theme))
463 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_light_theme))
464 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui_default.conf'))
465 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
466 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour-sae.menus'))
467 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ergonomic-us.bindings'))
468 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'mnemonic-us.bindings'))
469 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'SAE-de.bindings'))
471 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2'), 'splash.png'))
472 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'pixmaps'), pixmap_files))
473 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'icons'), icon_files))
475 env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))
478 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
480 'i18n.h', 'gettext.h',
482 'ardev_common.sh.in',
484 'ardour2_ui_dark.rc.in', 'ardour2_ui_light.rc.in', 'splash.png',
485 'ardour.menus', 'ardour-sae.menus',
486 'ardour.bindings.in',
487 'ardour-sae-ansi.bindings.in',
488 'ardour-sae-de.bindings.in',
489 'ardour2_ui_default.conf',
501 glob.glob('po/*.po') + glob.glob('*.h')))
503 # generate a prototype full-featured ardour_ui.rc file
505 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
506 grep set_name $SOURCES | \
507 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
508 grep -v '\\.' | sort | uniq | \
509 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
510 fg[NORMAL] = { 0, 0, 0 }\\n\
511 fg[ACTIVE] = { 0, 0, 0 }\\n\
512 fg[SELECTED] = { 0, 0, 0 }\\n\
513 bg[NORMAL] = { 0, 0, 0 }\\n\
514 bg[ACTIVE] = { 0, 0, 0 }\\n\
515 bg[SELECTED] = { 0, 0, 0 }\\n\
516 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
517 $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
518 grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
519 sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
521 awk '{ printf ("style \\"%s\\"\\n{\\n\
522 fg[NORMAL] = { 0, 0, 0 }\\n\
523 fg[ACTIVE] = { 0, 0, 0 }\\n\
524 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;