Opened 6 years ago

Closed 6 years ago

#56059 closed defect (fixed)

tesseract @3.0.5: library name is wrong, pkg-config file has wrong contents

Reported by: mainka (Jérôme Mainka) Owned by: markemer (Mark Anderson)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc: stromnov (Andrey Stromnov)
Port: tesseract

Description

After a port selfupdate and a port upgrade outdated command, port rev-upgrade gives the following error message:

Could not open /opt/local/lib/libtesseract.3.dylib: Error opening or reading file (referenced from /opt/local/lib/libopencv_text.3.3.1.dylib)

The installed files are:

$ port contents tesseract
Port tesseract contains:
<snip>
  /opt/local/lib/liblibtesseract.dylib
  /opt/local/lib/liblibtesseract.3.0.5.dylib

Notice the liblib prefix and the missing libtesseract.3.dylib.

pkg-config seems ill-configured too:

$ pkg-config --libs tesseract
-L/opt/local/lib -ltesseract_OUTPUT_NAME-NOTFOUND

So, opencv cannot be rebuilt.

Attachments (1)

tesseract.contents.txt (1.5 KB) - added by mainka (Jérôme Mainka) 6 years ago.
port contents tesseract result

Download all attachments as: .zip

Change History (13)

Changed 6 years ago by mainka (Jérôme Mainka)

Attachment: tesseract.contents.txt added

port contents tesseract result

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Cc: markemer removed
Owner: set to markemer
Status: newassigned

comment:2 Changed 6 years ago by markemer (Mark Anderson)

Does tesseract itself run?

comment:3 Changed 6 years ago by mainka (Jérôme Mainka)

Yes. (At least, it seems so, because I don't use tesseract). The binary is linked to the curious library name.

$ otool -L /opt/local/bin/tesseract
/opt/local/bin/tesseract:
	/opt/local/lib/liblibtesseract.3.0.5.dylib (compatibility version 3.0.5, current version 3.0.5)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	/opt/local/lib/liblept.5.dylib (compatibility version 6.0.0, current version 6.1.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)

comment:4 Changed 6 years ago by markemer (Mark Anderson)

Yeah mine is working too, and it's installing stuff in /opt/local/cmake despite PortGroup cmake 1.1 saying it should be in /opt/local/share/cmake or something.

comment:5 Changed 6 years ago by markemer (Mark Anderson)

Also, what variants do you have opencv installed with?

comment:6 in reply to:  5 Changed 6 years ago by mainka (Jérôme Mainka)

Replying to markemer:

Also, what variants do you have opencv installed with?

$ port -v installed opencv
The following ports are currently installed:
  opencv @3.3.1_1+contrib+python35 (active) platform='darwin 16' archs='x86_64' date='2017-12-20T10:59:42+0100'

comment:7 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Certainly, the filename liblibtesseract.3.0.5.dylib that the tesseract port installs is wrong in two respects:

  1. The "lib" prefix should not appear twice
  2. The version number in the filename should be the major version only, e.g. 3

Since the library name has already changed in 3.0.5, and will change again when the above problems are fixed, all ports that link with the library need to be rebuilt by increasing their revision. According to my search, the only affected port should be olena with the +scribo variant.

opencv does not declare a dependency on tesseract, but on Jérôme's system, it apparently uses it. We need to discover why it does that, and either add a tesseract dependency to opencv, or prevent opencv from using tesseract even if tesseract is installed.

comment:8 in reply to:  7 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: stromnov added
Summary: tesseract installation seems brokentesseract @3.0.5: library name is wrong, pkg-config file has wrong contents

Replying to ryandesign:

opencv does not declare a dependency on tesseract, but on Jérôme's system, it apparently uses it. We need to discover why it does that, and either add a tesseract dependency to opencv, or prevent opencv from using tesseract even if tesseract is installed.

It comes from opencv's +contrib variant.

comment:9 Changed 6 years ago by stromnov (Andrey Stromnov)

comment:10 Changed 6 years ago by markemer (Mark Anderson)

So, should I bump to 4.0 something which will include all of the fixes? It seems like 03.05.01 was released broken.

In the meantime is there a way to apply 52cac3a42ef2b823b9367b9ee2d1d84f8eda4ea0 from github, or should I just make a CMakefile.txt.patch

comment:11 in reply to:  9 Changed 6 years ago by markemer (Mark Anderson)

Thanks, I'm searching for a pkgconfig fix too, I think it's in here somewhere.

Replying to stromnov:

"Fix library being named liblibtesseract on non win32 platforms" - https://github.com/tesseract-ocr/tesseract/pull/1100/commits/52cac3a42ef2b823b9367b9ee2d1d84f8eda4ea0

comment:12 Changed 6 years ago by dliessi (Davide Liessi)

Resolution: fixed
Status: assignedclosed

In 59f9d9c9e3988a5b287f44d8b2149641d205cfe5/macports-ports (master):

tesseract: use C++11; fix mtree violation, lib name

Patchfile patch-fix-library-name.diff is commit
52cac3a42ef2b823b9367b9ee2d1d84f8eda4ea0
from https://github.com/tesseract-ocr/tesseract

Fixes #56059

Note: See TracTickets for help on using tickets.