-
Notifications
You must be signed in to change notification settings - Fork 425
Home
linuxdeployqt
makes Linux applications self-contained by copying in the Qt libraries and plugins that the application uses. Since it is still relatively new, expect to find bugs, please report them to GitHub Issues or, even better, send a Pull Request.
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.
# 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.
# 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.
linuxdeployqt -- Software packaging for Linux made simple! ❤️
Linuxdeployqt is the one-in-all solution for packaging application. If it doesn't do the job, we consider it a bug of the software. Please open an issue and suggest your idaes!
Support our mission for a revolution of the Linux desktop and application deployment therefore! Visit http://appimage.org for more information on AppImage, related technologies, user and open source project lead voices, and examples!