Skip to content

meson: Add -Wl,-rpath,${libdir} on macOS

Nirbheek Chauhan requested to merge nirbheek/gstreamer:add-rpath-on-macos into main

We made the gstreamer installation prefix relocatable by picking up plugins relative to the location of libgstreamer-1.0.dylib, similar to how it's done for Windows:

!1627 (merged)

This had a lot of side-effects:

#1051 (closed) cerbero#363 (closed) cerbero#371 (closed) cerbero#362 (closed)

A partial fix for the cerbero side of these was:

cerbero!807 (merged)

However, this relied on the consumers knowing that they need to add LC_RPATH entries to the libdir of the prefix. This is done automatically by build systems like Meson, but not by others, such as Autotools, CMake, Cargo, XCode, etc. For those, we need to add the RPATH entries to the gstreamer-1.0.pc file.

This also has the side-effect of fixing the loading of gstreamer rust plugins on macOS:

Fixes #1159 (closed)

Fixes #1149 (closed)

Merge request reports