evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / pyocr / default.nix
blob7df733b680a0fb07ed311b69c0bcdde293de0233
2   lib,
3   stdenv,
4   fetchFromGitLab,
5   buildPythonPackage,
6   pillow,
7   tesseract,
8   cuneiform,
9   isPy3k,
10   substituteAll,
11   pytestCheckHook,
12   setuptools,
13   setuptools-scm,
14   withTesseractSupport ? true,
15   withCuneiformSupport ? stdenv.hostPlatform.isLinux,
18 buildPythonPackage rec {
19   pname = "pyocr";
20   version = "0.8.5";
21   disabled = !isPy3k;
22   format = "pyproject";
24   # Don't fetch from PYPI because it doesn't contain tests.
25   src = fetchFromGitLab {
26     domain = "gitlab.gnome.org";
27     group = "World";
28     owner = "OpenPaperwork";
29     repo = "pyocr";
30     rev = version;
31     hash = "sha256-gE0+qbHCwpDdxXFY+4rjVU2FbUSfSVrvrVMcWUk+9FU=";
32   };
34   patches =
35     [ ]
36     ++ (lib.optional withTesseractSupport (substituteAll {
37       src = ./paths-tesseract.patch;
38       inherit tesseract;
39       tesseractLibraryLocation = "${tesseract}/lib/libtesseract${stdenv.hostPlatform.extensions.sharedLibrary}";
40     }))
41     ++ (lib.optional stdenv.hostPlatform.isLinux (substituteAll {
42       src = ./paths-cuneiform.patch;
43       inherit cuneiform;
44     }));
46   propagatedBuildInputs = [ pillow ];
48   nativeBuildInputs = [
49     setuptools
50     setuptools-scm
51   ];
53   nativeCheckInputs = [ pytestCheckHook ];
55   meta = with lib; {
56     inherit (src.meta) homepage;
57     changelog = "https://gitlab.gnome.org/World/OpenPaperwork/pyocr/-/blob/${version}/ChangeLog";
58     description = "Python wrapper for Tesseract and Cuneiform";
59     license = licenses.gpl3Plus;
60     maintainers = with maintainers; [
61       symphorien
62       tomodachi94
63     ];
64   };