You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Linux Deployment Tool for Qt, `linuxdeployqt`, takes an application as input and makes it self-contained by copying in the Qt libraries and plugins that the application uses into a bundle. This can optionally be put into an [AppImage](http://appimage.org/), and, using [fpm](https://github.com/probonopd/linuxdeployqt/issues/9), into cross-distro deb and rpm packages.
3
+
This Linux Deployment Tool, `linuxdeployqt`, takes an application as input and makes it self-contained by copying in the resources that the application uses (like libraries, graphics, and plugins) into a bundle. The resulting bundle can be distributed as an AppDir or as an [AppImage](https://appimage.org/) to users, or can be put into cross-distribution packages. It can be used as part of the build process to deploy applications written in C, C++, and other compiled languages with systems like `CMake`, `qmake`, and `make`. When used on Qt-based applications, it can bundle a specific minimal subset of Qt required to run the application.
This tool is conceptually based on the [Mac Deployment Tool](http://doc.qt.io/qt-5/osx-deployment.html), `macdeployqt` in the tools applications of the Qt Toolkit, but has been changed to a slightly different logic and other tools needed for Linux.
@@ -22,16 +24,17 @@ Please download __linuxdeployqt-x86_64.AppImage__ from the [Releases](https://gi
-bundle-non-qt-libs : Also bundle non-core, non-Qt libraries
32
+
-executable=<path> : Let the given executable use the deployed libraries too
33
+
-qmldir=<path> : Scan for QML imports to bundle from the given directory, determined by Qt's qmlimportscanner
34
+
-always-overwrite : Copy files even if the target file exists
35
+
-qmake=<path> : The qmake executable to use
36
+
-no-translations : Skip deployment of translations
37
+
-extra-plugins=<list> : List of extra plugins which should be deployed, separated by comma
35
38
36
39
linuxdeployqt takes an application as input and makes it
37
40
self-contained by copying in the Qt libraries and plugins that
@@ -40,12 +43,43 @@ the application uses.
40
43
41
44
#### Simplest example
42
45
43
-
Given that a desktop file should be provided with an AppImage, `linuxdeployqt` can use that to determine the parameters of the build.
46
+
You'll need to provide the basic structure of an `AppDir` which should look something like this:
47
+
```
48
+
└── usr
49
+
├── bin
50
+
│ └── your_app
51
+
├── lib
52
+
└── share
53
+
├── applications
54
+
│ └── your_app.desktop
55
+
└── icons
56
+
└── <theme>
57
+
└── <resolution>
58
+
└── apps
59
+
└── your_app.png
60
+
```
61
+
Replace `<theme>` and `<resolution>` with (for example) `hicolor` and `256x256` respectively; see [icon theme spec](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html) for more details.
62
+
63
+
64
+
Using the desktop file `linuxdeployqt` can determine the parameters of the build.
Where your desktop file would look something like:
67
+
```
68
+
[Desktop Entry]
69
+
Type=Application
70
+
Name=Amazing Qt App
71
+
Comment=The best Qt Application Ever
72
+
Exec=your_app
73
+
Icon=your_app
74
+
Categories=Office;
75
+
```
76
+
77
+
* Notice that both `Exec` and `Icon` only have file names.
78
+
* Also Notice that the `Icon` entry does not include an extension.
46
79
47
-
Where the _desktop_ file specifies the executable to be run (with `EXEC=`), the name of the applications and an icon.
48
-
See [desktop file specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html).
80
+
Read more about desktop files in the [freedesktop specification here](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html).
81
+
82
+
Now you can say: `linuxdeployqt-continuous-x86_64.AppImage path/to/AppDir/usr/share/applications/your_app.desktop`
49
83
50
84
For a more detailed example, see "Using linuxdeployqt with Travis CI" below.
If you want aditional plugins which the tool doesn't deploy, for a variety of reasons, you can use the -extra-plugins argument and include a list of plugins separated by a comma.
118
+
The plugins deployed are from the Qt installation pointed out by `qmake -v`.
119
+
You can deploy entire plugin directories, a specific directory or a mix of both.
A common use case for `linuxdeployqt` is to use it on Travis CI after the `make` command. The following example illustrates how to use `linuxdeployqt` with Travis CI. Create a `.travis.yml` file similar to this one (be sure to customize it, e.g., change `APPNAME` to the name of your application as it is spelled in the `Name=` entry of the `.desktop` file):
- # Do not build tags that we create when we upload to GitHub Releases
165
+
- /^(?i:continuous)/
112
166
```
113
167
114
168
When you save your change, then Travis CI should build and upload an AppImage for you. More likely than not, some fine-tuning will still be required.
@@ -124,6 +178,10 @@ find: `appdir/': No such file or directory
124
178
125
179
If `qmake` does not allow for `make install` or does not install the desktop file and icon, then you need to change your `.pro` file it similar to https://github.com/probonopd/FeedTheMonkey/blob/master/FeedTheMonkey.pro.
126
180
181
+
It is common on Unix to also use the build tool to install applications and libraries; for example, by invoking `make install`. For this reason, `qmake` has the concept of an install set, an object which contains instructions about the way a part of a project is to be installed.
182
+
183
+
Please see the section "Installing Files" on http://doc.qt.io/qt-5/qmake-advanced-usage.html.
__autotools__ (the dinosaur that spends precious minutes "checking...") wants `DESTDIR` too but insists on an absolute link which we can feed it using readlink:
140
198
141
199
```
142
-
- ./configure --prefix=/usr
143
-
- make -j$(nproc)
144
-
- make install DESTDIR=$(readlink -f appdir) ; find appdir/
200
+
- ./configure --prefix=/usr
201
+
- make -j$(nproc)
202
+
- make install DESTDIR=$(readlink -f appdir) ; find appdir/
145
203
```
146
204
147
205
Caution if you encounter
@@ -159,9 +217,7 @@ The exception is that you are building Qt libraries that _should_ be installed t
159
217
`linuxdeployqt` is great for upstream application projects that want to release their software in binary form to Linux users quickly and without much overhead. If you would like to see a particular application use `linuxdeployqt`, then sending a Pull Request may be an option to get the upstream application project to consider it. You can use the following template text for Pull Requests but make sure to customize it to the project in question.
160
218
161
219
```
162
-
This PR, when merged, will compile this application on [Travis CI](https://travis-ci.org/) upon each `git push`, and upload an [AppImage](http://appimage.org/) to a temporary download URL on transfer.sh (available for 14 days). The download URL is toward the end of each Travis CI build log of each build (see below for how to set up automatic uploading to your GitHub Releases page).
163
-
164
-
For this to work, you need to enable Travis CI for your repository as [described here](https://travis-ci.org/getting_started) __prior to merging this__, if you haven't already done so.
220
+
This PR, when merged, will compile this application on [Travis CI](https://travis-ci.org/) upon each `git push`, and upload an [AppImage](http://appimage.org/) to your GitHub Releases page.
165
221
166
222
Providing an [AppImage](http://appimage.org/) would have, among others, these advantages:
167
223
- Applications packaged as an AppImage can run on many distributions (including Ubuntu, Fedora, openSUSE, CentOS, elementaryOS, Linux Mint, and others)
@@ -175,12 +231,12 @@ Providing an [AppImage](http://appimage.org/) would have, among others, these ad
175
231
- Can optionally GPG2-sign your AppImages (inside the file)
176
232
- Works on Live ISOs
177
233
- Can use the same AppImages when dual-booting multiple distributions
178
-
- Can be listed in the [AppImageHub](https://appimage.github.io/) central directory of available AppImages
179
-
180
-
[Here is an overview](https://github.com/probonopd/AppImageKit/wiki/AppImages) of projects that are already distributing upstream-provided, official AppImages.
234
+
- Can be listed in the [AppImageHub](https://appimage.github.io/apps) central directory of available AppImages
235
+
- Can double as a self-extracting compressed archive with the `--appimage-extract` parameter
181
236
182
-
__Please note:__ Instead of storing AppImage builds temporarily for 14 days each on transfer.sh, you could use GitHub Releases to store the binaries permanently. This way, they would be visible on the Releases page of your project. This is what I recommend. See https://docs.travis-ci.com/user/deployment/releases/. If you want to do this for continuous builds, also see https://github.com/probonopd/uploadtool.
237
+
[Here is an overview](https://appimage.github.io/apps) of projects that are already distributing upstream-provided, official AppImages.
183
238
239
+
__PLEASE NOTE:__ For this to work, you need to enable Travis CI for your repository as [described here](https://travis-ci.org/getting_started) __prior to merging this__, if you haven't already done so. Also, You need to set up `GITHUB_TOKEN` in Travis CI for this to work; please see https://github.com/probonopd/uploadtool.
184
240
If you would like to see only one entry for the Pull Request in your project's history, then please enable [this GitHub functionality](https://help.github.com/articles/configuring-commit-squashing-for-pull-requests/) on your repo. It allows you to squash (combine) the commits when merging.
185
241
186
242
If you have questions, AppImage developers are on #AppImage on irc.freenode.net.
@@ -189,6 +245,8 @@ If you have questions, AppImage developers are on #AppImage on irc.freenode.net.
189
245
## Projects using linuxdeployqt
190
246
191
247
These projects are already using [Travis CI](http://travis-ci.org/) and linuxdeployqt to provide AppImages of their builds:
0 commit comments