python312Packages.videocr: modernize

This commit is contained in:
Peder Bergebakken Sundt 2024-08-24 18:50:30 +02:00
parent dda86a4a7b
commit 7b602b5456

View File

@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchPypi,
setuptools,
levenshtein,
pytesseract,
opencv4,
@ -11,14 +12,16 @@
buildPythonPackage rec {
pname = "videocr";
version = "0.1.6";
format = "setuptools";
pyproject = true;
src = fetchPypi {
inherit pname version;
sha256 = "1clifwczvhvbaw2spgxkkyqsbqh21vyfw3rh094pxfmq89ylyj63";
hash = "sha256-w0hPfUK4un5JAjAP7vwOAuKlsZ+zv6sFV2vD/Rl3kbI=";
};
propagatedBuildInputs = [
build-system = [ setuptools ];
dependencies = [
levenshtein
pytesseract
opencv4
@ -27,12 +30,12 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace setup.py \
--replace "python-Levenshtein" "Levenshtein" \
--replace "opencv-python" "opencv"
--replace-fail "python-Levenshtein" "Levenshtein" \
--replace-fail "opencv-python" "opencv"
substituteInPlace videocr/constants.py \
--replace "master" "main"
--replace-fail "master" "main"
substituteInPlace videocr/video.py \
--replace '--tessdata-dir "{}"' '--tessdata-dir="{}"'
--replace-fail '--tessdata-dir "{}"' '--tessdata-dir="{}"'
'';
# Project has no tests