From f5ee17f8d18a4cd3f386141ef7711b55c2a4d764 Mon Sep 17 00:00:00 2001 From: mahuifa <1603291350@qq.com> Date: Fri, 13 Dec 2024 12:54:53 +0800 Subject: [PATCH 1/7] Add option -runtime Using the -runtime option to specify the runtime file path is more friendly to developers in offline development environments and poor network environments. --- README.md | 2 ++ tools/linuxdeployqt/main.cpp | 8 +++++++- tools/linuxdeployqt/shared.cpp | 9 ++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) 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; From 37c528bd88253c1c28e211a17c51acbd36a00a55 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Dec 2024 19:55:16 +0100 Subject: [PATCH 2/7] -runtime-file in line with appimagetool --- tools/linuxdeployqt/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index 90fa7dde..b1422c08 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -75,7 +75,7 @@ int main(int argc, char **argv) extern QStringList ignoreGlob; extern bool copyCopyrightFiles; extern QString updateInformation; - extern QString qtLibInfix; + extern QString qtLibfix; extern QString runtime; // Check arguments @@ -186,8 +186,8 @@ int main(int argc, char **argv) } else if (argument.startsWith("-qtlibinfix=")) { LogDebug() << "Argument found:" << argument; int index = argument.indexOf("="); - qtLibInfix = QString(argument.mid(index+1)); - } else if (argument.startsWith("-runtime=")) { + qtLibfix = QString(argument.mid(index+1)); + } else if (argument.startsWith("-runtime-file=")) { LogDebug() << "Argument found:" << argument; int index = argument.indexOf("="); runtime = QString(argument.mid(index+1)); @@ -201,7 +201,7 @@ int main(int argc, char **argv) } // We need to catch those errors at the source of the problem - // https://github.com/AppImage/appimage.github.io/search?q=GLIBC&unscoped_q=GLIBC&type=Issues + // https://github.com/appimage.github.io/search?q=GLIBC&unscoped_q=GLIBC&type=Issues const char *glcv = gnu_get_libc_version (); if(skipGlibcCheck) { if(! bundleEverything) { @@ -257,7 +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() << " -runtime-file= : Runtime file to use. (-runtime-file=/runtime)"; qInfo() << " -version : Print version statement and exit."; qInfo() << ""; qInfo() << "linuxdeployqt takes an application as input and makes it"; From 2da5fdd5745ab717593bc329242054c836f19444 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Dec 2024 19:55:55 +0100 Subject: [PATCH 3/7] -runtime-file= --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2d8bc84..ddd2fd97 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Options: 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) + -runtime-file= : Runtime file to use. (-runtime-file=/runtime) -version : Print version statement and exit. linuxdeployqt takes an application as input and makes it From 50b40ed7b9cfb6e953adac50f001c00be01012cb Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Dec 2024 19:57:36 +0100 Subject: [PATCH 4/7] Reinstate Categories=Development --- 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 5d0aaff3..56b0f681 100644 --- a/tools/linuxdeployqt/shared.cpp +++ b/tools/linuxdeployqt/shared.cpp @@ -1978,7 +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"; + out << "Categories=Development\n"; file.close(); } From 7a0fd7ef8534f3f2d2f6b557b164dc53606537b8 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Dec 2024 20:00:50 +0100 Subject: [PATCH 5/7] Whitespace --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ddd2fd97..9c01b229 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,10 @@ Options: -show-exclude-libs : Print exclude libraries list. -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 + -updateinformation= : Embed update information STRING; + if zsyncmake is installed, generate zsync file -qtlibinfix= : Adapt the .so search if your Qt distribution has infix. - -runtime-file= : Runtime file to use. (-runtime-file=/runtime) + -runtime-file= : Runtime file to use. (-runtime-file=/runtime) -version : Print version statement and exit. linuxdeployqt takes an application as input and makes it From 37960d80dbce1d9767df2f2c577a3b71d2e92435 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Dec 2024 20:01:27 +0100 Subject: [PATCH 6/7] Line width --- tools/linuxdeployqt/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index b1422c08..06053b8a 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -255,7 +255,8 @@ int main(int argc, char **argv) qInfo() << " -show-exclude-libs : Print exclude libraries list."; qInfo() << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default),"; qInfo() << " 2 = normal, 3 = debug."; - qInfo() << " -updateinformation= : Embed update information STRING; if zsyncmake is installed, generate zsync file"; + 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-file= : Runtime file to use. (-runtime-file=/runtime)"; qInfo() << " -version : Print version statement and exit."; From 339fd08321a2a2c8a7749781de7727b4497659cc Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Dec 2024 20:19:09 +0100 Subject: [PATCH 7/7] qInfo() --- tools/linuxdeployqt/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index 06053b8a..5816baa9 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -255,8 +255,8 @@ int main(int argc, char **argv) qInfo() << " -show-exclude-libs : Print exclude libraries list."; qInfo() << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default),"; qInfo() << " 2 = normal, 3 = debug."; - qInfo() << " -updateinformation= : Embed update information STRING; - if zsyncmake is installed, generate zsync file"; + qInfo() << " -updateinformation= : Embed update information STRING;"; + qInfo() << " if zsyncmake is installed, generate zsync file"; qInfo() << " -qtlibinfix= : Adapt the .so search if your Qt distribution has infix."; qInfo() << " -runtime-file= : Runtime file to use. (-runtime-file=/runtime)"; qInfo() << " -version : Print version statement and exit.";