ibus-engines.mozc-ut: init at 2.30.5544.102 (#314248)

This commit is contained in:
h7x4 2024-09-21 20:18:30 +02:00 committed by GitHub
commit 9a0f009815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 607 additions and 32 deletions

View File

@ -0,0 +1,48 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "jawiki-all-titles-in-ns0";
version = "0-unstable-2024-09-11";
src = fetchFromGitHub {
owner = "musjj";
repo = "jawiki-archive";
rev = "d205f63665e351ea853edc72157f14daa22a227f";
hash = "sha256-Jj2vH8UMhgSzWv+RnOipnVNSdeOF6jttcLN/kVYa4D4=";
};
installPhase = ''
runHook preInstall
mkdir $out
cp jawiki-latest-all-titles-in-ns0.gz $out/jawiki-all-titles-in-ns0.gz
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "A jawiki dump list of page titles in main namespace";
homepage = "https://dumps.wikimedia.org/backup-index.html";
license = with lib.licenses; [
fdl13Only
cc-by-sa-30
];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides a dump gz file
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,46 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "jp-zip-code";
version = "0-unstable-2024-08-01";
# This package uses a mirror as the source because the
# original provider uses the same URL for updated content.
src = fetchFromGitHub {
owner = "musjj";
repo = "jp-zip-codes";
rev = "94139331b79d8e23cd089fb9ad511ce55079154a";
hash = "sha256-e+wsJv2cP2wUwVNimWy0eYr32pr7YUy8pJAYDYbk0zo=";
};
installPhase = ''
runHook preInstall
install -Dt $out ken_all.zip
install -Dt $out jigyosyo.zip
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Zip files containing japanese zip codes";
longDescription = "Zip files with japanese zip codes for japanese IME dictionaries";
homepage = "https://github.com/musjj/jp-zip-codes";
license = lib.licenses.publicDomain;
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,90 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
python3,
jawiki-all-titles-in-ns0,
ibus-engines,
mozcdic-ut-jawiki,
mozcdic-ut-personal-names,
mozcdic-ut-place-names,
mozcdic-ut-sudachidict,
dictionaries ? [
mozcdic-ut-jawiki
mozcdic-ut-personal-names
mozcdic-ut-place-names
mozcdic-ut-sudachidict
],
}:
assert lib.assertMsg (dictionaries != [ ]) "merge-ut-dictionaries needs at least one dictionary.";
stdenvNoCC.mkDerivation {
pname = "merge-ut-dictionaries";
version = "0-unstable-2024-08-28";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "merge-ut-dictionaries";
rev = "9cacaadfc4a199914726687ad6545bfd7152c001";
hash = "sha256-AdcwXl+33pyN8Q95EDNwMps3ObCzys8nicege6yeRk8=";
};
nativeBuildInputs = [ python3 ];
preConfigure = ''
cd src
substituteInPlace make.sh \
--replace-fail "git" "true #" \
--replace-fail "mv mozcdic-ut" "#"
substituteInPlace count_word_hits.py \
--replace-fail 'subprocess.run' "#" \
--replace-fail "jawiki-latest-all-titles-in-ns0.gz" "${jawiki-all-titles-in-ns0}/jawiki-all-titles-in-ns0.gz"
substituteInPlace remove_duplicate_ut_entries.py \
--replace-fail "url =" 'url = "${ibus-engines.mozc.src}/src/data/dictionary_oss/id.def"#' \
--replace-fail "urllib.request.urlopen" "open" \
--replace-fail "read().decode()" "read()"
for dir in ${lib.concatStringsSep " " dictionaries}; do
cp -v $dir/mozcdic-ut-*.txt.tar.bz2 .
done
'';
buildPhase = ''
runHook preBuild
bash make.sh
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut.txt
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT dictionaries are additional dictionaries for Mozc.";
homepage = "https://github.com/utuhiro78/merge-ut-dictionaries";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides a dictionary
hydraPlatforms = [ ];
};
}

View File

