git: 3f1cf94980fd - main - graphics/tesseract: update to 4.1.3

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Tue, 16 Nov 2021 12:11:13 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3f1cf94980fdec66bdb115c46c94635ec3b54572

commit 3f1cf94980fdec66bdb115c46c94635ec3b54572
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-11-16 12:04:01 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-11-16 12:04:01 +0000

    graphics/tesseract: update to 4.1.3
    
    - disable OPENMP, build is broken
    - switch to CMake
    - add some implicit dependencies
---
 graphics/tesseract/Makefile  | 42 +++++++++++++++++++++++-------------------
 graphics/tesseract/distinfo  |  6 +++---
 graphics/tesseract/pkg-plist | 34 +++++++---------------------------
 3 files changed, 33 insertions(+), 49 deletions(-)

diff --git a/graphics/tesseract/Makefile b/graphics/tesseract/Makefile
index 74e39eb651d8..0c16872a40c9 100644
--- a/graphics/tesseract/Makefile
+++ b/graphics/tesseract/Makefile
@@ -1,8 +1,7 @@
 # Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
 
 PORTNAME=	tesseract
-PORTVERSION=	4.1.1
-PORTREVISION=	5
+PORTVERSION=	4.1.3
 CATEGORIES=	graphics
 
 MAINTAINER=	pkubaj@FreeBSD.org
