17 pname = "fcitx5-mozc";
18 version = "2.30.5544.102";
20 src = fetchFromGitHub {
23 fetchSubmodules = true;
24 rev = "57e67f2a25e4c0861e0e422da0c7d4c232d89fcc";
25 hash = "sha256-1EZjEbMl+LRipH5gEgFpaKP8uEKPfupHmiiTNJc/T1k=";
41 sed -i -e 's|^\(LINUX_MOZC_SERVER_DIR = \).\+|\1"${mozc}/lib/mozc"|' src/config.bzl
45 removeRulesCC = false;
46 dontAddBazelOpts = true;
56 "unix/fcitx5:fcitx5-mozc.so"
62 rm -rf $bazelOut/external/fcitx5
65 sha256 = "sha256-wz2lJckr7Pu4jtoejjFv8LdjVO2+ferrS473M4jc86I=";
76 install -Dm444 ../LICENSE $out/share/licenses/fcitx5-mozc/LICENSE
77 install -Dm444 data/installer/credits_en.html $out/share/licenses/fcitx5-mozc/Submodules
79 install -Dm555 bazel-bin/unix/fcitx5/fcitx5-mozc.so $out/lib/fcitx5/fcitx5-mozc.so
80 install -Dm444 unix/fcitx5/mozc-addon.conf $out/share/fcitx5/addon/mozc.conf
81 install -Dm444 unix/fcitx5/mozc.conf $out/share/fcitx5/inputmethod/mozc.conf
83 for pofile in unix/fcitx5/po/*.po; do
84 filename=$(basename $pofile)
85 lang=''${filename/.po/}
86 mofile=''${pofile/.po/.mo}
87 msgfmt $pofile -o $mofile
88 install -Dm444 $mofile $out/share/locale/$lang/LC_MESSAGES/fcitx5-mozc.mo
91 msgfmt --xml -d unix/fcitx5/po/ --template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in -o unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
92 install -Dm444 unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml $out/share/metainfo/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
98 # These are relative symlinks, they will always resolve to files within $out
100 install -Dm444 mozc.png $out/share/icons/hicolor/128x128/apps/org.fcitx.Fcitx5.fcitx_mozc.png
101 ln -s org.fcitx.Fcitx5.fcitx_mozc.png $out/share/icons/hicolor/128x128/apps/fcitx_mozc.png
110 outlined/dictionary.svg \
111 outlined/properties.svg \
114 name=$(basename -- $svg)
115 path=$out/share/icons/hicolor/scalable/apps
116 prefix=org.fcitx.Fcitx5.fcitx_mozc
118 install -Dm444 $svg $path/$prefix_$name
119 ln -s $prefix_$name $path/fcitx_mozc_$name
126 passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isLinux {
127 inherit (nixosTests) fcitx5;
131 description = "Mozc - a Japanese Input Method Editor designed for multi-platform";
132 homepage = "https://github.com/fcitx/mozc";
133 license = with licenses; [
135 bsd3 # mozc, breakpad, gtest, gyp, japanese-usage-dictionary, protobuf
138 publicDomain # src/data/test/stress_test, Okinawa dictionary
139 unicode-30 # src/data/unicode, breakpad
141 maintainers = with maintainers; [
146 platforms = platforms.linux;