From becd20aa668995f514f1fc1299d979cd46824870 Mon Sep 17 00:00:00 2001 From: Berk Ozkutuk Date: Tue, 22 Feb 2022 22:43:58 +0300 Subject: [PATCH 1/2] python3Packages.videocr: init at 0.1.6 --- .../python-modules/videocr/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/videocr/default.nix diff --git a/pkgs/development/python-modules/videocr/default.nix b/pkgs/development/python-modules/videocr/default.nix new file mode 100644 index 000000000000..020f582d0e4b --- /dev/null +++ b/pkgs/development/python-modules/videocr/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchPypi +, python-Levenshtein +, pytesseract +, opencv4 +, fuzzywuzzy +}: + +buildPythonPackage rec { + pname = "videocr"; + version = "0.1.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "1clifwczvhvbaw2spgxkkyqsbqh21vyfw3rh094pxfmq89ylyj63"; + }; + + propagatedBuildInputs = [ + python-Levenshtein + pytesseract + opencv4 + fuzzywuzzy + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "opencv-python" "opencv" + substituteInPlace videocr/constants.py \ + --replace "master" "main" + substituteInPlace videocr/video.py \ + --replace '--tessdata-dir "{}"' '--tessdata-dir="{}"' + ''; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ "videocr" ]; + + meta = with lib; { + description = "Extract hardcoded subtitles from videos using machine learning"; + homepage = "https://github.com/apm1467/videocr"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 664c196a659b..3e7810fbf7ae 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10387,6 +10387,8 @@ in { veryprettytable = callPackage ../development/python-modules/veryprettytable { }; + videocr = callPackage ../development/python-modules/videocr { }; + vidstab = callPackage ../development/python-modules/vidstab { }; ViennaRNA = toPythonModule pkgs.ViennaRNA; From c995349365e82fcf8510a97d9847b9136e92cf49 Mon Sep 17 00:00:00 2001 From: Berk Ozkutuk Date: Tue, 22 Feb 2022 22:44:57 +0300 Subject: [PATCH 2/2] maintainers: Add ozkutuk --- maintainers/maintainer-list.nix | 6 ++++++ pkgs/development/python-modules/videocr/default.nix | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index f70ea32e02c2..5e20969554d5 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -9253,6 +9253,12 @@ githubId = 15930073; name = "Moritz Scheuren"; }; + ozkutuk = { + email = "ozkutuk@protonmail.com"; + github = "ozkutuk"; + githubId = 5948762; + name = "Berk Özkütük"; + }; pablovsky = { email = "dealberapablo07@gmail.com"; github = "pablo1107"; diff --git a/pkgs/development/python-modules/videocr/default.nix b/pkgs/development/python-modules/videocr/default.nix index 020f582d0e4b..a6ac156b7063 100644 --- a/pkgs/development/python-modules/videocr/default.nix +++ b/pkgs/development/python-modules/videocr/default.nix @@ -41,6 +41,6 @@ buildPythonPackage rec { description = "Extract hardcoded subtitles from videos using machine learning"; homepage = "https://github.com/apm1467/videocr"; license = licenses.mit; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ ozkutuk ]; }; }