summaryrefslogtreecommitdiff
path: root/graphics/py-pytesseract/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/py-pytesseract/Makefile')
-rw-r--r--graphics/py-pytesseract/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/graphics/py-pytesseract/Makefile b/graphics/py-pytesseract/Makefile
index 541f47401242..c3ec6d410828 100644
--- a/graphics/py-pytesseract/Makefile
+++ b/graphics/py-pytesseract/Makefile
@@ -1,6 +1,5 @@
PORTNAME= pytesseract
-PORTVERSION= 0.3.9
-PORTREVISION= 1
+PORTVERSION= 0.3.10
DISTVERSIONPREFIX= v
CATEGORIES= graphics python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -28,6 +27,16 @@ USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
do-test:
+ # FIXME hack alert. graphics/leptonica by default does not include
+ # jpeg2000 (openjpeg) support, and the pytesseract self-test is not
+ # smart enough to detect that and skip the test, so let us check
+ # and punch out the jpeg2000 test if it is pointless running it.
+ # https://github.com/madmaze/pytesseract/issues/419
+ @if ${READELF} -d ${LOCALBASE}/lib/liblept.so | ${EGREP} -q '\<NEEDED\>.+\<libopenjp2\.so\.[[:digit:]]' ; then : ; else \
+ if [ $$? -ne 1 ] ; then exit 1 ; fi ; \
+ ${ECHO_MSG} >&2 '===> liblept.so (graphics/leptonica) is linked without libopenjp2, disabling JPEG2000 test' ; \
+ ${REINPLACE_CMD} '/jpeg2000/d' ${WRKSRC}/tests/pytesseract_test.py ; \
+ fi
cd ${WRKSRC} && ${SETENV} ${TEST_ENV} tox-${PYTHON_VER} -e ${PY_FLAVOR} --sitepackages
.include <bsd.port.pre.mk>