nixpkgs/pkgs/development/python-modules/pyocr/default.nix
Michael Daniels 075e8c2c4f
treewide: change 'format = "pyproject";' to 'pyproject = true;'
This is almost all find-and-replace.

I manually edited:
* pkgs/development/python-modules/notifications-android-tv/default.nix,
* pkgs/servers/home-assistant/default.nix,
* pkgs/development/tools/continuous-integration/buildbot/master.nix

A few files have not been changed in this PR because they would cause rebuilds.

This PR should have 0 rebuilds.
2026-01-12 17:50:35 -05:00

67 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
buildPythonPackage,
pillow,
tesseract,
cuneiform,
isPy3k,
replaceVars,
pytestCheckHook,
setuptools,
setuptools-scm,
withTesseractSupport ? true,
withCuneiformSupport ? false,
}:
buildPythonPackage rec {
pname = "pyocr";
version = "0.8.5";
disabled = !isPy3k;
pyproject = true;
# Don't fetch from PYPI because it doesn't contain tests.
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
group = "World";
owner = "OpenPaperwork";
repo = "pyocr";
rev = version;
hash = "sha256-gE0+qbHCwpDdxXFY+4rjVU2FbUSfSVrvrVMcWUk+9FU=";
};
patches =
[ ]
++ (lib.optional withTesseractSupport (
replaceVars ./paths-tesseract.patch {
inherit tesseract;
tesseractLibraryLocation = "${tesseract}/lib/libtesseract${stdenv.hostPlatform.extensions.sharedLibrary}";
}
))
++ (lib.optional withCuneiformSupport (
replaceVars ./paths-cuneiform.patch {
inherit cuneiform;
}
));
propagatedBuildInputs = [ pillow ];
nativeBuildInputs = [
setuptools
setuptools-scm
];
nativeCheckInputs = [ pytestCheckHook ];
meta = {
inherit (src.meta) homepage;
changelog = "https://gitlab.gnome.org/World/OpenPaperwork/pyocr/-/blob/${version}/ChangeLog";
description = "Python wrapper for Tesseract and Cuneiform";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
symphorien
tomodachi94
];
};
}