git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39472 from ChengCat/fcitx-libpinyin

fcitx-libpinyin: fix data path

commit37e79019d6ccbc483af0f3a25f0ec90a6fda27fb authorJörg Thalheim <Mic92@users.noreply.github.com> dateFri 27 Apr 2018, 10:59 (9 years ago) parentf5bee7e19f6fe6
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