1{ buildPythonPackage
2, fetchPypi
3, lib
4
5# build dependencies
6, cython
7, leptonica
8, pkg-config
9, tesseract
10
11# propagates
12, pillow
13
14# tests
15, unittestCheckHook
16}:
17
18buildPythonPackage rec {
19 pname = "tesserocr";
20 version = "2.5.2";
21
22 src = fetchPypi {
23 inherit pname version;
24 sha256 = "1bmj76gi8401lcqdaaznfmz9yf11myy1bzivqwwq08z3dwzxswck";
25 };
26
27 nativeBuildInputs = [
28 cython
29 pkg-config
30 ];
31
32 buildInputs = [
33 leptonica
34 tesseract
35 ];
36
37 propagatedBuildInputs = [
38 pillow
39 ];
40
41 pythonImportsCheck = [
42 "tesserocr"
43 ];
44
45 checkInputs = [
46 unittestCheckHook
47 ];
48
49 meta = with lib; {
50 changelog = "https://github.com/sirfz/tesserocr/releases/tag/v${version}";
51 description = "A simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR)";
52 homepage = "https://github.com/sirfz/tesserocr";
53 license = licenses.mit;
54 maintainers = with maintainers; [ mtrsk ];
55 platforms = platforms.linux;
56 };
57}