From a3a6376573fcb17a5f1e8528d2ac2789ec5f5f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=B6her?= Date: Wed, 17 May 2017 21:30:22 +0200 Subject: [PATCH 1/9] Allow the qmake executable to be passed on CLI This change adds a new command line option `qmake` to the tool which allows the user to specify the qmake executable to be used. By default, if that option is omitted, the behavior is unchanged (i.e. the tool first searches for the `qmake` executable and - if this is not successful - then for either `qmake-qt5` or `qmake-qt4`. If the new option is used, no search takes place and instead the executable provided is used as-is. This implements a part of the functionality as discussed in issue #94. --- README.md | 11 +++++---- linuxdeployqt/main.cpp | 18 ++++++++++---- shared/shared.cpp | 56 ++++++++++++++++++++++-------------------- shared/shared.h | 4 ++- 4 files changed, 52 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 4083e69..eb88ef3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Please download __linuxdeployqt-x86_64.AppImage__ from the [Releases](https://gi 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. -__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:__ 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 @@ -29,6 +29,7 @@ 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 show the correct path to your Qt instance that you want to be bundled, then adjust your `$PATH` to find the correct `qmake`. +Alternatively, use the `-qmake` command line option to point the tool directly to the qmake executable to be used. 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: @@ -69,8 +70,8 @@ dist: trusty before_install: - sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y - sudo apt-get update -qq - -install: + +install: - sudo apt-get -y install qt58base - source /opt/qt*/bin/qt*-env.sh @@ -80,14 +81,14 @@ script: - make INSTALL_ROOT=appdir install ; find appdir/ after_success: - - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" - chmod a+x linuxdeployqt*.AppImage - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - curl --upload-file ./APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage -``` +``` 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. diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index 0d203ae..e12040c 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -55,13 +55,15 @@ int main(int argc, char **argv) qDebug() << " -executable= : Let the given executable use the deployed libraries too"; qDebug() << " -qmldir= : Scan for QML imports in the given path"; qDebug() << " -always-overwrite : Copy files even if the target file exists"; + qDebug() << " -qmake= : The qmake executable to use"; qDebug() << ""; qDebug() << "linuxdeployqt takes an application as input and makes it"; qDebug() << "self-contained by copying in the Qt libraries and plugins that"; qDebug() << "the application uses."; qDebug() << ""; - qDebug() << "It deploys the Qt instance that qmake on the $PATH points to,"; - qDebug() << "so make sure that it is the correct one."; + qDebug() << "By default it deploys the Qt instance that qmake on the $PATH points to."; + qDebug() << "The '-qmake' option can be used to point to the qmake executable"; + qDebug() << "to be used instead."; qDebug() << ""; qDebug() << "Plugins related to a Qt library are copied in with the library."; /* TODO: To be implemented @@ -145,7 +147,7 @@ int main(int argc, char **argv) // Allow binaries next to linuxdeployqt to be found; this is useful for bundling // this application itself together with helper binaries such as patchelf QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - QString oldPath = env.value("PATH"); + QString oldPath = env.value("PATH"); QString newPath = QCoreApplication::applicationDirPath() + ":" + oldPath; LogDebug() << newPath; setenv("PATH",newPath.toUtf8().constData(),1); @@ -169,6 +171,7 @@ int main(int argc, char **argv) QStringList additionalExecutables; bool qmldirArgumentUsed = false; QStringList qmlDirs; + QString qmakeExecutable; /* FHS-like mode is for an application that has been installed to a $PREFIX which is otherwise empty, e.g., /path/to/usr. * In this case, we want to construct an AppDir in /path/to. */ @@ -304,7 +307,7 @@ int main(int argc, char **argv) qDebug() << "preExistingToplevelIcon:" << preExistingToplevelIcon; } else { qDebug() << "iconToBeUsed:" << iconToBeUsed; - QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName(); + QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName(); if (QFile::copy(iconToBeUsed, targetIconPath)){ qDebug() << "Copied" << iconToBeUsed << "to" << targetIconPath; QFile::copy(targetIconPath, appDirPath + "/.DirIcon"); @@ -358,6 +361,10 @@ int main(int argc, char **argv) } else if (argument == QByteArray("-always-overwrite")) { LogDebug() << "Argument found:" << argument; alwaysOwerwriteEnabled = true; + } else if (argument.startsWith("-qmake=")) { + LogDebug() << "Argument found:" << argument; + int index = argument.indexOf("="); + qmakeExecutable = argument.mid(index+1); } else if (argument.startsWith("-")) { LogError() << "Unknown argument" << argument << "\n"; return 1; @@ -371,7 +378,8 @@ int main(int argc, char **argv) } } - DeploymentInfo deploymentInfo = deployQtLibraries(appDirPath, additionalExecutables); + DeploymentInfo deploymentInfo = deployQtLibraries(appDirPath, additionalExecutables, + qmakeExecutable); // Convenience: Look for .qml files in the current directoty if no -qmldir specified. if (qmlDirs.isEmpty()) { diff --git a/shared/shared.cpp b/shared/shared.cpp index c4e1e8f..82714fd 100644 --- a/shared/shared.cpp +++ b/shared/shared.cpp @@ -99,20 +99,20 @@ inline QDebug operator<<(QDebug debug, const AppDirInfo &info) // on architecture. See "vDSO names" in the notes section of vdso(7) // for more information. static bool lddOutputContainsLinuxVDSO(const QString &lddOutput) { - // aarch64, arm, mips, x86_64, x86/x32 - if (lddOutput.contains(QStringLiteral("linux-vdso.so.1"))) { - return true; - // ppc32, s390 - } else if (lddOutput.contains(QStringLiteral("linux-vdso32.so.1"))) { - return true; - // ppc64, s390x - } else if (lddOutput.contains(QStringLiteral("linux-vdso64.so.1"))) { - return true; - // ia64, sh, i386 - } else if (lddOutput.contains(QStringLiteral("linux-gate.so.1"))) { - return true; - } - return false; + // aarch64, arm, mips, x86_64, x86/x32 + if (lddOutput.contains(QStringLiteral("linux-vdso.so.1"))) { + return true; + // ppc32, s390 + } else if (lddOutput.contains(QStringLiteral("linux-vdso32.so.1"))) { + return true; + // ppc64, s390x + } else if (lddOutput.contains(QStringLiteral("linux-vdso64.so.1"))) { + return true; + // ia64, sh, i386 + } else if (lddOutput.contains(QStringLiteral("linux-gate.so.1"))) { + return true; + } + return false; } bool copyFilePrintStatus(const QString &from, const QString &to) @@ -879,7 +879,7 @@ static QString captureOutput(const QString &command) return process.readAllStandardOutput(); } -DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables) +DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables, const QString& qmake) { AppDirInfo applicationBundle; @@ -906,15 +906,19 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a // Determine the location of the Qt to be bundled LogDebug() << "Using qmake to determine the location of the Qt to be bundled"; - QString qmakePath = ""; + // Use the qmake executable passed in by the user: + QString qmakePath = qmake; - // The upstream name of the binary is "qmake", for Qt 4 and Qt 5 - qmakePath = QStandardPaths::findExecutable("qmake"); + // If we did not get a qmake, first try to find "qmake", which is the + // upstream name of the binary in both Qt4 and Qt5: + if (qmakePath.isEmpty()) { + qmakePath = QStandardPaths::findExecutable("qmake"); + } // But openSUSE has qmake for Qt 4 and qmake-qt5 for Qt 5 // Qt 4 on Fedora comes with suffix -qt4 // http://www.geopsy.org/wiki/index.php/Installing_Qt_binary_packages - if(qmakePath == ""){ + if(qmakePath.isEmpty()){ if(qtDetected == 5){ qmakePath = QStandardPaths::findExecutable("qmake-qt5"); } @@ -1016,7 +1020,7 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath } } else { pluginList.append(QStringLiteral("imageformats/") + plugin); - } + } } } @@ -1026,8 +1030,8 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath foreach (const QString &plugin, xcbglintegrationPlugins) { pluginList.append(QStringLiteral("xcbglintegrations/") + plugin); } - } - + } + // Also deploy plugins/iconengines/libqsvgicon.so whenever libQt5Svg.so.* is about to be deployed, // https://github.com/probonopd/linuxdeployqt/issues/36 if (containsHowOften(deploymentInfo.deployedLibraries, "libQt5Svg")) { @@ -1069,7 +1073,7 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath QString sourcePath; QString destinationPath; - + // Qt WebEngine if libQt5WebEngineCore is in use // https://doc-snapshots.qt.io/qt5-5.7/qtwebengine-deploying.html // TODO: Rather than hardcode the source paths, somehow get them dynamically @@ -1124,7 +1128,7 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath destinationPath = QDir::cleanPath(dstTranslations + "/qtwebengine_locales"); recursiveCopy(sourcePath, destinationPath); } - + LogNormal() << "pluginList after having detected hopefully all required plugins:" << pluginList; foreach (const QString &plugin, pluginList) { @@ -1143,7 +1147,7 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath QString relativePath = dir.relativeFilePath(appDirInfo.path + "/" + libraries[0].libraryDestinationDirectory); relativePath.remove(0, 3); // remove initial '../' changeIdentification("$ORIGIN/" + relativePath, QFileInfo(destinationPath).canonicalFilePath()); - + } } } @@ -1224,7 +1228,7 @@ bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, argumentList.append(qtToBeBundledInfo.value("QT_INSTALL_QML")); LogDebug() << "qmlImportsPath (QT_INSTALL_QML):" << qtToBeBundledInfo.value("QT_INSTALL_QML"); - + // run qmlimportscanner QProcess qmlImportScanner; LogDebug() << qmlImportScannerPath << argumentList; diff --git a/shared/shared.h b/shared/shared.h index 9e0ff6d..82dcb61 100644 --- a/shared/shared.h +++ b/shared/shared.h @@ -112,7 +112,9 @@ QString findAppBinary(const QString &appDirPath); QList getQtLibraries(const QString &path, const QString &appDirPath, const QSet &rpaths); QList getQtLibraries(const QStringList &lddLines, const QString &appDirPath, const QSet &rpaths); QString copyLibrary(const LibraryInfo &library, const QString path); -DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables); +DeploymentInfo deployQtLibraries(const QString &appDirPath, + const QStringList &additionalExecutables, + const QString &qmake); DeploymentInfo deployQtLibraries(QList libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useLoaderPath); void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo); bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs); From 9d9192f31b31f3046997711e268bf32a6e9bd28d Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 22 Jul 2017 12:54:03 +0000 Subject: [PATCH 2/9] Attempt to fix "not found" error --- tools/linuxdeployqt/shared.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/linuxdeployqt/shared.cpp b/tools/linuxdeployqt/shared.cpp index 5d8436f..3ef0ce4 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -298,6 +298,14 @@ LddInfo findDependencyInfo(const QString &binaryPath) } foreach (QString outputLine, outputLines) { + + if(outputLine.contains("libQt5")){ + qtDetected = 5; + } + if(outputLine.contains("libQtCore.so.4")){ + qtDetected = 4; + } + // LogDebug() << "ldd outputLine:" << outputLine; if ((outputLine.contains("not found")) && (qtDetectionComplete == 1)){ LogError() << "ldd outputLine:" << outputLine.replace("\t", ""); @@ -984,15 +992,6 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a // Find out whether Qt is a dependency of the application to be bundled LddInfo lddInfo = findDependencyInfo(appBinaryPath); - foreach (const DylibInfo dep, lddInfo.dependencies) { - LogDebug() << "dep.binaryPath" << dep.binaryPath; - if(dep.binaryPath.contains("libQt5")){ - qtDetected = 5; - } - if(dep.binaryPath.contains("libQtCore.so.4")){ - qtDetected = 4; - } - } if(qtDetected != 0){ From 8c13c97c77ec1267bfcd5058f826a82e64165547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=B6her?= Date: Fri, 11 Aug 2017 22:37:47 +0200 Subject: [PATCH 3/9] Add test for qmake option --- tests/tests.sh | 18 ++++++++++++++++++ tools/linuxdeployqt/shared.cpp | 12 ++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/tests.sh b/tests/tests.sh index 01a8c79..1d615df 100644 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -79,6 +79,24 @@ killall QtWidgetsApplication && echo "SUCCESS" cd ../../../ +############################################################################### +# Test bundling the sample Qt Widgets Application passing in the qmake exe +############################################################################### + +cd tests/QtWidgetsApplication/build/ +mkdir -p explicitqmake + +cp QtWidgetsApplication explicitqmake/ +../../../linuxdeployqt-*-x86_64.AppImage explicitqmake/QtWidgetsApplication \ + -qmake=$(which qmake) +ldd explicitqmake/QtWidgetsApplication +find explicitqmake/ +LD_DEBUG=libs explicitqmake/QtWidgetsApplication & +sleep 5 +killall QtWidgetsApplication && echo "SUCCESS" + +cd ../../../ + ############################################################################### # Test bundling the sample Qt Quick Controls 2 Application that comes with Qt Creator ############################################################################### diff --git a/tools/linuxdeployqt/shared.cpp b/tools/linuxdeployqt/shared.cpp index d8ef4fa..09597f8 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -50,13 +50,13 @@ bool runStripEnabled = true; bool bundleAllButCoreLibs = false; bool fhsLikeMode = false; QString fhsPrefix; -static bool alwaysOwerwriteEnabled = false; -static QStringList librarySearchPath; -static bool appstoreCompliant = false; +bool alwaysOwerwriteEnabled = false; +QStringList librarySearchPath; +bool appstoreCompliant = false; int logLevel = 1; -static int qtDetected = 0; -static bool qtDetectionComplete = 0; // As long as Qt is not detected yet, ldd may encounter "not found" messages, continue anyway -static bool deployLibrary = false; +int qtDetected = 0; +bool qtDetectionComplete = 0; // As long as Qt is not detected yet, ldd may encounter "not found" messages, continue anyway +bool deployLibrary = false; using std::cout; using std::endl; From 60dea92affd85f0ef2d36e53c396a87d3fa06a1b Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 20 Aug 2017 12:05:01 +0200 Subject: [PATCH 4/9] Do not exclude libselinux.so.1 https://github.com/AppImage/AppImages/issues/83 --- 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 09597f8..1cca4c6 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -382,7 +382,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" << "libgdk-x11-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" << "libgssapi_krb5.so.2" << "libgtk-x11-2.0.so.0" << "libICE.so.6" << "libidn.so.11" << "libk5crypto.so.3" << "libkeyutils.so.1" << "libm.so.6" << "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" << "libselinux.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 << "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" << "libgdk-x11-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" << "libgssapi_krb5.so.2" << "libgtk-x11-2.0.so.0" << "libICE.so.6" << "libidn.so.11" << "libk5crypto.so.3" << "libkeyutils.so.1" << "libm.so.6" << "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"; LogDebug() << "excludelist:" << excludelist; if (! trimmed.contains("libicu")) { if (containsHowOften(excludelist, QFileInfo(trimmed).completeBaseName())) { From 51d61f0224127b0631c0d759372738051eab4a3b Mon Sep 17 00:00:00 2001 From: probonopd Date: Mon, 28 Aug 2017 17:50:16 +0200 Subject: [PATCH 5/9] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 22f6d16..a227fba 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ Providing an [AppImage](http://appimage.org/) would have, among others, these ad - Can optionally GPG2-sign your AppImages (inside the file) - Works on Live ISOs - Can use the same AppImages when dual-booting multiple distributions +- Can be listed in the [AppImageHub](https://appimage.github.io/) central directory of available AppImages [Here is an overview](https://github.com/probonopd/AppImageKit/wiki/AppImages) of projects that are already distributing upstream-provided, official AppImages. From 01ff23053a52a744cf89013013ca18ed89f78f0b Mon Sep 17 00:00:00 2001 From: "Lilian A. Moraru" Date: Sat, 2 Sep 2017 20:00:48 +0300 Subject: [PATCH 6/9] Suggest optimized builds --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a227fba..c50ad42 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,9 @@ install: - source /opt/qt*/bin/qt*-env.sh script: - - qmake PREFIX=/usr + - qmake CONFIG+=release PREFIX=/usr - make -j$(nproc) - - make INSTALL_ROOT=appdir install ; find appdir/ + - make INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/ - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" - chmod a+x linuxdeployqt*.AppImage - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH @@ -131,9 +131,9 @@ If `qmake` does not allow for `make install` or does not install the desktop fil __CMake__ wants `DESTDIR` instead: ``` - - cmake . -DCMAKE_INSTALL_PREFIX=/usr + - cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr - make -j$(nproc) - - make DESTDIR=appdir install ; find appdir/ + - make DESTDIR=appdir -j$(nproc) install ; find appdir/ ``` __autotools__ (the dinosaur that spends precious minutes "checking...") wants `DESTDIR` too but insists on an absolute link which we can feed it using readlink: From 534f1cf79a34f77a3989083a6fb73265c01ac6ef Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Sat, 28 Oct 2017 21:51:41 +0200 Subject: [PATCH 7/9] Fix: Check if desktop file from first argument really exists and issue a proper error message if not. When using linuxdeployqt for example in OBS and packages can not be installed, it can happen that the desktop file is not existing. This error message makes debugging easier. --- tools/linuxdeployqt/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index e438fa9..e51bae1 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -88,6 +88,12 @@ int main(int argc, char **argv) * to do when using linuxdeployqt. */ if (firstArgument.endsWith(".desktop")){ qDebug() << "Desktop file as first argument:" << firstArgument; + + /* Check if the desktop file really exists */ + if (! QFile::exists(firstArgument)) { + LogError() << "Desktop file in first argument does not exist!"; + return 1; + } QSettings * settings = 0; settings = new QSettings(firstArgument, QSettings::IniFormat); desktopExecEntry = settings->value("Desktop Entry/Exec", "r").toString().split(' ').first().split('/').last().trimmed(); From 6bc4c246f058e74cef17dcb4c47abd0d62a21514 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Oct 2017 22:07:08 +0200 Subject: [PATCH 8/9] Fix PPA name --- tests/tests-environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests-environment.sh b/tests/tests-environment.sh index a410d7f..d452ef2 100755 --- a/tests/tests-environment.sh +++ b/tests/tests-environment.sh @@ -2,7 +2,7 @@ set -e -sudo add-apt-repository --yes ppa:beineri/opt-qt59-trusty +sudo add-apt-repository --yes ppa:beineri/opt-qt591-trusty sudo apt-get update -qq wget http://ftp.de.debian.org/debian/pool/main/p/patchelf/patchelf_0.8-2_amd64.deb From c0217607bc3942c38374eec96ce83377cef12bce Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Oct 2017 22:08:35 +0200 Subject: [PATCH 9/9] Authenticate downloaded file by checking hash sum --- tests/tests-environment.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tests-environment.sh b/tests/tests-environment.sh index d452ef2..b771852 100755 --- a/tests/tests-environment.sh +++ b/tests/tests-environment.sh @@ -5,7 +5,8 @@ set -e sudo add-apt-repository --yes ppa:beineri/opt-qt591-trusty sudo apt-get update -qq -wget http://ftp.de.debian.org/debian/pool/main/p/patchelf/patchelf_0.8-2_amd64.deb +wget https://ftp.fau.de/debian/pool/main/p/patchelf/patchelf_0.8-2_amd64.deb +echo "5d506507df7c02766ae6c3ca0d15b4234f4cb79a80799190ded9d3ca0ac28c0c patchelf_0.8-2_amd64.deb" | sha256sum -c sudo dpkg -i patchelf_0.8-2_amd64.deb cd /tmp/