cups-kyocera (cups driver): use patchPpdFilesHook

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

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).
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.
This commit is contained in:
Yarny0 2021-07-07 21:27:21 +02:00
parent ef8566f38b
commit bf30b53817

View file

@ -1,4 +1,9 @@
{ stdenv, lib, fetchzip, cups }:
{ lib
, stdenv
, cups
, fetchzip
, patchPpdFilesHook
}:
let
platform =
@ -23,6 +28,8 @@ stdenv.mkDerivation {
sha256 = "0z1pbgidkibv4j21z0ys8cq1lafc6687syqa07qij2qd8zp15wiz";
};
nativeBuildInputs = [ patchPpdFilesHook ];
installPhase = ''
tar -xvf ${platform}/Global/English.tar.gz
install -Dm755 English/rastertokpsl $out/lib/cups/filter/rastertokpsl
@ -33,13 +40,11 @@ stdenv.mkDerivation {
mkdir -p $out/share/cups/model/Kyocera
cd English
for i in *.ppd; do
sed -i $i -e \
"s,/usr/lib/cups/filter/rastertokpsl,$out/lib/cups/filter/rastertokpsl,g"
cp $i $out/share/cups/model/Kyocera
done;
cp *.ppd $out/share/cups/model/Kyocera
'';
ppdFileCommands = [ "rastertokpsl" ];
meta = with lib; {
description = "CUPS drivers for several Kyocera FS-{1020,1025,1040,1060,1120,1125} printers";
homepage = "https://www.kyoceradocumentsolutions.ru/index/service_support/download_center.false.driver.FS1040._.EN.html#";