Admins will be upgrading ORNL GitLab Servers on Saturday, 16 May 2026, from 7 AM until 11 AM EST. Repositories will experience intermittent outages during this time.
# Upstream expects the source files to be under rapidocr/rapidocr
# instead of rapidocr for the wheel to build correctly.
# Upstream expects the source files to be under rapidocr_onnxruntime/rapidocr_onnxruntime
# instead of rapidocr_onnxruntime for the wheel to build correctly.
preBuild=''
mkdir rapidocr_t
mv rapidocr rapidocr_t
mv rapidocr_t rapidocr
mkdir rapidocr_onnxruntime_t
mv rapidocr_onnxruntime rapidocr_onnxruntime_t
mv rapidocr_onnxruntime_t rapidocr_onnxruntime
'';
# Revert the above hack
postBuild=''
mv rapidocr rapidocr_t
mv rapidocr_t/* .
mv rapidocr_onnxruntime rapidocr_onnxruntime_t
mv rapidocr_onnxruntime_t/* .
'';
build-system=[setuptools];
dependencies=[
colorlog
numpy
omegaconf
onnxruntime
opencv-python
pillow
pyclipper
pyyaml
requests
shapely
opencv-python
numpy
six
shapely
pyyaml
pillow
onnxruntime
tqdm
];
pythonImportsCheck=["rapidocr"];
pythonImportsCheck=["rapidocr_onnxruntime"];
nativeCheckInputs=[
pytestCheckHook
requests
];
# These are tests for different backends.
disabledTestPaths=[
"tests/test_vino.py"
"tests/test_paddle.py"
];
disabledTests=[
# Needs Internet access
"test_long_img"
];
# As of version 2.1.0, 61 out of 70 tests require internet access.
# It's just not plausible to manually pick out ones that actually work
# in a hermetic build environment anymore :(
doCheck=false;
# rapidocr-onnxruntime has been renamed to rapidocr by upstream since 2.0.0. However, some packages like open-webui still requires rapidocr-onnxruntime 1.4.4. Therefore we set no auto update here.
# nixpkgs-update: no auto update
passthru.skipBulkUpdate=true;
meta={
# This seems to be related to https://github.com/microsoft/onnxruntime/issues/10038