1 { lib, stdenv, fetchurl, pkg-config, cmake, intltool, gettext
2 , libxml2, enchant2, isocodes, icu, libpthreadstubs
3 , pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
4 , dbus, gtk2, gtk3, qt4, extra-cmake-modules
5 , xkeyboard_config, pcre, libuuid, xorg, makeWrapper
11 # releases at http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz
12 # contains all data but if we want to compile from source, we need to
13 # fetch them ourselves
14 # to update the urls and where to unpack these, look into the
15 # src/module/*/data/CMakeLists.txt files
16 # fcitx_download tgt_name url output)
17 dicts = let SPELL_EN_DICT_VER="20121020"; in fetchurl {
18 url = "http://download.fcitx-im.org/data/en_dict-${SPELL_EN_DICT_VER}.tar.gz";
19 sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4";
22 url = "http://download.fcitx-im.org/data/table.tar.gz";
23 sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1";
25 pystroke-data = let PY_STROKE_VER="20121124"; in fetchurl {
26 url = "http://download.fcitx-im.org/data/py_stroke-${PY_STROKE_VER}.tar.gz";
27 sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf";
29 pytable-data = let PY_TABLE_VER="20121124"; in fetchurl {
30 url = "http://download.fcitx-im.org/data/py_table-${PY_TABLE_VER}.tar.gz";
31 sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522";
33 pinyin-data = fetchurl {
34 url = "http://download.fcitx-im.org/data/pinyin.tar.gz";
35 sha256 = "1qfq5dy4czvd1lvdnxzyaiir9x8b1m46jjny11y0i33m9ar2jf2q";
38 stdenv.mkDerivation rec {
42 src = fetchFromGitLab {
46 sha256 = "0j5vaf930lb21gx4h7z6mksh1fazqw32gajjjkyir94wbmml9n3s";
49 # put data at the correct locations else cmake tries to fetch them,
50 # which fails in sandboxed mode
52 cp ${dicts} src/module/spell/dict/$(stripHash ${dicts})
53 cp ${table} src/im/table/data/$(stripHash ${table})
55 + lib.optionalString withPinyin ''
56 cp ${pystroke-data} src/module/pinyin-enhance/data/$(stripHash ${pystroke-data})
57 cp ${pytable-data} src/module/pinyin-enhance/data/$(stripHash ${pytable-data})
58 cp ${pinyin-data} src/im/pinyin/data/$(stripHash ${pinyin-data})
62 patches = [ ./find-enchant-lib.patch ];
65 substituteInPlace src/frontend/qt/CMakeLists.txt \
66 --replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
72 wrapProgram $out/bin/fcitx \
73 --prefix PATH : "${xorg.xmodmap}/bin"
76 nativeBuildInputs = [ cmake extra-cmake-modules intltool pkg-config pcre makeWrapper ];
79 xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile
80 libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid
84 "-DENABLE_QT_IM_MODULE=ON"
85 "-DENABLE_GTK2_IM_MODULE=ON"
86 "-DENABLE_GTK3_IM_MODULE=ON"
89 "-DENABLE_PRESAGE=OFF"
90 "-DENABLE_XDGAUTOSTART=OFF"
91 "-DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"}"
95 "-DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml'"
99 homepage = "https://github.com/fcitx/fcitx";
100 description = "A Flexible Input Method Framework";
101 license = licenses.gpl2;
102 platforms = platforms.linux;
103 maintainers = with maintainers; [ ericsagnes ];