Merge branch 'brother-mfcl3770cdw' into 'master'
Brother mfcl3770cdw See merge request steveeJ/infra!9
This commit is contained in:
commit
485dc95411
2 changed files with 91 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
keys = import ../../../variables/keys.nix;
|
keys = import ../../../variables/keys.nix;
|
||||||
|
mfcl3770cdw = pkgs.callPackage ../../../pkgs/mfcl3770cdw.nix {};
|
||||||
in {
|
in {
|
||||||
|
|
||||||
# TASK: new device
|
# TASK: new device
|
||||||
|
@ -29,6 +30,8 @@ in {
|
||||||
cups-kyodialog3
|
cups-kyodialog3
|
||||||
mfcj6510dwlpr
|
mfcj6510dwlpr
|
||||||
mfcj6510dw-cupswrapper
|
mfcj6510dw-cupswrapper
|
||||||
|
mfcl3770cdw.driver
|
||||||
|
mfcl3770cdw.cupswrapper
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
88
nix/pkgs/mfcl3770cdw.nix
Normal file
88
nix/pkgs/mfcl3770cdw.nix
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
{ pkgsi686Linux
|
||||||
|
, stdenv
|
||||||
|
, fetchurl
|
||||||
|
, dpkg
|
||||||
|
, makeWrapper
|
||||||
|
, coreutils
|
||||||
|
, ghostscript
|
||||||
|
, gnugrep
|
||||||
|
, gnused
|
||||||
|
, which
|
||||||
|
, perl
|
||||||
|
, lib
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
model = "mfcl3770cdw";
|
||||||
|
version = "1.0.2-0";
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://download.brother.com/welcome/dlf103935/${model}pdrv-${version}.i386.deb";
|
||||||
|
sha256 = "09fhbzhpjymhkwxqyxzv24b06ybmajr6872yp7pri39595mhrvay";
|
||||||
|
};
|
||||||
|
reldir = "opt/brother/Printers/${model}/";
|
||||||
|
|
||||||
|
in rec {
|
||||||
|
driver = stdenv.mkDerivation rec {
|
||||||
|
inherit src version;
|
||||||
|
name = "${model}drv-${version}";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||||
|
|
||||||
|
unpackPhase = "dpkg-deb -x $src $out";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
dir="$out/${reldir}"
|
||||||
|
substituteInPlace $dir/lpd/filter_${model} \
|
||||||
|
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||||
|
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
|
||||||
|
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
|
||||||
|
wrapProgram $dir/lpd/filter_${model} \
|
||||||
|
--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/lpd/brmfcl3770cdwfilter
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Brother ${lib.strings.toUpper model} driver";
|
||||||
|
homepage = http://www.brother.com/;
|
||||||
|
license = stdenv.lib.licenses.unfree;
|
||||||
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||||
|
maintainers = [ stdenv.lib.maintainers.steveej ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cupswrapper = stdenv.mkDerivation rec {
|
||||||
|
inherit version src;
|
||||||
|
name = "${model}cupswrapper-${version}";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||||
|
|
||||||
|
unpackPhase = "dpkg-deb -x $src $out";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
basedir=${driver}/${reldir}
|
||||||
|
dir=$out/${reldir}
|
||||||
|
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_${model} \
|
||||||
|
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||||
|
--replace "basedir =~" "basedir = \"$basedir\"; #" \
|
||||||
|
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
|
||||||
|
wrapProgram $dir/cupswrapper/brother_lpdwrapper_${model} \
|
||||||
|
--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_${model} $out/lib/cups/filter
|
||||||
|
ln $dir/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Brother ${lib.strings.toUpper model} CUPS wrapper driver";
|
||||||
|
homepage = http://www.brother.com/;
|
||||||
|
license = stdenv.lib.licenses.gpl2;
|
||||||
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||||
|
maintainers = [ stdenv.lib.maintainers.steveej ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue