summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorYarny0 <41838844+Yarny0@users.noreply.github.com>2021-07-07 21:41:32 +0200
committerYarny0 <41838844+Yarny0@users.noreply.github.com>2022-11-06 16:19:23 +0100
commitbfe3271fc0cc6d0a471f8ef4ebe466cd8cf4c949 (patch)
tree49f3ca4f17663859679b293f8eeeddb3c2a705ad /pkgs/misc
parentbf30b53817652cc0bdaca8fbf8891165e273e332 (diff)
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.
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/cups/drivers/samsung/4.01.17.nix18
1 files changed, 11 insertions, 7 deletions
diff --git a/pkgs/misc/cups/drivers/samsung/4.01.17.nix b/pkgs/misc/cups/drivers/samsung/4.01.17.nix
index 12cfcde82f76a..dc9cb8f0515bb 100644
--- a/pkgs/misc/cups/drivers/samsung/4.01.17.nix
+++ b/pkgs/misc/cups/drivers/samsung/4.01.17.nix
@@ -11,7 +11,13 @@
 # }
 # (This advice was tested on the 1st November 2016.)
 
-{ lib, stdenv, fetchurl, cups, libusb-compat-0_1 }:
+{ lib
+, stdenv
+, cups
+, libusb-compat-0_1
+, fetchurl
+, patchPpdFilesHook
+}:
 
 # Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
 # to see what will break when upgrading. Consider a new versioned attribute.
@@ -28,6 +34,8 @@ in stdenv.mkDerivation rec {
     sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0";
   };
 
+  nativeBuildInputs = [ patchPpdFilesHook ];
+
   dontPatchELF = true;
   dontStrip = true;
 
@@ -63,15 +71,11 @@ in stdenv.mkDerivation rec {
     mkdir -p $out/share/cups/model/samsung
     cd -
     cd ../noarch/at_opt/share/ppd
-    for i in *.ppd; do
-      sed -i $i -e \
-        "s,pstosecps,$out/lib/cups/filter/pstosecps,g; \
-         s,pstospl,$out/lib/cups/filter/pstospl,g; \
-         s,rastertospl,$out/lib/cups/filter/rastertospl,g"
-    done;
     cp -r ./* $out/share/cups/model/samsung
   '';
 
+  ppdFileCommands = [ "pstosecps" "pstospl" "rastertospl" ];
+
   meta = with lib; {
     description = "Samsung's Linux printing drivers; includes binaries without source code";
     homepage = "http://www.samsung.com/";