fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / mf / mfcl2740dwcupswrapper / package.nix
blobb8b9ff1d099c528b8aeb69c6d2d27a7183ed070f
2   lib,
3   stdenv,
4   fetchurl,
5   dpkg,
6   makeWrapper,
7   coreutils,
8   gnugrep,
9   gnused,
10   perl,
11   mfcl2740dwlpr,
14 stdenv.mkDerivation rec {
15   pname = "mfcl2740dwcupswrapper";
16   version = "3.2.0-1";
18   src = fetchurl {
19     url = "https://download.brother.com/welcome/dlf101726/${pname}-${version}.i386.deb";
20     sha256 = "078453e19f20ab6c7fc4d63c3e09f162f3d1410c04c23a294b6ffbd720b35ffb";
21   };
23   nativeBuildInputs = [
24     dpkg
25     makeWrapper
26   ];
28   unpackPhase = "dpkg-deb -x $src $out";
30   installPhase = ''
31     basedir=${mfcl2740dwlpr}/opt/brother/Printers/MFCL2740DW
32     dir=$out/opt/brother/Printers/MFCL2740DW
34     substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
35       --replace /usr/bin/perl ${perl}/bin/perl \
36       --replace "basedir =~" "basedir = \"$basedir\"; #" \
37       --replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
39     substituteInPlace $dir/cupswrapper/paperconfigml1 \
40       --replace /usr/bin/perl ${perl}/bin/perl
42     wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
43       --prefix PATH : ${
44         lib.makeBinPath [
45           coreutils
46           gnugrep
47           gnused
48         ]
49       }
51     mkdir -p $out/lib/cups/filter
52     mkdir -p $out/share/cups/model
54     ln $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW $out/lib/cups/filter
55     ln $dir/cupswrapper/brother-MFCL2740DW-cups-en.ppd $out/share/cups/model
56   '';
58   meta = {
59     description = "Brother MFC-L2740DW CUPS wrapper driver";
60     homepage = "http://www.brother.com/";
61     license = lib.licenses.gpl2Plus;
62     platforms = [
63       "x86_64-linux"
64       "i686-linux"
65     ];
66     maintainers = [ ];
67   };