nixpkgs/pkgs/development/python-modules/pyocr/default.nix

37 lines
942 B
Nix
Raw Normal View History

2020-03-10 12:00:00 +00:00
{ lib, fetchFromGitLab, buildPythonPackage, pillow, setuptools_scm,
setuptools-scm-git-archive , tesseract, cuneiform, isPy3k, substituteAll,
pytest, tox }:
buildPythonPackage rec {
pname = "pyocr";
2020-03-10 12:00:00 +00:00
version = "0.7.2";
disabled = !isPy3k;
# Don't fetch from PYPI because it doesn't contain tests.
2018-09-10 16:27:56 +01:00
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
group = "World";
owner = "OpenPaperwork";
repo = "pyocr";
rev = version;
2020-03-10 12:00:00 +00:00
sha256 = "09ab86bmizpv94w3mdvdqkjyyvk1vafw3jqhkiw5xx7p180xn3il";
};
2018-09-10 16:27:56 +01:00
patches = [ (substituteAll {
src = ./paths.patch;
inherit cuneiform tesseract;
})
];
2020-03-10 12:00:00 +00:00
buildInputs = [ setuptools_scm setuptools-scm-git-archive ];
propagatedBuildInputs = [ pillow ];
2018-09-10 16:27:56 +01:00
checkInputs = [ pytest tox ];
checkPhase = "pytest";
meta = {
inherit (src.meta) homepage;
description = "A Python wrapper for Tesseract and Cuneiform";
license = lib.licenses.gpl3Plus;
};
}