Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcitx5-mozc: 2.26.4220.102 -> 2.30.5544.102 #346680

Merged
merged 10 commits into from
Oct 27, 2024
5 changes: 5 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14587,6 +14587,11 @@
githubId = 96225281;
name = "Mustafa Çalışkan";
};
musjj = {
name = "musjj";
github = "musjj";
githubId = 72612857;
};
mvisonneau = {
name = "Maxime VISONNEAU";
email = "[email protected]";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/by-name/fc/fcitx5-mozc-ut/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
fcitx5-mozc,
mozc-ut,
}:

fcitx5-mozc.override {
mozc = mozc-ut;
}
147 changes: 147 additions & 0 deletions pkgs/by-name/fc/fcitx5-mozc/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
bazel_7,
buildBazelPackage,
fcitx5,
fetchFromGitHub,
gettext,
lib,
mozc,
nixosTests,
pkg-config,
python3,
unzip,
}:

buildBazelPackage {
pname = "fcitx5-mozc";
version = "2.30.5544.102";

src = fetchFromGitHub {
owner = "fcitx";
repo = "mozc";
fetchSubmodules = true;
rev = "57e67f2a25e4c0861e0e422da0c7d4c232d89fcc";
hash = "sha256-1EZjEbMl+LRipH5gEgFpaKP8uEKPfupHmiiTNJc/T1k=";
};

nativeBuildInputs = [
gettext
pkg-config
python3
unzip
];

buildInputs = [
mozc
fcitx5
];

postPatch = ''
sed -i -e 's|^\(LINUX_MOZC_SERVER_DIR = \).\+|\1"${mozc}/lib/mozc"|' src/config.bzl
'';

bazel = bazel_7;
removeRulesCC = false;
dontAddBazelOpts = true;

bazelFlags = [
"--config"
"oss_linux"
"--compilation_mode"
"opt"
];

bazelTargets = [
"unix/fcitx5:fcitx5-mozc.so"
"unix/icons"
];

fetchAttrs = {
preInstall = ''
rm -rf $bazelOut/external/fcitx5
'';

sha256 = "sha256-wz2lJckr7Pu4jtoejjFv8LdjVO2+ferrS473M4jc86I=";
};

preConfigure = ''
cd src
'';

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;
};
h7x4 marked this conversation as resolved.
Show resolved Hide resolved

meta = with lib; {
description = "Mozc - a Japanese Input Method Editor designed for multi-platform";
homepage = "https://github.com/fcitx/mozc";
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;
};
}
23 changes: 23 additions & 0 deletions pkgs/by-name/mo/mozc-ut/package.nix
Original file line number Diff line number Diff line change
@@ -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
];
}
2 changes: 1 addition & 1 deletion pkgs/by-name/mo/mozc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let
ut-dictionary = merge-ut-dictionaries.override { inherit dictionaries; };
in
buildBazelPackage rec {
pname = "ibus-mozc";
pname = "mozc";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for changing this! I forgot about it.

version = "2.30.5544.102";

src = fetchFromGitHub {
Expand Down
129 changes: 0 additions & 129 deletions pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix

This file was deleted.

19 changes: 1 addition & 18 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6514,18 +6514,7 @@ with pkgs;

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

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 mozc-ut;
h7x4 marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down Expand Up @@ -7474,12 +7463,6 @@ 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-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { };

fcitx5-anthy = callPackage ../tools/inputmethods/fcitx5/fcitx5-anthy.nix { };
Expand Down