···
18
+
stdenv.mkDerivation rec {
19
+
pname = "cups-brother-dcpt725dw";
20
+
version = "3.5.0-1";
22
+
url = "https://download.brother.com/welcome/dlf105181/dcpt725dwpdrv-${version}.i386.deb";
23
+
hash = "sha256-fK6RHaW/ej1nFgSaTbzWxVgjIW32YTbJbd1xD37ZE7c=";
26
+
nativeBuildInputs = [
30
+
buildInputs = [ perl ];
38
+
dpkg-deb -x $src $out
40
+
LPDDIR=$out/opt/brother/Printers/dcpt725dw/lpd
41
+
WRAPPER=$out/opt/brother/Printers/dcpt725dw/cupswrapper/brother_lpdwrapper_dcpt725dw
43
+
ln -s $LPDDIR/${stdenv.hostPlatform.linuxArch}/* $LPDDIR/
45
+
substituteInPlace $WRAPPER \
46
+
--replace-fail "PRINTER =~" "PRINTER = \"dcpt725dw\"; #" \
47
+
--replace-fail "basedir =~" "basedir = \"$out/opt/brother/Printers/dcpt725dw/\"; #" \
48
+
--replace-fail "lpdconf = " "lpdconf = \$lpddir.'/'.\$LPDCONFIGEXE.\$PRINTER; #" \
49
+
--replace-fail "\$DEBUG=0;" "\$DEBUG=${debugLvl};"
51
+
substituteInPlace $LPDDIR/filter_dcpt725dw \
52
+
--replace-fail "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/dcpt725dw/\"; #" \
53
+
--replace-fail "PRINTER =~" "PRINTER = \"dcpt725dw\"; #"
55
+
wrapProgram $WRAPPER \
64
+
wrapProgram $LPDDIR/filter_dcpt725dw \
76
+
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
77
+
$LPDDIR/brdcpt725dwfilter
79
+
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
80
+
$LPDDIR/brprintconf_dcpt725dw
82
+
wrapProgram $LPDDIR/brprintconf_dcpt725dw \
83
+
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
84
+
--set NIX_REDIRECTS /opt=$out/opt
86
+
wrapProgram $LPDDIR/brdcpt725dwfilter \
87
+
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
88
+
--set NIX_REDIRECTS /opt=$out/opt
90
+
mkdir -p "$out/lib/cups/filter" "$out/share/cups/model"
92
+
ln -s $out/opt/brother/Printers/dcpt725dw/cupswrapper/brother_lpdwrapper_dcpt725dw \
93
+
$out/lib/cups/filter/brother_lpdwrapper_dcpt725dw
95
+
ln -s "$out/opt/brother/Printers/dcpt725dw/cupswrapper/brother_dcpt725dw_printer_en.ppd" \
96
+
"$out/share/cups/model/"
102
+
description = "Brother DCP-T725DW printer driver";
103
+
license = licenses.unfree;
104
+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
105
+
maintainers = with maintainers; [ u2x1 ];
110
+
downloadPage = "https://support.brother.com/g/b/downloadtop.aspx?c=cn_ot&lang=en&prod=dcpt725dw_cn";
111
+
homepage = "http://www.brother.com/";