nixpkgs/pkgs/development/python-modules/pyocr/default.nix
Martin Weinelt 8056f9250c
treewide: remove redundant SETUPTOOLS_SCM_PRETEND_VERSION usage
The setuptools-scm packages gained a setup hook, that sets it to the
derivation version automatically, so setting it to that manually has
become redundant.

This also affects downstream consumers of setuptools-scm, like hatch-vcs
or flit-scm.
2023-12-20 20:16:39 +01:00

51 lines
1.1 KiB
Nix

{ lib
, fetchFromGitLab
, buildPythonPackage
, pillow
, tesseract
, cuneiform
, isPy3k
, substituteAll
, pytestCheckHook
, setuptools
, setuptools-scm
}:
buildPythonPackage rec {
pname = "pyocr";
version = "0.8.5";
disabled = !isPy3k;
format = "pyproject";
# 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 = [
(substituteAll {
src = ./paths.patch;
inherit cuneiform tesseract;
})
];
propagatedBuildInputs = [ pillow ];
nativeBuildInputs = [ setuptools setuptools-scm ];
nativeCheckInputs = [ pytestCheckHook ];
meta = with lib; {
inherit (src.meta) homepage;
changelog = "https://gitlab.gnome.org/World/OpenPaperwork/pyocr/-/blob/${version}/ChangeLog";
description = "A Python wrapper for Tesseract and Cuneiform";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ symphorien ];
};
}