Waf: build UI/RC files, menu files, keybinding files, and fix paths in wrapper scripts.
authorDavid Robillard <d@drobilla.net>
Thu, 26 Feb 2009 04:41:09 +0000 (04:41 +0000)
committerDavid Robillard <d@drobilla.net>
Thu, 26 Feb 2009 04:41:09 +0000 (04:41 +0000)
Ardour should now build and run when built with waf from a clean svn checkout.

git-svn-id: svn://localhost/ardour2/branches/3.0@4676 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardev-common-waf.sh.in
gtk2_ardour/wscript
libs/ardour/filesystem_paths.cc

index 3a6e0e4dc90a302c37ea762d30d99684b303b3e8..70b37cd381847fd8c5acfcaeb192861f02763a90 100644 (file)
@@ -4,9 +4,9 @@ cd `dirname "$0"`/..
 
 libs=build/default/libs
 
-export ARDOUR_PATH=gtk2_ardour/icons:gtk2_ardour/pixmaps:gtk2_ardour:.
+export ARDOUR_PATH=gtk2_ardour/icons:gtk2_ardour/pixmaps:gtk2_ardour:build/default/gtk2_ardour:.
 export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate
-export ARDOUR_DATA_PATH=gtk2_ardour:.
+export ARDOUR_DATA_PATH=gtk2_ardour:build/default/gtk2_ardour:.
 if test -d $HOME/gtk/inst ; then
     echo USING NEW CLEARLOOKS
     export GTK_PATH=~/.ardour3:$libs/clearlooks-newer
index 438159876164301c2106e7d6e1ecffe500a5f97d..c98037f24f2f961fbe88eeb9d1de77910eff4883 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 import autowaf
 import os
+import glob
 
 # Version of this package (even if built as a child)
 MAJOR = '1'
@@ -44,6 +45,9 @@ def configure(conf):
        conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
        conf.write_config_header('wafconfig.h')
 
+       # TODO
+       conf.define('WINDOWS_KEY', 'Mod4')
+
        # Boost headers
        autowaf.check_header(conf, 'boost/shared_ptr.hpp')
        autowaf.check_header(conf, 'boost/weak_ptr.hpp')
@@ -255,6 +259,111 @@ def build(bld):
        obj.chmod  = 0755
        obj.dict   = wrapper_subst_dict
        
