Browse Source

Show example usage and restructures usage section (#139)

master
orbifx 7 years ago
committed by probonopd
parent
commit
f399119ab6
  1. 53
      README.md

53
README.md

@ -18,8 +18,40 @@ Please download __linuxdeployqt-x86_64.AppImage__ from the [Releases](https://gi
## Usage ## Usage
```
Usage: linuxdeployqt app-binary [options]
Options:
-verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug
-no-plugins : Skip plugin deployment
-appimage : Create an AppImage
-no-strip : Don't run 'strip' on the binaries
-bundle-non-qt-libs : Also bundle non-core, non-Qt libraries
-executable=<path> : Let the given executable use the deployed libraries too
-qmldir=<path> : Scan for QML imports in the given path
-always-overwrite : Copy files even if the target file exists
-no-translations : Skip deployment of translations
linuxdeployqt takes an application as input and makes it
self-contained by copying in the Qt libraries and plugins that
the application uses.
```
#### Simplest example
Given that a desktop file should be provided with an AppImage, `linuxdeployqt` can use that to determine the parameters of the build.
`linuxdeployqt ./path/to/appdir/usr/share/application_name.desktop`
Where the _desktop_ file specifies the executable to be run (with `EXEC=`), the name of the applications and an icon.
See [desktop file specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html).
#### Checking library inclusion
Open in Qt Creator and build your application. Run it from the command line and inspect it with `ldd` to make sure the correct libraries from the correct locations are getting loaded, as `linuxdeployqt` will use `ldd` internally to determine from where to copy libraries into the bundle. Open in Qt Creator and build your application. Run it from the command line and inspect it with `ldd` to make sure the correct libraries from the correct locations are getting loaded, as `linuxdeployqt` will use `ldd` internally to determine from where to copy libraries into the bundle.
#### QMake configuration
__Important:__ `linuxdeployqt` deploys the Qt instance that qmake on the $PATH points to, so make sure that it is the correct one. Verify that qmake finds the correct Qt instance like this before running the `linuxdeployqt` tool: __Important:__ `linuxdeployqt` deploys the Qt instance that qmake on the $PATH points to, so make sure that it is the correct one. Verify that qmake finds the correct Qt instance like this before running the `linuxdeployqt` tool:
``` ```
@ -30,6 +62,8 @@ Using Qt version 5.7.0 in /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/lib
``` ```
If this does not show the correct path to your Qt instance that you want to be bundled, then adjust your `$PATH` to find the correct `qmake`. If this does not show the correct path to your Qt instance that you want to be bundled, then adjust your `$PATH` to find the correct `qmake`.
#### Remove unecessary files
Before running linuxdeployqt it may be wise to delete unneeded files that you do not wish to distribute from the build directory. These may be autogenerated during the build. You can delete them like so: Before running linuxdeployqt it may be wise to delete unneeded files that you do not wish to distribute from the build directory. These may be autogenerated during the build. You can delete them like so:
``` ```
@ -38,25 +72,6 @@ find $HOME/build-*-*_Qt_* \( -name "moc_*" -or -name "*.o" -or -name "qrc_*" -or
Alternatively, you could use `$DESTDIR`. Alternatively, you could use `$DESTDIR`.
```
Usage: linuxdeployqt app-binary [options]
Options:
-verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug
-no-plugins : Skip plugin deployment
-appimage : Create an AppImage
-no-strip : Don't run 'strip' on the binaries
-bundle-non-qt-libs : Also bundle non-core, non-Qt libraries
-executable=<path> : Let the given executable use the deployed libraries too
-qmldir=<path> : Scan for QML imports in the given path
-always-overwrite : Copy files even if the target file exists
-no-translations : Skip deployment of translations
linuxdeployqt takes an application as input and makes it
self-contained by copying in the Qt libraries and plugins that
the application uses.
```
## Using linuxdeployqt with Travis CI ## Using linuxdeployqt with Travis CI
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): 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):

Loading…
Cancel
Save