1 { lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper, bash }:
3 stdenv.mkDerivation rec {
4 pname = "mfcj470dw-cupswrapper";
8 url = "https://download.brother.com/welcome/dlf006866/mfcj470dw_cupswrapper_GPL_source_${version}.tar.gz";
9 sha256 = "b88f9b592723a00c024129560367f40a560ca3cba06fd99512ab368dd6855853";
12 nativeBuildInputs = [ makeWrapper ];
17 makeFlags = [ "-C" "brcupsconfpt1" "all" ];
20 WRAPPER=cupswrapper/cupswrappermfcj470dw
22 substituteInPlace $WRAPPER \
23 --replace-fail /opt "${mfcj470dwlpr}/opt" \
24 --replace-fail /usr "${mfcj470dwlpr}/usr" \
25 --replace-fail /etc "$out/etc"
27 substituteInPlace $WRAPPER \
28 --replace-fail "cp " "cp -p "
34 TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
35 PPDFOLDER=$out/share/cups/model/
36 FILTERFOLDER=$out/lib/cups/filter/
38 mkdir -p $TARGETFOLDER
40 mkdir -p $FILTERFOLDER
42 cp brcupsconfpt1/brcupsconfpt1 $TARGETFOLDER
43 cp cupswrapper/cupswrappermfcj470dw $TARGETFOLDER
44 cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER
46 ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/
52 homepage = "http://www.brother.com/";
53 description = "Brother MFC-J470DW CUPS wrapper driver";
54 license = lib.licenses.gpl2Plus;
55 platforms = lib.platforms.linux;
56 downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128";
57 maintainers = [ lib.maintainers.yochai ];