Unverified Commit 39d2a724 authored by natsukium's avatar natsukium
Browse files

python311Packages.sudachi-dict: fix build

parent ea1c1122
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
, fetchFromGitHub
, sudachidict
, setuptools
, sudachipy
}:

buildPythonPackage rec {
@@ -33,6 +34,10 @@ buildPythonPackage rec {
    setuptools
  ];

  propagatedBuildInputs = [
    sudachipy
  ];

  # we need to prepare some files before the build
  # https://github.com/WorksApplications/SudachiDict/blob/develop/package_python.sh
  preBuild = ''
+14 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
, pytestCheckHook
, sudachidict-core
, tokenizers
, sudachipy
}:

buildPythonPackage rec {
@@ -37,6 +38,9 @@ buildPythonPackage rec {
    cd python
  '';

  # avoid infinite recursion due to sudachidict
  doCheck = false;

  nativeCheckInputs = [
    pytestCheckHook
    sudachidict-core
@@ -49,6 +53,16 @@ buildPythonPackage rec {

  passthru = {
    inherit (sudachi-rs) updateScript;
    tests = {
      pytest = sudachipy.overridePythonAttrs (
        _: {
          doCheck = true;
          # avoid catchConflicts of sudachipy
          # we don't need to install this package since it is just a test
          dontInstall = true;
        }
      );
    };
  };

  meta = sudachi-rs.meta // {