1 { lib, stdenv, coreutils, dpkg, fetchurl, ghostscript, gnugrep, gnused, makeWrapper, perl, which }:
3 stdenv.mkDerivation rec {
4 pname = "mfcl2700dnlpr";
8 url = "https://download.brother.com/welcome/dlf102085/${pname}-${version}.i386.deb";
9 sha256 = "170qdzxlqikzvv2wphvfb37m19mn13az4aj88md87ka3rl5knk4m";
12 nativeBuildInputs = [ dpkg makeWrapper ];
19 dir=$out/opt/brother/Printers/MFCL2700DN
21 substituteInPlace $dir/lpd/filter_MFCL2700DN \
22 --replace /usr/bin/perl ${perl}/bin/perl \
23 --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
24 --replace "PRINTER =~" "PRINTER = \"MFCL2700DN\"; #"
26 wrapProgram $dir/lpd/filter_MFCL2700DN \
27 --prefix PATH : ${lib.makeBinPath [
28 coreutils ghostscript gnugrep gnused which
31 interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
32 patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
33 patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
34 patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
38 description = "Brother MFC-L2700DN LPR driver";
39 homepage = "http://www.brother.com/";
40 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
41 license = lib.licenses.unfree;
42 maintainers = [ lib.maintainers.tv ];
43 platforms = [ "i686-linux" ];