Bug 705764 - Allow to build OCR devices against system tesseract and leptonica
Summary: Allow to build OCR devices against system tesseract and leptonica
Status: RESOLVED DUPLICATE of bug 706490
Alias: None
Product: GhostPDL
Classification: Unclassified
Component: Build Process (show other bugs)
Version: master
Hardware: PC Linux
: P4 enhancement
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-19 15:05 UTC by M.J.G.
Modified: 2024-03-11 09:06 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description M.J.G. 2022-08-19 15:05:42 UTC
I am aware about the reasons why gs is built against in-source copies, and I'm grateful for your upstreaming work in this regard.

As a distro packager, it is quite difficult to justify bundling large libraries like tesseract and leptonica.

mupdf works fine with the system libraries in Fedora (thanks for making it possible).

I suggest to make this possible for gs as well, with the obvious caveat that anyone deviating from your (in-source build) default gets to keep the pieces when  something breaks ;)
Comment 1 Carlo Cabrera 2022-09-24 04:41:58 UTC
We'd appreciate this at Homebrew too. We currently carry a patch [1] to fix some macOS builds of your bundled leptonica. It would really be much better if we only needed to patch leptonica in one place instead of multiple ones. See discussion at [2].

Arch users would likely benefit from this too, as installing ghoscript using pacman results in an installation that lacks OCR support. [3] Allowing the use of system libraries would likely have Arch building with this feature enabled when they link with system versions of tesseract and leptonica.

[1] https://github.com/Homebrew/homebrew-core/blob/c266044e8e4319eb214efc08a8d2235b11bb7d1a/Formula/ghostscript.rb#L61-L69

[2] https://github.com/Homebrew/homebrew-core/pull/111494

[3] https://github.com/archlinux/svntogit-packages/blob/24a8a17317635b9d45551e4e7322edf14c8346b0/trunk/PKGBUILD#L34-L41
Comment 2 M.J.G. 2024-03-09 11:44:09 UTC
FYI, I recently built ghostscript for Fedora rawhide (development version) against system tesseract and leptonica (just as a test build), and ocr devices showed up, and a minimal example works.

Is it safe to assume that we can use this in distro builds now? By that I mean that the build scripts will continue supporting this? I don't expect support for broken distro builds, of course. In case of problems we'd have to check against standard builds with bundled libs.
Comment 3 Chris Liddell (chrisl) 2024-03-11 09:06:29 UTC
Yes, we'll support this moving forwards.

The only thing I ought to add are versions checks for tesseract and leptonica. But since the current code should cope with tesseract 4 and 5, which I think are the only mainstream versions just now.

*** This bug has been marked as a duplicate of bug 706490 ***