1 { lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gnugrep, gnused, perl, mfcl2720dwlpr }:
3 stdenv.mkDerivation rec {
4 pname = "mfcl2720dwcupswrapper";
8 url = "https://download.brother.com/welcome/dlf101802/${pname}-${version}.i386.deb";
9 sha256 = "6d131926ce22c51b1854d2b91e426cc7ecbf5d6dabd698ef51a417090e35c598";
12 nativeBuildInputs = [ dpkg makeWrapper ];
19 basedir=${mfcl2720dwlpr}/opt/brother/Printers/MFCL2720DW
20 dir=$out/opt/brother/Printers/MFCL2720DW
22 substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \
23 --replace /usr/bin/perl ${perl}/bin/perl \
24 --replace "basedir =~" "basedir = \"$basedir\"; #" \
25 --replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #"
27 substituteInPlace $dir/cupswrapper/paperconfigml1 \
28 --replace /usr/bin/perl ${perl}/bin/perl
30 wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \
31 --prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
33 mkdir -p $out/lib/cups/filter
34 mkdir -p $out/share/cups/model
36 ln $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW $out/lib/cups/filter
37 ln $dir/cupswrapper/brother-MFCL2720DW-cups-en.ppd $out/share/cups/model
41 description = "Brother MFC-L2720DW CUPS wrapper driver";
42 homepage = "http://www.brother.com/";
43 license = lib.licenses.gpl2Plus;
44 platforms = [ "x86_64-linux" "i686-linux" ];
45 maintainers = [ lib.maintainers.xeji ];