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'],
37 libraries['freetype2'],
43 libraries['gtkmm2ext'],
45 libraries['libgnomecanvas2'],
46 libraries['libgnomecanvasmm'],
51 libraries['samplerate'],
53 libraries['sndfile-ardour'],
56 libraries['vamphost'],
61 gtkmmtests.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
74 if gtkardour['DMALLOC']:
75 gtkardour.Merge([libraries['dmalloc']])
76 gtkardour.Append(CCFLAGS='-DUSE_DMALLOC')
78 if gtkardour['FFT_ANALYSIS']:
79 gtkardour.Merge ([libraries['fftw3f']])
80 gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
82 if gtkardour['RUBBERBAND']:
83 gtkardour.Merge ([ libraries['rubberband'] ])
85 gtkardour.Merge ([ libraries['soundtouch'] ])
87 skipped_files=Split("""
91 audiounit_files=Split("""
95 gtkosx_files=Split("""
103 gtkardour_files=Split("""
110 ardour_ui_dependents.cc
116 audio_region_editor.cc
120 automation_gain_line.cc
122 automation_pan_line.cc
123 automation_time_axis.cc
125 boolean_automation_line.cc
135 editor_audio_import.cc
138 editor_canvas_events.cc
141 editor_edit_groups.cc
142 editor_export_audio.cc
152 editor_region_list.cc
157 editor_selection_list.cc
158 editor_tempodisplay.cc
163 export_range_markers_dialog.cc
164 export_region_dialog.cc
165 export_session_dialog.cc
166 gain_automation_time_axis.cc
173 imageframe_socket_handler.cc
174 imageframe_time_axis.cc
175 imageframe_time_axis_group.cc
176 imageframe_time_axis_view.cc
186 marker_time_axis_view.cc
191 new_session_dialog.cc
194 pan_automation_time_axis.cc
203 redirect_automation_line.cc
204 redirect_automation_time_axis.cc
211 route_redirect_selection.cc
225 time_axis_view_item.cc
234 fft_analysis_files=Split("""
240 pixmap_files = glob.glob('pixmaps/*.xpm')
241 icon_files = glob.glob ('icons/*.png')
243 intl_files = gtkardour_files + glob.glob('*.h')
245 evtest_files=Split("""
249 mtest_files=Split("""
258 itest_files=Split("""
262 stest_files=Split("""
272 vst_files = [ 'vst_pluginui.cc' ]
275 extra_sources += vst_files
276 gtkardour.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
279 gtkardour.Append (CCFLAGS="-DHAVE_SLV2")
280 gtkardour.Merge ([libraries['slv2']])
283 if gtkardour['GTKOSX']:
284 extra_sources += gtkosx_files
285 gtkardour.Append (CCFLAGS="-DTOP_MENUBAR -DGTKOSX")
286 gtkardour.Append (LINKFLAGS=" -framework AppKit -framework CoreAudioKit")
288 if gtkardour['AUDIOUNITS']:
289 extra_sources += audiounit_files
290 gtkardour.Append(CCFLAGS='-DHAVE_AUDIOUNITS')
291 gtkardour.Merge([libraries['appleutility']])
294 extra_sources += x11_files
297 if env['FFT_ANALYSIS']:
298 extra_sources += fft_analysis_files
300 intl_files += extra_sources
302 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
303 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
305 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
307 gtkardour.Append(CXXFLAGS=versionflag)
309 executable = 'ardour-' + ardour_version
311 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
312 ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources)
314 evest = gtkmmtests.Program(target = 'evtest', source = evtest_files)
315 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
316 itest = gtkardour.Program(target = 'itest', source = itest_files)
317 rcu = gtkardour.Program(target = 'rcu', source = rcu_files)
318 tt = gtkmmtests.Program(target = 'tt', source = tt_files)
322 if gtkardour['IS_OSX']:
324 # OS X font rendering is different even with X11
339 basefont = "Lucida Grande"
343 # Linux/X11 font rendering
346 if gtkardour['OLDFONTS']:
375 for style in ['', 'BOLD', 'ITALIC']:
376 for sizename,points in font_sizes.iteritems():
378 key = "_".join (['FONT',style,sizename])
379 fontstyle = " ".join ([basefont,style.lower(),points])
381 key = "_".join (['FONT',sizename])
382 fontstyle = " ".join ([basefont,points])
384 key = '%' + key + '%'
385 my_font_dict[key] = fontstyle
387 ardour_dark_theme = env.SubstInFile ('ardour2_ui_dark.rc', 'ardour2_ui_dark.rc.in', SUBST_DICT = my_font_dict)
388 ardour_light_theme = env.SubstInFile ('ardour2_ui_light.rc', 'ardour2_ui_light.rc.in', SUBST_DICT = my_font_dict)
393 # null substitution just to avoid ardour.bindings being in svn
396 keybindings_dict = { }
398 if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']:
400 # Command(Meta), Alt(Mod1), Ctrl, Shift
401 # **** as of february 4th 2008, OUR VERSION OF *****
403 # NSCommand (aka "Command" aka "Apple" aka "Cauliflower") -> Meta
404 # NSAlternate (aka "Option") -> Mod1
406 keybindings_dict['%PRIMARY%'] = 'Meta'
407 keybindings_dict['%SECONDARY%'] = 'Mod1'
408 keybindings_dict['%TERTIARY%'] = 'Shift'
409 keybindings_dict['%LEVEL4%'] = 'Ctrl'
410 keybindings_dict['%WINDOW%'] = 'Mod1'
413 # Ctrl, Alt, Shift, Mod4(Super/Windows/Hyper)
415 keybindings_dict['%PRIMARY%'] = 'Ctrl'
416 keybindings_dict['%SECONDARY%'] = 'Alt'
417 keybindings_dict['%TERTIARY%'] = 'Shift'
418 keybindings_dict['%LEVEL4%'] = env['WINDOWS_KEY']
419 keybindings_dict['%WINDOW%'] = 'Alt'
421 for b in [ 'SAE-de', 'mnemonic-us', 'ergonomic-us' ]:
422 target_file = b + '.bindings'
423 src_file = target_file + '.in'
424 Default (env.SubstInFile (target_file, src_file, SUBST_DICT = keybindings_dict))
426 my_subst_dict['%INSTALL_PREFIX%'] = final_prefix
427 my_subst_dict['%LIBDIR%'] = env['LIBDIR']
428 my_subst_dict['%VERSION%'] = ardour_version
430 ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
431 env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))
433 ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT = my_subst_dict);
434 env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755))
438 Default(ardour_dark_theme)
439 Default(ardour_light_theme)
443 # the library - into the library dir
444 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardourlib))
448 Default (env.VersionedExecutable ('tagged_executable', ardour))
454 # the executable - into the library dir
455 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardour))
456 # the script - into the bin dir
457 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))
460 i18n (gtkardour, gtkardour_files+skipped_files+fft_analysis_files, env)
462 # configuration files
463 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_dark_theme))
464 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_light_theme))
465 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui_default.conf'))
466 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
467 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour-sae.menus'))
468 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ergonomic-us.bindings'))
469 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'mnemonic-us.bindings'))
470 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'SAE-de.bindings'))
472 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2'), 'splash.png'))
473 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'pixmaps'), pixmap_files))
474 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'], []))
477 # This will install icons and MIME type as per freedesktop.org specs. #
478 if env['FREEDESKTOP']:
479 desktop_icon_install_prefix = install_prefix + '/share/icons/hicolor'
480 # Install the desktop icons to the default locations #
481 env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '16x16', 'apps', 'ardour2.png'), 'icons/ardour_icon_16px.png'))
482 env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '22x22', 'apps', 'ardour2.png'), 'icons/ardour_icon_22px.png'))
483 env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '32x32', 'apps', 'ardour2.png'), 'icons/ardour_icon_32px.png'))
484 env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '48x48', 'apps', 'ardour2.png'), 'icons/ardour_icon_48px.png'))
485 # Install the mime type xml file and its icon #
486 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'mime', 'packages'), 'ardour2.xml'))
487 env.Alias('install', env.Install(os.path.join(desktop_icon_install_prefix, '48x48', 'mimetypes'), 'icons/application-x-ardour2.png'))
488 env.Alias('install', env.Command (os.path.join(install_prefix, 'share', 'mime'), [], 'update-mime-database $TARGET'))
489 # Update the icon cache #
490 env.Alias('install', env.Command (desktop_icon_install_prefix, [], 'touch --no-create $TARGET'))
491 env.Alias('install', env.Command (desktop_icon_install_prefix, [], 'gtk-update-icon-cache $TARGET'))
492 # Make the ardour2.desktop file and install it #
493 env.Alias('install', env.Command ('ardour2.desktop', 'ardour2.desktop.in', 'cat $SOURCES > $TARGET'))
494 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'applications'), 'ardour2.desktop'))
495 env.Alias('install', env.Command (os.path.join(install_prefix, 'share', 'applications'), [], 'update-desktop-database $TARGET'))
496 # uninstall target.. needed to run update-mime-database and update-desktop-database after removal. #`
497 remove_desktop_files = env.Command ('another_frobnicatory_decoy', [],
498 [ Delete (install_prefix + '/share/mime/packages/ardour2.xml'),
499 Delete (install_prefix + '/share/applications/ardour2.desktop'),
500 Delete (desktop_icon_install_prefix + '/16x16/apps/ardour2.png'),
501 Delete (desktop_icon_install_prefix + '/22x22/apps/ardour2.png'),
502 Delete (desktop_icon_install_prefix + '/32x32/apps/ardour2.png'),
503 Delete (desktop_icon_install_prefix + '/48x48/apps/ardour2.png'),
504 Delete (desktop_icon_install_prefix + '/48x48/mimetypes/application-x-ardour2.png'),
505 Action ('update-mime-database ' + install_prefix + '/share/mime'),
506 Action ('gtk-update-icon-cache ' + desktop_icon_install_prefix),
507 Action ('update-desktop-database ' + install_prefix + '/share/applications')])
508 env.Alias('uninstall', remove_desktop_files)
511 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
513 'i18n.h', 'gettext.h',
515 'ardev_common.sh.in',
517 'ardour2_ui_dark.rc.in', 'ardour2_ui_light.rc.in', 'splash.png',
518 'ardour.menus', 'ardour-sae.menus',
519 'ardour.bindings.in',
520 'ardour-sae-ansi.bindings.in',
521 'ardour-sae-de.bindings.in',
522 'ardour2_ui_default.conf',
536 glob.glob('po/*.po') + glob.glob('*.h')))
538 # generate a prototype full-featured ardour_ui.rc file
540 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
541 grep set_name $SOURCES | \
542 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
543 grep -v '\\.' | sort | uniq | \
544 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
545 fg[NORMAL] = { 0, 0, 0 }\\n\
546 fg[ACTIVE] = { 0, 0, 0 }\\n\
547 fg[SELECTED] = { 0, 0, 0 }\\n\
548 bg[NORMAL] = { 0, 0, 0 }\\n\
549 bg[ACTIVE] = { 0, 0, 0 }\\n\
550 bg[SELECTED] = { 0, 0, 0 }\\n\
551 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
552 $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
553 grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
554 sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
556 awk '{ printf ("style \\"%s\\"\\n{\\n\
557 fg[NORMAL] = { 0, 0, 0 }\\n\
558 fg[ACTIVE] = { 0, 0, 0 }\\n\
559 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;