[Interest] Qt.conf and desktop application
Roland Hughes
roland at logikalsolutions.com
Wed Jan 16 13:46:53 CET 2019
On 1/16/19 4:00 AM, Jérôme Godbout wrote:
> Hi,
> I'm having some problem while porting an application to Linux Desktop. I'm using a qt.conf to set 2 values
> [Paths]
> Translations = :/i18n
> Qml2Imports = :/
Those aren't valid Linux paths. Qt.conf is a bit of a house of cards. It
never works quite they way you want, when it works. On Linux you really
need to pay attention to RPATH and your deployment directory tree. Here
is a snippet from a project using 5.9.7.
# Unlike the system directories the RPATH tree isn't walked, only the actual
# entry. Must list all of them for deployment.
#
QMAKE_RPATHDIR += $ORIGIN/lib: \
$ORIGIN/plugins: \
$ORIGIN/plungins/platforms: \
$ORIGIN/plugins/qtwebengine: \
$ORIGIN/libexec:
In the script which builds your .deb you need to build a proper
deployment directory tree. Something along the lines of this.
# nuke and recreate our working directory tree
#
rm -rf debian
mkdir -p debian/home/"$DEPLOYMENT_USER"/.config/upstart
mkdir -p debian/home/"$DEPLOYMENT_USER"/.config/autostart
mkdir -p debian/home/"$DEPLOYMENT_USER"/.local/share/applications
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/libexec
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/translations
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/translations/qtwebengine_locales
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/imageformats
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/lib/x86_64-linux-gnu/nss
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/lib/x86_64-linux-gnu/mesa
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/lib/x86_64-linux-gnu/dri
mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/lib/x86_64-linux-gnu/pulseaudio
#mkdir -p debian/home/"$DEPLOYMENT_USER"/bin/lib/gcc/i686-linux-gnu/7
mkdir -p debian/home/"$DEPLOYMENT_USER"/etc
mkdir -p debian/home/"$DEPLOYMENT_USER"/files
mkdir -p debian/home/"$DEPLOYMENT_USER"/logs
mkdir -p debian/home/"$DEPLOYMENT_USER"/Data
#mkdir -p debian/home/"$DEPLOYMENT_USER"/lib/amd64
mkdir -p debian/home/"$DEPLOYMENT_USER"/extra
mkdir -p debian/DEBIAN
mkdir -p debian/usr/share/doc/ipos
The above is setup to deploy the Qt application to a bin directory tree
underneath a user created for deployment. The same with the RPATH above.
Depending on what your application utilizes, you may or may not need the
library directories listed above. You have to test your debian on a base
install from various live disks. One cannot expect even the necessary Qt
libraries will already be installed.
The directory tree becomes super duper important if you have any part of
WebEngine in your application.
Straddling 32 and 64-bit architectures with same executable can be done
as long as you are not going back to Ubuntu 14. That LTS has a massive
bug in the default loader under 64-bit. If it encounters the correct
library name, but a version which is the wrong architecture, it stops
searching the library directory list. There is no way to defeat it
without breaking the native applications. Versions 16 and 18 don't have
this problem.
I have no idea about deploying to Windows. Professionals don't use
Microsoft products.
--
Roland Hughes, President
Logikal Solutions
(630)-205-1593 (cell)
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
More information about the Interest
mailing list