33 pname = "cups-brother-mfcl2800dw";
41 buildInputs = [ perl ];
46 url = "https://download.brother.com/welcome/dlf106048/mfcl2800dwpdrv-${version}.i386.deb";
47 hash = "sha256-sY92w0EFI69LxoNrhluIhqFOWZQOI+SJKKyuExvasgA=";
57 # delete unnecessary files for the current architecture
59 + lib.concatMapStrings (arch: ''
60 echo Deleting files for ${arch}
61 rm -r "$out/opt/brother/Printers/MFCL2800DW/lpd/${arch}"
62 '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches)
65 # bundled scripts don't understand the arch subdirectories for some reason
67 "$out/opt/brother/Printers/MFCL2800DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
68 "$out/opt/brother/Printers/MFCL2800DW/lpd/"
70 # Fix global references and replace auto discovery mechanism with hardcoded values
71 substituteInPlace $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \
72 --replace-fail /opt "$out/opt" \
73 --replace-fail "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2800DW\"; #" \
74 --replace-fail "PRINTER =~" "PRINTER = \"MFCL2800DW\"; #"
76 # Make sure all executables have the necessary runtime dependencies available
77 find "$out" -executable -and -type f | while read file; do
78 wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
81 # Symlink filter and ppd into a location where CUPS will discover it
82 mkdir -p $out/lib/cups/filter $out/share/cups/model
85 $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \
86 $out/lib/cups/filter/brother_lpdwrapper_MFCL2800DW
89 $out/opt/brother/Printers/MFCL2800DW/cupswrapper/brother-MFCL2800DW-cups-en.ppd \
90 $out/share/cups/model/
96 homepage = "http://www.brother.com/";
97 description = "Brother MFC-L2750DW printer driver";
98 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
99 license = lib.licenses.unfree;
100 platforms = builtins.map (arch: "${arch}-linux") arches;
101 maintainers = [ lib.maintainers.luftmensch-luftmensch ];