Update shared.cpp

This commit is contained in:
probonopd
2019-01-13 15:19:26 +00:00
committed by GitHub
parent 4123a34a39
commit 56a8027535
+35 -33
View File
@@ -49,6 +49,7 @@
QString appBinaryPath; QString appBinaryPath;
bool runStripEnabled = true; bool runStripEnabled = true;
bool bundleAllButCoreLibs = false; bool bundleAllButCoreLibs = false;
bool bundleEverything = false;
bool fhsLikeMode = false; bool fhsLikeMode = false;
QString fhsPrefix; QString fhsPrefix;
bool alwaysOwerwriteEnabled = false; bool alwaysOwerwriteEnabled = false;
@@ -429,43 +430,44 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath,
if (trimmed.isEmpty()) if (trimmed.isEmpty())
return info; return info;
if(!bundleEverything) {
if(bundleAllButCoreLibs) {
/*
Bundle every lib including the low-level ones except those that are explicitly blacklisted.
This is more suitable for bundling in a way that is portable between different distributions and target systems.
Along the way, this also takes care of non-Qt libraries.
if(bundleAllButCoreLibs) { The excludelist can be updated by running the bundled script generate-excludelist.sh
/* */
Bundle every lib including the low-level ones except those that are explicitly blacklisted.
This is more suitable for bundling in a way that is portable between different distributions and target systems.
Along the way, this also takes care of non-Qt libraries.
The excludelist can be updated by running the bundled script generate-excludelist.sh // copy generated excludelist
*/ QStringList excludelist = generatedExcludelist;
// copy generated excludelist // append exclude libs
QStringList excludelist = generatedExcludelist; excludelist += excludeLibs;
// append exclude libs LogDebug() << "excludelist:" << excludelist;
excludelist += excludeLibs; if (! trimmed.contains("libicu")) {
if (containsHowOften(excludelist, QFileInfo(trimmed).completeBaseName())) {
LogDebug() << "excludelist:" << excludelist; LogDebug() << "Skipping blacklisted" << trimmed;
if (! trimmed.contains("libicu")) { return info;
if (containsHowOften(excludelist, QFileInfo(trimmed).completeBaseName())) { }
LogDebug() << "Skipping blacklisted" << trimmed; }
return info; } else {
} /*
} Don't deploy low-level libraries in /usr or /lib because these tend to break if moved to a system with a different glibc.
} else { TODO: Could make bundling these low-level libraries optional but then the bundles might need to
/* use something like patchelf --set-interpreter or http://bitwagon.com/rtldi/rtldi.html
Don't deploy low-level libraries in /usr or /lib because these tend to break if moved to a system with a different glibc. With the Qt provided by qt.io the libicu libraries come bundled, but that is not the case with e.g.,
TODO: Could make bundling these low-level libraries optional but then the bundles might need to Qt from ppas. Hence we make sure libicu is always bundled since it cannot be assumed to be on target sytems
use something like patchelf --set-interpreter or http://bitwagon.com/rtldi/rtldi.html */
With the Qt provided by qt.io the libicu libraries come bundled, but that is not the case with e.g., // Manual make of Qt deploys it to /usr/local/Qt-x.x.x so we cannot remove this path just like that, so let's allow known libs of Qt.
Qt from ppas. Hence we make sure libicu is always bundled since it cannot be assumed to be on target sytems if (!trimmed.contains("libicu") && !trimmed.contains("lib/libQt") && !trimmed.contains("lib/libqgsttools")) {
*/ if ((trimmed.startsWith("/usr") or (trimmed.startsWith("/lib")))) {
// Manual make of Qt deploys it to /usr/local/Qt-x.x.x so we cannot remove this path just like that, so let's allow known libs of Qt. return info;
if (!trimmed.contains("libicu") && !trimmed.contains("lib/libQt") && !trimmed.contains("lib/libqgsttools")) { }
if ((trimmed.startsWith("/usr") or (trimmed.startsWith("/lib")))) { }
return info; }
}
}
} }
enum State {QtPath, LibraryName, Version, End}; enum State {QtPath, LibraryName, Version, End};