Skip to content

Use the system libopenjpeg2.

Soren Stoutner requested to merge (removed):master into master

This patch fixes a problem where two files, usr/lib/x86_64-linux-gnu/libQt6WebEngineCore.so.6.4.2 and usr/lib/x86_64-linux-gnu/libQt6Pdf.so.6.4.2 are built with a static, embedded copy of libopenjpeg2.

For the first file, usr/lib/x86_64-linux-gnu/libQt6WebEngineCore.so.6.4.2, this is accomplished by adding the necessary plumbing to src/core/CMakeLists.txt and src/core/api/configure.cmake. Once this plumbing is in place, the system will automatically build WebEngine against the system libopenjpeg2 on Linux as long as the development library is available in the build environment.

However, for reasons I don't understand, when building usr/lib/x86_64-linux-gnu/libQt6Pdf.so.6.4.2 it bypasses all of the above settings and builds with the pdfium defaults, which include an embedded library. The only way I was able to override this behavior was to change the the default in src/3rdparty/chromium/third_party/pdfium/pdfium.gni, which is suboptimal because it is not an upstreamable change. I assume there is some other place where the behavior can be overwritten, but I was not able to find it. Perhaps you might have some idea.

As a note, this patch is similar to one one I submitted to the Qt 5 package: qt-kde-team/qt/qtwebengine!11 (merged). In that case, the patch was able to fix the build problem for libraries, but things are a bit different between Qt 5 and Qt 6, and the Qt 6 version does not include src/buildtools/config/linux.pri.

In the Qt 5 patch, Dmitry suggested I add the line to debian/rules overriding the autodetection and forcing the usage of the system library, so that if the system library is not available at build time for some reason the build will fail. The addition of the modified line to debian/rules accomplishes the same thing for Qt 6, although in testing the error message that is produced is so vague that it probably would not easily lead people in the right direction. If desired, this can be left off and any problems building against the system library can be detected in the future by looking at the Lintian errors.

My plan is to submit both patches to upstream shortly. Beyond that, there are other Lintian errors I intend to look at more closely in the future.

Edited by Soren Stoutner

Merge request reports

Loading