I'm trying to package a Qt 5.x application as described in https://packaging.ubuntu.com/html/packaging-new-software.html
My Build-Depends in debian/control
file are:
debhelper-compat (= 13), libqt5widgets5 (>=5.4), libqt5xml5 (>=5.4), libqt5gui5 (>=5.4), libqt5core5a (>=5.4), libtiff5 (>=4.0.3), libjpeg8 (>=8c), libgcc1 (>=1.3.0), libc6 (>=2.14), libpng16-16 (>=1.6.2-1), libstdc++6 (>=5.2)
I'm building deb with bzr builddeb -- -us -uc
Unfortunately build process fails bcs it tries to launch test cases after binary compilation and one of them is crashing. The test case uses QPainter
that requires an instance of QApplication
to work. And it seems app crashes at creation of QApplication
. The output is:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: wayland-org.kde.kwin.qpa, dxcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
So my guess is that bzr is trying to run the app in some clean environment that is made based on my Build-Depends list. And this list misses something that's required by qt5/plugins/platforms/libqxcb.so
.
The question is: what can it be and how to track this down?
I can execute ldd
on my machine, but i need it in bzr environment.
Here is the build log https://pastebin.com/BVbZVwr6 I've cut out a middle of compilation process to fit the paste size limits. But compilation is fine, It's make test that fails. The code of tests is here: https://cutt.ly/BgYQITO
The building environment is the minimum clean one which does not have a Display Server (X11, Wayland). Qt seems to fail detecting a display server.
I suspect those image tests launch some tools that required some desktop features.
Because this is the initial try to package.
export DH_VERBOSE=1
at top ofdebian/rules
file.override_dh_auto_test:
Reference: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#rules
If you get it through, try enable tests that don't require server first. For full tests with display server, honestly I lack the experience, I didn't face such case before. Either all packages disable that or there is a solution which I didn't notice.