Browse Source

Remove mentions of debug libraries (a macOS leftover)

master
probonopd 8 years ago
parent
commit
562c578a9b
  1. 10
      linuxdeployqt/main.cpp
  2. 44
      shared/shared.cpp
  3. 14
      shared/shared.h

10
linuxdeployqt/main.cpp

@ -48,7 +48,6 @@ int main(int argc, char **argv)
qDebug() << " -no-plugins : Skip plugin deployment"; qDebug() << " -no-plugins : Skip plugin deployment";
qDebug() << " -appimage : Create an AppImage"; qDebug() << " -appimage : Create an AppImage";
qDebug() << " -no-strip : Don't run 'strip' on the binaries"; qDebug() << " -no-strip : Don't run 'strip' on the binaries";
qDebug() << " -use-debug-libs : Deploy with debug versions of libraries and plugins (implies -no-strip)";
qDebug() << " -executable=<path> : Let the given executable use the deployed libraries too"; qDebug() << " -executable=<path> : Let the given executable use the deployed libraries too";
qDebug() << " -qmldir=<path> : Scan for QML imports in the given path"; qDebug() << " -qmldir=<path> : Scan for QML imports in the given path";
qDebug() << " -always-overwrite : Copy files even if the target file exists"; qDebug() << " -always-overwrite : Copy files even if the target file exists";
@ -97,7 +96,6 @@ int main(int argc, char **argv)
bool plugins = true; bool plugins = true;
bool dmg = false; bool dmg = false;
bool useDebugLibs = false;
extern bool runStripEnabled; extern bool runStripEnabled;
extern bool alwaysOwerwriteEnabled; extern bool alwaysOwerwriteEnabled;
extern QStringList librarySearchPath; extern QStringList librarySearchPath;
@ -116,10 +114,6 @@ int main(int argc, char **argv)
} else if (argument == QByteArray("-no-strip")) { } else if (argument == QByteArray("-no-strip")) {
LogDebug() << "Argument found:" << argument; LogDebug() << "Argument found:" << argument;
runStripEnabled = false; runStripEnabled = false;
} else if (argument == QByteArray("-use-debug-libs")) {
LogDebug() << "Argument found:" << argument;
useDebugLibs = true;
runStripEnabled = false;
} else if (argument.startsWith(QByteArray("-verbose"))) { } else if (argument.startsWith(QByteArray("-verbose"))) {
LogDebug() << "Argument found:" << argument; LogDebug() << "Argument found:" << argument;
int index = argument.indexOf("="); int index = argument.indexOf("=");
@ -160,7 +154,7 @@ int main(int argc, char **argv)
} }
} }
DeploymentInfo deploymentInfo = deployQtLibraries(appDirPath, additionalExecutables, useDebugLibs); DeploymentInfo deploymentInfo = deployQtLibraries(appDirPath, additionalExecutables);
// Convenience: Look for .qml files in the current directoty if no -qmldir specified. // Convenience: Look for .qml files in the current directoty if no -qmldir specified.
if (qmlDirs.isEmpty()) { if (qmlDirs.isEmpty()) {
@ -184,7 +178,7 @@ int main(int argc, char **argv)
if (plugins && !deploymentInfo.qtPath.isEmpty()) { if (plugins && !deploymentInfo.qtPath.isEmpty()) {
deploymentInfo.pluginPath = QDir::cleanPath(deploymentInfo.qtPath + "/../plugins"); deploymentInfo.pluginPath = QDir::cleanPath(deploymentInfo.qtPath + "/../plugins");
deployPlugins(appDirPath, deploymentInfo, useDebugLibs); deployPlugins(appDirPath, deploymentInfo);
createQtConf(appDirPath); createQtConf(appDirPath);
} }

44
shared/shared.cpp

@ -209,7 +209,7 @@ LddInfo findDependencyInfo(const QString &binaryPath)
return info; return info;
} }
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs) LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths)
{ {
LibraryInfo info; LibraryInfo info;
QString trimmed = line.trimmed(); QString trimmed = line.trimmed();
@ -230,7 +230,7 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath,
int part = 0; int part = 0;
QString name; QString name;
QString qtPath; QString qtPath;
QString suffix = useDebugLibs ? "_debug" : ""; QString suffix = "";
// Split the line into [Qt-path]/lib/qt[Module].library/Versions/[Version]/ // Split the line into [Qt-path]/lib/qt[Module].library/Versions/[Version]/
QStringList parts = trimmed.split("/"); QStringList parts = trimmed.split("/");
@ -326,8 +326,8 @@ QStringList findAppLibraries(const QString &appDirPath)
iter.next(); iter.next();
result << iter.fileInfo().filePath(); result << iter.fileInfo().filePath();
} }
// .so.* // .so.*, FIXME: Is the above really needed or is it covered by the below too?
QDirIterator iter2(appDirPath, QStringList() << QString::fromLatin1("*.so.*"), QDirIterator iter2(appDirPath, QStringList() << QString::fromLatin1("*.so*"),
QDir::Files, QDirIterator::Subdirectories); QDir::Files, QDirIterator::Subdirectories);
while (iter2.hasNext()) { while (iter2.hasNext()) {
@ -354,11 +354,11 @@ QStringList findAppBundleFiles(const QString &appDirPath, bool absolutePath = fa
return result; return result;
} }
QList<LibraryInfo> getQtLibraries(const QList<DylibInfo> &dependencies, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs) QList<LibraryInfo> getQtLibraries(const QList<DylibInfo> &dependencies, const QString &appDirPath, const QSet<QString> &rpaths)
{ {
QList<LibraryInfo> libraries; QList<LibraryInfo> libraries;
for (const DylibInfo &dylibInfo : dependencies) { for (const DylibInfo &dylibInfo : dependencies) {
LibraryInfo info = parseLddLibraryLine(dylibInfo.binaryPath, appDirPath, rpaths, useDebugLibs); LibraryInfo info = parseLddLibraryLine(dylibInfo.binaryPath, appDirPath, rpaths);
if (info.libraryName.isEmpty() == false) { if (info.libraryName.isEmpty() == false) {
LogDebug() << "Adding library:"; LogDebug() << "Adding library:";
LogDebug() << info; LogDebug() << info;
@ -405,19 +405,19 @@ QSet<QString> getBinaryRPaths(const QString &path, bool resolve = true, QString
return rpaths; return rpaths;
} }
QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs) QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appDirPath, const QSet<QString> &rpaths)
{ {
const LddInfo info = findDependencyInfo(path); const LddInfo info = findDependencyInfo(path);
return getQtLibraries(info.dependencies, appDirPath, rpaths + getBinaryRPaths(path), useDebugLibs); return getQtLibraries(info.dependencies, appDirPath, rpaths + getBinaryRPaths(path));
} }
QList<LibraryInfo> getQtLibrariesForPaths(const QStringList &paths, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs) QList<LibraryInfo> getQtLibrariesForPaths(const QStringList &paths, const QString &appDirPath, const QSet<QString> &rpaths)
{ {
QList<LibraryInfo> result; QList<LibraryInfo> result;
QSet<QString> existing; QSet<QString> existing;
foreach (const QString &path, paths) { foreach (const QString &path, paths) {
foreach (const LibraryInfo &info, getQtLibraries(path, appDirPath, rpaths, useDebugLibs)) { foreach (const LibraryInfo &info, getQtLibraries(path, appDirPath, rpaths)) {
if (!existing.contains(info.libraryPath)) { // avoid duplicates if (!existing.contains(info.libraryPath)) { // avoid duplicates
existing.insert(info.libraryPath); existing.insert(info.libraryPath);
result << info; result << info;
@ -609,7 +609,7 @@ void stripAppBinary(const QString &bundlePath)
a list of actually deployed libraries. a list of actually deployed libraries.
*/ */
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries, DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,
const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, const QString &bundlePath, const QStringList &binaryPaths,
bool useLoaderPath) bool useLoaderPath)
{ {
@ -651,7 +651,7 @@ DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,
} }
// Check for library dependencies // Check for library dependencies
QList<LibraryInfo> dependencies = getQtLibraries(deployedBinaryPath, bundlePath, rpathsUsed, useDebugLibs); QList<LibraryInfo> dependencies = getQtLibraries(deployedBinaryPath, bundlePath, rpathsUsed);
foreach (LibraryInfo dependency, dependencies) { foreach (LibraryInfo dependency, dependencies) {
if (dependency.rpathUsed.isEmpty() != true) { if (dependency.rpathUsed.isEmpty() != true) {
@ -671,7 +671,7 @@ DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,
return deploymentInfo; return deploymentInfo;
} }
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables, bool useDebugLibs) DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables)
{ {
AppDirInfo applicationBundle; AppDirInfo applicationBundle;
applicationBundle.path = appDirPath; applicationBundle.path = appDirPath;
@ -693,7 +693,7 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a
LogDebug() << "allLibraryPaths:" << allLibraryPaths; LogDebug() << "allLibraryPaths:" << allLibraryPaths;
QList<LibraryInfo> libraries = getQtLibrariesForPaths(allBinaryPaths, appDirPath, allLibraryPaths, useDebugLibs); QList<LibraryInfo> libraries = getQtLibrariesForPaths(allBinaryPaths, appDirPath, allLibraryPaths);
if (libraries.isEmpty() && !alwaysOwerwriteEnabled) { if (libraries.isEmpty() && !alwaysOwerwriteEnabled) {
LogWarning() << "Could not find any external Qt libraries to deploy in" << appDirPath; LogWarning() << "Could not find any external Qt libraries to deploy in" << appDirPath;
@ -701,12 +701,12 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a
LogWarning() << "If so, you will need to rebuild" << appDirPath << "before trying again."; LogWarning() << "If so, you will need to rebuild" << appDirPath << "before trying again.";
return DeploymentInfo(); return DeploymentInfo();
} else { } else {
return deployQtLibraries(libraries, applicationBundle.path, allBinaryPaths, useDebugLibs, !additionalExecutables.isEmpty()); return deployQtLibraries(libraries, applicationBundle.path, allBinaryPaths, !additionalExecutables.isEmpty());
} }
} }
void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath, void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath,
const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs) const QString pluginDestinationPath, DeploymentInfo deploymentInfo)
{ {
LogNormal() << "Deploying plugins from" << pluginSourcePath; LogNormal() << "Deploying plugins from" << pluginSourcePath;
@ -770,8 +770,8 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath
if (copyFilePrintStatus(sourcePath, destinationPath)) { if (copyFilePrintStatus(sourcePath, destinationPath)) {
runStrip(destinationPath); runStrip(destinationPath);
QList<LibraryInfo> libraries = getQtLibraries(destinationPath, appDirInfo.path, deploymentInfo.rpathsUsed, useDebugLibs); QList<LibraryInfo> libraries = getQtLibraries(destinationPath, appDirInfo.path, deploymentInfo.rpathsUsed);
deployQtLibraries(libraries, appDirInfo.path, QStringList() << destinationPath, useDebugLibs, deploymentInfo.useLoaderPath); deployQtLibraries(libraries, appDirInfo.path, QStringList() << destinationPath, deploymentInfo.useLoaderPath);
} }
} }
} }
@ -807,14 +807,14 @@ void createQtConf(const QString &appDirPath)
} }
} }
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo, bool useDebugLibs) void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo)
{ {
AppDirInfo applicationBundle; AppDirInfo applicationBundle;
applicationBundle.path = appDirPath; applicationBundle.path = appDirPath;
applicationBundle.binaryPath = findAppBinary(appDirPath); applicationBundle.binaryPath = findAppBinary(appDirPath);
const QString pluginDestinationPath = appDirPath + "/" + "plugins"; const QString pluginDestinationPath = appDirPath + "/" + "plugins";
deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo, useDebugLibs); deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo);
} }
void deployQmlImport(const QString &appDirPath, const QSet<QString> &rpaths, const QString &importSourcePath, const QString &importName) void deployQmlImport(const QString &appDirPath, const QSet<QString> &rpaths, const QString &importSourcePath, const QString &importName)
@ -965,11 +965,11 @@ void changeQtLibraries(const QList<LibraryInfo> libraries, const QStringList &bi
} }
} }
void changeQtLibraries(const QString appPath, const QString &qtPath, bool useDebugLibs) void changeQtLibraries(const QString appPath, const QString &qtPath)
{ {
const QString appBinaryPath = findAppBinary(appPath); const QString appBinaryPath = findAppBinary(appPath);
const QStringList libraryPaths = findAppLibraries(appPath); const QStringList libraryPaths = findAppLibraries(appPath);
const QList<LibraryInfo> libraries = getQtLibrariesForPaths(QStringList() << appBinaryPath << libraryPaths, appPath, getBinaryRPaths(appBinaryPath, true), useDebugLibs); const QList<LibraryInfo> libraries = getQtLibrariesForPaths(QStringList() << appBinaryPath << libraryPaths, appPath, getBinaryRPaths(appBinaryPath, true));
if (libraries.isEmpty()) { if (libraries.isEmpty()) {
LogWarning() << "Could not find any _external_ Qt libraries to change in" << appPath; LogWarning() << "Could not find any _external_ Qt libraries to change in" << appPath;

14
shared/shared.h

@ -104,19 +104,19 @@ public:
inline QDebug operator<<(QDebug debug, const AppDirInfo &info); inline QDebug operator<<(QDebug debug, const AppDirInfo &info);
void changeQtLibraries(const QString appPath, const QString &qtPath, bool useDebugLibs); void changeQtLibraries(const QString appPath, const QString &qtPath);
void changeQtLibraries(const QList<LibraryInfo> libraries, const QStringList &binaryPaths, const QString &qtPath); void changeQtLibraries(const QList<LibraryInfo> libraries, const QStringList &binaryPaths, const QString &qtPath);
LddInfo findDependencyInfo(const QString &binaryPath); LddInfo findDependencyInfo(const QString &binaryPath);
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs); LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths);
QString findAppBinary(const QString &appDirPath); QString findAppBinary(const QString &appDirPath);
QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs); QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appDirPath, const QSet<QString> &rpaths);
QList<LibraryInfo> getQtLibraries(const QStringList &lddLines, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs); QList<LibraryInfo> getQtLibraries(const QStringList &lddLines, const QString &appDirPath, const QSet<QString> &rpaths);
QString copyLibrary(const LibraryInfo &library, const QString path); QString copyLibrary(const LibraryInfo &library, const QString path);
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables, bool useDebugLibs); DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables);
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath); DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useLoaderPath);
void createQtConf(const QString &appDirPath); void createQtConf(const QString &appDirPath);
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo, bool useDebugLibs); void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo);
bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs); bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs);
void changeIdentification(const QString &id, const QString &binaryPath); void changeIdentification(const QString &id, const QString &binaryPath);
void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath); void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath);

Loading…
Cancel
Save