# linuxdeployqt [![Build Status](https://github.com/probonopd/linuxdeployqt/actions/workflows/build.yaml/badge.svg?branch=master)](https://github.com/probonopd/linuxdeployqt/actions) ![Downloads](https://img.shields.io/github/downloads/probonopd/linuxdeployqt/total.svg) [![discourse](https://img.shields.io/badge/forum-discourse-orange.svg)](http://discourse.appimage.org/t/linuxdeployqt-new-linux-deployment-tool-for-qt/57) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/probonopd/AppImageKit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![irc](https://img.shields.io/badge/IRC-%23AppImage%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=AppImage)
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.
![](https://user-images.githubusercontent.com/2480569/34471167-d44bd55e-ef41-11e7-941e-e091a83cae38.png)
## Differences to macdeployqt
This tool is conceptually based on the [Mac Deployment Tool](https://doc.qt.io/qt-5/macos-deployment.html#macdeploy), `macdeployqt` in the tools applications of the Qt Toolkit, but has been changed to a slightly different logic and other tools needed for Linux.
* Instead of an `.app` bundle for macOS, this produces an [AppDir](http://rox.sourceforge.net/desktop/AppDirs.html) for Linux
* Instead of a `.dmg` disk image for macOS, this produces an [AppImage](http://appimage.org/) for Linux which is quite similar to a dmg but executes the contained application rather than just opening a window on the desktop from where the application can be launched
## A note on binary compatibility
__To produce binaries that are compatible with many target systems, build on the oldest still-supported build system.__ The oldest still-supported release of Ubuntu is currently targeted, tested and supported by the team.
We recommend to target the oldest still-supported Ubuntu LTS release and build your applications on that. If you do this, the resulting binaries should be able to run on newer (but not older) systems (Ubuntu and other distributions).
`linuxdeployqt` refuses to work on systems any newer than the oldest currently still-supported Ubuntu LTS release, because we want to encourage developers to build applications in a way that makes them possible to run on all still-supported distribution releases. For an overview about the support cycles of Ubuntu LTS releases, please see https://wiki.ubuntu.com/Releases. If you absolutely need to build your application on a build system newer than the oldest currently still-supported Ubuntu LTS release, then consider using go-appimage `appimagetool -s deploy` (unlike `linuxdeployqt`, this bundles _all_ libraries).
`linuxdeployqt` does not contain any specific workarounds for Wayland which breaks many things. For best results, do not use Wayland.
## Installation
Please download __linuxdeployqt-x86_64.AppImage__ from the [Releases](https://github.com/probonopd/linuxdeployqt/releases) page and `chmod a+x` it. If you would like to build `linuxdeployqt` from source instead, see [BUILDING.md](https://github.com/probonopd/linuxdeployqt/blob/master/BUILDING.md).
## Usage
```
Usage: linuxdeployqt <app-binary|desktop file> [options]
Options:
-always-overwrite : Copy files even if the target file exists.
-appimage : Create an AppImage (implies -bundle-non-qt-libs).
-bundle-non-qt-libs : Also bundle non-core, non-Qt libraries.
-exclude-libs=<list> : List of libraries which should be excluded,
separated by comma.
-ignore-glob=<glob> : Glob pattern relative to appdir to ignore when
searching for libraries.
-executable=<path> : Let the given executable use the deployed libraries
too
-extra-plugins=<list> : List of extra plugins which should be deployed,
separated by comma.
-no-copy-copyright-files : Skip deployment of copyright files.
-no-plugins : Skip plugin deployment.
-no-strip : Don't run 'strip' on the binaries.
-no-translations : Skip deployment of translations.
-qmake=<path> : The qmake executable to use.
-qmldir=<path> : Scan for QML imports in the given path.
-qmlimport=<path> : Add the given path to QML module search locations.
-show-exclude-libs : Print exclude libraries list.
-verbose=<0-3> : 0 = no output, 1 = error/warning (default),
2 = normal, 3 = debug.
-updateinformation=<update string> : Embed update information STRING; if zsyncmake is installed, generate zsync file
-version : Print version statement and exit.
linuxdeployqt takes an application as input and makes it
self-contained by copying in the Qt libraries and plugins that
the application uses.
By default it deploys the Qt instance that qmake on the $PATH points to.
The '-qmake' option can be used to point to the qmake executable
to be used instead.
Plugins related to a Qt library are copied in with the library.
See the "Deploying Applications on Linux" topic in the
documentation for more information about deployment on Linux.
```
#### Simplest example
You'll need to provide the basic structure of an `AppDir` which should look something like this:
```
└── usr
├── bin
│ └── your_app
├── lib
└── share
├── applications
│ └── your_app.desktop
└── icons
└── <theme>
└── <resolution>
└── apps
└── your_app.png
```
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.
Using the desktop file `linuxdeployqt` can determine the parameters of the build.
Where your desktop file would look something like:
```
[Desktop Entry]
Type=Application
Name=Amazing Qt App
Comment=The best Qt Application Ever
Exec=your_app
Icon=your_app
Categories=Office;
```
* Notice that both `Exec` and `Icon` only have file names.
* Also Notice that the `Icon` entry does not include an extension.
Read more about desktop files in the [Desktop Entry Specification 1.0](https://standards.freedesktop.org/desktop-entry-spec/1.0/).
Now you can say: `linuxdeployqt-continuous-x86_64.AppImage path/to/AppDir/usr/share/applications/your_app.desktop`
For a more detailed example, see "Using linuxdeployqt with Travis CI" below.
#### 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.
#### QMake configuration
__Important:__ By default, `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:
```
qmake -v
QMake version 3.0
Using Qt version 5.7.0 in /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/lib
```
If this does not sho
没有合适的资源?快使用搜索试试~ 我知道了~
linuxdeployqt源码
共45个文件
pro:8个
cpp:6个
sh:4个
需积分: 0 0 下载量 128 浏览量
2023-11-17
14:07:55
上传
评论
收藏 99KB ZIP 举报
温馨提示
linuxdeployqt源码
资源推荐
资源详情
资源评论
收起资源包目录
continuous.zip (45个子文件)
linuxdeployqt-continuous
LICENSE.GPLv3 35KB
CMakeLists.txt 3KB
tools
tools.pro 63B
linuxdeployqt
CMakeLists.txt 1KB
shared.h 5KB
main.cpp 26KB
linuxdeployqt.pro 2KB
shared.cpp 91KB
excludelist.h 2KB
generate-excludelist.sh 1KB
.github
workflows
build.yaml 2KB
sync.profile 39B
src
src.pro 15B
tests
QtWidgetsApplication
mainwindow.h 291B
mainwindow.cpp 219B
main.cpp 172B
mainwindow.ui 630B
QtWidgetsApplication.pro 1004B
QtQuickControls2Application
Page1.qml 138B
main.cpp 314B
qml.qrc 199B
qtquickcontrols2.conf 310B
main.qml 680B
QtQuickControls2Application.pro 1KB
Page1Form.ui.qml 498B
QtWebEngineApplication
qt.png 19KB
main.cpp 2KB
qml.qrc 87B
QtWebEngineApplication.pro 132B
main.qml 2KB
QWebEngineApplication.desktop 119B
tests-ci.sh 2KB
tests-environment.sh 2KB
tests.sh 5KB
tests.pro 177B
linuxdeployqt.pro 15B
.qmake.conf 82B
Dockerfile 559B
BUILDING.md 2KB
.gitignore 339B
README.md 21KB
LICENSE.LGPLv3 8KB
linuxdeployqt.AppDir
AppRun 315B
linuxdeployqt.svg 21KB
linuxdeployqt.desktop 187B
共 45 条
- 1
资源评论
zerwave
- 粉丝: 7
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功