Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkgs/by-name/pa/patchPpdFilesHook/patch-ppd-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ fixupOutputHooks+=(_patchPpdFileCommands4fixupOutputHooks)
# Install a hook for the `fixupPhase`:
# If the variable `ppdFileCommands` contains a list of
# executable names, the hook calls `patchPpdFileCommands`
# on each output's `/share/cups/model` and `/share/ppds`
# on each output's `/share/cups/model` and `/share/ppd`
# directories in order to replace calls to those executables.

_patchPpdFileCommands4fixupOutputHooks () {
[[ -n $ppdFileCommands ]] || return 0
if [[ -d $prefix/share/cups/model ]]; then
patchPpdFileCommands "$prefix/share/cups/model" $ppdFileCommands
fi
if [[ -d $prefix/share/ppds ]]; then
patchPpdFileCommands "$prefix/share/ppds" $ppdFileCommands
if [[ -d $prefix/share/ppd ]]; then
patchPpdFileCommands "$prefix/share/ppd" $ppdFileCommands
fi
}

Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/pa/patchPpdFilesHook/test.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
lib,
replaceVars,
diffutils,
stdenv,
patchPpdFilesHook,
}:

let
inherit (lib.meta) getExe';

input = replaceVars ./test.ppd {
keep = "cmp";
patch = "cmp";
Expand All @@ -15,9 +18,9 @@ let

output = replaceVars ./test.ppd {
keep = "cmp";
patch = "${diffutils}/bin/cmp";
patch = getExe' diffutils "cmp";
pathkeep = "/bin/cmp";
pathpatch = "${diffutils}/bin/cmp";
pathpatch = getExe' diffutils "cmp";
};
in

Expand All @@ -33,10 +36,10 @@ stdenv.mkDerivation {
ppdFileCommands = [ "cmp" ];
preFixup = ''
install -D "${input}" "${placeholder "out"}/share/cups/model/test.ppd"
install -D "${input}" "${placeholder "out"}/share/ppds/test.ppd"
install -D "${input}" "${placeholder "out"}/share/ppd/test.ppd"
'';
postFixup = ''
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"
diff --color --report-identical-files "${output}" "${placeholder "out"}/share/ppd/test.ppd"
'';
}
Loading