Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

qt

qt5

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!

like image 577
Miro Samek Avatar asked Aug 06 '14 16:08

Miro Samek


1 Answers

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:

+-platforms/
| +-libqxcb.so
+-libicudata.so.52
+-libicui18n.so.52
+-libicuuc.so.52
+-libQt5Core.so.5
+-libQt5DBus.so.5
+-libQt5Gui.so.5
+-libQt5PrintSupport.so.5
+-libQt5Widgets.so.5
+-qm
+-qm.sh

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

#!/bin/sh
dirname=`dirname $0`
tmp="${dirname#?}"

if [ "${dirname%$tmp}" != "/" ]; then
dirname=$PWD/$dirname
fi
LD_LIBRARY_PATH=$dirname
export LD_LIBRARY_PATH
$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:

http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-linux-x64-5.3.1.run.mirrorlist

I hope this is helpful.

like image 149
Miro Samek Avatar answered Sep 19 '22 22:09

Miro Samek