2021-04-05 15:23:46 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, which, ninja, pkg-config, protobuf
|
2020-12-07 07:45:13 +00:00
|
|
|
, ibus, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese, python3Packages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ibus-mozc";
|
|
|
|
version = "2.26.4423.100";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-07-14 22:03:04 +00:00
|
|
|
owner = "google";
|
|
|
|
repo = "mozc";
|
|
|
|
rev = "7654223979067e3c5ae52ea238d43880c5508f85";
|
|
|
|
sha256 = "aZVuhj4I9ZCsVR9dOplOd9zinYMgYw5SF5wG3IxBTO0=";
|
2020-12-07 07:45:13 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
which ninja python3Packages.python python3Packages.six
|
|
|
|
python3Packages.gyp pkg-config qt5.wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ protobuf ibus gtk2 zinnia qt5.qtbase libxcb ];
|
|
|
|
|
|
|
|
postUnpack = lib.optionalString stdenv.isLinux ''
|
2020-12-07 07:45:13 +00:00
|
|
|
sed -i 's/-lc++/-lstdc++/g' $sourceRoot/src/gyp/common.gypi
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
2021-07-14 22:03:04 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 ibus_mozc_path=$out/lib/ibus-mozc/ibus-engine-mozc zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model"
|
2020-12-07 07:45:13 +00:00
|
|
|
cd src && python build_mozc.py gyp --gypdir=${python3Packages.gyp}/bin --server_dir=$out/lib/mozc
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2021-07-14 22:03:04 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \
|
|
|
|
unix/ibus/ibus.gyp:ibus_mozc \
|
|
|
|
unix/emacs/emacs.gyp:mozc_emacs_helper \
|
|
|
|
server/server.gyp:mozc_server \
|
|
|
|
gui/gui.gyp:mozc_tool \
|
|
|
|
renderer/renderer.gyp:mozc_renderer
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-07-14 22:03:04 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
install -d $out/share/licenses/mozc
|
|
|
|
head -n 29 server/mozc_server.cc > $out/share/licenses/mozc/LICENSE
|
2021-07-14 22:03:04 +00:00
|
|
|
install -m 644 data/installer/*.html $out/share/licenses/mozc/
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
install -D -m 755 out_linux/Release/mozc_server $out/lib/mozc/mozc_server
|
|
|
|
install -m 755 out_linux/Release/mozc_tool $out/lib/mozc/mozc_tool
|
2020-09-25 04:45:31 +00:00
|
|
|
wrapQtApp $out/lib/mozc/mozc_tool
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
install -d $out/share/doc/mozc
|
2021-07-14 22:03:04 +00:00
|
|
|
install -m 644 data/installer/*.html $out/share/doc/mozc/
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
install -D -m 755 out_linux/Release/ibus_mozc $out/lib/ibus-mozc/ibus-engine-mozc
|
|
|
|
install -D -m 644 out_linux/Release/gen/unix/ibus/mozc.xml $out/share/ibus/component/mozc.xml
|
|
|
|
install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png $out/share/ibus-mozc/product_icon.png
|
|
|
|
install -m 644 data/images/unix/ui-tool.png $out/share/ibus-mozc/tool.png
|
|
|
|
install -m 644 data/images/unix/ui-properties.png $out/share/ibus-mozc/properties.png
|
|
|
|
install -m 644 data/images/unix/ui-dictionary.png $out/share/ibus-mozc/dictionary.png
|
|
|
|
install -m 644 data/images/unix/ui-direct.png $out/share/ibus-mozc/direct.png
|
|
|
|
install -m 644 data/images/unix/ui-hiragana.png $out/share/ibus-mozc/hiragana.png
|
|
|
|
install -m 644 data/images/unix/ui-katakana_half.png $out/share/ibus-mozc/katakana_half.png
|
|
|
|
install -m 644 data/images/unix/ui-katakana_full.png $out/share/ibus-mozc/katakana_full.png
|
|
|
|
install -m 644 data/images/unix/ui-alpha_half.png $out/share/ibus-mozc/alpha_half.png
|
|
|
|
install -m 644 data/images/unix/ui-alpha_full.png $out/share/ibus-mozc/alpha_full.png
|
|
|
|
install -D -m 755 out_linux/Release/mozc_renderer $out/lib/mozc/mozc_renderer
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
isIbusEngine = true;
|
|
|
|
description = "Japanese input method from Google";
|
|
|
|
homepage = "https://github.com/google/mozc";
|
|
|
|
license = licenses.free;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ gebner ericsagnes ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|