2016-03-06 00:34:08 +00:00
|
|
|
{ stdenv, fetchurl, cups, perl, glibc, ghostscript, which, makeWrapper}:
|
|
|
|
|
|
|
|
/*
|
|
|
|
[Setup instructions](http://support.brother.com/g/s/id/linux/en/instruction_prn1a.html).
|
|
|
|
|
|
|
|
URI example
|
|
|
|
~ `lpd://BRW0080927AFBCE/binary_p1`
|
|
|
|
|
|
|
|
Logging
|
|
|
|
-------
|
2016-05-04 10:08:35 +00:00
|
|
|
|
2016-03-06 00:34:08 +00:00
|
|
|
`/tmp/br_lpdfilter_ml1.log` when `$ENV{LPD_DEBUG} > 0` in `filter_BrGenML1`
|
|
|
|
which is activated automatically when `DEBUG > 0` in `brother_lpdwrapper_BrGenML1`
|
|
|
|
from the cups wrapper.
|
|
|
|
|
|
|
|
Issues
|
|
|
|
------
|
|
|
|
|
|
|
|
- filter_BrGenML1 ln 196 `my $GHOST_SCRIPT=`which gs`;`
|
2016-05-04 10:08:35 +00:00
|
|
|
|
2016-03-06 00:34:08 +00:00
|
|
|
`GHOST_SCRIPT` is empty resulting in an empty `/tmp/br_lpdfilter_ml1_gsout.dat` file.
|
|
|
|
See `/tmp/br_lpdfilter_ml1.log` for the executed command.
|
|
|
|
|
|
|
|
Notes
|
|
|
|
-----
|
|
|
|
|
|
|
|
- The `setupPrintcap` has totally no use in our context.
|
|
|
|
*/
|
|
|
|
|
|
|
|
let
|
|
|
|
myPatchElf = file: with stdenv.lib; ''
|
|
|
|
patchelf --set-interpreter \
|
|
|
|
${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \
|
|
|
|
${file}
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "brgenml1lpr-3.1.0-1";
|
|
|
|
src = fetchurl {
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://download.brother.com/welcome/dlf101123/${name}.i386.deb";
|
2016-03-06 00:34:08 +00:00
|
|
|
sha256 = "0zdvjnrjrz9sba0k525linxp55lr4cyivfhqbkq1c11br2nvy09f";
|
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar x $src
|
|
|
|
tar xfvz data.tar.gz
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ cups perl glibc ghostscript which ];
|
2016-05-04 10:08:35 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
2016-03-06 00:34:08 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
INFDIR=opt/brother/Printers/BrGenML1/inf
|
|
|
|
LPDDIR=opt/brother/Printers/BrGenML1/lpd
|
|
|
|
|
|
|
|
# Setup max debug log by default.
|
|
|
|
substituteInPlace $LPDDIR/filter_BrGenML1 \
|
|
|
|
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/BrGenML1\"; #" \
|
|
|
|
--replace "PRINTER =~" "PRINTER = \"BrGenML1\"; #"
|
|
|
|
|
|
|
|
${myPatchElf "$INFDIR/braddprinter"}
|
|
|
|
${myPatchElf "$LPDDIR/brprintconflsr3"}
|
|
|
|
${myPatchElf "$LPDDIR/rawtobr3"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
INFDIR=opt/brother/Printers/BrGenML1/inf
|
|
|
|
LPDDIR=opt/brother/Printers/BrGenML1/lpd
|
|
|
|
|
|
|
|
mkdir -p $out/$INFDIR
|
|
|
|
cp -rp $INFDIR/* $out/$INFDIR
|
|
|
|
mkdir -p $out/$LPDDIR
|
|
|
|
cp -rp $LPDDIR/* $out/$LPDDIR
|
|
|
|
|
|
|
|
wrapProgram $out/$LPDDIR/filter_BrGenML1 \
|
|
|
|
--prefix PATH ":" "${ghostscript}/bin" \
|
|
|
|
--prefix PATH ":" "${which}/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Brother BrGenML1 LPR driver";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.brother.com";
|
2016-03-06 00:34:08 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2019-02-22 19:31:09 +00:00
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
2016-03-06 00:34:08 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ jraygauthier ];
|
|
|
|
};
|
|
|
|
}
|