Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Apr 2019 03:08:21 +0000 (UTC)
From:      Michael Gmelin <grembo@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r497458 - in head/graphics/tesseract: . files
Message-ID:  <201904010308.x3138LUV090764@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: grembo
Date: Mon Apr  1 03:08:20 2019
New Revision: 497458
URL: https://svnweb.freebsd.org/changeset/ports/497458

Log:
  Various build fixes:
  
  - Make sure man pages are always built correctly. They were
    only built if asciidoc happened to be installed and
    the output was XML instead of troff.
  - Fix build on 13-CURRENT - the build picked up
    OpenMP implicitly and didn't link the library to libomp
    properly, which broke dependent ports (like graphics/ffmpeg).
  - Fix build on releases if OpenMP was already installed.
  - Enable building with OpenMP support by default on i386
    and amd64.
  - Bump revision
  
  PR:		234285
  Approved by:	portmgr (build fix blanket)

Added:
  head/graphics/tesseract/files/patch-doc_Makefile.am   (contents, props changed)
Modified:
  head/graphics/tesseract/Makefile
  head/graphics/tesseract/files/patch-configure.ac
  head/graphics/tesseract/pkg-plist

Modified: head/graphics/tesseract/Makefile
==============================================================================
--- head/graphics/tesseract/Makefile	Mon Apr  1 01:48:41 2019	(r497457)
+++ head/graphics/tesseract/Makefile	Mon Apr  1 03:08:20 2019	(r497458)
@@ -3,7 +3,7 @@
 
 PORTNAME=	tesseract
 PORTVERSION=	4.0.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 
 MAINTAINER=	pkubaj@anongoth.pl
@@ -11,14 +11,18 @@ COMMENT=	Commercial quality open source OCR engine
 
 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
 RUN_DEPENDS=	tesseract-data>=0:graphics/tesseract-data
 
-USES=		autoreconf compiler:c++11-lang gnome localbase libtool pathfix \
-		pkgconfig shebangfix
-GNU_CONFIGURE=	yes
+USES=		autoreconf compiler:c++11-lang gmake gnome localbase \
+		libtool pathfix pkgconfig shebangfix
 USE_LDCONFIG=	yes
 
+GNU_CONFIGURE=	yes
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	${PORTNAME}-ocr
 
@@ -32,8 +36,17 @@ 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_SUB=	yes
+
+OPENMP_USES=	compiler:openmp
+OPENMP_CONFIGURE_ENABLE=openmp
+OPENMP_LIB_DEPENDS=libomp.so:devel/openmp
+
 TOOLS_DESC=	Include training tools
 TOOLS_LIB_DEPENDS=libicui18n.so:devel/icu \
 		libfontconfig.so:x11-fonts/fontconfig
@@ -42,6 +55,7 @@ TOOLS_USE=	GNOME=cairo,glib20,pango
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|-O3 -DNDEBUG||' ${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/doc/Makefile.am
 
 post-build-TOOLS-on:
 	@cd ${WRKSRC} && ${MAKE} training

Modified: head/graphics/tesseract/files/patch-configure.ac
==============================================================================
--- head/graphics/tesseract/files/patch-configure.ac	Mon Apr  1 01:48:41 2019	(r497457)
+++ head/graphics/tesseract/files/patch-configure.ac	Mon Apr  1 03:08:20 2019	(r497458)
@@ -1,12 +1,18 @@
 sem_init(3) is part of libc on FreeBSD, so we ended up not linking against
 libpthread. Look for a symbol that causes us to load it.
+libtesseract.so is not linked against libomp if openmp is enabled,
+which makes dependent ports fail. This adds a workaround by linking
+directly against libomp.
 --- configure.ac.orig	2019-03-26 21:58:42 UTC
 +++ configure.ac
-@@ -375,6 +375,7 @@ CXXFLAGS="$OLD_CXXFLAGS"
+@@ -375,6 +375,10 @@ CXXFLAGS="$OLD_CXXFLAGS"
  # ----------------------------------------
  
  AC_SEARCH_LIBS([sem_init], [pthread rt])
 +AC_SEARCH_LIBS([pthread_create], [pthread])
- 
++if test "$enable_openmp" != no; then
++  AC_SEARCH_LIBS([omp_get_thread_num ], [omp])
++fi
+
  
  # ----------------------------------------

Added: head/graphics/tesseract/files/patch-doc_Makefile.am
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/tesseract/files/patch-doc_Makefile.am	Mon Apr  1 03:08:20 2019	(r497458)
@@ -0,0 +1,15 @@
+--- doc/Makefile.am.orig	2019-03-28 05:11:18 UTC
++++ doc/Makefile.am
+@@ -36,7 +36,11 @@ EXTRA_DIST = $(man_MANS) Doxyfile
+ html: $(patsubst %,%.html,$(man_MANS))
+ 
+ %: %.asc
+-	$(asciidoc) -o $@ $<
++	$(asciidoc) $<
++	$(asciidoc) -b docbook $<
++	%%LOCALBASE%%/bin/xsltproc --nonet --param man.charmap.use.subset "0" \
++		%%LOCALBASE%%/share/xsl/docbook/manpages/docbook.xsl \
++		$@.xml
+ 
+ %.html: %.asc
+ 	asciidoc -b html5 -o $@ $<

Modified: head/graphics/tesseract/pkg-plist
==============================================================================
--- head/graphics/tesseract/pkg-plist	Mon Apr  1 01:48:41 2019	(r497457)
+++ head/graphics/tesseract/pkg-plist	Mon Apr  1 03:08:20 2019	(r497458)
@@ -42,3 +42,21 @@ lib/libtesseract.so
 lib/libtesseract.so.4
 lib/libtesseract.so.4.0.0
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904010308.x3138LUV090764>