2018-01-16 03:38:55 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
|
|
|
, cups
|
|
|
|
, dpkg
|
|
|
|
, a2ps, ghostscript, gnugrep, gnused, coreutils, file, perl, which
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "hll2390dw-cups";
|
2018-01-16 03:38:55 +00:00
|
|
|
version = "4.0.0-1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# The i386 part is a lie. There are x86, x86_64 and armv7l drivers.
|
|
|
|
# Though this builds only supports x86_64 for now.
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://download.brother.com/welcome/dlf103579/hll2390dwpdrv-${version}.i386.deb";
|
2018-01-16 03:38:55 +00:00
|
|
|
sha256 = "0w8rxh1sa5amxr87qmzs4m2p06b1b36wn2q127mg427sbkh1rwni";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ cups ghostscript dpkg a2ps ];
|
|
|
|
|
2019-06-19 15:45:34 +00:00
|
|
|
dontUnpack = true;
|
2018-01-16 03:38:55 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
dpkg-deb -x $src $out
|
|
|
|
|
|
|
|
substituteInPlace $out/opt/brother/Printers/HLL2390DW/lpd/lpdfilter \
|
|
|
|
--replace /opt "$out/opt" \
|
|
|
|
--replace /usr/bin/perl ${perl}/bin/perl \
|
|
|
|
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out\"; #" \
|
|
|
|
--replace "PRINTER =~" "PRINTER = \"HLL2390DW\"; #"
|
|
|
|
|
|
|
|
# FIXME : Allow i686 and armv7l variations to be setup instead.
|
|
|
|
_PLAT=x86_64
|
|
|
|
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
|
|
|
$out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/brprintconflsr3
|
|
|
|
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
|
|
|
$out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/rawtobr3
|
|
|
|
ln -s $out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/brprintconflsr3 $out/opt/brother/Printers/HLL2390DW/lpd/brprintconflsr3
|
|
|
|
ln -s $out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/rawtobr3 $out/opt/brother/Printers/HLL2390DW/lpd/rawtobr3
|
|
|
|
|
|
|
|
for f in \
|
|
|
|
$out/opt/brother/Printers/HLL2390DW/cupswrapper/lpdwrapper \
|
|
|
|
$out/opt/brother/Printers/HLL2390DW/cupswrapper/paperconfigml2 \
|
|
|
|
; do
|
|
|
|
#substituteInPlace $f \
|
|
|
|
wrapProgram $f \
|
|
|
|
--prefix PATH : ${stdenv.lib.makeBinPath [
|
|
|
|
coreutils ghostscript gnugrep gnused
|
|
|
|
]}
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $out/lib/cups/filter/
|
|
|
|
ln -s $out/opt/brother/Printers/HLL2390DW/lpd/lpdfilter $out/lib/cups/filter/brother_lpdwrapper_HLL2390DW
|
|
|
|
|
|
|
|
mkdir -p $out/share/cups/model
|
|
|
|
ln -s $out/opt/brother/Printers/HLL2390DW/cupswrapper/brother-HLL2390DW-cups-en.ppd $out/share/cups/model/
|
|
|
|
|
|
|
|
wrapProgram $out/opt/brother/Printers/HLL2390DW/lpd/lpdfilter \
|
|
|
|
--prefix PATH ":" ${ stdenv.lib.makeBinPath [ ghostscript a2ps file gnused gnugrep coreutils which ] }
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.brother.com/";
|
2018-01-16 03:38:55 +00:00
|
|
|
description = "Brother HL-L2390DW combined print driver";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2020-04-01 01:11:51 +00:00
|
|
|
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us_ot&lang=en&prod=hll2390dw_us&os=128";
|
2018-01-16 03:38:55 +00:00
|
|
|
maintainers = [ maintainers.samueldr ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|