Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / videocr / default.nix
blob0685b184c4ab86b063b098233ccfd95965a46b9a
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , levenshtein
5 , pytesseract
6 , opencv4
7 , fuzzywuzzy
8 }:
10 buildPythonPackage rec {
11   pname = "videocr";
12   version = "0.1.6";
14   src = fetchPypi {
15     inherit pname version;
16     sha256 = "1clifwczvhvbaw2spgxkkyqsbqh21vyfw3rh094pxfmq89ylyj63";
17   };
19   propagatedBuildInputs = [
20     levenshtein
21     pytesseract
22     opencv4
23     fuzzywuzzy
24   ];
26   postPatch = ''
27     substituteInPlace setup.py \
28       --replace "python-Levenshtein" "Levenshtein" \
29       --replace "opencv-python" "opencv"
30     substituteInPlace videocr/constants.py \
31       --replace "master" "main"
32     substituteInPlace videocr/video.py \
33       --replace '--tessdata-dir "{}"' '--tessdata-dir="{}"'
34   '';
36   # Project has no tests
37   doCheck = false;
39   pythonImportsCheck = [ "videocr" ];
41   meta = with lib; {
42     description = "Extract hardcoded subtitles from videos using machine learning";
43     homepage = "https://github.com/apm1467/videocr";
44     license = licenses.mit;
45     maintainers = with maintainers; [ ozkutuk ];
46   };