Skip to content
probonopd edited this page Feb 19, 2017 · 13 revisions

Welcome to the linuxdeployqt wiki!

Examples

Some real-world examples on how to bundle Qt-based applications on GitHub using linuxdeployqt. Note that many projects do this as part of their continuous build pipeline, e.g., on each push to GitHub, using Travis CI.

LibrePCB

# Compile LibrePCB as usual
git clone --recursive https://github.com/LibrePCB/LibrePCB.git && cd LibrePCB
export PATH=/tmp/.mount_QtCreator-5.8.0-x86_64/5.8/gcc_64/bin/:$PATH
qmake -r ../librepcb.pro
sudo apt-get install libglu1-mesa-dev openssl zlib1g zlib1g-dev
make -j 8

# Copy into AppDir FHS-like stucture
mkdir -p LibrePCB.AppDir/usr
cp -r generated/unix  LibrePCB.AppDir/usr/bin
cp -r generated/{lib,share}  LibrePCB.AppDir/usr/

# Get and run linuxdeployqt
wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage 

# Create AppImage using linuxdeployqt
./linuxdeployqt-continuous-x86_64.AppImage ./LibrePCB.AppDir/usr/bin/librepcb
( cd LibrePCB.AppDir/ ; cp ./usr/share/applications/librepcb.desktop . )
( cd LibrePCB.AppDir/ ; cp ./usr/share/pixmaps/librepcb.svg . )
export VERSION=$(git rev-list --count HEAD).$(git describe --tags | cut -d - -f 3)
./linuxdeployqt-continuous-x86_64.AppImage ./LibrePCB.AppDir/usr/bin/librepcb -appimage

# Success!
ls -lh LibrePCB*AppImage
# -rwxr-xr-x 1 me me 31M Feb 19 15:34 LibrePCB-864.gf0d32a2-x86_64.AppImage

Note that no wrapper script, no LD_LIBRARY_PATH, and no qt.conf file are used.

RedTimer

# Compile as usual
git clone https://github.com/fathomssen/redtimer.git
cd redtimer
git submodule update --init
qmake -r
make -j 4

# Create AppDir and start populating
mkdir -p appdir/usr/bin
cp gui/redtimer appdir/usr/bin/
cp ./.travis/redtimer.desktop appdir/
cp gui/icons/clock_red.svg appdir/redtimer.svg

# Deploy to AppDir
wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage 
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/bin/redtimer -qmldir=gui/

# Generate AppImage
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/bin/redtimer -qmldir=gui/ -appimage
# Result is ./RedTimer-x86_64.AppImage 

Note that some fine-tuning may be needed, such as properly copying icons and other resources into the AppDir manually. Also note that no wrapper script, no LD_LIBRARY_PATH, and no qt.conf file are used.

Clone this wiki locally