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