Miro Samek Miro Samek - 16 days ago 4x
Linux Question

How to deploy Qt5 application on Linux in compliance with LGPL?

Recently, I have successfully migrated my Qt4 application to Qt5. In fact, the application builds and runs on a development machine using the pre-built binary Qt5 libraries from the qt-opensource-linux-x64-5.3.1 distribution.

Because my app needs to be compliant with the LGPL 2.1 license, the linking to Qt5 must be dynamic. (So I can**not** link to Qt statically!)

My problem is deployment of this application. I just can't come up with a package with all the sharable libraries, which would run across existing Linux distributions.

I can tolerate the requirement that the users need to install Qt5 themselves from the qt-opensource-linux-x64-5.3.1 binary. In fact, this would ensure even stricter compliance with LGPL 2.1. So, I can assume that the compatible Qt5 libraries are installed and available on the host machine (although I don't know if I can assume a specific directory for Qt installation)

However, it's not clear to me how to package my application to run on the host machine. Any help would be greatly appreciated!


I thought that other people with a similar problem would be interested what I ended up doing. So, I experimented some more with the simplest for me dynamic linking of the standard pre-build binary Qt5 shared libraries. It turned out that I could come up with a distribution that worked on the following Linux distros: CentOS 7 64-bit, Ubuntu 12.04 64-bit, and Slackware 14.1 64-bit with KDE desktop. The trick was not to include all the dependencies shown by the ldd command. Instead, my binary distribution contains only the following files:

| +-libqxcb.so

Where, qm is the application executable and qm.sh is the bash script for launching the application. The script looks as follows:

dirname=`dirname $0`

if [ "${dirname%$tmp}" != "/" ]; then
$dirname/qm "$@"

The application (qm) does not have any plugins and uses only the basic Qt widget library.

I should perhaps add that I was using the binary qt-opensource-linux-x64-5.3.1 distribution:


I hope this is helpful.