diff --git a/README.md b/README.md index 92cecef4..d2d8bc84 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ Options: -verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug. -updateinformation= : Embed update information STRING; if zsyncmake is installed, generate zsync file + -qtlibinfix= : Adapt the .so search if your Qt distribution has infix. + -runtime== : Runtime file to use. (-runtime=/runtime) -version : Print version statement and exit. linuxdeployqt takes an application as input and makes it diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index 810ba60d..90fa7dde 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -76,6 +76,7 @@ int main(int argc, char **argv) extern bool copyCopyrightFiles; extern QString updateInformation; extern QString qtLibInfix; + extern QString runtime; // Check arguments // Due to the structure of the argument parser, we have to check all arguments at first to check whether the user @@ -186,7 +187,11 @@ int main(int argc, char **argv) LogDebug() << "Argument found:" << argument; int index = argument.indexOf("="); qtLibInfix = QString(argument.mid(index+1)); - } else if (argument.startsWith("--")) { + } else if (argument.startsWith("-runtime=")) { + LogDebug() << "Argument found:" << argument; + int index = argument.indexOf("="); + runtime = QString(argument.mid(index+1)); + }else if (argument.startsWith("--")) { LogError() << "Error: arguments must not start with --, only -:" << argument << "\n"; return 1; } else { @@ -252,6 +257,7 @@ int main(int argc, char **argv) qInfo() << " 2 = normal, 3 = debug."; qInfo() << " -updateinformation= : Embed update information STRING; if zsyncmake is installed, generate zsync file"; qInfo() << " -qtlibinfix= : Adapt the .so search if your Qt distribution has infix."; + qInfo() << " -runtime== : Runtime file to use. (-runtime=/runtime)"; qInfo() << " -version : Print version statement and exit."; qInfo() << ""; qInfo() << "linuxdeployqt takes an application as input and makes it"; diff --git a/tools/linuxdeployqt/shared.cpp b/tools/linuxdeployqt/shared.cpp index e4af7de2..5d0aaff3 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -70,6 +70,7 @@ QStringList ignoreGlob; bool copyCopyrightFiles = true; QString updateInformation; QString qtLibInfix; +QString runtime; using std::cout; using std::endl; @@ -1977,6 +1978,7 @@ bool checkAppImagePrerequisites(const QString &appDirPath) out << "Icon=default\n"; out << "Comment=Edit this default file\n"; out << "Terminal=true\n"; + out << "# Categories=Development\n"; file.close(); } @@ -2006,7 +2008,12 @@ int createAppImage(const QString &appDirPath) updateInfoArgument = QString("-u '%1'").arg(updateInformation); } - QString appImageCommand = "appimagetool -v '" + appDirPath + "' -n " + updateInfoArgument; // +"' '" + appImagePath + "'"; + QString runtimeArgument; + if(!runtime.isEmpty()) { + runtimeArgument = QString(" --runtime-file %1").arg(runtime); + } + + QString appImageCommand = "appimagetool -v '" + appDirPath + "' -n " + updateInfoArgument + runtimeArgument; // +"' '" + appImagePath + "'"; LogNormal() << appImageCommand; int ret = system(appImageCommand.toUtf8().constData()); LogNormal() << "ret" << ret;