Using libpoppler in harbour application

I’ve developed an application which is using libpoppler-qt5 to read and render pdf documents. However, it cannot be published in jolla store, due to this requirements.

What would be the best way to publish in jolla store:

  • statically recompile libpoppler-qt5, and include it in the binary. I fear that libpoppler itself has a lot of dependencies, and it may be a lot of work
  • copy the shared object from the sdk in the rpm (same issue)
  • another ideas ?

How do usually application do if they rely on third party libraries which are somewhat guaranted to be available on the system ?

1 Like

Usually bundling dependencies not allowed in harbour with your application is the recommended solution. I thin 1 and 2 both would work. You need to bundle all dependencies, that are not allowed, with your app. If poppler-qt5 has such dependencies, you will need to include those too. If its dependencies are allowed, you don’t need to. It looks like poppler-qt5 doesn’t actually have a lot of disallowed dependencies, but I’m sure there are others, who already use that lib and can give more information regarding that.

1 Like

Well, what are you using it for?
Is it a hard or soft (optional added feature) dependency?
My app SeaPrint uses pdftoppm as an optional dependency, running inside a QProcess.

AFAIK MuPDF builds much more cleanly and contains all non-trivial dependencies as submodules, but i’m not sure it helps you.

1 Like

It’s a hard dependency, the app basically just annotates a source pdf document. I could get rid of it by recreating the whole document inside the app, but that would be overkill.

I’ll take a look at how to rebuild libpoppler. Thanks for your answers !

1 Like

You don’t need to actually build it. You can just copy to a RPATH of your program the required library from the SDK into your RPM.

Not necessary a perfect way to do this, but you can have a look to Mæp spec file: https://github.com/dcaliste/maep-qt/blob/master/rpm/maep-qt.spec I’m putting in the RPM things like libsoup, libcairo… I’m having also this line in the maep.pro file:
# This part is to circumvent harbour limitations.
QMAKE_RPATHDIR = $$DEPLOYMENT_PATH/lib
where DEPLOYMENT_PATH is a simple variable pointing to $$PREFIX/share/$$TARGET.

2 Likes

Thanks a lot, it seems to work fine. The remaining issue is that the jolla-built libpoppler has some hardcoded path in them, which is also forbidden :confused: .

I’ll try to submit it that way, with a note to qa, let’s see if it passes. Otherwise i’ll try to rebuild poppler.

2 Likes