I haven’t exactly got to the bottom of this, but I think that autoPatchelfHook
is replacing the whole of the fixupPhase
, and so my postFixup
hook is never being called. I’ve got things working in a slightly different way, which I overall prefer, by adding
patchelf --add-needed libssl.so.10 $out/bin/my_executable
to the end of the installPhase
. By way of explanation:
-
openssl.so.10
is the dynamic dependency that was missing when I tried to runmy_executable
, and which is being provided by theopenssl_1_0_2
package that I tried to manually add to therpath
. -
patchelf --add-needed
just adds a dynamic dependency to the binary -
autoPatchelfHook
then realizes that this dynamic dependency is needed, and that it can be satisfied by theopenssl_1_0_2
in thebuildInputs
. So it addsopenssl_1_0_2
to therpath
.