about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2018-07-03 17:38:04 +1000
committerMichael Hoang <enzime@users.noreply.github.com>2018-07-04 19:43:02 +1000
commitcc7fba1ce3e13522e08f1488ecea33c492bae018 (patch)
tree85734e92d5ce6713583c8e6096b386f155a1d792 /pkgs/misc
parent7138bc0eabe23800273e1fb74e4b39c4e12da08b (diff)
downloadnixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.tar
nixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.tar.gz
nixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.tar.bz2
nixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.tar.lz
nixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.tar.xz
nixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.tar.zst
nixlib-cc7fba1ce3e13522e08f1488ecea33c492bae018.zip
mfcl2740dwlpr: init at 3.2.0-1
Brother MFC-L2740DW lpr driver
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix
new file mode 100644
index 000000000000..6d3cf18e5296
--- /dev/null
+++ b/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix
@@ -0,0 +1,43 @@
+{ pkgsi686Linux, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript, gnugrep, gnused, which, perl }:
+
+stdenv.mkDerivation rec {
+  name = "mfcl2740dwlpr-${version}";
+  version = "3.2.0-1";
+
+  src = fetchurl {
+    url = "https://download.brother.com/welcome/dlf101727/${name}.i386.deb";
+    sha256 = "10a2bc672bd54e718b478f3afc7e47d451557f7d5513167d3ad349a3d00bffaf";
+  };
+
+  nativeBuildInputs = [ dpkg makeWrapper ];
+
+  unpackPhase = "dpkg-deb -x $src $out";
+
+  installPhase = ''
+    dir=$out/opt/brother/Printers/MFCL2740DW
+
+    substituteInPlace $dir/lpd/filter_MFCL2740DW \
+      --replace /usr/bin/perl ${perl}/bin/perl \
+      --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
+      --replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
+
+    wrapProgram $dir/lpd/filter_MFCL2740DW \
+      --prefix PATH : ${stdenv.lib.makeBinPath [
+        coreutils ghostscript gnugrep gnused which
+      ]}
+
+    # need to use i686 glibc here, these are 32bit proprietary binaries
+    interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2
+    patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
+    patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
+    patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
+  '';
+
+  meta = {
+    description = "Brother MFC-L2740DW lpr driver";
+    homepage = http://www.brother.com/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = [ stdenv.lib.maintainers.enzime ];
+  };
+}