From f68c665bfbadc9ba10d8001355130da92fc4b26b Mon Sep 17 00:00:00 2001 From: ryota2357 Date: Sun, 30 Nov 2025 09:44:01 +0900 Subject: [PATCH] babeldoc: init at 0.5.22 --- pkgs/by-name/ba/babeldoc/package.nix | 90 ++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 pkgs/by-name/ba/babeldoc/package.nix diff --git a/pkgs/by-name/ba/babeldoc/package.nix b/pkgs/by-name/ba/babeldoc/package.nix new file mode 100644 index 000000000000..9555945b107c --- /dev/null +++ b/pkgs/by-name/ba/babeldoc/package.nix @@ -0,0 +1,90 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + fetchpatch2, + writableTmpDirAsHomeHook, + versionCheckHook, +}: + +python3Packages.buildPythonApplication rec { + pname = "babeldoc"; + version = "0.5.22"; + pyproject = true; + + src = fetchFromGitHub { + owner = "funstory-ai"; + repo = "BabelDOC"; + tag = "v${version}"; + hash = "sha256-ArLTv5AjpUdbsN8bQs03ATwg5ugXetld2FmHhicU8OE="; + }; + + patches = [ + (fetchpatch2 { + name = "rename-python-levenshtein-to-levenshtein"; + url = "https://github.com/funstory-ai/BabelDOC/pull/542.patch?full_index=1"; + hash = "sha256-rjXhKVFivkJo54WdYiihqB3lrlu4YEwVZZkE4WBatWs="; + }) + ]; + + build-system = with python3Packages; [ hatchling ]; + + dependencies = + with python3Packages; + [ + bitstring + configargparse + httpx + huggingface-hub + numpy + onnx + onnxruntime + openai + orjson + charset-normalizer + cryptography + peewee + psutil + pymupdf + rich + toml + tqdm + xsdata + msgpack + pydantic + tenacity + scikit-image + freetype-py + tiktoken + levenshtein + opencv-python-headless + rapidocr-onnxruntime + pyzstd + hyperscan + rtree + chardet + scipy + uharfbuzz + scikit-learn + ] + ++ httpx.optional-dependencies.socks + ++ (with xsdata.optional-dependencies; cli ++ lxml ++ soap); + + pythonImportsCheck = [ "babeldoc" ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + python3Packages.pytestCheckHook + versionCheckHook + ]; + versionCheckKeepEnvironment = "HOME"; + + meta = { + description = "PDF scientific paper translation and bilingual comparison library"; + homepage = "https://github.com/funstory-ai/BabelDOC"; + changelog = "https://github.com/funstory-ai/BabelDOC/releases/tag/${src.tag}"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ ryota2357 ]; + mainProgram = "babeldoc"; + }; +}