Browse Source

Deploy platformthemes/libqgtk2.so, styles/libqgtk2style.so, iconengines and imageformats (#352)

master
probonopd 6 years ago
committed by GitHub
parent
commit
aa78a03de0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 61
      tools/linuxdeployqt/shared.cpp

61
tools/linuxdeployqt/shared.cpp

@ -1218,25 +1218,6 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath
// Plugin white list: // Plugin white list:
QStringList pluginList; QStringList pluginList;
// Make the bundled application look good on, e.g., Xfce
// Note: http://code.qt.io/qt/qtstyleplugins.git must be compiled (using libgtk2.0-dev)
// https://askubuntu.com/a/910143
// https://askubuntu.com/a/748186
// This functionality used to come as part of Qt by default in earlier versions
// At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself)
pluginList.append("platformthemes/libqgtk2.so");
pluginList.append("styles/libqgtk2style.so");
// Always bundle iconengines,imageformats
// https://github.com/probonopd/linuxdeployqt/issues/82
// https://github.com/probonopd/linuxdeployqt/issues/325
// FIXME
// The following does NOT work;
// findDependencyInfo: "ldd: /usr/local/Qt-5.9.3/plugins/iconengines: not regular file"
// pluginList.append("iconengines");
// pluginList.append("imageformats");
// TODO: Need to traverse the directories and add each contained plugin individually
LogDebug() << "deploymentInfo.deployedLibraries before attempting to bundle required plugins:" << deploymentInfo.deployedLibraries; LogDebug() << "deploymentInfo.deployedLibraries before attempting to bundle required plugins:" << deploymentInfo.deployedLibraries;
// Platform plugin: // Platform plugin:
@ -1257,15 +1238,41 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath
pluginList.append(QStringLiteral("platformthemes/") + plugin); pluginList.append(QStringLiteral("platformthemes/") + plugin);
} }
*/ */
// All image formats (svg if QtSvg library is used)
QStringList imagePlugins = QDir(pluginSourcePath + QStringLiteral("/imageformats")).entryList(QStringList() << QStringLiteral("*.so")); // Make the bundled application look good on, e.g., Xfce
foreach (const QString &plugin, imagePlugins) { // Note: http://code.qt.io/qt/qtstyleplugins.git must be compiled (using libgtk2.0-dev)
if (plugin.contains(QStringLiteral("qsvg"))) { // https://askubuntu.com/a/910143
if (containsHowOften(deploymentInfo.deployedLibraries, "libQt5Svg")) { // https://askubuntu.com/a/748186
pluginList.append(QStringLiteral("imageformats/") + plugin); // This functionality used to come as part of Qt by default in earlier versions
} // At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself)
QStringList extraQtPluginsAdded = { "platformthemes/libqgtk2.so", "styles/libqgtk2style.so" };
foreach (const QString &plugin, extraQtPluginsAdded) {
if (QFile::exists(pluginSourcePath + "/" + plugin)) {
pluginList.append(plugin);
LogDebug() << plugin << "appended";
} else { } else {
pluginList.append(QStringLiteral("imageformats/") + plugin); LogWarning() <<"Plugin" << pluginSourcePath + "/" + plugin << "not found, skipping";
}
}
// Always bundle iconengines,imageformats
// https://github.com/probonopd/linuxdeployqt/issues/82
// https://github.com/probonopd/linuxdeployqt/issues/325
// FIXME
// The following does NOT work;
// findDependencyInfo: "ldd: /usr/local/Qt-5.9.3/plugins/iconengines: not regular file"
// pluginList.append("iconengines");
// pluginList.append("imageformats");
// TODO: Need to traverse the directories and add each contained plugin individually
QStringList extraQtPluginDirs = { "iconengines", "imageformats" };
foreach (const QString &plugin, extraQtPluginDirs) {
QDir pluginDirectory(pluginSourcePath + "/" + plugin);
if (pluginDirectory.exists()) {
//If it is a plugin directory we will deploy the entire directory
QStringList plugins = pluginDirectory.entryList(QStringList() << QStringLiteral("*.so"));
foreach (const QString &pluginFile, plugins) {
pluginList.append(plugin + "/" + pluginFile);
LogDebug() << plugin + "/" + pluginFile << "appended";
}
} }
} }
} }

Loading…
Cancel
Save