From 8b484dabec41c40b6553e965c1928d5c94f961e6 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 17 Mar 2018 13:27:24 +0100 Subject: [PATCH 1/5] Improve argument parser user experience See https://github.com/probonopd/linuxdeployqt/issues/256#issuecomment-373916136 The argument parser requires flags expecting a payload to be passed in the form -arg=payload. If not, it fails to recognize them and falsely reports "argument must not start with --". These usability issues should be gone with these two minor changes. --- tools/linuxdeployqt/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index 1055476..0d535e5 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -416,11 +416,11 @@ int main(int argc, char **argv) LogDebug() << "Argument found:" << argument; int index = argument.indexOf("="); extraQtPlugins = QString(argument.mid(index + 1)).split(","); - } else if (argument.startsWith("-")) { - LogError() << "Error: arguments must not start with --, only -" << "\n"; + } else if (argument.startsWith("--")) { + LogError() << "Error: arguments must not start with --, only -:" << argument << "\n"; return 1; } else { - LogError() << "Unknown argument" << argument << "\n"; + LogError() << "Unknown argument:" << argument << "\n"; return 1; } } From 7fdf33913266e2e94850839d32b32e6c975e348f Mon Sep 17 00:00:00 2001 From: Adam Zahran Date: Sat, 17 Mar 2018 15:32:09 +0200 Subject: [PATCH 2/5] Updated the readme simplist example. made it a bit more complicated, but at least anyone reading won't have to ask amiright lol --- README.md | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2e5edc5..faf2533 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,41 @@ 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. +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 + └── hicolor + └── 256x256 + └── your_app.png +``` + +Using the desktop file `linuxdeployqt` can determine the parameters of the build. + +Where your desktop file would look something like: +``` +[Desktop Entry] +Version=1.0 +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. -`linuxdeployqt path/to/appdir/usr/share/application_name.desktop` +Read more about desktop files in the [freedesktop specification here](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). -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). +Now you can say: `linuxdeployqt path/to/AppDir/usr/share/applications/your_app.desktop` For a more detailed example, see "Using linuxdeployqt with Travis CI" below. From 2e4ff40262c485abb293972676210b0be37a1150 Mon Sep 17 00:00:00 2001 From: Adam Zahran Date: Sat, 17 Mar 2018 16:33:34 +0200 Subject: [PATCH 3/5] updated readme.md * a template in the AppDir tree instead of hardcoded values * replaced linuxdeployqt with linuxdeployqt-continuous-x86_64.AppImage in the commandline example --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index faf2533..8e8e54b 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,12 @@ You'll need to provide the basic structure of an `AppDir` which should look some ├── applications │   └── your_app.desktop └── icons - └── hicolor - └── 256x256 + └── + └── └── your_app.png ``` +Replace `` and `` 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. @@ -77,7 +79,7 @@ Categories=Office; Read more about desktop files in the [freedesktop specification here](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). -Now you can say: `linuxdeployqt path/to/AppDir/usr/share/applications/your_app.desktop` +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. From 4c23dc5cf2c530f82334afd7636a97a84a4518b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 30 Mar 2018 16:36:11 -0300 Subject: [PATCH 4/5] shared: Update excludelist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- tools/linuxdeployqt/shared.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linuxdeployqt/shared.cpp b/tools/linuxdeployqt/shared.cpp index be59ff6..ebde2ec 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -473,7 +473,7 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, */ QStringList excludelist; - 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"; + 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"; LogDebug() << "excludelist:" << excludelist; if (! trimmed.contains("libicu")) { if (containsHowOften(excludelist, QFileInfo(trimmed).completeBaseName())) { From 464f1f249be51a95f8c98ab176861e23f4109ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sat, 31 Mar 2018 13:40:13 -0300 Subject: [PATCH 5/5] Create excludelist at build time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- tools/excludelist.sh | 9 +++++++++ tools/linuxdeployqt/linuxdeployqt.pro | 1 + tools/linuxdeployqt/shared.cpp | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 tools/excludelist.sh diff --git a/tools/excludelist.sh b/tools/excludelist.sh new file mode 100755 index 0000000..dce1a11 --- /dev/null +++ b/tools/excludelist.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Download excludelist +blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]")) +# Create array +for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do + echo -ne '\\"'$item'\\" << ' +done +echo -ne '\\"'${blacklisted[-1]}'\\"' diff --git a/tools/linuxdeployqt/linuxdeployqt.pro b/tools/linuxdeployqt/linuxdeployqt.pro index 1d9e3f5..85488ea 100644 --- a/tools/linuxdeployqt/linuxdeployqt.pro +++ b/tools/linuxdeployqt/linuxdeployqt.pro @@ -35,3 +35,4 @@ isEmpty(_BUILD_NUMBER) { } DEFINES += LINUXDEPLOYQT_VERSION="'\"$(shell git describe --tags $(shell git rev-list --tags --skip=1 --max-count=1) --abbrev=0)\"'" +DEFINES += EXCLUDELIST=\""$$system($$_PRO_FILE_PWD_/../excludelist.sh)"\" \ No newline at end of file diff --git a/tools/linuxdeployqt/shared.cpp b/tools/linuxdeployqt/shared.cpp index ebde2ec..f5218dc 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -473,7 +473,12 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, */ QStringList excludelist; - 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"; + #ifndef EXCLUDELIST + 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"; + #else + excludelist << EXCLUDELIST; + #endif + LogDebug() << "excludelist:" << excludelist; if (! trimmed.contains("libicu")) { if (containsHowOften(excludelist, QFileInfo(trimmed).completeBaseName())) {