Merge pull request #42905 from Enzime/add/mfcl2740dw

Add Brother MFC-L2740DW drivers
This commit is contained in:
Silvan Mosberger 2018-07-04 16:37:49 +02:00 committed by GitHub
commit 71a062755f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,45 @@
{ stdenv, fetchurl, dpkg, makeWrapper, coreutils, gnugrep, gnused, perl, mfcl2740dwlpr }:
stdenv.mkDerivation rec {
name = "mfcl2740dwcupswrapper-${version}";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101726/${name}.i386.deb";
sha256 = "078453e19f20ab6c7fc4d63c3e09f162f3d1410c04c23a294b6ffbd720b35ffb";
};
nativeBuildInputs = [ dpkg makeWrapper ];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
basedir=${mfcl2740dwlpr}/opt/brother/Printers/MFCL2740DW
dir=$out/opt/brother/Printers/MFCL2740DW
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "basedir =~" "basedir = \"$basedir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
substituteInPlace $dir/cupswrapper/paperconfigml1 \
--replace /usr/bin/perl ${perl}/bin/perl
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
--prefix PATH : ${stdenv.lib.makeBinPath [ coreutils gnugrep gnused ]}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW $out/lib/cups/filter
ln $dir/cupswrapper/brother-MFCL2740DW-cups-en.ppd $out/share/cups/model
'';
meta = {
description = "Brother MFC-L2740DW CUPS wrapper driver";
homepage = http://www.brother.com/;
license = stdenv.lib.licenses.gpl2;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = [ stdenv.lib.maintainers.enzime ];
};
}

View File

@ -0,0 +1,43 @@
{ pkgsi686Linux, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript, gnugrep, gnused, which, perl }:
stdenv.mkDerivation rec {
name = "mfcl2740dwlpr-${version}";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101727/${name}.i386.deb";
sha256 = "10a2bc672bd54e718b478f3afc7e47d451557f7d5513167d3ad349a3d00bffaf";
};
nativeBuildInputs = [ dpkg makeWrapper ];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
dir=$out/opt/brother/Printers/MFCL2740DW
substituteInPlace $dir/lpd/filter_MFCL2740DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
wrapProgram $dir/lpd/filter_MFCL2740DW \
--prefix PATH : ${stdenv.lib.makeBinPath [
coreutils ghostscript gnugrep gnused which
]}
# need to use i686 glibc here, these are 32bit proprietary binaries
interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
'';
meta = {
description = "Brother MFC-L2740DW lpr driver";
homepage = http://www.brother.com/;
license = stdenv.lib.licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = [ stdenv.lib.maintainers.enzime ];
};
}

View File

@ -21381,6 +21381,9 @@ with pkgs;
mfcl2720dwcupswrapper = callPackage ../misc/cups/drivers/mfcl2720dwcupswrapper { };
mfcl2720dwlpr = callPackage ../misc/cups/drivers/mfcl2720dwlpr { };
mfcl2740dwcupswrapper = callPackage ../misc/cups/drivers/mfcl2740dwcupswrapper { };
mfcl2740dwlpr = callPackage ../misc/cups/drivers/mfcl2740dwlpr { };
samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung { };
samsung-unified-linux-driver_4_01_17 = callPackage ../misc/cups/drivers/samsung/4.01.17.nix { };
samsung-unified-linux-driver = callPackage ../misc/cups/drivers/samsung/4.00.39 { };