+ setenv ("LV2_PATH", path.c_str(), 1);
+
+ path = dir_path;
+ path += "/../Frameworks/clearlooks";
+
+ setenv ("GTK_PATH", path.c_str(), 1);
+
+ path = dir_path;
+ path += "/../Resources/locale";
+
+ localedir = strdup (path.c_str());
+
+ /* write a pango.rc file and tell pango to use it. we'd love
+ to put this into the Ardour.app bundle and leave it there,
+ but the user may not have write permission. so ...
+
+ we also have to make sure that the user ardour directory
+ actually exists ...
+ */
+
+ try {
+ sys::create_directories (user_config_directory ());
+ }
+ catch (const sys::filesystem_error& ex) {
+ error << _("Could not create user configuration directory") << endmsg;
+ }
+
+ sys::path pangopath = user_config_directory();
+ pangopath /= "pango.rc";
+ path = pangopath.to_string();
+
+ std::ofstream pangorc (path.c_str());
+ if (!pangorc) {
+ error << string_compose (_("cannot open pango.rc file %1") , path) << endmsg;
+ return;
+ } else {
+ pangorc << "[Pango]\nModuleFiles=";
+
+ pangopath = dir_path;
+ pangopath /= "..";
+ pangopath /= "Resources";
+ pangopath /= "pango.modules";
+
+ pangorc << pangopath.to_string() << endl;
+
+ pangorc.close ();
+
+ setenv ("PANGO_RC_FILE", path.c_str(), 1);
+ }
+
+ // gettext charset aliases
+
+ setenv ("CHARSETALIASDIR", path.c_str(), 1);
+
+ // font config
+
+ path = dir_path;
+ path += "/../Resources/fonts.conf";
+
+ setenv ("FONTCONFIG_FILE", path.c_str(), 1);
+
+ // GDK Pixbuf loader module file
+
+ path = dir_path;
+ path += "/../Resources/gdk-pixbuf.loaders";
+
+ setenv ("GDK_PIXBUF_MODULE_FILE", path.c_str(), 1);
+
+ if (getenv ("ARDOUR_WITH_JACK")) {
+ // JACK driver dir
+
+ path = dir_path;
+ path += "/../Frameworks";
+
+ setenv ("JACK_DRIVER_DIR", path.c_str(), 1);