Hi,
I don't get why you don't want to recompile when runtime dependencies
change, they seem just as important to me as build time dependencies.
Don't you loose purity (dependablility) by this?
Wouter
Nicolas Pierron schreef:
Hi,
I have found a way to handle runtime dependencies which offer the
opportunity to not recompile a program if its runtime dependencies
have changed.The following code handle a new attribute
(runtimeDependencies) inside mkDerivation. This attribute contains a
derivation which has as source (src) the "clean" installed version.
addRuntimeDependenciesToDerivation = stdenv: stdenv //
{ mkDerivation = args:
if args ? runtimeDependencies then
stdenv.mkDerivation ({
meta = args.meta;
name = args.name;
src = stdenv.mkDerivation (removeAttrs args
["runtimeDependencies"]);
} // args.runtimeDependencies)
else
stdenv.mkDerivation args
;
};
It is use as follow:
{ ... }:
stdenv.mkDerivation rec {
name = "...";
src = fetchurl { ... };
runtimeDependencies = {
buildInputs = [ ... ];
buildCommand = '' ... '';
};
meta = { ... };
}
Should I commit this?
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev