git.iko.soy/typeable/nixpkgs
on master help sign in
fcitx-libpinyin: fix data path
commit19f6fe6e9c616ff64ace9ae2c2a13068732a0bcb authorYucheng Zhang <yu@cheng.cat> dateWed 25 Apr 2018, 15:39 (9 years ago) parent2e855dc
2 files changed+26
pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch+16 pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix+10
pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patchnew file+16
@@ -0,0 +1,16 @@
1+--- a/src/utils.cpp
2++++ b/src/utils.cpp
3+@@ -9,12 +9,7 @@ char* FcitxLibPinyinGetSysPath(LIBPINYIN_LANGUAGE_TYPE type)
4+ #ifdef LIBPINYIN_TOOLS_FOUND
5+ if (type == LPLT_Simplified) {
6+ #endif
7+- /* portable detect here */
8+- if (getenv("FCITXDIR")) {
9+- syspath = fcitx_utils_get_fcitx_path_with_filename("datadir", "libpinyin/data");
10+- } else {
11+- syspath = strdup(LIBPINYIN_PKGDATADIR "/data");
12+- }
13++ syspath = strdup(LIBPINYIN_PKGDATADIR "/data");
14+ #ifdef LIBPINYIN_TOOLS_FOUND
15+ }
16+ else {
pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix+10
@@ -12,6 +12,16 @@ stdenv.mkDerivation rec {
1212 nativeBuildInputs = [ pkgconfig ];
1313 buildInputs = [ fcitx-qt5 qtbase qtwebengine.dev cmake fcitx gettext libpinyin glib pcre dbus ];
1414
15+ # With a typical installation via NixOS option i18n.inputMethod.fcitx.engines,
16+ # the FCITXDIR environment variable is set to $out of fcitx-with-plugins,
17+ # which leads to an incorrect path for pinyin data.
18+ #
19+ # It is impossible or difficult to fix this issue without patching. We want
20+ # FCITXDIR to point into libpinyin, which is currently not symlinked within
21+ # fcitx-with-plugins (only fcitx-libpinyin is symlinked). Also, FCITXDIR
22+ # doesn't accept multiple directories.
23+ patches = [ ./datapath.patch ];
24+
1525 preInstall = ''
1626 substituteInPlace src/cmake_install.cmake \
1727 --replace ${fcitx} $out