@@ -13,11 +12,15 @@ LICENSE=	APACHE20
 BUILD_DEPENDS=	asciidoc:textproc/asciidoc \
 		xsltproc:textproc/libxslt \
 		${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl
-LIB_DEPENDS=	liblept.so:graphics/leptonica
+LIB_DEPENDS=	liblept.so:graphics/leptonica \
+		libtiff.so:graphics/tiff \
+		libharfbuzz.so:print/harfbuzz \
+		libfreetype.so:print/freetype2
+
 RUN_DEPENDS=	tesseract-data>=0:graphics/tesseract-data
 
-USES=		autoreconf compiler:c++11-lang cpe gmake gnome localbase \
-		libtool pathfix pkgconfig shebangfix
+USES=		compiler:c++11-lang cmake cpe gnome libarchive libtool \
+		localbase pathfix pkgconfig shebangfix
 USE_LDCONFIG=	yes
 
 GNU_CONFIGURE=	yes
@@ -32,36 +35,37 @@ CONFIGURE_ENV=	LIBLEPT_HEADERSDIR="${LOCALBASE}/include/leptonica"
 DATADIR=	${PREFIX}/share/tessdata
 PORTDATA=	*
 PORTDOCS=	AUTHORS ChangeLog README.md
-INSTALL_TARGET=	install-strip
 SHEBANG_FILES=	src/training/language-specific.sh \
 		src/training/tesstrain.sh
 
 OPTIONS_DEFINE=	DOCS TOOLS
-OPTIONS_DEFINE_amd64=OPENMP
-OPTIONS_DEFINE_i386=OPENMP
-OPTIONS_DEFAULT=TOOLS
-OPTIONS_DEFAULT_amd64=OPENMP
-OPTIONS_DEFAULT_i386=OPENMP
+#OPTIONS_DEFINE_amd64=	OPENMP
+#OPTIONS_DEFINE_i386=	OPENMP
+#OPTIONS_DEFINE_powerpc64=	OPENMP
+#OPTIONS_DEFINE_powerpc64le=	OPENMP
+OPTIONS_DEFAULT=	TOOLS
+#OPTIONS_DEFAULT_amd64=	OPENMP
+#OPTIONS_DEFAULT_i386=	OPENMP
+#OPTIONS_DEFAULT_powerpc64=	OPENMP
+#OPTIONS_DEFAULT_powerpc64le=	OPENMP
 OPTIONS_SUB=	yes
 
-OPENMP_CONFIGURE_ENABLE=openmp
+#OPENMP_CMAKE_BOOL=	OPENMP_BUILD
 
+TOOLS_CMAKE_ON=	BUILD_TRAINING_TOOLS
 TOOLS_DESC=	Include training tools
 TOOLS_LIB_DEPENDS=libicui18n.so:devel/icu \
 		libfontconfig.so:x11-fonts/fontconfig
 TOOLS_USE=	GNOME=cairo,glib20,pango
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|-O3 -DNDEBUG||' ${WRKSRC}/configure.ac
+.include <bsd.port.options.mk>
 
-post-build-TOOLS-on:
-	@cd ${WRKSRC} && ${MAKE} training
+.if ${ARCH} != powerpc64 && ${ARCH} != riscv64
+CMAKE_ARGS+=	-DENABLE_LTO:BOOL=ON
+.endif
 
 post-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
 
-post-install-TOOLS-on:
-	@cd ${WRKSRC} && ${MAKE} DESTDIR=${STAGEDIR} training-install
-
 .include <bsd.port.mk>
diff --git a/graphics/tesseract/distinfo b/graphics/tesseract/distinfo
index a4b3b55d2d1c..fcca3ec163ad 100644
--- a/graphics/tesseract/distinfo
+++ b/graphics/tesseract/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1579706285
-SHA256 (tesseract-ocr-tesseract-4.1.1_GH0.tar.gz) = 2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb
-SIZE (tesseract-ocr-tesseract-4.1.1_GH0.tar.gz) = 1974988
+TIMESTAMP = 1636999899
+SHA256 (tesseract-ocr-tesseract-4.1.3_GH0.tar.gz) = 83dc56b544be938983f528c777e4e1d906205b0f6dc0110afc223f2cc1cec6d3
+SIZE (tesseract-ocr-tesseract-4.1.3_GH0.tar.gz) = 1975331
diff --git a/graphics/tesseract/pkg-plist b/graphics/tesseract/pkg-plist
index 97e86a355c36..e33b4922f8de 100644
--- a/graphics/tesseract/pkg-plist
+++ b/graphics/tesseract/pkg-plist
@@ -4,19 +4,19 @@
 %%TOOLS%%bin/combine_lang_model
 %%TOOLS%%bin/combine_tessdata
 %%TOOLS%%bin/dawg2wordlist
-%%TOOLS%%bin/language-specific.sh
-%%TOOLS%%bin/lstmtraining
 %%TOOLS%%bin/lstmeval
-%%TOOLS%%bin/merge_unicharsets
+%%TOOLS%%bin/lstmtraining
 %%TOOLS%%bin/mftraining
 %%TOOLS%%bin/set_unicharset_properties
 %%TOOLS%%bin/shapeclustering
 bin/tesseract
-%%TOOLS%%bin/tesstrain.sh
-%%TOOLS%%bin/tesstrain_utils.sh
 %%TOOLS%%bin/text2image
 %%TOOLS%%bin/unicharset_extractor
 %%TOOLS%%bin/wordlist2dawg
+cmake/TesseractConfig-version.cmake
+cmake/TesseractConfig.cmake
+cmake/TesseractTargets-%%CMAKE_BUILD_TYPE%%.cmake
+cmake/TesseractTargets.cmake
 include/tesseract/apitypes.h
 include/tesseract/baseapi.h
 include/tesseract/capi.h
@@ -32,30 +32,10 @@ include/tesseract/renderer.h
 include/tesseract/resultiterator.h
 include/tesseract/serialis.h
 include/tesseract/strngs.h
-include/tesseract/tesscallback.h
 include/tesseract/tess_version.h
+include/tesseract/tesscallback.h
 include/tesseract/thresholder.h
 include/tesseract/unichar.h
-lib/libtesseract.a
 lib/libtesseract.so
-lib/libtesseract.so.4
-lib/libtesseract.so.4.0.1
+lib/libtesseract.so.4.1.3
 libdata/pkgconfig/tesseract.pc
-man/man1/ambiguous_words.1.gz
-man/man1/classifier_tester.1.gz
-man/man1/cntraining.1.gz
-man/man1/combine_lang_model.1.gz
-man/man1/combine_tessdata.1.gz
-man/man1/dawg2wordlist.1.gz
-man/man1/lstmeval.1.gz
-man/man1/lstmtraining.1.gz
-man/man1/merge_unicharsets.1.gz
-man/man1/mftraining.1.gz
-man/man1/set_unicharset_properties.1.gz
-man/man1/shapeclustering.1.gz
-man/man1/tesseract.1.gz
-man/man1/text2image.1.gz
-man/man1/unicharset_extractor.1.gz
-man/man1/wordlist2dawg.1.gz
-man/man5/unicharambigs.5.gz
-man/man5/unicharset.5.gz