acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / mf / mfcl2740dwlpr / package.nix
blob162b019ac9b13095d927ffa6f2d30d3e5ec50410
1 { pkgsi686Linux, lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript, gnugrep, gnused, which, perl }:
3 stdenv.mkDerivation rec {
4   pname = "mfcl2740dwlpr";
5   version = "3.2.0-1";
7   src = fetchurl {
8     url = "https://download.brother.com/welcome/dlf101727/${pname}-${version}.i386.deb";
9     sha256 = "10a2bc672bd54e718b478f3afc7e47d451557f7d5513167d3ad349a3d00bffaf";
10   };
12   nativeBuildInputs = [ dpkg makeWrapper ];
14   unpackPhase = "dpkg-deb -x $src $out";
16   installPhase = ''
17     dir=$out/opt/brother/Printers/MFCL2740DW
19     substituteInPlace $dir/lpd/filter_MFCL2740DW \
20       --replace /usr/bin/perl ${perl}/bin/perl \
21       --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
22       --replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
24     wrapProgram $dir/lpd/filter_MFCL2740DW \
25       --prefix PATH : ${lib.makeBinPath [
26         coreutils ghostscript gnugrep gnused which
27       ]}
29     # need to use i686 glibc here, these are 32bit proprietary binaries
30     interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2
31     patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
32     patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
33     patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
34   '';
36   meta = {
37     description = "Brother MFC-L2740DW lpr driver";
38     homepage = "http://www.brother.com/";
39     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
40     license = lib.licenses.unfree;
41     platforms = [ "x86_64-linux" "i686-linux" ];
42     maintainers = [ ];
43   };