1 { pkgs, lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript, gnugrep, gnused, which, perl }:
3 stdenv.mkDerivation rec {
4 pname = "mfcl2720dwlpr";
8 url = "https://download.brother.com/welcome/dlf101801/${pname}-${version}.i386.deb";
9 sha256 = "088217e9ad118ec1e7f3d3f8f60f3bd839fe2c7d7c1136b249e9ac648dc742af";
12 nativeBuildInputs = [ dpkg makeWrapper ];
19 dir=$out/opt/brother/Printers/MFCL2720DW
21 substituteInPlace $dir/lpd/filter_MFCL2720DW \
22 --replace /usr/bin/perl ${perl}/bin/perl \
23 --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
24 --replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #"
26 wrapProgram $dir/lpd/filter_MFCL2720DW \
27 --prefix PATH : ${lib.makeBinPath [
28 coreutils ghostscript gnugrep gnused which
31 # need to use i686 glibc here, these are 32bit proprietary binaries
32 interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2
33 patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
34 patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
35 patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
39 description = "Brother MFC-L2720DW lpr driver";
40 homepage = "http://www.brother.com/";
41 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
42 license = lib.licenses.unfree;
43 platforms = [ "x86_64-linux" "i686-linux" ];
44 maintainers = [ lib.maintainers.xeji ];