summary refs log tree commit diff
path: root/pkgs/misc/cups/drivers
diff options
context:
space:
mode:
authorMartin Ramm <martin-ramm@gmx.de>2023-03-19 00:51:15 +0100
committerMartin Ramm <martin-ramm@gmx.de>2023-03-19 00:51:48 +0100
commite2871a593c24da5e521a57901c8c703efa0e7893 (patch)
tree8001eae1741e97b38d8fc631cc3f36e7dec143eb /pkgs/misc/cups/drivers
parentaeece9d990e43477804a76107cac6f9d1fdf9854 (diff)
downloadnixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.tar
nixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.tar.gz
nixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.tar.bz2
nixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.tar.lz
nixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.tar.xz
nixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.tar.zst
nixpkgs-e2871a593c24da5e521a57901c8c703efa0e7893.zip
mfc5890cnlpr: init at 1.1.2-2
Diffstat (limited to 'pkgs/misc/cups/drivers')
-rw-r--r--pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix75
1 files changed, 75 insertions, 0 deletions
diff --git a/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix b/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix
new file mode 100644
index 00000000000..7878d77afc0
--- /dev/null
+++ b/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, a2ps
+, lib
+, fetchurl
+, dpkg
+, makeWrapper
+, coreutils
+, file
+, gawk
+, ghostscript
+, gnused
+, pkgsi686Linux
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mfc5890cnlpr";
+  version = "1.1.2-2";
+
+  src = fetchurl {
+    url = "https://download.brother.com/welcome/dlf006168/${pname}-${version}.i386.deb";
+    sha256 = "119h3s1p9pv83mrfv6cmxpc0v33xf8c9nw5clj9yafv3aizxy6dp";
+  };
+
+  unpackPhase = ''
+    dpkg-deb -x $src $out
+  '';
+
+  nativeBuildInputs = [
+    dpkg
+    makeWrapper
+  ];
+
+  dontBuild = true;
+
+  installPhase = ''
+    dir=$out/usr/local/Brother/Printer/mfc5890cn
+
+    patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc5890cnfilter
+
+    wrapProgram $dir/inf/setupPrintcapij \
+      --prefix PATH : ${lib.makeBinPath [
+        coreutils
+      ]}
+
+    substituteInPlace $dir/lpd/filtermfc5890cn \
+      --replace "/usr/" "$out/usr/"
+
+    wrapProgram $dir/lpd/filtermfc5890cn \
+      --prefix PATH : ${lib.makeBinPath [
+        a2ps
+        coreutils
+        file
+        ghostscript
+        gnused
+      ]}
+
+    substituteInPlace $dir/lpd/psconvertij2 \
+      --replace '`which gs`' "${ghostscript}/bin/gs"
+
+    wrapProgram $dir/lpd/psconvertij2 \
+      --prefix PATH : ${lib.makeBinPath [
+        gnused
+        gawk
+      ]}
+  '';
+
+  meta = with lib; {
+    description = "Brother MFC-5890CN LPR printer driver";
+    homepage = "http://www.brother.com/";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    maintainers = with maintainers; [ martinramm ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}