1 { lib, stdenv, fetchurl, cups, perl, ghostscript, which, makeWrapper}:
4 [Setup instructions](http://support.brother.com/g/s/id/linux/en/instruction_prn1a.html).
7 ~ `lpd://BRW0080927AFBCE/binary_p1`
12 `/tmp/br_lpdfilter_ml1.log` when `$ENV{LPD_DEBUG} > 0` in `filter_BrGenML1`
13 which is activated automatically when `DEBUG > 0` in `brother_lpdwrapper_BrGenML1`
14 from the cups wrapper.
19 - filter_BrGenML1 ln 196 `my $GHOST_SCRIPT=`which gs`;`
21 `GHOST_SCRIPT` is empty resulting in an empty `/tmp/br_lpdfilter_ml1_gsout.dat` file.
22 See `/tmp/br_lpdfilter_ml1.log` for the executed command.
27 - The `setupPrintcap` has totally no use in our context.
32 patchelf --set-interpreter \
33 ${stdenv.cc.libc}/lib/ld-linux${lib.optionalString stdenv.hostPlatform.is64bit "-x86-64"}.so.2 \
37 stdenv.mkDerivation rec {
38 pname = "brgenml1lpr";
42 url = "https://download.brother.com/welcome/dlf101123/brgenml1lpr-${version}.i386.deb";
43 sha256 = "0zdvjnrjrz9sba0k525linxp55lr4cyivfhqbkq1c11br2nvy09f";
51 nativeBuildInputs = [ makeWrapper ];
52 buildInputs = [ cups perl stdenv.cc.libc ghostscript which ];
57 INFDIR=opt/brother/Printers/BrGenML1/inf
58 LPDDIR=opt/brother/Printers/BrGenML1/lpd
60 # Setup max debug log by default.
61 substituteInPlace $LPDDIR/filter_BrGenML1 \
62 --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/BrGenML1\"; #" \
63 --replace "PRINTER =~" "PRINTER = \"BrGenML1\"; #"
65 ${myPatchElf "$INFDIR/braddprinter"}
66 ${myPatchElf "$LPDDIR/brprintconflsr3"}
67 ${myPatchElf "$LPDDIR/rawtobr3"}
71 INFDIR=opt/brother/Printers/BrGenML1/inf
72 LPDDIR=opt/brother/Printers/BrGenML1/lpd
75 cp -rp $INFDIR/* $out/$INFDIR
77 cp -rp $LPDDIR/* $out/$LPDDIR
79 wrapProgram $out/$LPDDIR/filter_BrGenML1 \
80 --prefix PATH ":" "${ghostscript}/bin" \
81 --prefix PATH ":" "${which}/bin"
88 description = "Brother BrGenML1 LPR driver";
89 homepage = "http://www.brother.com";
90 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
91 platforms = lib.platforms.linux;
92 license = lib.licenses.unfreeRedistributable;
93 maintainers = with lib.maintainers; [ jraygauthier ];