diff options
author | Shogo Takata <peshogo@gmail.com> | 2024-01-20 22:07:34 +0900 |
---|---|---|
committer | Shogo Takata <peshogo@gmail.com> | 2024-02-01 04:01:41 +0900 |
commit | efa2193ff08c7c897d5dff0c7411f703b420640f (patch) | |
tree | e6f4945b818c3394fe3ddae49651680bd27f0f68 /pkgs | |
parent | d01b5a56a259ec37c519c5f0dffbf0a76e31fe09 (diff) |
ibus-engines.mozc: 2.26.4660.102 -> 2.29.5268.102
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix | 109 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 5 |
2 files changed, 54 insertions, 60 deletions
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix index 118fb63f45e04..220c89ca175d9 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix @@ -1,83 +1,80 @@ -{ lib, stdenv, fetchFromGitHub, which, ninja, pkg-config, protobuf -, ibus, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese, python3Packages }: - -stdenv.mkDerivation rec { +{ lib +, buildBazelPackage +, fetchFromGitHub +, qt6 +, pkg-config +, bazel +, ibus +, unzip +, xdg-utils +}: +let + zip-codes = fetchFromGitHub { + owner = "musjj"; + repo = "jp-zip-codes"; + rev = "a1eed9bae0ba909c8c8f5387008b08ff490f5e57"; + hash = "sha256-VfI8qAMPPCC2H4vjm4a6sAmSwc1YkXlMyLm1cnufvrU="; + }; +in +buildBazelPackage rec { pname = "ibus-mozc"; - version = "2.26.4660.102"; + version = "2.29.5268.102"; src = fetchFromGitHub { owner = "google"; repo = "mozc"; - rev = "refs/tags/${version}"; - hash = "sha256-sgsfJZALpPHFB5bXu4OkRssViRDaPcgLfEyGhbqvJbI="; + rev = version; + hash = "sha256-B7hG8OUaQ1jmmcOPApJlPVcB8h1Rw06W5LAzlTzI9rU="; fetchSubmodules = true; }; - nativeBuildInputs = [ - which ninja python3Packages.python python3Packages.six - python3Packages.gyp pkg-config qt5.wrapQtAppsHook - ]; + nativeBuildInputs = [ qt6.wrapQtAppsHook pkg-config unzip ]; - buildInputs = [ protobuf ibus gtk2 zinnia qt5.qtbase libxcb ]; + buildInputs = [ ibus qt6.qtbase ]; - postUnpack = lib.optionalString stdenv.isLinux '' - sed -i 's/-lc++/-lstdc++/g' $sourceRoot/src/gyp/common.gypi - ''; + dontAddBazelOpts = true; + removeRulesCC = false; - configurePhase = '' - runHook preConfigure + inherit bazel; - 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" - cd src && python build_mozc.py gyp --gypdir=${python3Packages.gyp}/bin --server_dir=$out/lib/mozc + fetchAttrs = { + sha256 = "sha256-17QHh1MJUu8OK/T+WSpLXEx83DmRORLN7yLzILqP7vw="; - runHook postConfigure - ''; + # remove references of buildInputs + preInstall = '' + rm -rv $bazelOut/external/{ibus,qt_linux} + ''; + }; - buildPhase = '' - runHook preBuild + bazelFlags = [ "--config" "oss_linux" "--compilation_mode" "opt" ]; - 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 + bazelTargets = [ "package" ]; - runHook postBuild + postPatch = '' + substituteInPlace src/config.bzl \ + --replace-fail "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open" \ + --replace-fail "/usr" "$out" + substituteInPlace src/WORKSPACE.bazel \ + --replace-fail "https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip" "file://${zip-codes}/ken_all.zip" \ + --replace-fail "https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip" "file://${zip-codes}/jigyosyo.zip" ''; - installPhase = '' + preConfigure = '' + cd src + ''; + + buildAttrs.installPhase = '' runHook preInstall - install -d $out/share/licenses/mozc - head -n 29 server/mozc_server.cc > $out/share/licenses/mozc/LICENSE - install -m 644 data/installer/*.html $out/share/licenses/mozc/ - - 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 - wrapQtApp $out/lib/mozc/mozc_tool - - install -d $out/share/doc/mozc - install -m 644 data/installer/*.html $out/share/doc/mozc/ - - 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 - install -D -m 755 out_linux/Release/mozc_emacs_helper $out/lib/mozc/mozc_emacs_helper + unzip bazel-bin/unix/mozc.zip -x "tmp/*" -d / runHook postInstall ''; + passthru = { + inherit zip-codes; + }; + meta = with lib; { isIbusEngine = true; description = "Japanese input method from Google"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f82a065de04ad..939cd46822ed0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7057,10 +7057,7 @@ with pkgs; m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; - mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { - stdenv = clangStdenv; - protobuf = pkgs.protobuf_21.overrideDerivation (_: { stdenv = clangStdenv; }); - }; + mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { }; openbangla-keyboard = libsForQt5.callPackage ../applications/misc/openbangla-keyboard { withIbusSupport = true; }; |