macdeployqt: List missing gstreamer plugins instead of failing

Fixes #936
This commit is contained in:
Jonas Kvinge
2022-05-04 23:11:53 +02:00
parent 4cfe8dd95e
commit edd088927d

View File

@@ -1228,13 +1228,15 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
} }
const QStringList giomodules = QStringList() << "libgiognutls.so" << "libgioopenssl.so"; const QStringList giomodules = QStringList() << "libgiognutls.so" << "libgioopenssl.so";
bool have_giomodule = false;
for (const QString &giomodule : giomodules) { for (const QString &giomodule : giomodules) {
const QString sourcePath = giomodule_path + "/" + giomodule; const QString sourcePath = giomodule_path + "/" + giomodule;
QFileInfo fileinfo(sourcePath); QFileInfo fileinfo(sourcePath);
if (!fileinfo.exists()) { if (!fileinfo.exists()) {
LogError() << "Missing GIO module" << fileinfo.baseName(); LogError() << "Missing GIO module" << fileinfo.baseName();
qFatal("Missing GIO modules."); continue;
} }
have_giomodule = true;
const QString destinationPath = appBundleInfo.path + "/Contents/PlugIns/gio-modules/" + giomodule; const QString destinationPath = appBundleInfo.path + "/Contents/PlugIns/gio-modules/" + giomodule;
QDir dir; QDir dir;
if (dir.mkpath(QFileInfo(destinationPath).path()) && copyFilePrintStatus(sourcePath, destinationPath)) { if (dir.mkpath(QFileInfo(destinationPath).path()) && copyFilePrintStatus(sourcePath, destinationPath)) {
@@ -1243,6 +1245,11 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
deployQtFrameworks(frameworks, appBundleInfo.path, QStringList() << destinationPath, useDebugLibs, deploymentInfo.useLoaderPath); deployQtFrameworks(frameworks, appBundleInfo.path, QStringList() << destinationPath, useDebugLibs, deploymentInfo.useLoaderPath);
} }
} }
if (!have_giomodule) {
qFatal("Missing GIO modules.");
}
} }
// gst-plugin-scanner // gst-plugin-scanner
@@ -1336,13 +1343,16 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
} }
} }
QStringList missing_gst_plugins;
for (const QString &plugin : gstreamer_plugins) { for (const QString &plugin : gstreamer_plugins) {
QFileInfo info(gstreamer_plugins_dir + "/" + plugin); QFileInfo info(gstreamer_plugins_dir + "/" + plugin);
if (!info.exists()) { if (!info.exists()) {
info.setFile(gstreamer_plugins_dir + "/" + info.baseName() + QString(".so")); info.setFile(gstreamer_plugins_dir + "/" + info.baseName() + QString(".so"));
if (!info.exists()) { if (!info.exists()) {
LogError() << "Missing gstreamer plugin" << info.baseName(); LogError() << "Missing gstreamer plugin" << info.baseName();
qFatal("Missing %s", info.baseName().toUtf8().constData()); missing_gst_plugins << info.baseName();
continue;
} }
} }
const QString &sourcePath = info.filePath(); const QString &sourcePath = info.filePath();
@@ -1354,6 +1364,10 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
} }
} }
if (!missing_gst_plugins.isEmpty()) {
LogError() << "Missing gstreamer plugins" << missing_gst_plugins;
}
} }
void createQtConf(const QString &appBundlePath) void createQtConf(const QString &appBundlePath)