Hi,
Marc Weber wrote:
> Could be applied to ghcboot and acroread (if buildInputs would be used
> instead of libPath .. adding more libraries to rpath than necessary
> doesn't harm, does it? As long as they belong to the nix system ..)
Yes, that shouldn't hurt (except that it can cause a "retained" runtime
dependency - you might end up with some paths in the closure that aren't
needed). In fact you could patchelf again (with --shrink-rpath) to get rid of
unnecessary paths.
> patchelfExecutables = drv : drv // {
This won't work because "drv" is the result of a call to mkDerivation, and only
the attributes passed in the actual call to mkDerivation will be passed to the
builder. Any attributes added to the *result* of mkDerivation won't be used.
The solution is to add the postBuild attribute *before* the call to
mkDerivation. The overrideGCC function in all-packages.nix does something
similar, namely setting the NIX_GCC attribute:
overrideGCC = stdenv: gcc: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // { NIX_GCC = gcc; });
};
But maybe it simpler to just stick your postBuild value in a file that you can
then import in every Nix expression that needs it.
--
Eelco Dolstra | http://www.cs.uu.nl/~eelco
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev