Sorry, I dont have a computer to test, but here are a few thougts:
- if the libraries are picked at runtime using dlopen, autopatchelf can’t see them so you might need to use
runtimeDependencies
, and disable the optimisations on rpath,dontPatchELF = true;
. See also How to set `runtimeDependencies` for shared libraries? - #5 by tobiasBora - if the binary really expects lib to be in a subfolder, you can copy the whole program to
$out/opt
and add a wrapper (maybe a link would work as well) in$out/bin
that calls stuff in$out/opt