On Mon, January 7, 2019 4:16 pm, Stuart Henderson wrote: > On 2019/01/07 16:06, Raphael Graf wrote: >> On 1/7/19 3:46 PM, Stuart Henderson wrote: >> > On 2019/01/07 15:29, Raphael Graf wrote: >> > > The diff below fixes the pkg-config file installed by tesseract. >> > > >> > > Before: >> > > x1$ pkg-config --cflags tesseract >> > > -I/usr/local/include/tesseract -I/usr/local/include/leptonica >> > > >> > > After: >> > > x1$ pkg-config --cflags tesseract >> > > -I/usr/local/include -I/usr/local/include/tesseract >> > > -I/usr/local/include/leptonica >> > > >> > > The fix is inspired by tesseract.pc.cmake (which we do not use): >> > > https://github.com/tesseract-ocr/tesseract/blob/3.05/tesseract.pc.cmake >> > > >> > > (The issue is already fixed in upstream version 4.0.0) >> > >> > Could you explain the problem please? I don't see anything different in >> > git master for this file, and don't see why -I/usr/local/include is needed >> > when the files are all in the subdirectory? >> >> The tesseract headers are normally included like this: >> #include <tesseract/baseapi.h> >> >> For example in one of the opencv_contrib modules: >> https://github.com/opencv/opencv_contrib/blob/master/modules/text/src/precomp.hpp >> >> The git master version uses '-I/usr/local/include' only. >> (It is not obvious if you are looking at tesseract.pc.in, the value of >> @includedir@ is in fact '/usr/local/include' now). > > Ah I see, thanks. Then the patch makes sense, but also needs a REVISION > bump since it changes the files in the package, and a quick build test > with the existing dependencies just to make sure it doesn't add a problem: > > graphics/pdfsandwich > mail/p5-FuzzyOcr > multimedia/ogmrip > x11/gnome/ocrfeeder > > Could you add a quick comment to the patch (under the CVS line) too e.g. > > Add -I/usr/local/include to include path. Typical users include headers > with "#include <tesseract/XX.h>". Patch should be removed for 4.0.0 as > fixed > upstream by changing @includedir@ definition. > >
Ok, I have successfully compile-tested those four ports. Here is an updated diff: Index: tesseract/Makefile =================================================================== RCS file: /cvs/ports/graphics/tesseract/tesseract/Makefile,v retrieving revision 1.16 diff -u -p -u -p -r1.16 Makefile --- tesseract/Makefile 4 Sep 2018 12:46:14 -0000 1.16 +++ tesseract/Makefile 7 Jan 2019 16:07:34 -0000 @@ -4,7 +4,7 @@ COMMENT= OCR Engine developed at HP Labs GH_PROJECT= tesseract GH_TAGNAME= 3.05.02 -REVISION= 1 +REVISION= 2 SHARED_LIBS += tesseract 3.2 # 3.5 Index: tesseract/patches/patch-tesseract_pc_in =================================================================== RCS file: tesseract/patches/patch-tesseract_pc_in diff -N tesseract/patches/patch-tesseract_pc_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tesseract/patches/patch-tesseract_pc_in 7 Jan 2019 16:07:34 -0000 @@ -0,0 +1,24 @@ +$OpenBSD$ + +Add -I/usr/local/include to include path. Typical users include headers +with "#include <tesseract/XX.h>". Patch should be removed for 4.0.0 as fixed +upstream by changing @includedir@ definition. + +Index: tesseract.pc.in +--- tesseract.pc.in.orig ++++ tesseract.pc.in +@@ -4,7 +4,7 @@ bindir=@bindir@ + datarootdir = @datarootdir@ + datadir=@datadir@ + libdir=@libdir@ +-includedir=@includedir@ ++includedir=@prefix@/include + + Name: @PACKAGE_NAME@ + Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google. +@@ -13,4 +13,4 @@ Version: @VERSION@ + Requires.private: lept + Libs: -L${libdir} -ltesseract + Libs.private: -lpthread @OPENCL_LDFLAGS@ +-Cflags: -I${includedir} ++Cflags: -I${includedir} -I${includedir}/tesseract