major rationalization of use of search paths. ardour now has just 4 functions used...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 18 May 2012 17:24:06 +0000 (17:24 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 18 May 2012 17:24:06 +0000 (17:24 +0000)
This commit re-enabes ./waf install, and it is believed that it works fully at this point (more testing likely required)

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

33 files changed:
gtk2_ardour/about.cc
gtk2_ardour/actions.cc
gtk2_ardour/ardev_common.sh.in
gtk2_ardour/ardour.sh.in
gtk2_ardour/editor_actions.cc
gtk2_ardour/keyboard.cc
gtk2_ardour/mixer_actor.cc
gtk2_ardour/splash.cc
gtk2_ardour/step_entry.cc
gtk2_ardour/theme_manager.cc
gtk2_ardour/ui_config.cc
gtk2_ardour/utils.cc
gtk2_ardour/wscript
libs/ardour/ardour/filesystem_paths.h
libs/ardour/control_protocol_manager.cc
libs/ardour/control_protocol_search_path.cc
libs/ardour/filesystem_paths.cc
libs/ardour/globals.cc
libs/ardour/midi_patch_search_path.cc
libs/ardour/panner_search_path.cc
libs/ardour/rc_configuration.cc
libs/ardour/template_utils.cc
libs/ardour/wscript
libs/pbd/filesystem_paths.cc [deleted file]
libs/pbd/pbd/filesystem_paths.h [deleted file]
libs/pbd/wscript
libs/surfaces/generic_midi/generic_midi_control_protocol.cc
libs/surfaces/mackie/device_info.cc
libs/surfaces/mackie/device_profile.cc
libs/surfaces/osc/osc.cc
mcp/wscript [new file with mode: 0644]
tools/linux_packaging/ardour.sh.in
wscript

index a66a4a2f691da76a8d9f84f014a23c34b1ff516c..5ecc075c30d15789798db33bb6ed5819b4ae512c 100644 (file)
@@ -559,7 +559,7 @@ About::About ()
 
        sys::path splash_file;
 
-       SearchPath spath(ardour_search_path() + system_data_search_path());
+       SearchPath spath(ardour_data_search_path());
 
        if (find_file_in_search_path (spath, "splash.png", splash_file)) {
                set_logo (Gdk::Pixbuf::create_from_file (splash_file.to_string()));
index e9252bcbffc0e567614cdaff72cc5a606cb1a926..a1bdcdb36e391f1fd8d184d516d9071ce07437c1 100644 (file)
@@ -72,9 +72,7 @@ ActionManager::init ()
 
        ui_manager = UIManager::create ();
 
-       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
-
-       find_file_in_search_path (spath, "ardour.menus", ui_file);
+       find_file_in_search_path (ardour_config_search_path(), "ardour.menus", ui_file);
 
        bool loaded = false;
 
index d8bdeb430d7c76f8093b110cdb62b6c16f909c6d..0b0fc1b7dcb1cc5fa94bc618f983d32b6cee1c09 100644 (file)
@@ -4,6 +4,13 @@ TOP=`dirname "$0"`/..
 
 libs=$TOP/@LIBS@
 
+#
+# when running ardev, the various parts of Ardour have not been consolidated into the locations that they 
+# would normally end up after an install. We therefore need to set up environment variables so that we
+# can find all the components. 
+#
+
+
 export ARDOUR_PATH=$TOP/gtk2_ardour/icons:$TOP/gtk2_ardour/pixmaps:$TOP/build/gtk2_ardour:$TOP/gtk2_ardour:.
 export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
 export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
@@ -11,6 +18,14 @@ export ARDOUR_DATA_PATH=$TOP/gtk2_ardour:build/gtk2_ardour:.
 export ARDOUR_MIDIMAPS_PATH=$TOP/midi_maps:.
 export ARDOUR_MCP_PATH=$TOP/mcp:.
 
+#
+# even though we set the above variables, ardour requires that these 
+# two also be set. the above settings will override them.
+#
+
+export ARDOUR_CONFIG_PATH=$TOP:$TOP/gtk2_ardour:../build:../build/gtk2_ardour
+export ARDOUR_DLL_PATH=$libs
+
 if test -d $HOME/gtk/inst ; then
     export GTK_PATH=~/.ardour3:$libs/clearlooks-newer
 else
index d7297fd77cd91d891beeed4e3a2373161174dcd4..45fdb6f55e2dcd1dec31a9d1074bc0e50a880fba 100644 (file)
@@ -1,10 +1,13 @@
 #!/bin/sh
 
-export GTK_PATH=@LIBDIR@/ardour3${GTK_PATH:+:$GTK_PATH}
+#
+# This script runs an installed version of Ardour. It sets a few environment variables
+# and does a few checks before exec'ing the real executable.
+# 
+
+export GTK_PATH=@SYSCONFDIR@/ardour3${GTK_PATH:+:$GTK_PATH}
 
 export LD_LIBRARY_PATH=@LIBDIR@/ardour3${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
-# DYLD_LIBRARY_PATH is for Darwin
-export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
 
 ## Memlock check
 
@@ -36,6 +39,14 @@ elif [ $(nm -D --radix=dec --defined-only -S $GLIB | grep -w g_atomic_int_add |
        echo ""
 fi
 
+#
+# Running Ardour requires these 3 variables to be set
+#
+
+export ARDOUR_DATA_PATH=@DATADIR@/ardour3
+export ARDOUR_CONFIG_PATH=@SYSCONFDIR@/ardour3
+export ARDOUR_DLL_PATH=@LIBDIR@/ardour3
+
 exec @LIBDIR@/ardour3/ardour-@VERSION@ "$@"
 
 
index ac7af6494ab9566e4422694e97d62d96a53a4a12..e544f7d8c3fb48e350dab1fbce3d64ed957e6d89 100644 (file)
@@ -643,13 +643,12 @@ Editor::load_bindings ()
         key_bindings.set_action_map (editor_action_map);
 
        sys::path binding_file;
-       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
 
-       if (find_file_in_search_path (spath, "editor.bindings", binding_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "editor.bindings", binding_file)) {
                 key_bindings.load (binding_file.to_string());
                info << string_compose (_("Loaded editor bindings from %1"), binding_file.to_string()) << endmsg;
         } else {
-               error << string_compose (_("Could not find editor.bindings in search path %1"), spath.to_string()) << endmsg;
+               error << string_compose (_("Could not find editor.bindings in search path %1"), ardour_config_search_path().to_string()) << endmsg;
        }
 }
 
index 41e6a088145676a0d906dc8deca313e47b090320..2fbd5812adec7e371152af240668236e9d5b25bc 100644 (file)
@@ -126,9 +126,7 @@ ArdourKeyboard::setup_keybindings ()
                        /* not absolute - look in the usual places */
                        sys::path keybindings_file;
 
-                       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
-
-                       if ( ! find_file_in_search_path (spath, keybindings_path, keybindings_file)) {
+                       if ( ! find_file_in_search_path (ardour_config_search_path(), keybindings_path, keybindings_file)) {
 
                                if (keybindings_path == default_bindings) {
                                        error << string_compose (_("Default keybindings not found - %1 will be hard to use!"), PROGRAM_NAME) << endmsg;
index b309b9fd7f7d58fa44c9f3575747a17dcd188e10..437da39babeab9cf6db98b30a6cdac1498c61140 100644 (file)
@@ -83,13 +83,12 @@ MixerActor::load_bindings ()
         bindings.set_action_map (myactions);
 
        sys::path binding_file;
-       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
 
-       if (find_file_in_search_path (spath, "mixer.bindings", binding_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "mixer.bindings", binding_file)) {
                 bindings.load (binding_file.to_string());
                info << string_compose (_("Loaded mixer bindings from %1"), binding_file.to_string()) << endmsg;
         } else {
-               error << string_compose (_("Could not find mixer.bindings in search path %1"), spath.to_string()) << endmsg;
+               error << string_compose (_("Could not find mixer.bindings in search path %1"), ardour_config_search_path().to_string()) << endmsg;
        }
 }
 
index 8d6e84bae2323b73b964deed51c5b6773ea5a812..f91ae89e697a625a45673c801d7a912e9e1de218 100644 (file)
@@ -22,7 +22,7 @@ Splash::Splash ()
 {
        sys::path splash_file;
 
-       if (!find_file_in_search_path (ardour_search_path() + system_data_search_path(), "splash.png", splash_file)) {
+       if (!find_file_in_search_path (ardour_data_search_path(), "splash.png", splash_file)) {
                throw failed_constructor();
        }
 
index 61bdeacae0af683d1ee322cc4e775a0381c4a11f..8e8bd3a3fadae62bae2a33addeaa922d89850673 100644 (file)
@@ -709,9 +709,8 @@ StepEntry::load_bindings ()
         bindings.set_action_map (myactions);
 
        sys::path binding_file;
-       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
 
-       if (find_file_in_search_path (spath, "step_editing.bindings", binding_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "step_editing.bindings", binding_file)) {
                 bindings.load (binding_file.to_string());
         }
 }
index 887ca5453c0b9c980ede46d5e0c79bb4979348af..a3ee38e629eb8c9818f771a88311c96051ece5a2 100644 (file)
@@ -202,13 +202,9 @@ load_rc_file (const string& filename, bool themechange)
 {
        sys::path rc_file_path;
 
-       SearchPath spath (ardour_search_path());
-       spath += user_config_directory();
-       spath += system_config_search_path();
-
-       if (!find_file_in_search_path (spath, filename, rc_file_path)) {
+       if (!find_file_in_search_path (ardour_config_search_path(), filename, rc_file_path)) {
                warning << string_compose (_("Unable to find UI style file %1 in search path %2. %3 will look strange"),
-                                           filename, spath.to_string(), PROGRAM_NAME)
+                                           filename, ardour_config_search_path().to_string(), PROGRAM_NAME)
                                << endmsg;
                return;
        }
index 17ba896f1f92f938a8c0e5ed323e368dd212eec6..0d41ade0a591be3fffcb06bb90b6986113845105 100644 (file)
@@ -75,8 +75,7 @@ UIConfiguration::load_defaults ()
                rcfile = "ardour3_ui_default.conf";
        }
 
-       if (find_file_in_search_path (ardour_search_path() + system_config_search_path(),
-                                     rcfile, default_ui_rc_file) ) {
+       if (find_file_in_search_path (ardour_config_search_path(), rcfile, default_ui_rc_file) ) {
                XMLTree tree;
                found = 1;
 
@@ -107,8 +106,7 @@ UIConfiguration::load_state ()
 
        sys::path default_ui_rc_file;
 
-       if ( find_file_in_search_path (ardour_search_path() + system_config_search_path(),
-                       "ardour3_ui_default.conf", default_ui_rc_file) ) {
+       if ( find_file_in_search_path (ardour_config_search_path(), "ardour3_ui_default.conf", default_ui_rc_file)) {
                XMLTree tree;
                found = true;
 
@@ -129,8 +127,7 @@ UIConfiguration::load_state ()
 
        sys::path user_ui_rc_file;
 
-       if (find_file_in_search_path (ardour_search_path() + user_config_directory(),
-                       "ardour3_ui.conf", user_ui_rc_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "ardour3_ui.conf", user_ui_rc_file)) {
                XMLTree tree;
                found = true;
 
index d061fce35f3963bbd6dbbcdd0e37312a97cb00ef..988bd370ae7a3618391e2cd0092bfb9342fda65e 100644 (file)
@@ -494,8 +494,7 @@ get_xpm (std::string name)
 {
        if (!xpm_map[name]) {
 
-               SearchPath spath(ARDOUR::ardour_search_path());
-               spath += ARDOUR::system_data_search_path();
+               SearchPath spath(ARDOUR::ardour_data_search_path());
 
                spath.add_subdirectory_to_paths("pixmaps");
 
@@ -521,15 +520,14 @@ get_icon_path (const char* cname)
        string name = cname;
        name += X_(".png");
 
-       SearchPath spath(ARDOUR::ardour_search_path());
-       spath += ARDOUR::system_data_search_path();
+       SearchPath spath(ARDOUR::ardour_data_search_path());
 
        spath.add_subdirectory_to_paths("icons");
 
        sys::path data_file_path;
 
        if (!find_file_in_search_path (spath, name, data_file_path)) {
-               fatal << string_compose (_("cannot find icon image for %1"), name) << endmsg;
+               fatal << string_compose (_("cannot find icon image for %1 using %2"), name, spath.to_string()) << endmsg;
        }
 
        return data_file_path.to_string();
index 338a585dca333a0456643215610b0020625a9ba3..e1fccbd328d41d4f6754328800feb396c96defd2 100644 (file)
@@ -405,9 +405,7 @@ def build(bld):
         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
-        'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
-        'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']),
-                                     'locale') + '"',
+        'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
         ]
     obj.includes += ['../libs']
@@ -449,6 +447,8 @@ def build(bld):
     wrapper_subst_dict = {
             'INSTALL_PREFIX' : bld.env['PREFIX'],
             'LIBDIR'         : os.path.normpath(bld.env['LIBDIR']),
+            'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
+            'SYSCONFDIR'     : os.path.normpath(bld.env['SYSCONFDIR']),
             'LIBS'           : 'build/libs',
             'VERSION'        : '3.0',
             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-3.0'
@@ -644,8 +644,6 @@ def build(bld):
 
     # Default UI configuration
     bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_ui_default.conf')
-    # Generic widget style mappings
-    bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_widgets.rc')
 
     # Default export stuff
     bld.install_files('${SYSCONFDIR}/ardour3/export', bld.path.ant_glob('export/*.format'))
index e183193cb0832e38869f3dc325db065d81765a0c..120ae25f97474246395fdaf4ee90b3773d32da3d 100644 (file)
@@ -35,13 +35,20 @@ namespace ARDOUR {
         * @return the path to the directory that contains the system wide ardour
         * modules.
         */
-       PBD::sys::path ardour_module_directory ();
+       PBD::sys::path ardour_dll_directory ();
 
-       PBD::SearchPath ardour_search_path ();
-
-       PBD::SearchPath system_config_search_path ();
+       /**
+        * @return the search path to be used when looking for per-system
+        * configuration files. This may include user configuration files.
+        */
+       PBD::SearchPath ardour_config_search_path ();
 
-       PBD::SearchPath system_data_search_path ();
+       /**
+        * @return the search path to be used when looking for data files
+        * that could be shared by systems (h/w and configuration independent
+        * files, such as icons, XML files, etc)
+        */
+       PBD::SearchPath ardour_data_search_path ();
 
 } // namespace ARDOUR
 
index 59001dce144f95c5b4be0fe7d9787cedf5503d36..2931fe46e5ef3118ede67855c1e8e81eb495fb99 100644 (file)
@@ -210,7 +210,7 @@ ControlProtocolManager::discover_control_protocols ()
                                            dylib_extension_pattern, cp_modules);
 
        DEBUG_TRACE (DEBUG::ControlProtocols, 
-                    string_compose (_("looking for control protocols in %1"), control_protocol_search_path().to_string()));
+                    string_compose (_("looking for control protocols in %1\n"), control_protocol_search_path().to_string()));
        
        for (vector<sys::path>::iterator i = cp_modules.begin(); i != cp_modules.end(); ++i) {
                control_protocol_discover ((*i).to_string());
@@ -222,12 +222,14 @@ ControlProtocolManager::control_protocol_discover (string path)
 {
        ControlProtocolDescriptor* descriptor;
 
-       /* don't load shared objects that are just symlinks to the real thing.
+#ifdef __APPLE__
+       /* don't load OS X shared objects that are just symlinks to the real thing.
         */
 
-       if (Glib::file_test (path, Glib::FILE_TEST_IS_SYMLINK)) {
+       if (path.find (".dylib") && Glib::file_test (path, Glib::FILE_TEST_IS_SYMLINK)) {
                return 0;
        }
+#endif
 
        if ((descriptor = get_descriptor (path)) != 0) {
 
index 345989277bef662f571b17585dca960fe5d15efb..157531cbf251eba7e398e9f76a4f450e570ba5f7 100644 (file)
@@ -17,6 +17,8 @@
 
 */
 
+#include <iostream>
+
 #include <glibmm/miscutils.h>
 
 #include "ardour/control_protocol_search_path.h"
@@ -36,7 +38,7 @@ control_protocol_search_path ()
 {
        SearchPath spath (user_config_directory ());
 
-       spath += ardour_module_directory ();
+       spath += ardour_dll_directory ();
        spath.add_subdirectory_to_paths (surfaces_dir_name);
 
        bool surfaces_path_defined = false;
index 2d144947645604c65d6afb0f020d3972546307cd..bc84243c842796cb90108c5fb5ae14f20f2a51b1 100644 (file)
 
 */
 #include <cstdlib>
+#include <iostream>
 
 #include "pbd/error.h"
 #include "pbd/compose.h"
-#include "pbd/filesystem_paths.h"
+#include "pbd/strsplit.h"
 
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
@@ -90,38 +91,72 @@ user_config_directory ()
 }
 
 sys::path
-ardour_module_directory ()
+ardour_dll_directory ()
 {
-       sys::path module_directory(MODULE_DIR);
-       module_directory /= "ardour3";
-       return module_directory;
+       std::string s = Glib::getenv("ARDOUR_DLL_PATH");
+       if (s.empty()) {
+               std::cerr << _("ARDOUR_CONFIG_PATH not set in environment - exiting\n");
+               ::exit (1);
+       }       
+       return sys::path (s);
 }
 
 SearchPath
-ardour_search_path ()
+ardour_config_search_path ()
 {
-       SearchPath spath_env(Glib::getenv("ARDOUR_PATH"));
-       return spath_env;
-}
-
-SearchPath
-system_config_search_path ()
-{
-       SearchPath config_path(system_config_directories());
-
-       config_path.add_subdirectory_to_paths("ardour3");
+       static bool have_path = false;
+       static SearchPath search_path;
+
+       if (!have_path) {
+               SearchPath sp (user_config_directory());
+               
+               std::string s = Glib::getenv("ARDOUR_CONFIG_PATH");
+               if (s.empty()) {
+                       std::cerr << _("ARDOUR_CONFIG_PATH not set in environment - exiting\n");
+                       ::exit (1);
+               }
+               
+               std::vector<string> ss;
+               split (s, ss, ':');
+               for (std::vector<string>::iterator i = ss.begin(); i != ss.end(); ++i) {
+                       sp += sys::path (*i);
+               }
+               
+               search_path = sp;
+               have_path = true;
+               std::cerr << "CONFIG PATH: " << search_path.to_string() << std::endl;
+       }
 
-       return config_path;
+       return search_path;
 }
 
 SearchPath
-system_data_search_path ()
+ardour_data_search_path ()
 {
-       SearchPath data_path(system_data_directories());
-
-       data_path.add_subdirectory_to_paths("ardour3");
+       static bool have_path = false;
+       static SearchPath search_path;
+
+       if (!have_path) {
+               SearchPath sp (user_config_directory());
+               
+               std::string s = Glib::getenv("ARDOUR_DATA_PATH");
+               if (s.empty()) {
+                       std::cerr << _("ARDOUR_DATA_PATH not set in environment - exiting\n");
+                       ::exit (1);
+               }
+               
+               std::vector<string> ss;
+               split (s, ss, ':');
+               for (std::vector<string>::iterator i = ss.begin(); i != ss.end(); ++i) {
+                       sp += sys::path (*i);
+               }
+               
+               search_path = sp;
+               have_path = true;
+               std::cerr << "DATA PATH: " << search_path.to_string() << std::endl;
+       }
 
-       return data_path;
+       return search_path;
 }
 
 } // namespace ARDOUR
index 96d93ea5bc15f78fd22bd63b28de1a0e76e48ea0..c6aa660115e7695ceaa1fc2b27feb631554b8b7e 100644 (file)
@@ -319,14 +319,9 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization)
 
        /* Make VAMP look in our library ahead of anything else */
 
-       char *p = getenv ("VAMP_PATH");
-       string vamppath = VAMP_DIR;
-       if (p) {
-               vamppath += ':';
-               vamppath += p;
-       }
-       setenv ("VAMP_PATH", vamppath.c_str(), 1);
-
+       SearchPath sp (ardour_dll_directory());
+       sp.add_subdirectory_to_paths ("vamp");
+       setenv ("VAMP_PATH", sp.to_string().c_str(), 1);
 
        setup_hardware_optimization (try_optimization);
 
@@ -400,7 +395,7 @@ void
 ARDOUR::find_bindings_files (map<string,string>& files)
 {
        vector<sys::path> found;
-       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
+       SearchPath spath = ardour_config_search_path();
 
        if (getenv ("ARDOUR_SAE")) {
                Glib::PatternSpec pattern("*SAE-*.bindings");
index 50f83d852e9422ac409c8839a30d9f5106c4b2a4..3f83375c9672e4d09e588de911cb8970aaa77662 100644 (file)
@@ -36,7 +36,7 @@ midi_patch_search_path ()
 {
        SearchPath spath (user_config_directory ());
 
-       spath += ardour_module_directory ();
+       spath += ardour_dll_directory ();
        spath.add_subdirectory_to_paths(midi_patch_dir_name);
 
        bool midi_patch_path_defined = false;
index 257f9d0c7889501a64796a68b93f254e40bed808..debc19c7574a289bcb5b8bb1ce5f31f575ac2676 100644 (file)
@@ -36,7 +36,7 @@ panner_search_path ()
 {
        SearchPath spath (user_config_directory ());
 
-       spath += ardour_module_directory ();
+       spath += ardour_dll_directory ();
        spath.add_subdirectory_to_paths(panner_dir_name);
 
        bool panner_path_defined = false;
index d5bfc7a9a8d24ef7c9736923006ed62c04dc049a..1adde47b2aa62ad7aff33841c192249a83f8ce3b 100644 (file)
@@ -84,7 +84,7 @@ RCConfiguration::load_state ()
 
        /* load system configuration first */
 
-       if (find_file_in_search_path (ardour_search_path() + system_config_search_path(), "ardour_system.rc", system_rc_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "ardour_system.rc", system_rc_file)) {
                string rcfile = system_rc_file.to_string();
 
                /* stupid XML Parser hates empty files */
@@ -115,7 +115,7 @@ RCConfiguration::load_state ()
 
        sys::path user_rc_file;
 
-       if (find_file_in_search_path (ardour_search_path() + user_config_directory(), "ardour.rc", user_rc_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "ardour.rc", user_rc_file)) {
                string rcfile = user_rc_file.to_string();
 
                /* stupid XML parser hates empty files */
index 388e09fab184ef8eb01009827abe24d05891c0a6..3e4797dac1de8bbf361a531f07c11709e5481f4c 100644 (file)
@@ -19,32 +19,20 @@ using namespace PBD;
 
 namespace ARDOUR {
 
-sys::path
-system_template_directory ()
+SearchPath
+template_search_path ()
 {
-       SearchPath spath(system_data_search_path());
+       SearchPath spath (ardour_data_search_path());
        spath.add_subdirectory_to_paths(templates_dir_name);
-
-       // just return the first directory in the search path that exists
-       SearchPath::const_iterator i = std::find_if(spath.begin(), spath.end(), sys::exists);
-
-       if (i == spath.end()) return sys::path();
-
-       return *i;
+       return spath;
 }
 
-sys::path
-system_route_template_directory ()
+SearchPath
+route_template_search_path ()
 {
-       SearchPath spath(system_data_search_path());
+       SearchPath spath (ardour_data_search_path());
        spath.add_subdirectory_to_paths(route_templates_dir_name);
-
-       // just return the first directory in the search path that exists
-       SearchPath::const_iterator i = std::find_if(spath.begin(), spath.end(), sys::exists);
-
-       if (i == spath.end()) return sys::path();
-
-       return *i;
+       return spath;
 }
 
 sys::path
@@ -61,7 +49,7 @@ user_route_template_directory ()
 {
        sys::path p(user_config_directory());
        p /= route_templates_dir_name;
-
+       
        return p;
 }
 
@@ -100,8 +88,7 @@ find_session_templates (vector<TemplateInfo>& template_names)
 {
        vector<string *> *templates;
        PathScanner scanner;
-       SearchPath spath (system_template_directory());
-       spath += user_template_directory ();
+       SearchPath spath (template_search_path());
 
        templates = scanner (spath.to_string(), template_filter, 0, true, true);
 
@@ -137,8 +124,7 @@ find_route_templates (vector<TemplateInfo>& template_names)
 {
        vector<string *> *templates;
        PathScanner scanner;
-       SearchPath spath (system_route_template_directory());
-       spath += user_route_template_directory ();
+       SearchPath spath (route_template_search_path());
 
        templates = scanner (spath.to_string(), route_template_filter, 0, false, true);
 
index df46d8cc86cbf9678dece12a06439a5c06610c35..c69673ed00c4d83198d7f876e5d75dc07db17367 100644 (file)
@@ -364,11 +364,7 @@ def build(bld):
         'PACKAGE="' + I18N_PACKAGE + '"',
         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
-        'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
-        'LOCALEDIR="' + os.path.join(
-            os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
-        'VAMP_DIR="' + os.path.join(
-            os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"',
+        'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
         ]
 
@@ -453,7 +449,6 @@ def build(bld):
             'PACKAGE="libardour3test"',
             'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
             'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
-            'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
             'LOCALEDIR="' + os.path.join(
                 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
             'VAMP_DIR="' + os.path.join(
@@ -485,7 +480,6 @@ def build(bld):
             'PACKAGE="libardour3profile"',
             'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
             'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
-            'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
             'LOCALEDIR="' + os.path.join(
                 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
             'VAMP_DIR="' + os.path.join(
diff --git a/libs/pbd/filesystem_paths.cc b/libs/pbd/filesystem_paths.cc
deleted file mode 100644 (file)
index 7f0ac62..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-       Copyright (C) 2007 Tim Mayberry
-
-       This program is free software; you can redistribute it and/or modify
-       it under the terms of the GNU General Public License as published by
-       the Free Software Foundation; either version 2 of the License, or
-       (at your option) any later version.
-
-       This program is distributed in the hope that it will be useful,
-       but WITHOUT ANY WARRANTY; without even the implied warranty of
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       GNU General Public License for more details.
-
-       You should have received a copy of the GNU General Public License
-       along with this program; if not, write to the Free Software
-       Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include <glib.h>
-
-#include "pbd/filesystem_paths.h"
-
-namespace PBD {
-
-std::vector<sys::path>
-system_data_directories ()
-{
-       std::vector<sys::path> tmp;
-       const char * const * dirs;
-
-       dirs = g_get_system_data_dirs ();
-
-       if (dirs == NULL) return tmp;
-
-       for (int i = 0; dirs[i] != NULL; ++i)
-       {
-               tmp.push_back(dirs[i]);
-       }
-
-       return tmp;
-}
-
-std::vector<sys::path>
-system_config_directories ()
-{
-       std::vector<sys::path> tmp;
-       const char * const * dirs;
-
-       dirs = g_get_system_config_dirs ();
-
-       if (dirs == NULL) return tmp;
-
-       for (int i = 0; dirs[i] != NULL; ++i)
-       {
-               tmp.push_back(dirs[i]);
-       }
-
-       return tmp;
-}
-
-} // namespace PBD
diff --git a/libs/pbd/pbd/filesystem_paths.h b/libs/pbd/pbd/filesystem_paths.h
deleted file mode 100644 (file)
index a31de8c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-       Copyright (C) 2007 Tim Mayberry 
-
-       This program is free software; you can redistribute it and/or modify
-       it under the terms of the GNU General Public License as published by
-       the Free Software Foundation; either version 2 of the License, or
-       (at your option) any later version.
-
-       This program is distributed in the hope that it will be useful,
-       but WITHOUT ANY WARRANTY; without even the implied warranty of
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       GNU General Public License for more details.
-
-       You should have received a copy of the GNU General Public License
-       along with this program; if not, write to the Free Software
-       Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef PBD_FILESYSTEM_PATHS_INCLUDED
-#define PBD_FILESYSTEM_PATHS_INCLUDED
-
-#include <vector>
-
-#include "pbd/filesystem.h"
-
-namespace PBD {
-
-       std::vector<sys::path> system_data_directories ();
-
-       std::vector<sys::path> system_config_directories ();
-
-} // namespace PBD
-
-#endif
index 8e3b435d7d39999e8547441fbca974887955cd89..83a78f8ef03ac957b7d7fe8ae6646e2fee8faabf 100644 (file)
@@ -79,7 +79,6 @@ def build(bld):
             epa.cc
             error.cc
             filesystem.cc
-            filesystem_paths.cc
             file_manager.cc
             file_utils.cc
             fpu.cc
index c2220c6fde236438bb9d18fc8fde39ab02744364..a9f5aa93415a9dfcb045be4aee264be719a38c77 100644 (file)
@@ -114,7 +114,7 @@ system_midi_map_search_path ()
                return spath_env;
        }
 
-       SearchPath spath (system_data_search_path());
+       SearchPath spath (ardour_data_search_path());
        spath.add_subdirectory_to_paths(midi_map_dir_name);
 
        // just return the first directory in the search path that exists
index 5646650eebe434e7835740f39f90f235486c4798..8d2186cf0c5bfad72d2d3a70610f31000587407d 100644 (file)
@@ -421,7 +421,7 @@ static const char* const devinfo_dir_name = "mcp";
 static const char* const devinfo_suffix = ".device";
 
 static SearchPath
-system_devinfo_search_path ()
+devinfo_search_path ()
 {
        bool devinfo_path_defined = false;
         sys::path spath_env (Glib::getenv (devinfo_env_variable_name, devinfo_path_defined));
@@ -430,21 +430,12 @@ system_devinfo_search_path ()
                return spath_env;
        }
 
-       SearchPath spath (system_data_search_path());
+       SearchPath spath (ardour_data_search_path());
        spath.add_subdirectory_to_paths(devinfo_dir_name);
 
        return spath;
 }
 
-static sys::path
-user_devinfo_directory ()
-{
-       sys::path p(user_config_directory());
-       p /= devinfo_dir_name;
-
-       return p;
-}
-
 static bool
 devinfo_filter (const string &str, void */*arg*/)
 {
@@ -459,8 +450,7 @@ DeviceInfo::reload_device_info ()
        vector<string> s;
        vector<string *> *devinfos;
        PathScanner scanner;
-       SearchPath spath (system_devinfo_search_path());
-       spath += user_devinfo_directory ();
+       SearchPath spath (devinfo_search_path());
 
        devinfos = scanner (spath.to_string(), devinfo_filter, 0, false, true);
        device_info.clear ();
index d7667ce721bf032578f08a5bc8c1c8b8155ba0b5..3a9013dc9fbea27ed6217f85ec591fab8829087d 100644 (file)
@@ -56,7 +56,7 @@ static const char* const devprofile_dir_name = "mcp";
 static const char* const devprofile_suffix = ".profile";
 
 static SearchPath
-system_devprofile_search_path ()
+devprofile_search_path ()
 {
        bool devprofile_path_defined = false;
         sys::path spath_env (Glib::getenv (devprofile_env_variable_name, devprofile_path_defined));
@@ -65,7 +65,7 @@ system_devprofile_search_path ()
                return spath_env;
        }
 
-       SearchPath spath (system_data_search_path());
+       SearchPath spath (ardour_data_search_path());
        spath.add_subdirectory_to_paths(devprofile_dir_name);
 
        return spath;
@@ -94,8 +94,7 @@ DeviceProfile::reload_device_profiles ()
        vector<string> s;
        vector<string *> *devprofiles;
        PathScanner scanner;
-       SearchPath spath (system_devprofile_search_path());
-       spath += user_devprofile_directory ();
+       SearchPath spath (devprofile_search_path());
 
        devprofiles = scanner (spath.to_string(), devprofile_filter, 0, false, true);
        device_profiles.clear ();
index afff3cdcd8857576ab645e1c9a5ad75548fb5f51..88479d9c281e20f183fffbfd582b7390fbb92562 100644 (file)
@@ -191,8 +191,7 @@ OSC::start ()
 
        PBD::sys::path url_file;
 
-       if (find_file_in_search_path (ardour_search_path() + system_config_search_path(),
-                                     "osc_url", url_file)) {
+       if (find_file_in_search_path (ardour_config_search_path(), "osc_url", url_file)) {
                
                _osc_url_file = url_file.to_string();
                ofstream urlfile;
diff --git a/mcp/wscript b/mcp/wscript
new file mode 100644 (file)
index 0000000..b1ff9c1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+
+import os
+
+top = '.'
+out = 'build'
+
+def configure(conf):
+    pass
+
+def build(bld):
+    devinfo = bld.path.ant_glob ('*.device')
+    profiles = bld.path.ant_glob ('*.profile')
+    bld.install_files (os.path.join(bld.env['DATADIR'], 'ardour3', 'mcp'), devinfo)
+    bld.install_files (os.path.join(bld.env['DATADIR'], 'ardour3', 'mcp'), profiles)
+
+def options(opt):
+    pass
index 694634199396063a6229cdf10a68b5b2902a3404..83f69bb2b6ade41d0f9691513950221bbaf0ec2e 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+# This is Linux-specific startup script for a bundled version of Ardour
+
 while [ $# -gt 0 ] ; do
        echo "arg = $1"
        case $1 in
@@ -11,9 +13,9 @@ while [ $# -gt 0 ] ; do
        esac
 done
 
-#LD_LIBRARY_PATH needs to be set (empty) so that epa can swap between the original and the bundled version
+# LD_LIBRARY_PATH needs to be set here so that epa can swap between the original and the bundled version
+# (the original one will be stored in PREBUNDLE_ENV)
 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
-
 export PREBUNDLE_ENV="$(env)"
 
 BIN_DIR=$(dirname $(readlink -f $0))
@@ -35,12 +37,13 @@ export ARDOUR_BUNDLED=true
 
 %ENV%
 
-export GTK_PATH=$INSTALL_DIR/libs/clearlooks${GTK_PATH:+:$GTK_PATH}
-export GTK_MODULES=""          # Disable extra modules from being loaded by gtk (example, libcanberra-gtk-module.so)
+# Disable extra modules from being loaded by gtk (example, libcanberra-gtk-module.so)
+export GTK_MODULES=""
+# Set this so that the executable will find all the right libraries inside the bundle
 export LD_LIBRARY_PATH=$INSTALL_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 
 # create install-location-dependent config files for Pango and GDK image loaders
-# We have to do this every time because its possible that BIN_DIR has changed
+# We have to do this every time because its possible that LIB_DIR has changed
 
 sed "s?@ROOTDIR@/modules?$LIB_DIR/modules?" < $ETC_DIR/pango.modules.in > $USER_ARDOUR_DIR/pango.modules
 sed "s?@ROOTDIR@/loaders?$LIB_DIR/loaders?" < $ETC_DIR/gdk-pixbuf.loaders.in > $USER_ARDOUR_DIR/gdk-pixbuf.loaders
diff --git a/wscript b/wscript
index f019091a2da2a1e3bd3336bce7e35dea6fa62d01..20a88dbd1e945401b7259b9107d53730ed3bc71f 100644 (file)
--- a/wscript
+++ b/wscript
@@ -35,6 +35,7 @@ children = [
         'templates',
         'export',
         'midi_maps',
+        'mcp',
         'manual'
 ]
 
@@ -737,11 +738,3 @@ def i18n_po(bld):
 def i18n_mo(bld):
     bld.recurse (i18n_children)
 
-def install_not_supported(bld):
-    print ('Installing Ardour 3 is currently unsupported. Run it via the command ./ardev from within the gtk2_ardour directory.')
-    sys.exit (1)
-
-from waflib import Build
-class install(Build.InstallContext):
-    cmd = 'install'
-    fun = 'install_not_supported'