Commit 2549b02f authored by NaCNO's avatar NaCNO
Browse files

mozc: make ibus dependency optional (opt-in)

parent 6f2c54f3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@

- `mercure` has been update to `0.21.4` (or later). Version [0.21.0](https://github.com/dunglas/mercure/releases/v0.21.0) and [0.21.2](https://github.com/dunglas/mercure/releases/tag/v0.21.2) introduce breaking changes to the package.

- `mozc` and `mozc-ut` no longer contains the IBus front-end, which are now provided by `ibus-engines.mozc` and `ibus-engines.mozc-ut`.

- `n8n` has been updated to version 2. You can find the breaking changes here: https://docs.n8n.io/2-0-breaking-changes/.

- `gurk-rs` has been updated from `0.6.4` to `0.8.0`. Version `0.8.0` includes breaking changes. For more information read the [release notes for 0.8.0](https://github.com/boxdot/gurk-rs/releases/tag/v0.8.0).
+2 −0
Original line number Diff line number Diff line
@@ -8,8 +8,10 @@
  mozcdic-ut-place-names,
  mozcdic-ut-skk-jisyo,
  mozcdic-ut-sudachidict,
  withIbus ? false,
}:
mozc.override {
  inherit withIbus;
  dictionaries = [
    mozcdic-ut-alt-cannadic
    mozcdic-ut-edict2
+35 −6
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
  protobuf_27,
  bazel_7,
  ibus,
  withIbus ? false,
  unzip,
  xdg-utils,
  jp-zip-codes,
@@ -36,9 +37,9 @@ buildBazelPackage rec {
  ];

  buildInputs = [
    ibus
    qt6.qtbase
  ];
  ]
  ++ lib.optional withIbus ibus;

  dontAddBazelOpts = true;
  removeRulesCC = false;
@@ -65,7 +66,18 @@ buildBazelPackage rec {
    "opt"
  ];

  bazelTargets = [ "package" ];
  bazelTargets = [
    "unix/icons"
    "gui/tool:mozc_tool"
    "server:mozc_server"
    "unix/emacs:mozc_emacs_helper"
    "unix/emacs:mozc.el"
    "renderer/qt:mozc_renderer"
  ]
  ++ lib.optionals withIbus [
    "unix/ibus:gen_mozc_xml"
    "unix/ibus:ibus_mozc"
  ];

  postPatch = ''
    # replace protobuf with our own
@@ -89,8 +101,25 @@ buildBazelPackage rec {
  buildAttrs.installPhase = ''
    runHook preInstall

    unzip bazel-bin/unix/mozc.zip -x "tmp/*" -d /

    install -Dm555 "bazel-bin/server/mozc_server"           "$out/lib/mozc/mozc_server"
    install -Dm555 "bazel-bin/renderer/qt/mozc_renderer"    "$out/lib/mozc/mozc_renderer"
    install -Dm555 "bazel-bin/gui/tool/mozc_tool"           "$out/lib/mozc/mozc_tool"
    install -Dm555 "bazel-bin/unix/emacs/mozc_emacs_helper" "$out/bin/mozc_emacs_helper"
    install -Dm444 "unix/emacs/mozc.el"                     "$out/share/emacs/site-lisp/emacs-mozc/mozc.el"
    install -d "$out/share/icons/mozc/"
    unzip bazel-bin/unix/icons.zip -d "$out/share/icons/mozc/"
  ''
  + (lib.optionalString withIbus ''
    install -Dm555 "bazel-bin/unix/ibus/ibus_mozc"          "$out/lib/ibus-mozc/ibus-engine-mozc"
    install -Dm555 "bazel-bin/unix/ibus/mozc.xml"           "$out/share/ibus/components/mozc.xml"
    install -d "$out/share/ibus-mozc/"
    for icon in $out/share/icons/mozc/*.png
    do
      cp $icon $out/share/ibus-mozc/
    done
    mv $out/share/ibus-mozc/{mozc,product_icon}.png
  '')
  + ''
    # create a desktop file for gnome-control-center
    # copied from ubuntu
    mkdir -p $out/share/applications
@@ -102,7 +131,7 @@ buildBazelPackage rec {
  '';

  meta = {
    isIbusEngine = true;
    isIbusEngine = withIbus;
    description = "Japanese input method from Google";
    mainProgram = "mozc_emacs_helper";
    homepage = "https://github.com/google/mozc";
+2 −1
Original line number Diff line number Diff line
@@ -2236,7 +2236,8 @@ with pkgs;

    m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { };

    inherit mozc mozc-ut;
    mozc = mozc.override { withIbus = true; };
    mozc-ut = mozc-ut.override { withIbus = true; };

    openbangla-keyboard = libsForQt5.callPackage ../applications/misc/openbangla-keyboard {
      withIbusSupport = true;