2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
deprecated,
|
|
|
|
fetchFromGitHub,
|
|
|
|
importlib-metadata,
|
|
|
|
jaconv,
|
|
|
|
py-cpuinfo,
|
|
|
|
pytest-benchmark,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pykakasi";
|
|
|
|
version = "2.2.1";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "miurahr";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "pykakasi";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-ivlenHPD00bxc0c9G368tfTEckOC3vqDB5kMQzHXbVM==";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail ', "klepto"' ""
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools-scm ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2021-12-06 16:07:01 +00:00
|
|
|
jaconv
|
|
|
|
deprecated
|
2024-04-21 15:54:59 +00:00
|
|
|
setuptools
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-03-04 12:14:45 +00:00
|
|
|
py-cpuinfo
|
2021-12-06 16:07:01 +00:00
|
|
|
pytest-benchmark
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# We don't care about benchmarks
|
|
|
|
"test_benchmark"
|
|
|
|
"pytest_benchmark_update_machine_info"
|
|
|
|
"pytest_benchmark_update_json"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pykakasi" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python converter for Japanese Kana-kanji sentences into Kana-Roman";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "kakasi";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/miurahr/pykakasi";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/miurahr/pykakasi/releases/tag/v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|