samsung-unified-linux-driver (cups driver): use patchPpdFilesHook

The `sed` script in the `installPhase` is removed.
Instead, the setup hook `patchPpdFilesHook` is
used to patch the path to the filter executables.

The result should essentially be the same.
Comparing the generated ppd files showed no difference,
short of the package's hash in the absolute paths and
added newline characters at the end of some ppd files.
Missing newline characters at the end of the last line are
apparently added by `awk`; this shouldn't affect functionality.
The new package also contains a `propagated-build-inputs`
file which propagates the package itself.
This ensures the package is available whenever
a ppd file is singled out by another package.

Yarny0 bfe3271f bf30b538

+11 -7
+11 -7
pkgs/misc/cups/drivers/samsung/4.01.17.nix
··· 11 11 # } 12 12 # (This advice was tested on the 1st November 2016.) 13 13 14 - { lib, stdenv, fetchurl, cups, libusb-compat-0_1 }: 14 + { lib 15 + , stdenv 16 + , cups 17 + , libusb-compat-0_1 18 + , fetchurl 19 + , patchPpdFilesHook 20 + }: 15 21 16 22 # Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html> 17 23 # to see what will break when upgrading. Consider a new versioned attribute. ··· 27 33 url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz"; 28 34 sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0"; 29 35 }; 36 + 37 + nativeBuildInputs = [ patchPpdFilesHook ]; 30 38 31 39 dontPatchELF = true; 32 40 dontStrip = true; ··· 63 71 mkdir -p $out/share/cups/model/samsung 64 72 cd - 65 73 cd ../noarch/at_opt/share/ppd 66 - for i in *.ppd; do 67 - sed -i $i -e \ 68 - "s,pstosecps,$out/lib/cups/filter/pstosecps,g; \ 69 - s,pstospl,$out/lib/cups/filter/pstospl,g; \ 70 - s,rastertospl,$out/lib/cups/filter/rastertospl,g" 71 - done; 72 74 cp -r ./* $out/share/cups/model/samsung 73 75 ''; 76 + 77 + ppdFileCommands = [ "pstosecps" "pstospl" "rastertospl" ]; 74 78 75 79 meta = with lib; { 76 80 description = "Samsung's Linux printing drivers; includes binaries without source code";