@@ -1,61 +0,0 @@
1−{ stdenv, fetchurl, cups, dpkg, ghostscript, patchelf, a2ps, coreutils, gnused, gawk, file }:
2−
3−stdenv.mkDerivation rec {
4− name = "mfcj470dw-cupswrapper-${version}";
5− version = "3.0.0-1";
6−
7− srcs =
8− [ (fetchurl {
9− url = "http://download.brother.com/welcome/dlf006843/mfcj470dwlpr-${version}.i386.deb";
10− sha256 = "7202dd895d38d50bb767080f2995ed350eed99bc2b7871452c3c915c8eefc30a";
11− })
12− (fetchurl {
13− url = "http://download.brother.com/welcome/dlf006845/mfcj470dwcupswrapper-${version}.i386.deb";
14− sha256 = "92af9024e821159eccd78a8925fc77fb92b4f247f2d2c824ca303004077076a7";
15− })
16− ];
17−
18− buildInputs = [ cups ghostscript dpkg a2ps ];
19−
20− unpackPhase = "true";
21−
22− installPhase = ''
23− for s in $srcs; do dpkg-deb -x $s $out; done
24−
25− substituteInPlace $out/opt/brother/Printers/mfcj470dw/cupswrapper/cupswrappermfcj470dw \
26− --replace /opt "$out/opt" \
27− --replace /usr "$out/usr" \
28− --replace /etc "$out/etc"
29−
30− substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
31− --replace /opt "$out/opt" \
32− --replace file "${file}/bin/file" \
33− --replace sed "${gnused}/bin/sed" \
34− --replace mktemp "${coreutils}/bin/mktemp" \
35− --replace cat "${coreutils}/bin/cat" \
36− --replace rm "${coreutils}/bin/rm"
37−
38− sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2
39− substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 \
40− --replace awk "${gawk}/bin/awk" \
41− --replace cat "${coreutils}/bin/cat" \
42− --replace mktemp "${coreutils}/bin/mktemp" \
43− --replace sed "${gnused}/bin/sed" \
44− --replace expr "${coreutils}/bin/expr" \
45− --replace rm "${coreutils}/bin/rm"
46−
47− patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter
48− patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/cupswrapper/brcupsconfpt1
49−
50− mkdir -p $out/lib/cups/filter/
51− ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw
52− '';
53−
54− meta = {
55− homepage = http://www.brother.com/;
56− description = "A driver for brother mfcj470dw printers to print over WiFi and USB";
57− license = stdenv.lib.licenses.unfree;
58− platforms = stdenv.lib.platforms.linux;
59− downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
60− };
61−}