Merge pull request #246429 from marcovergueira/dcp375cw-lpr-cupswrapper

This commit is contained in:
Artturi 2023-11-18 17:52:35 +02:00 committed by GitHub
commit 2d24100bcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 107 additions and 0 deletions

View file

@ -10968,6 +10968,12 @@
githubId = 1651325;
name = "maralorn";
};
marcovergueira = {
email = "vergueira.marco@gmail.com";
github = "marcovergueira";
githubId = 929114;
name = "Marco Vergueira";
};
marcus7070 = {
email = "marcus@geosol.com.au";
github = "marcus7070";

View file

@ -0,0 +1,97 @@
{ lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file
, a2ps, coreutils, gnugrep, which, gawk }:
let
version = "1.1.3";
model = "dcp375cw";
in rec {
driver = stdenv.mkDerivation {
pname = "${model}-lpr";
inherit version;
src = fetchurl {
url =
"https://download.brother.com/welcome/dlf005427/dcp375cwlpr-${version}-1.i386.deb";
sha256 =
"6daf0144b5802ea8da394ca14db0e6f0200d4049545649283791f899b7f7bd26";
};
nativeBuildInputs = [ dpkg makeWrapper ];
buildInputs = [ cups ghostscript a2ps gawk ];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
substituteInPlace $out/opt/brother/Printers/${model}/lpd/filter${model} \
--replace /opt "$out/opt"
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
$out/opt/brother/Printers/${model}/lpd/br${model}filter
mkdir -p $out/lib/cups/filter/
ln -s $out/opt/brother/Printers/${model}/lpd/filter${model} $out/lib/cups/filter/brlpdwrapper${model}
wrapProgram $out/opt/brother/Printers/${model}/lpd/filter${model} \
--prefix PATH ":" ${
lib.makeBinPath [
gawk
ghostscript
a2ps
file
gnused
gnugrep
coreutils
which
]
}
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother ${model} printer driver";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = platforms.linux;
downloadPage =
"https://support.brother.com/g/b/downloadlist.aspx?c=gb&lang=en&prod=${model}_all&os=128";
maintainers = with maintainers; [ marcovergueira ];
};
};
cupswrapper = stdenv.mkDerivation {
pname = "${model}-cupswrapper";
inherit version;
src = fetchurl {
url =
"https://download.brother.com/welcome/dlf005429/dcp375cwcupswrapper-${version}-1.i386.deb";
sha256 =
"9a255728b595d2667b2caf9d0d332b677e1a6829a3ec1ed6d4e900a44069cf2d";
};
nativeBuildInputs = [ dpkg makeWrapper ];
buildInputs = [ cups ghostscript a2ps gawk ];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
for f in $out/opt/brother/Printers/${model}/cupswrapper/cupswrapper${model}; do
wrapProgram $f --prefix PATH : ${
lib.makeBinPath [ coreutils ghostscript gnugrep gnused ]
}
done
mkdir -p $out/share/cups/model
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model/
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother ${model} printer CUPS wrapper driver";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = platforms.linux;
downloadPage =
"https://support.brother.com/g/b/downloadlist.aspx?c=gb&lang=en&prod=${model}_all&os=128";
maintainers = with maintainers; [ marcovergueira ];
};
};
}

View file

@ -40211,6 +40211,10 @@ with pkgs;
cups-bjnp = callPackage ../misc/cups/drivers/cups-bjnp { };
dcp375cwlpr = (pkgsi686Linux.callPackage ../misc/cups/drivers/brother/dcp375cw { }).driver;
dcp375cw-cupswrapper = (callPackage ../misc/cups/drivers/brother/dcp375cw { }).cupswrapper;
dcp9020cdwlpr = (pkgsi686Linux.callPackage ../misc/cups/drivers/brother/dcp9020cdw { }).driver;
dcp9020cdw-cupswrapper = (callPackage ../misc/cups/drivers/brother/dcp9020cdw { }).cupswrapper;