Skip to content

Commit f7d0520

Browse files
authored
Merge branch 'master' into master
2 parents b4af145 + 9f889b1 commit f7d0520

File tree

5 files changed

+54
-8
lines changed

5 files changed

+54
-8
lines changed

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,43 @@ the application uses.
4343

4444
#### Simplest example
4545

46-
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+
└── your_app.png
59+
```
60+
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.
61+
62+
63+
Using the desktop file `linuxdeployqt` can determine the parameters of the build.
64+
65+
Where your desktop file would look something like:
66+
```
67+
[Desktop Entry]
68+
Version=1.0
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.
4779

48-
`linuxdeployqt path/to/appdir/usr/share/application_name.desktop`
80+
Read more about desktop files in the [freedesktop specification here](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html).
4981

50-
Where the _desktop_ file specifies the executable to be run (with `EXEC=`), the name of the applications and an icon.
51-
See [desktop file specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html).
82+
Now you can say: `linuxdeployqt-continuous-x86_64.AppImage path/to/AppDir/usr/share/applications/your_app.desktop`
5283

5384
For a more detailed example, see "Using linuxdeployqt with Travis CI" below.
5485

tools/excludelist.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Download excludelist
4+
blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]"))
5+
# Create array
6+
for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do
7+
echo -ne '\\"'$item'\\" << '
8+
done
9+
echo -ne '\\"'${blacklisted[-1]}'\\"'

tools/linuxdeployqt/linuxdeployqt.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ isEmpty(_BUILD_NUMBER) {
3535
}
3636

3737
DEFINES += LINUXDEPLOYQT_VERSION="'\"$(shell git describe --tags $(shell git rev-list --tags --skip=1 --max-count=1) --abbrev=0)\"'"
38+
DEFINES += EXCLUDELIST=\""$$system($$_PRO_FILE_PWD_/../excludelist.sh)"\"

tools/linuxdeployqt/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,11 @@ int main(int argc, char **argv)
423423
LogDebug() << "Argument found:" << argument;
424424
int index = argument.indexOf("=");
425425
excludeLibs = QString(argument.mid(index + 1)).split(",");
426-
} else if (argument.startsWith("-")) {
427-
LogError() << "Error: arguments must not start with --, only -" << "\n";
426+
} else if (argument.startsWith("--")) {
427+
LogError() << "Error: arguments must not start with --, only -:" << argument << "\n";
428428
return 1;
429429
} else {
430-
LogError() << "Unknown argument" << argument << "\n";
430+
LogError() << "Unknown argument:" << argument << "\n";
431431
return 1;
432432
}
433433
}

tools/linuxdeployqt/shared.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,13 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath,
474474
*/
475475

476476
QStringList excludelist;
477+
#ifndef EXCLUDELIST
478+
excludelist << "ld-linux.so.2" << "ld-linux-x86-64.so.2" << "libanl.so.1" << "libasound.so.2" << "libBrokenLocale.so.1" << "libcidn.so.1" << "libcom_err.so.2" << "libcrypt.so.1" << "libc.so.6" << "libdl.so.2" << "libdrm.so.2" << "libexpat.so.1" << "libfontconfig.so.1" << "libfreetype.so.6" << "libgcc_s.so.1" << "libgdk_pixbuf-2.0.so.0" << "libgio-2.0.so.0" << "libglib-2.0.so.0" << "libGL.so.1" << "libgobject-2.0.so.0" << "libgpg-error.so.0" << "libharfbuzz.so.0" << "libICE.so.6" << "libjack.so.0" << "libkeyutils.so.1" << "libm.so.6" << "libmvec.so.1" << "libnsl.so.1" << "libnss_compat.so.2" << "libnss_db.so.2" << "libnss_dns.so.2" << "libnss_files.so.2" << "libnss_hesiod.so.2" << "libnss_nisplus.so.2" << "libnss_nis.so.2" << "libp11-kit.so.0" << "libpango-1.0.so.0" << "libpangocairo-1.0.so.0" << "libpangoft2-1.0.so.0" << "libpthread.so.0" << "libresolv.so.2" << "librt.so.1" << "libSM.so.6" << "libstdc++.so.6" << "libthread_db.so.1" << "libusb-1.0.so.0" << "libutil.so.1" << "libuuid.so.1" << "libX11.so.6" << "libxcb.so.1" << "libz.so.1";
479+
#else
480+
excludelist << EXCLUDELIST;
481+
#endif
477482
excludelist += excludeLibs;
478-
excludelist << "libasound.so.2" << "libcom_err.so.2" << "libcrypt.so.1" << "libc.so.6" << "libdl.so.2" << "libdrm.so.2" << "libexpat.so.1" << "libfontconfig.so.1" << "libgcc_s.so.1" << "libgdk_pixbuf-2.0.so.0" << "libgio-2.0.so.0" << "libglib-2.0.so.0" << "libGL.so.1" << "libgobject-2.0.so.0" << "libgpg-error.so.0" << "libICE.so.6" << "libkeyutils.so.1" << "libm.so.6" << "libnsl.so.1" << "libnss3.so" << "libnssutil3.so" << "libp11-kit.so.0" << "libpangoft2-1.0.so.0" << "libpangocairo-1.0.so.0" << "libpango-1.0.so.0" << "libpthread.so.0" << "libresolv.so.2" << "librt.so.1" << "libSM.so.6" << "libstdc++.so.6" << "libusb-1.0.so.0" << "libuuid.so.1" << "libX11.so.6" << "libxcb.so.1" << "libz.so.1";
483+
479484
LogDebug() << "excludelist:" << excludelist;
480485
if (! trimmed.contains("libicu")) {
481486
if (containsHowOften(excludelist, QFileInfo(trimmed).completeBaseName())) {

0 commit comments

Comments
 (0)