git: f36130b65a70 - main - graphics/py-tesserocr: new port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 03 Jul 2026 17:42:20 UTC
The branch main has been updated by cmt:
URL: https://cgit.FreeBSD.org/ports/commit/?id=f36130b65a704e1f58193fffc0de524f5593fca5
commit f36130b65a704e1f58193fffc0de524f5593fca5
Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2026-07-03 17:41:33 +0000
Commit: Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2026-07-03 17:41:33 +0000
graphics/py-tesserocr: new port
Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
https://github.com/sirfz/tesserocr
---
graphics/Makefile | 1 +
graphics/py-tesserocr/Makefile | 27 +++++++++++++++++++++++++++
graphics/py-tesserocr/distinfo | 3 +++
graphics/py-tesserocr/files/patch-setup.py | 13 +++++++++++++
graphics/py-tesserocr/pkg-descr | 7 +++++++
graphics/py-tesserocr/pkg-plist | 9 +++++++++
6 files changed, 60 insertions(+)
diff --git a/graphics/Makefile b/graphics/Makefile
index 136506156b1e..e8a2807ada7f 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -1066,6 +1066,7 @@
SUBDIR += py-svgwrite
SUBDIR += py-term-image
SUBDIR += py-termtosvg
+ SUBDIR += py-tesserocr
SUBDIR += py-tifffile
SUBDIR += py-tkcolorpicker
SUBDIR += py-toyplot
diff --git a/graphics/py-tesserocr/Makefile b/graphics/py-tesserocr/Makefile
new file mode 100644
index 000000000000..c03be2ad5473
--- /dev/null
+++ b/graphics/py-tesserocr/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= tesserocr
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.10.0
+CATEGORIES= graphics python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= cmt@FreeBSD.org
+COMMENT= Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
+WWW= https://github.com/sirfz/tesserocr
+
+LICENSE= MIT
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}cysignals>0:devel/py-cysignals@${PY_FLAVOR}
+LIB_DEPENDS= libtesseract.so:graphics/tesseract \
+ libleptonica.so:graphics/leptonica
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cysignals>0:devel/py-cysignals@${PY_FLAVOR}
+
+USES= compiler:c++17-lang pkgconfig python
+USE_GITHUB= yes
+GH_ACCOUNT= sirfz
+USE_PYTHON= cython pep517
+
+PLIST_SUB= DISTVERSION=${DISTVERSION}
+
+.include <bsd.port.mk>
diff --git a/graphics/py-tesserocr/distinfo b/graphics/py-tesserocr/distinfo
new file mode 100644
index 000000000000..bf9297be24ac
--- /dev/null
+++ b/graphics/py-tesserocr/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1782062331
+SHA256 (sirfz-tesserocr-v2.10.0_GH0.tar.gz) = 3c710d8bcea39716755546b0b5fe847e90e73fb9444839aa6175002f4f1d700c
+SIZE (sirfz-tesserocr-v2.10.0_GH0.tar.gz) = 75114
diff --git a/graphics/py-tesserocr/files/patch-setup.py b/graphics/py-tesserocr/files/patch-setup.py
new file mode 100644
index 000000000000..889c896981c4
--- /dev/null
+++ b/graphics/py-tesserocr/files/patch-setup.py
@@ -0,0 +1,13 @@
+diff --git setup.py setup.py
+index b06c872..fba3906 100644
+--- setup.py
++++ setup.py
+@@ -318,7 +318,7 @@ setup(
+ cmdclass={"build_ext": my_build_ext},
+ ext_modules=[make_extension()],
+ test_suite="tests",
+- setup_requires=["Cython>=3.0.0,<3.2.0", "cysignals"],
++ setup_requires=["Cython>=3.0.0", "cysignals"],
+ install_requires=["cysignals"],
+ packages=["tesserocr"],
+ package_dir={"tesserocr": "tesserocr"},
diff --git a/graphics/py-tesserocr/pkg-descr b/graphics/py-tesserocr/pkg-descr
new file mode 100644
index 000000000000..1871119049bf
--- /dev/null
+++ b/graphics/py-tesserocr/pkg-descr
@@ -0,0 +1,7 @@
+tesserocr integrates directly with Tesseract’s C++ API using Cython which
+allows for a simple Pythonic and easy-to-read source code. It enables real
+concurrent execution when used with Python’s threading module by releasing
+the GIL while processing an image in tesseract.
+
+tesserocr is designed to be Pillow-friendly but can also be used with image
+files instead.
diff --git a/graphics/py-tesserocr/pkg-plist b/graphics/py-tesserocr/pkg-plist
new file mode 100644
index 000000000000..7edbfae90aa2
--- /dev/null
+++ b/graphics/py-tesserocr/pkg-plist
@@ -0,0 +1,9 @@
+%%PYTHON_SITELIBDIR%%/tesserocr-%%DISTVERSION%%.dist-info/LICENSE
+%%PYTHON_SITELIBDIR%%/tesserocr-%%DISTVERSION%%.dist-info/METADATA
+%%PYTHON_SITELIBDIR%%/tesserocr-%%DISTVERSION%%.dist-info/RECORD
+%%PYTHON_SITELIBDIR%%/tesserocr-%%DISTVERSION%%.dist-info/WHEEL
+%%PYTHON_SITELIBDIR%%/tesserocr-%%DISTVERSION%%.dist-info/top_level.txt
+%%PYTHON_SITELIBDIR%%/tesserocr/__init__.py
+%%PYTHON_SITELIBDIR%%/tesserocr/__pycache__/__init__%%PYTHON_TAG%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/tesserocr/__pycache__/__init__%%PYTHON_TAG%%.pyc
+%%PYTHON_SITELIBDIR%%/tesserocr/tesserocr%%PYTHON_TAG%%.so