How to prevent RPATH being stripped for non-buildInputs

Since this issue was just linked to from another thread, and since I pondered on a similar question recently, here’s an sitrep for future readers:

  • CMake strips all Runpaths before installation (unless you specifically modify the install rpath), by design
  • Nixpkgs has hooks to append runpaths from buildInputs based on DT_NEEDED

Both are expected, just have your dependencies in buildInputs