diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix')
-rw-r--r-- | nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix index 57bb0220b312..dce5bd48592c 100644 --- a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix @@ -1,8 +1,12 @@ { lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchgit , python3Packages, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5 -, jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad }: +, jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad, nixosTests }: let inherit (python3Packages) python gyp six; + utdic = fetchurl { + url = "https://osdn.net/downloads/users/39/39056/mozcdic-ut-20220904.tar.bz2"; + sha256 = "sha256-pmLBCcw2Zsirzl1PjYkviRIZoyfUz5rpESeABDxuhtU="; + }; japanese_usage_dictionary = fetchFromGitHub { owner = "hiroyuki-komatsu"; repo = "japanese-usage-dictionary"; @@ -47,6 +51,9 @@ in clangStdenv.mkDerivation rec { postUnpack = '' unzip ${x-ken-all} -d $sourceRoot/src/ unzip ${jigyosyo} -d $sourceRoot/src/ + mkdir $TMPDIR/unpack + tar xf ${utdic} -C $TMPDIR/unpack + cat $TMPDIR/unpack/mozcdic-ut-20220904/mozcdic-ut-20220904.txt >> $sourceRoot/src/data/dictionary_oss/dictionary00.txt rmdir $sourceRoot/src/third_party/breakpad/ ln -s ${breakpad} $sourceRoot/src/third_party/breakpad @@ -77,13 +84,19 @@ in clangStdenv.mkDerivation rec { ''; buildPhase = '' + runHook preBuild + python build_mozc.py build -c Release \ server/server.gyp:mozc_server \ gui/gui.gyp:mozc_tool \ unix/fcitx5/fcitx5.gyp:fcitx5-mozc + + runHook postBuild ''; installPhase = '' + runHook preInstall + export PREFIX=$out export _bldtype=Release ../scripts/install_server @@ -94,13 +107,23 @@ in clangStdenv.mkDerivation rec { install -d $out/share/fcitx5/inputmethod install -d $out/lib/fcitx5 ../scripts/install_fcitx5 + + runHook postInstall ''; + preFixup = '' + wrapQtApp $out/lib/mozc/mozc_tool + ''; + + passthru.tests = { + inherit (nixosTests) fcitx5; + }; + meta = with lib; { description = "Fcitx5 Module of A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"; homepage = "https://github.com/fcitx/mozc"; license = licenses.bsd3; - maintainers = with maintainers; [ berberman ]; + maintainers = with maintainers; [ berberman govanify ]; platforms = platforms.linux; }; } |