11 rustPlatform.buildRustPackage rec {
15 src = fetchFromGitHub {
16 owner = "WorksApplications";
19 hash = "sha256-2sJ9diE/EjrQmFcCc4VluE4Gu4RebTYitd7zzfgj3g4=";
23 substituteInPlace sudachi/src/config.rs \
24 --replace '"resources"' '"${placeholder "out"}/share/resources"'
27 cargoHash = "sha256-fFvuxLOerqdjYogfTH3JiSlNPw2t7QT09lxp7prIpA8=";
29 # prepare the resources before the build so that the binary can find sudachidict
31 install -Dm644 ${sudachidict}/share/system.dic resources/system.dic
32 install -Dm644 resources/* -t $out/share/resources
36 updateScript = writeScript "update.sh" ''
37 #!/usr/bin/env nix-shell
38 #!nix-shell -i bash -p nix-update
42 nix-update --version=skip python3Packages.sudachipy
45 # detects an error that sudachidict is not found
46 cli = runCommand "${pname}-cli-test" { } ''
48 echo "高輪ゲートウェイ駅" | ${lib.getExe sudachi-rs} > $out/result
54 description = "Japanese morphological analyzer";
55 homepage = "https://github.com/WorksApplications/sudachi.rs";
56 changelog = "https://github.com/WorksApplications/sudachi.rs/blob/${src.rev}/CHANGELOG.md";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ natsukium ];
59 mainProgram = "sudachi";