diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2018-04-27 10:59:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 10:59:33 +0100 |
commit | 37e79019d6ccbc483af0f3a25f0ec90a6fda27fb (patch) | |
tree | 3af8130c498841defdb761dd0f95d2695396ac4f /pkgs/tools/inputmethods | |
parent | f5bee7ed02de6c9eb13a331d7177835f50a6cb6f (diff) | |
parent | 19f6fe6e9c616ff64ace9ae2c2a13068732a0bcb (diff) | |
download | nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.tar nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.tar.gz nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.tar.bz2 nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.tar.lz nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.tar.xz nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.tar.zst nixlib-37e79019d6ccbc483af0f3a25f0ec90a6fda27fb.zip |
Merge pull request #39472 from ChengCat/fcitx-libpinyin
fcitx-libpinyin: fix data path
Diffstat (limited to 'pkgs/tools/inputmethods')
-rw-r--r-- | pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch | 16 | ||||
-rw-r--r-- | pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch b/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch new file mode 100644 index 000000000000..84dd5fc8f462 --- /dev/null +++ b/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch @@ -0,0 +1,16 @@ +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -9,12 +9,7 @@ char* FcitxLibPinyinGetSysPath(LIBPINYIN_LANGUAGE_TYPE type) + #ifdef LIBPINYIN_TOOLS_FOUND + if (type == LPLT_Simplified) { + #endif +- /* portable detect here */ +- if (getenv("FCITXDIR")) { +- syspath = fcitx_utils_get_fcitx_path_with_filename("datadir", "libpinyin/data"); +- } else { +- syspath = strdup(LIBPINYIN_PKGDATADIR "/data"); +- } ++ syspath = strdup(LIBPINYIN_PKGDATADIR "/data"); + #ifdef LIBPINYIN_TOOLS_FOUND + } + else { diff --git a/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix b/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix index f2610efd2eb4..4468f1fa263a 100644 --- a/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix +++ b/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix @@ -12,6 +12,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ fcitx-qt5 qtbase qtwebengine.dev cmake fcitx gettext libpinyin glib pcre dbus ]; + # With a typical installation via NixOS option i18n.inputMethod.fcitx.engines, + # the FCITXDIR environment variable is set to $out of fcitx-with-plugins, + # which leads to an incorrect path for pinyin data. + # + # It is impossible or difficult to fix this issue without patching. We want + # FCITXDIR to point into libpinyin, which is currently not symlinked within + # fcitx-with-plugins (only fcitx-libpinyin is symlinked). Also, FCITXDIR + # doesn't accept multiple directories. + patches = [ ./datapath.patch ]; + preInstall = '' substituteInPlace src/cmake_install.cmake \ --replace ${fcitx} $out |