tweaks to dir path names for bundles
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 20 May 2012 12:51:38 +0000 (12:51 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 20 May 2012 12:51:38 +0000 (12:51 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12336 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/main.cc

index d7b7428b7e3bce7a1ea0578da46df6ef2740a3bb..d949b899c5f06b82e106702c032eb8acb6b29388 100644 (file)
@@ -167,34 +167,38 @@ fixup_bundle_environment (int, char* [])
        setenv ("PATH", path.c_str(), 1);
 
        path = dir_path;
-       path += "/../Resources";
-       path += dir_path;
        path += "/../Surfaces";
+       path += ':';
        path += dir_path;
        path += "/../Panners";
 
-       setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
+       setenv ("ARDOUR_DLL_PATH", path.c_str(), 1);
 
-       path = user_config_directory().to_string();
-       path += ':';
-       path += dir_path;
-       path += "/../Resources/icons:";
-       path += dir_path;
-       path += "/../Resources/pixmaps:";
-       path += dir_path;
-       path += "/../Resources/share:";
        path += dir_path;
        path += "/../Resources";
 
-       setenv ("ARDOUR_PATH", path.c_str(), 1);
-       setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1);
+       /* inside an OS X .app bundle, there is no difference
+          between DATA and CONFIG locations, since OS X doesn't
+          attempt to do anything to expose the notion of
+          machine-independent shared data.
+       */
 
-       path = dir_path;
-       path += "/../Resources";
+       setenv ("ARDOUR_DATA_PATH", path.c_str(), 1);
+       setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1);
        setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
 
        export_search_path (dir_path, "LADSPA_PATH", "/../Plugins");
        export_search_path (dir_path, "VAMP_PATH", "/../Frameworks");
+
+       /* in theory these do not need to be set since they would be found
+          using ARDOUR_DATA_PATH or ARDOUR_CONFIG_PATH suffixed by a suitable
+          folder/directory name. However, the way we bundle Ardour on OS X
+          uses Capitalized names for these folders which differs from
+          the hard-coded folder/directory name. In addition each of them
+          lives at the top level of the .app/Contents tree, rather
+          than within Resources or Frameworks.
+       */
+       
        export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/../Panners");
        export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/../Surfaces");
        export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/../MidiMaps");
@@ -305,49 +309,17 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
        Glib::ustring path;
        Glib::ustring userconfigdir = user_config_directory().to_string();
 
-       /* ensure that we find any bundled executables (e.g. JACK),
-          and find them before any instances of the same name
-          elsewhere in PATH
-       */
-
        /* note that this function is POSIX/Linux specific, so using / as
           a dir separator in this context is just fine.
        */
 
-       path = dir_path;
-       path += "/etc:";
-       path += dir_path;
-       path += "/lib/surfaces:";
-       path += dir_path;
-       path += "/lib/panners:";
-
-       setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
-
-       path = userconfigdir;
-       path += ':';
-       path += dir_path;
-       path += "/etc/icons:";
-       path += dir_path;
-       path += "/etc/pixmaps:";
-       path += dir_path;
-       path += "/share:";
-       path += dir_path;
-       path += "/etc";
-
-       setenv ("ARDOUR_PATH", path.c_str(), 1);
-       setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1);
-
-       path = dir_path;
-       path += "/etc";
-       setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
+       export_search_path (dir_path, "ARDOUR_DLL_PATH", "/lib");
+       export_search_path (dir_path, "ARDOUR_CONFIG_PATH", "/etc");
+       export_search_path (dir_path, "ARDOUR_INSTANT_XML_PATH", "/share");
+       export_search_path (dir_path, "ARDOUR_DATA_PATH", "/share");
 
        export_search_path (dir_path, "LADSPA_PATH", "/../plugins");
        export_search_path (dir_path, "VAMP_PATH", "/lib");
-       export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/lib/panners");
-       export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/lib/surfaces");
-       export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/share/midi_maps");
-       export_search_path (dir_path, "ARDOUR_MCP_PATH", "/share/mcp");
-       export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/share/export");
 
        path = dir_path;
        path += "/lib/clearlooks";
@@ -367,7 +339,7 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
        }
 
        /* Tell fontconfig where to find fonts.conf. Use the system version
-          if it exists, otherwise use the stuff we included in t
+          if it exists, otherwise use the stuff we included in the bundle
        */
 
        if (Glib::file_test ("/etc/fonts/fonts.conf", Glib::FILE_TEST_EXISTS)) {