probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.22k stars 414 forks source link

Bundling correct versions of plugins for GStreamer #559

Open MikePooh opened 1 year ago

MikePooh commented 1 year ago

I am trying to bundle Qt5 app which using GStreamer and its plugins. Running linuxdeployqt-5-x86_64.AppImage on Docker with Ubuntu 20.04 which uses Qt 5.12.8 and GStreamer 1.16.3 It bundles successfully, but after trying to run it on newer Linux distro, I got the following output:

(gpzv:579927): GStreamer-WARNING **: 16:58:21.318: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so: undefined symbol: gst_type_mark_as_plugin_api (gpzv:579927): GStreamer-WARNING **: 16:58:21.318: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so: undefined symbol: gst_type_mark_as_plugin_api (gpzv:579927): GStreamer-WARNING **: 16:58:21.319: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so: undefined symbol: gst_type_mark_as_plugin_api

Obviously that plugins was trying to loads from the wrong (host) path which uses newer GStremaer 1.20.4

This set of plugins which needed during runtime are not show with ldd before bundling, so it doesn't get in to it. I've run patchelf --add-needed to implicitly set it dependency. After that that it get into ldd and get into the bundle. libgstcoreelements.so => ..._Docker_x86_64/prog/./lib/libgstcoreelements.so (0x00007f67e2071000) But unfortunately in runtime it is still uses host path to load that plugins i.e. "/usr/lib/.." instead of bundle path "./lib/..." How to handle it?