[Nix-dev] Automatic makeWrapper

Tomasz Kontusz tomasz.kontusz at gmail.com
Thu Dec 12 22:35:15 CET 2013


I want to write some automation for generating makeWrapper - I want 
packages to propagate what variables will be needed to use them, and 
build wrappers based on that.

So far the API I think about is having "autoWrapper" function from set 
to set for preprocessing arguments to mkDerivation.
Example usage would be:

     stdenv.mkDerivation (autoWrapper {
       ...
       wrap = [ "bin/some_binary" { path = "bin/some_other_binary"; 
DONT_CRASH = "true"; } ];
     })

This would wrap "$out/bin/some_binary" and "$out/bin/some_other_binary" 
with values propagated from buildInputs, and additionaly add --set 
DONT_CRASH true for some_other_binary.

To propagate a variable's value, a package would define a 
"propagatedVariables" set with { "VARIABLE" = values_list; } attributes.
To say how those values are composed, exactly one package in the 
(recursive) buildInputs must define "propagatedVariablesConfiguration" 
with value similar to { "VARIABLE": { action = "prefix"; separator = 
":"; }; }.

Would a system like this be useful, and is the proposed API sane?

--
Tomasz Kontusz


More information about the nix-dev mailing list