Add flag to disable copyright files deployment

Should speed up linuxdeployqt runs on less powerful devices. Also makes
sense to use while developing build scripts etc.
This commit is contained in:
TheAssassin
2018-03-05 20:50:19 +01:00
parent e915ad00ee
commit 79c990c787
2 changed files with 26 additions and 15 deletions
+20 -15
View File
@@ -67,21 +67,22 @@ int main(int argc, char **argv)
qInfo() << "Usage: linuxdeployqt <app-binary|desktop file> [options]"; qInfo() << "Usage: linuxdeployqt <app-binary|desktop file> [options]";
qInfo() << ""; qInfo() << "";
qInfo() << "Options:"; qInfo() << "Options:";
qInfo() << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default),"; qInfo() << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default),";
qInfo() << " 2 = normal, 3 = debug"; qInfo() << " 2 = normal, 3 = debug";
qInfo() << " -no-plugins : Skip plugin deployment"; qInfo() << " -no-plugins : Skip plugin deployment";
qInfo() << " -appimage : Create an AppImage (implies -bundle-non-qt-libs)"; qInfo() << " -appimage : Create an AppImage (implies -bundle-non-qt-libs)";
qInfo() << " -no-strip : Don't run 'strip' on the binaries"; qInfo() << " -no-strip : Don't run 'strip' on the binaries";
qInfo() << " -bundle-non-qt-libs : Also bundle non-core, non-Qt libraries"; qInfo() << " -bundle-non-qt-libs : Also bundle non-core, non-Qt libraries";
qInfo() << " -executable=<path> : Let the given executable use the deployed libraries"; qInfo() << " -executable=<path> : Let the given executable use the deployed libraries";
qInfo() << " too"; qInfo() << " too";
qInfo() << " -qmldir=<path> : Scan for QML imports in the given path"; qInfo() << " -qmldir=<path> : Scan for QML imports in the given path";
qInfo() << " -always-overwrite : Copy files even if the target file exists"; qInfo() << " -always-overwrite : Copy files even if the target file exists";
qInfo() << " -qmake=<path> : The qmake executable to use"; qInfo() << " -qmake=<path> : The qmake executable to use";
qInfo() << " -no-translations : Skip deployment of translations."; qInfo() << " -no-translations : Skip deployment of translations.";
qInfo() << " -extra-plugins=<list> : List of extra plugins which should be deployed,"; qInfo() << " -no-copy-copyright-files : Skip deployment of copyright files.";
qInfo() << " separated by comma."; qInfo() << " -extra-plugins=<list> : List of extra plugins which should be deployed,";
qInfo() << " -version : Print version statement and exit."; qInfo() << " separated by comma.";
qInfo() << " -version : Print version statement and exit.";
qInfo() << ""; qInfo() << "";
qInfo() << "linuxdeployqt takes an application as input and makes it"; qInfo() << "linuxdeployqt takes an application as input and makes it";
qInfo() << "self-contained by copying in the Qt libraries and plugins that"; qInfo() << "self-contained by copying in the Qt libraries and plugins that";
@@ -206,6 +207,7 @@ int main(int argc, char **argv)
QStringList qmlDirs; QStringList qmlDirs;
QString qmakeExecutable; QString qmakeExecutable;
extern QStringList extraQtPlugins; extern QStringList extraQtPlugins;
extern bool copyCopyrightFiles;
/* FHS-like mode is for an application that has been installed to a $PREFIX which is otherwise empty, e.g., /path/to/usr. /* 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. */ * In this case, we want to construct an AppDir in /path/to. */
@@ -397,6 +399,9 @@ int main(int argc, char **argv)
LogError() << "Missing qml directory path"; LogError() << "Missing qml directory path";
else else
qmlDirs << argument.mid(index+1); qmlDirs << argument.mid(index+1);
} else if (argument.startsWith("-no-copy-copyright-files")) {
LogDebug() << "Argument found:" << argument;
copyCopyrightFiles = false;
} else if (argument == QByteArray("-always-overwrite")) { } else if (argument == QByteArray("-always-overwrite")) {
LogDebug() << "Argument found:" << argument; LogDebug() << "Argument found:" << argument;
alwaysOwerwriteEnabled = true; alwaysOwerwriteEnabled = true;
+6
View File
@@ -58,6 +58,7 @@ int qtDetected = 0;
bool qtDetectionComplete = 0; // As long as Qt is not detected yet, ldd may encounter "not found" messages, continue anyway bool qtDetectionComplete = 0; // As long as Qt is not detected yet, ldd may encounter "not found" messages, continue anyway
bool deployLibrary = false; bool deployLibrary = false;
QStringList extraQtPlugins; QStringList extraQtPlugins;
bool copyCopyrightFiles = true;
using std::cout; using std::cout;
using std::endl; using std::endl;
@@ -284,6 +285,11 @@ bool copyCopyrightFile(QString libPath){
* Debian-like systems. Pull requests welcome for other * Debian-like systems. Pull requests welcome for other
* systems. */ * systems. */
if (!copyCopyrightFiles) {
LogNormal() << "Skipping copyright files deployment as requested by the user";
return false;
}
QString dpkgPath; QString dpkgPath;
dpkgPath = QStandardPaths::findExecutable("dpkg"); dpkgPath = QStandardPaths::findExecutable("dpkg");
if(dpkgPath == ""){ if(dpkgPath == ""){