v2 builder: rewrite RPATH to dep-slice targets before wiping dep dirs
The cleanup that follows `cabal v2-build` walks the slice's `$out` and
deletes the lndir-composed dep-slice content — those symlinks are
pure overhead (NAR scan, fixupPhase walk, reference scan all stat
them) and downstream consumers compose dep slices directly from
`nix-support/transitive-deps`.
GHC bakes `<this-slice>/store/.../<dep-uid>/lib` into the slice's own
shared libraries' DT_RUNPATH / LC_RPATH so iserv-dyn / dyld can find
each dep's transitive `.so` at TH-eval time. Plain "wipe dep dirs"
breaks this: stdenv's `shrink-rpath` (Linux fixupPhase) sees the
entry's dir is empty / missing and drops it, and on Darwin
install_name_tool wasn't touching them either — at runtime dyld
fails with `No such file or directory`.
Before wiping, walk every ELF / Mach-O file in the slice's own
unit dirs and rewrite its rpath: for each entry pointing into
`$out/store/`, follow a symlink under it via `readlink -f` to find
the dep slice's actual `/nix/store/<dep-slice>/store/.../<dep-uid>/lib`
and substitute that. Linux uses `patchelf --set-rpath`; Darwin uses
`install_name_tool -rpath`. After the rewrite, `shrink-rpath` sees
populated dirs and keeps the entries.
Confirmed:
* x86_64-linux native with-packages.run (paired with the awk fix
in the v2-shell env-file generator)
* x86_64-linux musl64 js-template-haskell.build — previously
failed with `Error loading shared library libHSth-abstraction-…
.so: No such file or directory` because shrink-rpath had
stripped the dep-slice path
* x86_64-linux native cabal-sublib-shell.run
* armv7a-android-prebuilt c-ffi.run (cross)