1 { lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, gyp, which, ninja,
2 python, pkg-config, protobuf, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese,
5 japanese_usage_dictionary = fetchFromGitHub {
6 owner = "hiroyuki-komatsu";
7 repo = "japanese-usage-dictionary";
8 rev = "e5b3425575734c323e1d947009dd74709437b684";
9 sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm";
12 url = "http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz";
13 sha256 = "10bdjn481jsh32vll7r756l392anz44h6207vjqwby3rplk31np1";
15 in clangStdenv.mkDerivation rec {
17 version = "2.23.2815.102";
19 src = fetchFromGitHub {
22 rev = "afb03ddfe72dde4cf2409863a3bfea160f7a66d8";
23 sha256 = "0w2dy2j9x5nc7x3g95j17r3m60vbfyn5j617h7js9xryv33yzpgx";
26 nativeBuildInputs = [ gyp which ninja python pkg-config qt5.wrapQtAppsHook ];
27 buildInputs = [ protobuf gtk2 zinnia qt5.qtbase libxcb fcitx gettext ];
30 rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/
31 ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary
32 tar -xzf ${icons} -C $sourceRoot/src
35 patch_version = "${version}.1";
38 name = "fcitx-mozc-${patch_version}.patch";
39 url = "https://download.fcitx-im.org/fcitx-mozc/${name}";
40 sha256 = "0a8q3vzcbai1ccdrl6qdb81gvbw8aby4lqkl6qs9hg68p6zg42hg";
42 # https://github.com/google/mozc/pull/444 - fix for gcc8 STL
44 url = "https://github.com/google/mozc/commit/82d38f929882a9c62289b179c6fe41efed249987.patch";
45 sha256 = "07cja1b7qfsd3i76nscf1zwiav74h7d6h2g9g2w4bs3h1mc9jwla";
47 # Support dates after 2019
49 url = "https://salsa.debian.org/debian/mozc/-/raw/master/debian/patches/add_support_new_japanese_era.patch";
50 sha256 = "1dsiiglrmm8i8shn2hv0j2b8pv6miysjrimj4569h606j4lwmcw2";
55 substituteInPlace src/unix/fcitx/mozc.conf \
56 --replace "/usr/share/fcitx/mozc/icon/mozc.png" "mozc"
60 export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_fcitx5=0 zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model"
61 cd src && python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc
65 PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \
66 server/server.gyp:mozc_server \
67 gui/gui.gyp:mozc_tool \
68 unix/fcitx/fcitx.gyp:fcitx-mozc
72 install -d $out/share/licenses/fcitx-mozc
73 head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx-mozc/LICENSE
74 install -m 644 data/installer/*.html $out/share/licenses/fcitx-mozc/
76 install -d $out/share/doc/mozc
77 install -m 644 data/installer/*.html $out/share/doc/mozc/
79 install -D -m 755 out_linux/Release/mozc_server $out/lib/mozc/mozc_server
80 install -m 755 out_linux/Release/mozc_tool $out/lib/mozc/mozc_tool
82 wrapQtApp $out/lib/mozc/mozc_tool
84 install -D -m 755 out_linux/Release/fcitx-mozc.so $out/lib/fcitx/fcitx-mozc.so
85 install -D -m 644 unix/fcitx/fcitx-mozc.conf $out/share/fcitx/addon/fcitx-mozc.conf
86 install -D -m 644 unix/fcitx/mozc.conf $out/share/fcitx/inputmethod/mozc.conf
88 install -d $out/share/doc/mozc
90 for mofile in out_linux/Release/gen/unix/fcitx/po/*.mo
92 filename=`basename $mofile`
94 install -D -m 644 "$mofile" "$out/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo"
97 install -d $out/share/fcitx/imicon
98 install -m 644 fcitx-mozc-icons/mozc.png $out/share/fcitx/imicon/mozc.png
99 install -d $out/share/fcitx/mozc/icon
100 install -m 644 fcitx-mozc-icons/*.png $out/share/fcitx/mozc/icon/
104 isFcitxEngine = true;
105 description = "Fcitx engine for Google japanese input method";
106 homepage = "https://github.com/google/mozc";
107 downloadPage = "http://download.fcitx-im.org/fcitx-mozc/";
108 license = licenses.free;
109 platforms = platforms.linux;
110 maintainers = with maintainers; [ gebner ericsagnes ];