pkg-config auto-defines prefix incorrectly for plugin pkgconfig directories, which breaks static linking of plugins
The Libs:
line in plugin pc files has Libs: -L${prefix}/lib/gstreamer-1.0
and pkgconfig expands it to
-L[PREFIX]/lib/lib/gstreamer-1.0
instead of
-L[PREFIX]/lib/gstreamer-1.0
One workaround for this is to call pkg-config as:
pkg-config --define-variable=prefix=[PREFIX]
(or whatever else) but that doesn't work for linking the qmlgl plugin on non-Linux platforms where Qt is provided by a separate prefix.
The only workaround right now is to run this command:
find [PREFIX]/lib/gstreamer-1.0/pkgconfig/ -iname '*.pc' | sudo xargs sed -i .orig -e 's:-L${prefix}/lib:-L${prefix}:'
There's two solutions I can think of:
- Add a variable
gstplugindir
to those pc files and put-L${gstplugindir}
instead of-L${prefix}/lib/gstreamer-1.0
inLibs:
so that you can then pass--define-variable=gstplugindir=[PREFIX]/lib/gstreamer-1.0
to pkg-config - Try out meson's new 'relocatable' property when generating pc files and see if that makes a difference