Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cups-brother-dcpl3550cdw: init at 1.0.2 #368205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22307,6 +22307,11 @@
githubId = 159372832;
keys = [ { fingerprint = "6F54 C08C 37C8 EC78 15FA 0D01 A721 8CBA 2D80 15C3"; } ];
};
Tert0 = {
name = "Tert0";
github = "Tert0";
githubId = 62036464;
};
tesq0 = {
email = "[email protected]";
github = "tesq0";
Expand Down
104 changes: 104 additions & 0 deletions pkgs/by-name/cu/cups-brother-dcpl3550cdw/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
pkgsi686Linux,
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
ghostscript,
file,
gnused,
gnugrep,
coreutils,
which,
perl,
libredirect,
}:
let
version = "1.0.2";
model = "dcpl3550cdw";
interpreter = "${pkgsi686Linux.stdenv.cc.libc}/lib/ld-linux.so.2";
in
stdenv.mkDerivation {
pname = "cups-brother-${model}";
inherit version;
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103919/dcpl3550cdwpdrv-${version}-0.i386.deb";
hash = "sha256-FbtqISK3f1q1+JXJ+RP5O/8G0ZW9gcCS7OI0YRljwyY=";
};

nativeBuildInputs = [
dpkg
makeWrapper
];

unpackPhase = "dpkg-deb -x $src $out";

installPhase = ''
runHook preInstall

substituteInPlace $out/opt/brother/Printers/${model}/lpd/filter_${model} \
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
--replace-fail /usr/bin/perl ${perl}/bin/perl \
--replace-fail "PRINTER =~" "PRINTER = \"${model}\"; #" \
--replace-fail "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/${model}/\"; #"

substituteInPlace $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} \
--replace-fail /usr/bin/perl ${perl}/bin/perl \
--replace-fail "basedir =~ " "basedir = \"$out/opt/brother/Printers/${model}/\"; #" \
--replace-fail "PRINTER =~ " "PRINTER = \"${model}\"; #" \
--replace-fail "LPDCONFIGEXE=" "LPDCONFIGEXE=\"$out/usr/bin/brprintconf_\"; #"

patchelf --set-interpreter ${interpreter} $out/opt/brother/Printers/${model}/lpd/br${model}filter
patchelf --set-interpreter ${interpreter} $out/usr/bin/brprintconf_${model}

mkdir -p $out/lib/cups/filter $out/share/cups/model $out/bin
ln -s $out/opt/brother/Printers/${model}/lpd/filter_${model} $out/lib/cups/filter/brlpdwrapper${model}
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} $out/lib/cups/filter/brother_lpdwrapper_${model}
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model/brother_${model}_printer_en.ppd

runHook postInstall
'';
Tert0 marked this conversation as resolved.
Show resolved Hide resolved

postFixup = ''
wrapProgram $out/opt/brother/Printers/${model}/lpd/filter_${model} \
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
file
gnused
gnugrep
coreutils
which
]
}
wrapProgram $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} \
--prefix PATH ":" ${
lib.makeBinPath [
gnugrep
coreutils
]
}
wrapProgram $out/usr/bin/brprintconf_${model} \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
wrapProgram $out/opt/brother/Printers/${model}/lpd/br${model}filter \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
'';

meta = {
homepage = "https://www.brother.com/";
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=${model}_eu&os=128";
description = "Brother DCP-L3550CDW printer driver";
license = with lib.licenses; [
unfreeRedistributable
gpl2Only
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = with lib.maintainers; [ Tert0 ];
};
}
Loading