summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch')
-rw-r--r--app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch b/app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch
new file mode 100644
index 00000000000..dccdff76f15
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch
@@ -0,0 +1,89 @@
+https://github.com/google/mozc/issues/470
+
+--- /src/base/system_util.cc
++++ /src/base/system_util.cc
+@@ -226,6 +226,11 @@
+
+ std::string UserProfileDirectoryImpl::GetUserProfileDirectory() const {
+ #if defined(OS_CHROMEOS)
++ const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++ if (configuration_directory_env) {
++ return configuration_directory_env;
++ }
++
+ // TODO(toka): Must use passed in user profile dir which passed in. If mojo
+ // platform the user profile is determined on runtime.
+ // It's hack, the user profile dir should be passed in. Although the value in
+@@ -245,13 +250,23 @@
+ #elif defined(OS_IOS)
+ // OS_IOS block must be placed before __APPLE__ because both macros are
+ // currently defined on iOS.
+- //
++
++ const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++ if (configuration_directory_env) {
++ return configuration_directory_env;
++ }
++
+ // On iOS, use Caches directory instead of Application Spport directory
+ // because the support directory doesn't exist by default. Also, it is backed
+ // up by iTunes and iCloud.
+ return FileUtil::JoinPath({MacUtil::GetCachesDirectory(), kProductPrefix});
+
+ #elif defined(OS_WIN)
++ const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++ if (configuration_directory_env) {
++ return configuration_directory_env;
++ }
++
+ DCHECK(SUCCEEDED(Singleton<LocalAppDataDirectoryCache>::get()->result()));
+ std::string dir = Singleton<LocalAppDataDirectoryCache>::get()->path();
+
+@@ -263,6 +278,11 @@
+
+
+ #elif defined(__APPLE__)
++ const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++ if (configuration_directory_env) {
++ return configuration_directory_env;
++ }
++
+ std::string dir = MacUtil::GetApplicationSupportDirectory();
+ # ifdef GOOGLE_JAPANESE_INPUT_BUILD
+ dir = FileUtil::JoinPath(dir, "Google");
+@@ -276,6 +296,11 @@
+
+
+ #elif defined(OS_LINUX)
++ const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++ if (configuration_directory_env) {
++ return configuration_directory_env;
++ }
++
+ // 1. If "$HOME/.mozc" already exists,
+ // use "$HOME/.mozc" for backward compatibility.
+ // 2. If $XDG_CONFIG_HOME is defined
+@@ -395,6 +420,11 @@
+ #endif // OS_WIN
+
+ std::string SystemUtil::GetServerDirectory() {
++ const char *server_directory_env = Environ::GetEnv("MOZC_SERVER_DIRECTORY");
++ if (server_directory_env) {
++ return server_directory_env;
++ }
++
+ #ifdef OS_WIN
+ DCHECK(SUCCEEDED(Singleton<ProgramFilesX86Cache>::get()->result()));
+ # if defined(GOOGLE_JAPANESE_INPUT_BUILD)
+@@ -453,6 +483,11 @@
+ }
+
+ std::string SystemUtil::GetDocumentDirectory() {
++ const char *documents_directory_env = Environ::GetEnv("MOZC_DOCUMENTS_DIRECTORY");
++ if (documents_directory_env) {
++ return documents_directory_env;
++ }
++
+ #if defined(__APPLE__)
+ return GetServerDirectory();
+ #elif defined(MOZC_DOCUMENT_DIRECTORY)