depot/third_party/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime-with-nix-env-variable.patch
Default email 22017988c6 Project import generated by Copybara.
GitOrigin-RevId: c777cdf5c564015d5f63b09cc93bef4178b19b01
2022-04-27 11:35:20 +02:00

18 lines
638 B
Diff

:100644 100644 fac4f53 aed9617 M src/rimeengine.cpp
diff --git a/src/rimeengine.cpp b/src/rimeengine.cpp
index fac4f53..aed9617 100644
--- a/src/rimeengine.cpp
+++ b/src/rimeengine.cpp
@@ -164,7 +164,10 @@ void RimeEngine::rimeStart(bool fullcheck) {
RIME_ERROR() << "Failed to create user directory: " << userDir;
}
}
- const char *sharedDataDir = RIME_DATA_DIR;
+ const char *sharedDataDir = getenv("NIX_RIME_DATA_DIR");
+ if (!sharedDataDir) {
+ sharedDataDir = RIME_DATA_DIR;
+ }
RIME_STRUCT(RimeTraits, fcitx_rime_traits);
fcitx_rime_traits.shared_data_dir = sharedDataDir;