From 9498638988122c0c5122f7d7cfa042e4e3a2bded Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 20 Mar 2021 14:19:49 +0100 Subject: [PATCH] Make macdeployqt use environment variables for gstreamer --- .github/workflows/ccpp.yml | 6 ++++-- 3rdparty/macdeployqt/shared.cpp | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 43c2ecaa7..f6be7e9c8 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -1063,7 +1063,8 @@ jobs: PKG_CONFIG_PATH: /usr/local/lib/pkgconfig Qt6_DIR: /usr/local/opt/qt6/lib/cmake Qt5LinguistTools_DIR: /usr/local/opt/qt6/lib/cmake/Qt6LinguistTools - GST_SCANNER_PATH: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner + GIO_EXTRA_MODULES: /usr/local/lib/gio/modules + GST_PLUGIN_SCANNER: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0 working-directory: build run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_WITH_QT6=ON -DBUILD_WERROR=ON -DUSE_BUNDLE=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/lib/cmake @@ -1135,7 +1136,8 @@ jobs: PKG_CONFIG_PATH: /usr/local/lib/pkgconfig Qt5_DIR: /usr/local/opt/qt6/lib/cmake Qt5LinguistTools_DIR: /usr/local/opt/qt6/lib/cmake/Qt6LinguistTools - GST_SCANNER_PATH: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner + GIO_EXTRA_MODULES: /usr/local/lib/gio/modules + GST_PLUGIN_SCANNER: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0 working-directory: build run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_WITH_QT6=ON -DBUILD_WERROR=ON -DUSE_BUNDLE=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/lib/cmake diff --git a/3rdparty/macdeployqt/shared.cpp b/3rdparty/macdeployqt/shared.cpp index 69ff9cb9f..d3046d7f3 100644 --- a/3rdparty/macdeployqt/shared.cpp +++ b/3rdparty/macdeployqt/shared.cpp @@ -1196,7 +1196,13 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl // GIO modules { - const QString sourcePath = "/usr/local/lib/gio/modules/libgiognutls.so"; + QString sourcePath = qgetenv("GIO_EXTRA_MODULES"); + if (sourcePath.isEmpty()) { + sourcePath = "/usr/local/lib/gio/modules/libgiognutls.so"; + } + else { + sourcePath = sourcePath + "/libgiognutls.so"; + } const QString destinationPath = appBundleInfo.path + "/Contents/PlugIns/gio-modules/libgiognutls.so"; QDir dir; if (dir.mkpath(QFileInfo(destinationPath).path()) && copyFilePrintStatus(sourcePath, destinationPath)) { @@ -1208,7 +1214,10 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl // gst-plugin-scanner { - const QString sourcePath = "/usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner"; + QString sourcePath = qgetenv("GST_PLUGIN_SCANNER"); + if (sourcePath.isEmpty()) { + sourcePath = "/usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner"; + } const QString destinationPath = appBundleInfo.path + "/" + "Contents/PlugIns/gst-plugin-scanner"; QDir dir; if (dir.mkpath(QFileInfo(destinationPath).path()) && copyFilePrintStatus(sourcePath, destinationPath)) { @@ -1269,7 +1278,11 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl << "libgstlame.dylib" << "libgstmusepack.dylib"; - QString gstreamer_plugins_dir = "/usr/local/lib/gstreamer-1.0"; + QString gstreamer_plugins_dir = qgetenv("GST_PLUGIN_PATH"); + if (gstreamer_plugins_dir.isEmpty()) { + gstreamer_plugins_dir = "/usr/local/lib/gstreamer-1.0"; + } + for (const QString &plugin : gstreamer_plugins) { const QString sourcePath = gstreamer_plugins_dir + "/" + plugin; const QString destinationPath = appBundleInfo.path + "/Contents/PlugIns/gstreamer/" + plugin;