Unverified Commit e3c43c5c authored by natsukium's avatar natsukium
Browse files

sudachi-rs: set updateScript

parent abde03c6
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
, sudachidict
, runCommand
, sudachi-rs
, writeScript
}:

rustPlatform.buildRustPackage rec {
@@ -30,13 +31,23 @@ rustPlatform.buildRustPackage rec {
    install -Dm644 resources/* -t $out/share/resources
  '';

  passthru.tests = {
  passthru = {
    updateScript = writeScript "update.sh" ''
      #!/usr/bin/env nix-shell
      #!nix-shell -i bash -p nix-update

      set -eu -o pipefail
      nix-update sudachi-rs
      nix-update --version=skip python3Packages.sudachipy
    '';
    tests = {
      # detects an error that sudachidict is not found
      cli = runCommand "${pname}-cli-test" { } ''
        mkdir $out
        echo "高輪ゲートウェイ駅" | ${lib.getExe sudachi-rs} > $out/result
      '';
    };
  };

  meta = with lib; {
    description = "A Japanese morphological analyzer";
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@ buildPythonPackage rec {
    "sudachipy"
  ];

  passthru = {
    inherit (sudachi-rs) updateScript;
  };

  meta = sudachi-rs.meta // {
    homepage = "https://github.com/WorksApplications/sudachi.rs/tree/develop/python";
    mainProgram = "sudachipy";