From 6e9bc081b1fd2bc03d05bb878226b0957551125c Mon Sep 17 00:00:00 2001 From: xeji Date: Sun, 18 Feb 2018 19:47:05 +0100 Subject: [PATCH] mfcl2720dwcupswrapper: init at 3.2.0-1 Brother MFC-L2720DW CUPS wrapper driver --- .../drivers/mfcl2720dwcupswrapper/default.nix | 47 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix diff --git a/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix new file mode 100644 index 000000000000..d45b53b5b80b --- /dev/null +++ b/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix @@ -0,0 +1,47 @@ +{ stdenv, fetchurl, dpkg, makeWrapper, coreutils, gnugrep, gnused, perl, mfcl2720dwlpr }: + +stdenv.mkDerivation rec { + name = "mfcl2720dwcupswrapper-${version}"; + version = "3.2.0-1"; + + src = fetchurl { + url = "http://download.brother.com/welcome/dlf101802/${name}.i386.deb"; + sha256 = "6d131926ce22c51b1854d2b91e426cc7ecbf5d6dabd698ef51a417090e35c598"; + }; + + nativeBuildInputs = [ dpkg makeWrapper ]; + + phases = [ "installPhase" ]; + + installPhase = '' + dpkg-deb -x $src $out + + basedir=${mfcl2720dwlpr}/opt/brother/Printers/MFCL2720DW + dir=$out/opt/brother/Printers/MFCL2720DW + + substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \ + --replace /usr/bin/perl ${perl}/bin/perl \ + --replace "basedir =~" "basedir = \"$basedir\"; #" \ + --replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #" + + substituteInPlace $dir/cupswrapper/paperconfigml1 \ + --replace /usr/bin/perl ${perl}/bin/perl + + wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \ + --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_MFCL2720DW $out/lib/cups/filter + ln $dir/cupswrapper/brother-MFCL2720DW-cups-en.ppd $out/share/cups/model + ''; + + meta = { + description = "Brother MFC-L2720DW CUPS wrapper driver"; + homepage = http://www.brother.com/; + license = stdenv.lib.licenses.gpl2; + platforms = [ "x86_64-linux" "i686-linux" ]; + maintainers = [ stdenv.lib.maintainers.xeji ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f648abb9e719..ecc41b3eeded 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20205,6 +20205,7 @@ with pkgs; mfcl2700dncupswrapper = callPackage ../misc/cups/drivers/mfcl2700dncupswrapper { }; mfcl2700dnlpr = callPackage_i686 ../misc/cups/drivers/mfcl2700dnlpr { }; + mfcl2720dwcupswrapper = callPackage ../misc/cups/drivers/mfcl2720dwcupswrapper { }; mfcl2720dwlpr = callPackage ../misc/cups/drivers/mfcl2720dwlpr { }; samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung { };