From 8e8d8206f1d798384c1b8551811fb789a69e01b2 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 11 Jan 2023 01:11:06 +0530 Subject: [PATCH] meson: Add build_rpath for qt5 plugin on macOS Without this, the plugin cannot be loaded in a devenv because the RPATH is not added to the plugin dylib. This RPATH will be stripped on install, which is what we want. When deploying apps, people are supposed to use `macdeployqt` to create an AppBundle that bundles Qt for you and sets the RPATHs correctly to point to that bundled Qt. Part-of: --- subprojects/gst-plugins-good/ext/qt/meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/gst-plugins-good/ext/qt/meson.build b/subprojects/gst-plugins-good/ext/qt/meson.build index b1c47f05fe..e1b394ae23 100644 --- a/subprojects/gst-plugins-good/ext/qt/meson.build +++ b/subprojects/gst-plugins-good/ext/qt/meson.build @@ -151,6 +151,15 @@ if gst_gl_have_window_eagl and gst_gl_have_platform_eagl endif if have_qt_windowing + # rpath is needed to be able to load the plugin on macOS inside the devenv + qmlgl_kwargs = {} + if host_system == 'darwin' + fs = import('fs') + qt_bindir = fs.parent(find_program('qmake').full_path()) + qt_libdir = fs.parent(qt_bindir) / 'lib' + qmlgl_kwargs += {'build_rpath': qt_libdir} + endif + # Build it! moc_files = qt5_mod.preprocess(moc_headers : moc_headers) gstqmlgl = library('gstqmlgl', sources, moc_files, @@ -159,6 +168,7 @@ if have_qt_windowing include_directories: [configinc, libsinc], dependencies : [gst_dep, gstvideo_dep, gstgl_dep, gstglproto_dep, qt5qml_dep, optional_deps], override_options : ['cpp_std=c++11'], + kwargs: qmlgl_kwargs, install: true, install_dir : plugins_install_dir) plugins += [gstqmlgl]