bcb2f287e1
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
50 lines
939 B
Nix
50 lines
939 B
Nix
{
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
lib,
|
|
packaging,
|
|
pillow,
|
|
tesseract,
|
|
substituteAll,
|
|
pytestCheckHook,
|
|
setuptools,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pytesseract";
|
|
version = "0.3.13";
|
|
format = "pyproject";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "madmaze";
|
|
repo = pname;
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-gQMeck6ojlIwyiOCBBhzHHrjQfBMelVksVGd+fyxWZk=";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./tesseract-binary.patch;
|
|
drv = tesseract;
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
buildInputs = [ tesseract ];
|
|
|
|
propagatedBuildInputs = [
|
|
packaging
|
|
pillow
|
|
];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://pypi.org/project/pytesseract/";
|
|
license = licenses.asl20;
|
|
description = "Python wrapper for Google Tesseract";
|
|
mainProgram = "pytesseract";
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
}
|