Implement patches.nix to override parts of a derivation

This commit is contained in:
Moritz Ulrich 2014-10-09 21:59:17 +02:00
parent e47428d0e2
commit 172e55c7fc
2 changed files with 19 additions and 1 deletions

View File

@ -7,6 +7,14 @@
let
libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/";
patches = import ./patches.nix;
lib = stdenv.lib;
baseName = (builtins.parseDrvName name).name;
patch = if builtins.hasAttr baseName patches
then
builtins.getAttr baseName patches
else
{};
in
stdenv.mkDerivation ({
name = "chicken-${name}";
@ -37,4 +45,4 @@ stdenv.mkDerivation ({
--prefix PATH : "$out/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY"
done
'';
} // (builtins.removeAttrs args ["name" "buildInputs"]))
} // (builtins.removeAttrs args ["name" "buildInputs"]) // patch)

View File

@ -0,0 +1,10 @@
{
setup-helper = {
preBuild = ''
substituteInPlace setup-helper.setup \
--replace "(chicken-home)" \"$out/share/\"
cat setup-helper.setup
'';
};
}