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/optand add a wrapper (maybe a link would work as well) in$out/binthat calls stuff in$out/opt