Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, hdf5 5, numpy 6, opencv3 7, pillow 8, pyaml 9, pyclipper 10, python-bidi 11, torch 12, scikit-image 13, scipy 14, shapely 15, torchvision 16, onnx 17}: 18 19buildPythonPackage rec { 20 pname = "easyocr"; 21 version = "1.6.2"; 22 23 src = fetchFromGitHub { 24 owner = "JaidedAI"; 25 repo = "EasyOCR"; 26 rev = "v${version}"; 27 hash = "sha256-f+JBSnFMRvVlhRRiL1rJb7a0CNjZPuh6r8r3K1meQCk="; 28 }; 29 30 postPatch = '' 31 substituteInPlace requirements.txt \ 32 --replace "opencv-python-headless<=4.5.4.60" "" \ 33 --replace "ninja" "" 34 ''; 35 36 propagatedBuildInputs = [ 37 scikit-image 38 hdf5 39 python-bidi 40 numpy 41 opencv3 42 torchvision 43 pillow 44 pyaml 45 pyclipper 46 torch 47 scipy 48 shapely 49 ]; 50 51 nativeCheckInputs = [ onnx ]; 52 53 pythonImportsCheck = [ "easyocr" ]; 54 55 meta = with lib; { 56 description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts"; 57 homepage = "https://github.com/JaidedAI/EasyOCR"; 58 license = licenses.asl20; 59 maintainers = with maintainers; [ dit7ya ]; 60 }; 61}