Files
nixpkgs/pkgs/development/python-modules/easyocr/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

85 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
hdf5,
numpy,
opencv-python-headless,
pillow,
pyaml,
pyclipper,
python-bidi,
scikit-image,
scipy,
shapely,
torch,
torchvision,
python,
}:
buildPythonPackage rec {
pname = "easyocr";
version = "1.7.2";
pyproject = true;
src = fetchFromGitHub {
owner = "JaidedAI";
repo = "EasyOCR";
tag = "v${version}";
hash = "sha256-9mrAxt2lphYtLW81lGO5SYHsnMnSA/VpHiY2NffD/Js=";
};
build-system = [
setuptools
];
pythonRelaxDeps = [
"torchvision"
];
pythonRemoveDeps = [
"ninja"
];
dependencies = [
hdf5
numpy
opencv-python-headless
pillow
pyaml
pyclipper
python-bidi
scikit-image
scipy
shapely
torch
torchvision
];
checkPhase = ''
runHook preCheck
export HOME="$(mktemp -d)"
pushd unit_test
${python.interpreter} run_unit_test.py --easyocr "$out/${python.sitePackages}/easyocr"
popd
runHook postCheck
'';
# downloads detection model from the internet
doCheck = false;
pythonImportsCheck = [ "easyocr" ];
meta = {
description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts";
mainProgram = "easyocr";
homepage = "https://github.com/JaidedAI/EasyOCR";
changelog = "https://github.com/JaidedAI/EasyOCR/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ dit7ya ];
};
}