From c46f9d2a3c94f18671f1a2367161aa06a49bbf79 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:02:07 +0700 Subject: [PATCH 01/10] mozc: rename ibus-mozc -> mozc This package can be consumed and used by not just ibus, but by many other packages/tools, so it should have a more generic name. --- pkgs/by-name/mo/mozc/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/mo/mozc/package.nix b/pkgs/by-name/mo/mozc/package.nix index b374329d23ff9..a1b0e804f4525 100644 --- a/pkgs/by-name/mo/mozc/package.nix +++ b/pkgs/by-name/mo/mozc/package.nix @@ -17,7 +17,7 @@ let ut-dictionary = merge-ut-dictionaries.override { inherit dictionaries; }; in buildBazelPackage rec { - pname = "ibus-mozc"; + pname = "mozc"; version = "2.30.5544.102"; src = fetchFromGitHub { From 309fe2dd49d6197abb6907cc7d0de5dfb2433cc8 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:09:39 +0700 Subject: [PATCH 02/10] mozc-ut: move to the top-level namespace mozc-ut is not an ibus-exclusive package, so it should live in a higher namespace --- pkgs/top-level/all-packages.nix | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7db8390e79645..e74c2a3d98ff8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6467,6 +6467,17 @@ with pkgs; libskk = callPackage ../development/libraries/libskk { }; + mozc-ut = mozc.override { dictionaries = [ + mozcdic-ut-alt-cannadic + mozcdic-ut-edict2 + mozcdic-ut-jawiki + mozcdic-ut-neologd + mozcdic-ut-personal-names + mozcdic-ut-place-names + mozcdic-ut-skk-jisyo + mozcdic-ut-sudachidict + ]; }; + m17-cxx-demod = callPackage ../applications/radio/m17-cxx-demod { }; m17n_db = callPackage ../tools/inputmethods/m17n-db { }; @@ -6516,16 +6527,7 @@ with pkgs; inherit mozc; - mozc-ut = mozc.override { dictionaries = [ - mozcdic-ut-alt-cannadic - mozcdic-ut-edict2 - mozcdic-ut-jawiki - mozcdic-ut-neologd - mozcdic-ut-personal-names - mozcdic-ut-place-names - mozcdic-ut-skk-jisyo - mozcdic-ut-sudachidict - ]; }; + inherit mozc-ut; openbangla-keyboard = libsForQt5.callPackage ../applications/misc/openbangla-keyboard { withIbusSupport = true; }; @@ -7474,10 +7476,10 @@ with pkgs; fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { }; - fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { - abseil-cpp = abseil-cpp.override { - cxxStandard = "17"; - }; + fcitx5-mozc = callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { }; + + fcitx5-mozc-ut = callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { + mozc = mozc-ut; }; fcitx5-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; From 08278f16f8ed00d78ec3e549fa1e936cfcc77cf2 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:11:25 +0700 Subject: [PATCH 03/10] licenses: add naist-2003 --- lib/licenses.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/licenses.nix b/lib/licenses.nix index b1da1541c21de..e8e2dcf76fc5a 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -942,6 +942,11 @@ lib.mapAttrs mkLicense ({ url = "https://license.coscl.org.cn/MulanPSL2"; }; + naist-2003 = { + spdxId = "NAIST-2003"; + fullName = "Nara Institute of Science and Technology License (2003)"; + }; + nasa13 = { spdxId = "NASA-1.3"; fullName = "NASA Open Source Agreement 1.3"; From 96df1422108321d7b202dfbf5c476840eff20a1f Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:12:14 +0700 Subject: [PATCH 04/10] maintainers: add musjj --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 246a78bc02ab0..52bae480b708d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -14587,6 +14587,11 @@ githubId = 96225281; name = "Mustafa Çalışkan"; }; + musjj = { + name = "musjj"; + github = "musjj"; + githubId = 72612857; + }; mvisonneau = { name = "Maxime VISONNEAU"; email = "maxime@visonneau.fr"; From 85d7a2abf0332256d84977025f868c2f01d3c96a Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:17:46 +0700 Subject: [PATCH 05/10] fcitx5-mozc: 2.26.4220.102 -> 2.30.5544.102 --- .../tools/inputmethods/fcitx5/fcitx5-mozc.nix | 218 ++++++++++-------- pkgs/top-level/all-packages.nix | 4 +- 2 files changed, 118 insertions(+), 104 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix index e58db09f706c3..13f863478ad32 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix @@ -1,129 +1,145 @@ -{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch -, python3Packages, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5 -, 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"; - rev = "e5b3425575734c323e1d947009dd74709437b684"; - sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm"; - }; - zipcode_rel = "202011"; - jigyosyo = fetchurl { - url = "https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${zipcode_rel}.zip"; - sha256 = "j7MkNtd4+QTi91EreVig4/OV0o5y1+KIjEJBEmLK/mY="; - }; - x-ken-all = fetchurl { - url = - "https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${zipcode_rel}.zip"; - sha256 = "ExS0Cg3rs0I9IOVbZHLt8UEfk8/LmY9oAHPVVlYuTPw="; - }; - -in clangStdenv.mkDerivation { +{ + bazel_7, + buildBazelPackage, + fcitx5, + fetchFromGitHub, + gettext, + lib, + mozc, + nixosTests, + pkg-config, + python3, + unzip, +}: + +buildBazelPackage { pname = "fcitx5-mozc"; - version = "2.26.4220.102"; + version = "2.30.5544.102"; src = fetchFromGitHub { owner = "fcitx"; repo = "mozc"; - rev = "1882e33b61673b66d63277f82b4c80ae4e506c10"; - sha256 = "R+w0slVFpqtt7PIr1pyupJjRoQsABVZiMdZ9fKGKAqw="; + fetchSubmodules = true; + rev = "57e67f2a25e4c0861e0e422da0c7d4c232d89fcc"; + hash = "sha256-1EZjEbMl+LRipH5gEgFpaKP8uEKPfupHmiiTNJc/T1k="; }; - nativeBuildInputs = [ gyp ninja python pkg-config qt5.wrapQtAppsHook six which unzip ]; + sourceRoot = "source/src"; - buildInputs = [ protobuf zinnia qt5.qtbase fcitx5 abseil-cpp jsoncpp gtest gtk2 ]; - - patches = [ - # Support linking system abseil-cpp - (fetchpatch { - url = "https://salsa.debian.org/debian/mozc/-/raw/debian/sid/debian/patches/0007-Update-src-base-absl.gyp.patch"; - sha256 = "UiS0UScDKyAusXOhc7Bg8dF8ARQQiVTylEhAOxqaZt8="; - }) + nativeBuildInputs = [ + gettext + pkg-config + python3 + unzip + ]; + buildInputs = [ + mozc + fcitx5 ]; - 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 - rmdir $sourceRoot/src/third_party/gtest/ - ln -s ${gtest} $sourceRoot/src/third_party/gtest - rmdir $sourceRoot/src/third_party/gyp/ - ln -s ${gyp} $sourceRoot/src/third_party/gyp - rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/ - ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary + postPatch = '' + sed -i -e 's|^\(LINUX_MOZC_SERVER_DIR = \).\+|\1"${mozc}/lib/mozc"|' config.bzl ''; - # Copied from https://github.com/archlinux/svntogit-community/blob/packages/fcitx5-mozc/trunk/PKGBUILD - configurePhase = '' - cd src - export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_libabseil=1" - - # disable fcitx4 - rm unix/fcitx/fcitx.gyp - - # gen zip code seed - PYTHONPATH="$PWD:$PYTHONPATH" python dictionary/gen_zip_code_seed.py --zip_code="x-ken-all.csv" --jigyosyo="JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt - - # use libstdc++ instead of libc++ - sed "/stdlib=libc++/d;/-lc++/d" -i gyp/common.gypi + bazel = bazel_7; + removeRulesCC = false; + dontAddBazelOpts = true; - # run gyp - python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc - ''; - - buildPhase = '' - runHook preBuild + bazelFlags = [ + "--config" + "oss_linux" + "--compilation_mode" + "opt" + ]; - python build_mozc.py build -c Release \ - server/server.gyp:mozc_server \ - gui/gui.gyp:mozc_tool \ - unix/fcitx5/fcitx5.gyp:fcitx5-mozc + bazelTargets = [ + "unix/fcitx5:fcitx5-mozc.so" + "unix/icons" + ]; - runHook postBuild - ''; + fetchAttrs = { + preInstall = '' + rm -rf $bazelOut/external/fcitx5 + ''; - installPhase = '' - runHook preInstall - - export PREFIX=$out - export _bldtype=Release - ../scripts/install_server - install -d $out/share/licenses/fcitx5-mozc - head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx5-mozc/LICENSE - install -m644 data/installer/*.html $out/share/licenses/fcitx5-mozc/ - install -d $out/share/fcitx5/addon - install -d $out/share/fcitx5/inputmethod - install -d $out/lib/fcitx5 - ../scripts/install_fcitx5 - - runHook postInstall - ''; + sha256 = "sha256-wz2lJckr7Pu4jtoejjFv8LdjVO2+ferrS473M4jc86I="; + }; - preFixup = '' - wrapQtApp $out/lib/mozc/mozc_tool - ''; + buildAttrs = { + installPhase = '' + runHook preInstall + + install -Dm444 ../LICENSE $out/share/licenses/fcitx5-mozc/LICENSE + install -Dm444 data/installer/credits_en.html $out/share/licenses/fcitx5-mozc/Submodules + + install -Dm555 bazel-bin/unix/fcitx5/fcitx5-mozc.so $out/lib/fcitx5/fcitx5-mozc.so + install -Dm444 unix/fcitx5/mozc-addon.conf $out/share/fcitx5/addon/mozc.conf + install -Dm444 unix/fcitx5/mozc.conf $out/share/fcitx5/inputmethod/mozc.conf + + for pofile in unix/fcitx5/po/*.po; do + filename=$(basename $pofile) + lang=''${filename/.po/} + mofile=''${pofile/.po/.mo} + msgfmt $pofile -o $mofile + install -Dm444 $mofile $out/share/locale/$lang/LC_MESSAGES/fcitx5-mozc.mo + done + + 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 + install -Dm444 unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml $out/share/metainfo/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml + + cd bazel-bin/unix + + unzip -o icons.zip + + # These are relative symlinks, they will always resolve to files within $out + + install -Dm444 mozc.png $out/share/icons/hicolor/128x128/apps/org.fcitx.Fcitx5.fcitx_mozc.png + ln -s org.fcitx.Fcitx5.fcitx_mozc.png $out/share/icons/hicolor/128x128/apps/fcitx_mozc.png + + for svg in \ + alpha_full.svg \ + alpha_half.svg \ + direct.svg \ + hiragana.svg \ + katakana_full.svg \ + katakana_half.svg \ + outlined/dictionary.svg \ + outlined/properties.svg \ + outlined/tool.svg + do + name=$(basename -- $svg) + path=$out/share/icons/hicolor/scalable/apps + prefix=org.fcitx.Fcitx5.fcitx_mozc + + install -Dm444 $svg $path/$prefix_$name + ln -s $prefix_$name $path/fcitx_mozc_$name + done + + runHook postInstall + ''; + }; 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)"; + description = "Mozc - a Japanese Input Method Editor designed for multi-platform"; homepage = "https://github.com/fcitx/mozc"; - license = licenses.bsd3; - maintainers = with maintainers; [ berberman govanify ]; + license = with licenses; [ + asl20 # abseil-cpp + bsd3 # mozc, breakpad, gtest, gyp, japanese-usage-dictionary, protobuf + mit # wil + naist-2003 # IPAdic + publicDomain # src/data/test/stress_test, Okinawa dictionary + unicode-30 # src/data/unicode, breakpad + ]; + maintainers = with maintainers; [ + berberman + govanify + musjj + ]; platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e74c2a3d98ff8..afae5287db4b4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7478,9 +7478,7 @@ with pkgs; fcitx5-mozc = callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { }; - fcitx5-mozc-ut = callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { - mozc = mozc-ut; - }; + fcitx5-mozc-ut = fcitx5-mozc.override { mozc = mozc-ut; }; fcitx5-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; From 8aea7153f3f290e5d8ab45c483e428d81423078d Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sun, 6 Oct 2024 02:52:08 +0700 Subject: [PATCH 06/10] fcitx5-mozc: coalesce inherit statements --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index afae5287db4b4..6e0051d437227 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6525,9 +6525,7 @@ with pkgs; m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; - inherit mozc; - - inherit mozc-ut; + inherit mozc mozc-ut; openbangla-keyboard = libsForQt5.callPackage ../applications/misc/openbangla-keyboard { withIbusSupport = true; }; From 936e9a7d54554e32d72f2f3c5bf77fdeb1bf88d9 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:54:51 +0700 Subject: [PATCH 07/10] {fcitx5-mozc,fcitx5-mozc-ut}: move to by-name --- pkgs/by-name/fc/fcitx5-mozc-ut/package.nix | 8 ++++++++ .../fc/fcitx5-mozc/package.nix} | 0 pkgs/top-level/all-packages.nix | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 pkgs/by-name/fc/fcitx5-mozc-ut/package.nix rename pkgs/{tools/inputmethods/fcitx5/fcitx5-mozc.nix => by-name/fc/fcitx5-mozc/package.nix} (100%) diff --git a/pkgs/by-name/fc/fcitx5-mozc-ut/package.nix b/pkgs/by-name/fc/fcitx5-mozc-ut/package.nix new file mode 100644 index 0000000000000..7580b0181e337 --- /dev/null +++ b/pkgs/by-name/fc/fcitx5-mozc-ut/package.nix @@ -0,0 +1,8 @@ +{ + fcitx5-mozc, + mozc-ut, +}: + +fcitx5-mozc.override { + mozc = mozc-ut; +} diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix b/pkgs/by-name/fc/fcitx5-mozc/package.nix similarity index 100% rename from pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix rename to pkgs/by-name/fc/fcitx5-mozc/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6e0051d437227..147714e846fc3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7474,10 +7474,6 @@ with pkgs; fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { }; - fcitx5-mozc = callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { }; - - fcitx5-mozc-ut = fcitx5-mozc.override { mozc = mozc-ut; }; - fcitx5-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; fcitx5-anthy = callPackage ../tools/inputmethods/fcitx5/fcitx5-anthy.nix { }; From b8c086008602dcac53875e89c8aa0e3b46a65d20 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:06:16 +0700 Subject: [PATCH 08/10] mozc-ut: move to by-name --- pkgs/by-name/mo/mozc-ut/package.nix | 23 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 11 ----------- 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 pkgs/by-name/mo/mozc-ut/package.nix diff --git a/pkgs/by-name/mo/mozc-ut/package.nix b/pkgs/by-name/mo/mozc-ut/package.nix new file mode 100644 index 0000000000000..a758f1e8d6220 --- /dev/null +++ b/pkgs/by-name/mo/mozc-ut/package.nix @@ -0,0 +1,23 @@ +{ + mozc, + mozcdic-ut-alt-cannadic, + mozcdic-ut-edict2, + mozcdic-ut-jawiki, + mozcdic-ut-neologd, + mozcdic-ut-personal-names, + mozcdic-ut-place-names, + mozcdic-ut-skk-jisyo, + mozcdic-ut-sudachidict, +}: +mozc.override { + dictionaries = [ + mozcdic-ut-alt-cannadic + mozcdic-ut-edict2 + mozcdic-ut-jawiki + mozcdic-ut-neologd + mozcdic-ut-personal-names + mozcdic-ut-place-names + mozcdic-ut-skk-jisyo + mozcdic-ut-sudachidict + ]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 147714e846fc3..5658fc2028a76 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6467,17 +6467,6 @@ with pkgs; libskk = callPackage ../development/libraries/libskk { }; - mozc-ut = mozc.override { dictionaries = [ - mozcdic-ut-alt-cannadic - mozcdic-ut-edict2 - mozcdic-ut-jawiki - mozcdic-ut-neologd - mozcdic-ut-personal-names - mozcdic-ut-place-names - mozcdic-ut-skk-jisyo - mozcdic-ut-sudachidict - ]; }; - m17-cxx-demod = callPackage ../applications/radio/m17-cxx-demod { }; m17n_db = callPackage ../tools/inputmethods/m17n-db { }; From ba0f4f4fbec72cf638a6c5281607e5089941fc40 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:42:06 +0700 Subject: [PATCH 09/10] fcitx5-mozc: use cd instead of sourceRoot --- pkgs/by-name/fc/fcitx5-mozc/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/fc/fcitx5-mozc/package.nix b/pkgs/by-name/fc/fcitx5-mozc/package.nix index 13f863478ad32..b455db820e84e 100644 --- a/pkgs/by-name/fc/fcitx5-mozc/package.nix +++ b/pkgs/by-name/fc/fcitx5-mozc/package.nix @@ -24,8 +24,6 @@ buildBazelPackage { hash = "sha256-1EZjEbMl+LRipH5gEgFpaKP8uEKPfupHmiiTNJc/T1k="; }; - sourceRoot = "source/src"; - nativeBuildInputs = [ gettext pkg-config @@ -39,7 +37,7 @@ buildBazelPackage { ]; postPatch = '' - sed -i -e 's|^\(LINUX_MOZC_SERVER_DIR = \).\+|\1"${mozc}/lib/mozc"|' config.bzl + sed -i -e 's|^\(LINUX_MOZC_SERVER_DIR = \).\+|\1"${mozc}/lib/mozc"|' src/config.bzl ''; bazel = bazel_7; @@ -66,6 +64,10 @@ buildBazelPackage { sha256 = "sha256-wz2lJckr7Pu4jtoejjFv8LdjVO2+ferrS473M4jc86I="; }; + preConfigure = '' + cd src + ''; + buildAttrs = { installPhase = '' runHook preInstall From 65648a8f164edcfd0c177a2feca343f96ff9b383 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sat, 26 Oct 2024 18:43:01 +0700 Subject: [PATCH 10/10] fcitx5-mozc: attempt to fix tests Co-authored-by: h7x4 --- pkgs/by-name/fc/fcitx5-mozc/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fc/fcitx5-mozc/package.nix b/pkgs/by-name/fc/fcitx5-mozc/package.nix index b455db820e84e..43535fd935455 100644 --- a/pkgs/by-name/fc/fcitx5-mozc/package.nix +++ b/pkgs/by-name/fc/fcitx5-mozc/package.nix @@ -9,6 +9,7 @@ nixosTests, pkg-config, python3, + stdenv, unzip, }: @@ -122,7 +123,7 @@ buildBazelPackage { ''; }; - passthru.tests = { + passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit (nixosTests) fcitx5; };