2024-05-13 21:24:10 +00:00
|
|
|
{ substituteAll, diffutils, stdenv, patchPpdFilesHook }:
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
input = substituteAll {
|
|
|
|
src = ./test.ppd;
|
|
|
|
keep = "cmp";
|
|
|
|
patch = "cmp";
|
|
|
|
pathkeep = "/bin/cmp";
|
|
|
|
pathpatch = "/bin/cmp";
|
|
|
|
};
|
|
|
|
|
|
|
|
output = substituteAll {
|
|
|
|
src = ./test.ppd;
|
|
|
|
keep = "cmp";
|
|
|
|
patch = "${diffutils}/bin/cmp";
|
|
|
|
pathkeep = "/bin/cmp";
|
|
|
|
pathpatch = "${diffutils}/bin/cmp";
|
|
|
|
};
|
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
in stdenv.mkDerivation {
|
2024-05-02 00:46:19 +00:00
|
|
|
name = "${patchPpdFilesHook.name}-test";
|
|
|
|
buildInputs = [ diffutils ];
|
|
|
|
nativeBuildInputs = [ diffutils patchPpdFilesHook ];
|
|
|
|
dontUnpack = true;
|
|
|
|
dontInstall = true;
|
|
|
|
ppdFileCommands = [ "cmp" ];
|
|
|
|
preFixup = ''
|
|
|
|
install -D "${input}" "${placeholder "out"}/share/cups/model/test.ppd"
|
|
|
|
install -D "${input}" "${placeholder "out"}/share/ppds/test.ppd"
|
|
|
|
'';
|
|
|
|
postFixup = ''
|
2024-05-13 21:24:10 +00:00
|
|
|
diff --color --report-identical-files "${output}" "${
|
|
|
|
placeholder "out"
|
|
|
|
}/share/cups/model/test.ppd"
|
|
|
|
diff --color --report-identical-files "${output}" "${
|
|
|
|
placeholder "out"
|
|
|
|
}/share/ppds/test.ppd"
|
2024-05-02 00:46:19 +00:00
|
|
|
'';
|
|
|
|
}
|