nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime-with-nix-env-variable.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
638 B
Diff
Raw Normal View History

: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;