+       # Font configuration
+       
+       font_subst_dict = {}
+       font_sizes      = {}
+       base_font       = ""
+
+       # Set up font substitution dictionary
+       for style in ['', 'BOLD', 'ITALIC']:
+               for sizename,points in font_sizes.iteritems():
+                       if (len (style)):
+                               key = "_".join (['FONT',style,sizename])
+                               fontstyle = " ".join ([basefont,style.lower(),points])
+                       else:
+                               key = "_".join (['FONT',sizename])
+                               fontstyle = " ".join ([basefont,points])
+                       key = '%' + key + '%'
+                       font_subst_dict[key] = fontstyle
+
+       # Set up font sizes
+       if bld.env['IS_OSX']: # OS X fonts
+               basefont = "Lucida Grande"
+               font_sizes = {
+                       'TINY' : '7',
+                       'SMALLER' : '9',
+                       'SMALL' : '10',
+                       'NORMAL' : '11',
+                       'BIG' : '12',
+                       'BIGGER' : '14',
+                       'LARGE' : '18',
+                       'LARGER' : '28',
+                       'HUGER' : '36',
+                       'MASSIVE' : '60'
+               }
+       else: # Linux/X11 fonts
+               basefont = "sans"
+               font_sizes = {
+                       'TINY' : '6',
+                       'SMALLER' : '8',
+                       'SMALL' : '9',
+                       'NORMAL' : '10',
+                       'BIG' : '14',
+                       'BIGGER' : '16',
+                       'LARGE' : '18',
+                       'LARGER' : '24',
+                       'HUGER' : '34',
+                       'MASSIVE' : '60'
+               }
+
+       # RC files
+       
+       obj = bld.new_task_gen('subst')
+       obj.source = 'ardour3_ui_dark.rc.in'
+       obj.target = 'ardour3_ui_dark.rc'
+       obj.dict   = font_subst_dict
+       
+       obj = bld.new_task_gen('subst')
+       obj.source = 'ardour3_ui_light.rc.in'
+       obj.target = 'ardour3_ui_light.rc'
+       obj.dict   = font_subst_dict
+       
+       obj = bld.new_task_gen('subst')
+       obj.source = 'ardour3_ui_dark_sae.rc.in'
+       obj.target = 'ardour3_ui_dark_sae.rc'
+       obj.dict   = font_subst_dict
+       
+       obj = bld.new_task_gen('subst')
+       obj.source = 'ardour3_ui_light_sae.rc.in'
+       obj.target = 'ardour3_ui_light_sae.rc'
+       obj.dict   = font_subst_dict
+       
+       # Menus
+       menus_argv = []
+       if bld.env['GTKOSX']:
+               menus_argv = [ '-E', '-P', '-DGTKOSX', '-DTOP_MENUBAR', 'ardour.menus.in', 'ardour.menus' ]
+       else:
+               menus_argv = [ '-E', '-P', '../gtk2_ardour/ardour.menus.in' ]
+       obj = bld.new_task_gen('command-output')
+       obj.command = 'cpp'
+       obj.command_is_external = True
+       obj.no_inputs = True
+       obj.argv = menus_argv
+       obj.stdout = 'ardour.menus'
+
+       # Keybindings
+       keybindings_dict = {}
+       if bld.env['GTKOSX']:
+               keybindings_dict['%PRIMARY%']   = 'Meta'
+               keybindings_dict['%SECONDARY%'] = 'Mod1'
+               keybindings_dict['%TERTIARY%']  = 'Shift'
+               keybindings_dict['%LEVEL4%']    = 'Ctrl'
+               keybindings_dict['%WINDOW%']    = 'Mod1'
+       else:
+               keybindings_dict['%PRIMARY%']   = 'Ctrl'
+               keybindings_dict['%SECONDARY%'] = 'Alt'
+               keybindings_dict['%TERTIARY%']  = 'Shift'
+               keybindings_dict['%LEVEL4%']    = bld.env['WINDOWS_KEY']
+               keybindings_dict['%WINDOW%']    = 'Alt'
+       
+       for b in [ 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad', 'SAE-us-nokeypad',
+                  'mnemonic-us', 'ergonomic-us' ]:
+               obj = bld.new_task_gen('subst')
+               obj.target = b + '.bindings'
+               obj.source = obj.target + '.in'
+               obj.dict   = keybindings_dict
+
 def shutdown():
        autowaf.shutdown()
 
index a13b7fc45f32fc81206a8f28723109001e442476..bc2055c0dc7b21b306a2a460ea6f0bc3e1013e6f 100644 (file)
@@ -36,8 +36,7 @@ user_config_directory ()
 {
        const string home_dir = Glib::get_home_dir ();
 
-       if (home_dir.empty ())
-       {
+       if (home_dir.empty ()) {
                const string error_msg = "Unable to determine home directory";
 
                // log the error
@@ -71,13 +70,9 @@ SearchPath
 system_config_search_path ()
 {
 #ifdef WITH_STATIC_PATHS
-
        SearchPath config_path(string(CONFIG_DIR));
-
 #else
-
        SearchPath config_path(system_config_directories());
-
 #endif
 
        config_path.add_subdirectory_to_paths("ardour3");
@@ -89,13 +84,9 @@ SearchPath
 system_data_search_path ()
 {
 #ifdef WITH_STATIC_PATHS
-
        SearchPath data_path(string(DATA_DIR));
-
 #else
-
        SearchPath data_path(system_data_directories());
-
 #endif
 
        data_path.add_subdirectory_to_paths("ardour3");