@ -1,36 +1,43 @@
{ lib
, buildBazelPackage
, fetchFromGitHub
, qt6
, pkg-config
, bazel
, ibus
, unzip
, xdg-utils
{
lib,
buildBazelPackage,
fetchFromGitHub,
qt6,
pkg-config,
bazel,
ibus,
unzip,
xdg-utils,
jp-zip-codes,
dictionaries ? [ ],
merge-ut-dictionaries,
}:
let
zip-codes = fetchFromGitHub {
owner = "musjj";
repo = "jp-zip-codes";
rev = "119c888a38032a92e139c52cd26f45bb495c4d54";
hash = "sha256-uyAL2TcFJsYZACFDAxIQ4LE40Hi4PVrQRnJl5O5+RmU=";
};
ut-dictionary = merge-ut-dictionaries.override { inherit dictionaries; };
in
buildBazelPackage rec {
pname = "ibus-mozc";
version = "2.29.5374.102";
version = "2.30.5544.102";
src = fetchFromGitHub {
owner = "google";
repo = "mozc";
rev = version;
hash = "sha256-AcIN5sWPBe4JotAUYv1fytgQw+mJzdFhKuVPLR48soA=";
hash = "sha256-w0bjoMmq8gL7DSehEG7cKqp5e4kNOXnCYLW31Zl9FRs=";
fetchSubmodules = true;
};
nativeBuildInputs = [ qt6.wrapQtAppsHook pkg-config unzip ];
nativeBuildInputs = [
qt6.wrapQtAppsHook
pkg-config
unzip
];
buildInputs = [ ibus qt6.qtbase ];
buildInputs = [
ibus
qt6.qtbase
];
dontAddBazelOpts = true;
removeRulesCC = false;
@ -38,7 +45,7 @@ buildBazelPackage rec {
inherit bazel;
fetchAttrs = {
sha256 = "sha256-ToBLVJpAQErL/P1bfWJca2FjhDW5XTrwuJQLquwlrhA=";
sha256 = "sha256-+N7AhSemcfhq6j0IUeWZ0DyVvr1l5FbAkB+kahTy3pM=";
# remove references of buildInputs and zip code files
preInstall = ''
@ -46,7 +53,12 @@ buildBazelPackage rec {
'';
};
bazelFlags = [ "--config" "oss_linux" "--compilation_mode" "opt" ];
bazelFlags = [
"--config"
"oss_linux"
"--compilation_mode"
"opt"
];
bazelTargets = [ "package" ];
@ -55,13 +67,17 @@ buildBazelPackage rec {
--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"
--replace-fail "https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip" "file://${jp-zip-codes}/ken_all.zip" \
--replace-fail "https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip" "file://${jp-zip-codes}/jigyosyo.zip"
'';
preConfigure = ''
cd src
'';
preConfigure =
''
cd src
''
+ lib.optionalString (dictionaries != [ ]) ''
cat ${ut-dictionary}/mozcdic-ut.txt >> data/dictionary_oss/dictionary00.txt
'';
buildAttrs.installPhase = ''
runHook preInstall
@ -78,10 +94,6 @@ buildBazelPackage rec {
runHook postInstall
'';
passthru = {
inherit zip-codes;
};
meta = with lib; {
isIbusEngine = true;
description = "Japanese input method from Google";
@ -89,6 +101,10 @@ buildBazelPackage rec {
homepage = "https://github.com/google/mozc";
license = licenses.free;
platforms = platforms.linux;
maintainers = with maintainers; [ gebner ericsagnes pineapplehunter ];
maintainers = with maintainers; [
gebner
ericsagnes
pineapplehunter
];
};
}

View File

@ -0,0 +1,47 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-alt-cannadic";
version = "0-unstable-2024-07-28";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-alt-cannadic";
rev = "50fee0397b87fe508f9edd45bac56f5290d8ce66";
hash = "sha256-KKUj3d9yR2kTTTFbroZQs+OZR4KUyAUYE/X3z9/vQvM=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-alt-cannadic.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT Alt-Cannadic Dictionary is a dictionary converted from Alt-Cannadic for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-alt-cannadic";
license = with lib.licenses; [
asl20
gpl2
];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,47 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-edict2";
version = "0-unstable-2024-07-28";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-edict2";
rev = "b2112277d0d479b9218f42772356da3601b3e8cf";
hash = "sha256-DIIp8FooWxyHMrQmq+2KUGEmYHKy+H6NtHrvRldxXqc=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-edict2.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT EDICT2 Dictionary is a dictionary converted from EDICT2 for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-sudachidict";
license = with lib.licenses; [
asl20
cc-by-sa-40
];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,47 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-jawiki";
version = "0-unstable-2024-08-23";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-jawiki";
rev = "08814f70cc0cc9b0f4757fa46f40d918dfd7073d";
hash = "sha256-Sfw5cNXuno3aSUUPy9c3HODIu9cVSmskTwibD8w8jaM=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-jawiki.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT Jawiki Dictionary is a dictionary generated from the Japanese Wikipedia for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-jawiki";
license = with lib.licenses; [
asl20
cc-by-sa-40
];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,44 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-neologd";
version = "0-unstable-2024-07-28";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-neologd";
rev = "b7035b88db25ad1a933f05a33f193711c6c3b2db";
hash = "sha256-JPTrWaDtdNs/Z0uLRwaS8Qc/l4/Y7NtwLanivyefXnk=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-neologd.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT NEologd Dictionary is a dictionary converted from mecab-ipadic-NEologd for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-neologd";
license = with lib.licenses; [ asl20 ];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,44 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-personal-names";
version = "0-unstable-2024-08-06";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-personal-names";
rev = "79e1192de922bba74ce45f59fd591f1cd9a061f5";
hash = "sha256-5cfoeQS7H4uMRi7CQGFwdwDetihWKNVdFdON+/syvDA=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-personal-names.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT Personal Name Dictionary is a dictionary for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-personal-names";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,44 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-place-names";
version = "0-unstable-2024-08-06";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-place-names";
rev = "e606f2336b79bf0fa7fad3a0eb6a1a9baebafcb9";
hash = "sha256-IKn5ge8OiAidAmqr5+F7f4b1nUPa0ZT0n+5PfvkJKAs=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-place-names.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT Place Name Dictionary is a dictionary converted from the Japan Post's ZIP code data for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-place-names";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,47 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-skk-jisyo";
version = "0-unstable-2024-07-27";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-skk-jisyo";
rev = "7300f19e6a3f27334ed7af64589de8782549a13f";
hash = "sha256-LJ1rP+uyh8K3IWCgKMDYt0EwEDiQqQL+wBdQCFbZM/k=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-skk-jisyo.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT SKK-JISYO Dictionary is a dictionary converted from SKK-JISYO for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-sudachidict";
license = with lib.licenses; [
asl20
gpl2Plus
];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -0,0 +1,44 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
nix-update-script,
}:
stdenvNoCC.mkDerivation {
pname = "mozcdic-ut-sudachidict";
version = "0-unstable-2024-07-28";
src = fetchFromGitHub {
owner = "utuhiro78";
repo = "mozcdic-ut-sudachidict";
rev = "a754f1fff5fded62cc066aa6be0ab0169059a144";
hash = "sha256-WzhWNpqtiG9TtFHEOSbHG1mbb4ak0zCkO13g9ZWqyBE=";
};
installPhase = ''
runHook preInstall
install -Dt $out mozcdic-ut-sudachidict.txt.tar.bz2
runHook postInstall
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "Mozc UT SudachiDict Dictionary is a dictionary converted from SudachiDict for Mozc.";
homepage = "https://github.com/utuhiro78/mozcdic-ut-sudachidict";
license = with lib.licenses; [ asl20 ];
maintainers = with lib.maintainers; [ pineapplehunter ];
platforms = lib.platforms.all;
# this does not need to be separately built
# it only provides some zip files
hydraPlatforms = [ ];
};
}

View File

@ -6552,7 +6552,18 @@ with pkgs;
m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { };
mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { };
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
]; };
openbangla-keyboard = libsForQt5.callPackage ../applications/misc/openbangla-keyboard { withIbusSupport = true; };