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-dcp1610wlpr: init at 3.0.1-1 #378091

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
122 changes: 122 additions & 0 deletions pkgs/by-name/cu/cups-brother-dcp1610wlpr/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
lib,
stdenvNoCC,
pkgsi686Linux,
fetchurl,
cups,
dpkg,
gnused,
makeWrapper,
ghostscript,
file,
a2ps,
coreutils,
gawk,
}:

let
version = "3.0.1-1";
cupsdeb = fetchurl {
url = "https://download.brother.com/welcome/dlf101532/dcp1610wcupswrapper-${version}.i386.deb";
hash = "sha256-ZgE2o/xU11+MzSnBYakXZE5m+Qa85/KIo31wKWAmsGY=";
};
lprdeb = fetchurl {
url = "https://download.brother.com/welcome/dlf101533/dcp1610wlpr-${version}.i386.deb";
hash = "sha256-hi0b23DgSXVT/fNA+Y2aJOdopt7SwjUyYyev81boGlg=";
};
in
stdenvNoCC.mkDerivation {
pname = "cups-brother-dcp1610wlpr";
inherit version;

srcs = [
cupsdeb
lprdeb
];

nativeBuildInputs = [
makeWrapper
];

buildInputs = [
cups
ghostscript
dpkg
a2ps
];

unpackPhase = ''
runHook preUnpack
dpkg-deb -x ${lprdeb} $out
dpkg-deb -x ${cupsdeb} $out
runHook postUnpack
'';

installPhase = ''
runHook preInstall
mkdir -p $out/lib/cups/filter $out/share/cups/model
ln -s $out/opt/brother/Printers/DCP1610W/cupswrapper/brother_lpdwrapper_DCP1610W $out/lib/cups/filter/brother_lpdwrapper_DCP1610W
ln -s $out/opt/brother/Printers/DCP1610W/cupswrapper/brother-DCP1610W-cups-en.ppd $out/share/cups/model/
ln -s $out/opt/brother/Printers/DCP1610W/cupswrapper/brcupsconfig4 $out/lib/cups/filter/brcupsconfig4
runHook postInstall
'';

postFixup = ''
substituteInPlace $out/opt/brother/Printers/DCP1610W/lpd/filter_DCP1610W \
--replace-fail /opt "$out/opt"
sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/DCP1610W/lpd/psconvert2
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/DCP1610W/lpd/brprintconflsr3
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/DCP1610W/lpd/rawtobr3
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/DCP1610W/inf/braddprinter
wrapProgram $out/opt/brother/Printers/DCP1610W/lpd/psconvert2 \
--prefix PATH ":" ${
lib.makeBinPath [
gnused
coreutils
gawk
]
}
wrapProgram $out/opt/brother/Printers/DCP1610W/lpd/filter_DCP1610W \
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
a2ps
file
gnused
coreutils
]
}
substituteInPlace $out/opt/brother/Printers/DCP1610W/cupswrapper/brother_lpdwrapper_DCP1610W \
--replace-fail /opt "$out/opt"
wrapProgram $out/opt/brother/Printers/DCP1610W/cupswrapper/brother_lpdwrapper_DCP1610W \
--prefix PATH ":" ${
lib.makeBinPath [
gnused
coreutils
gawk
]
}
'';

meta = {
homepage = "http://www.brother.com/";
description = "Brother DCP-1610W printer driver";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfreeRedistributable;
platforms = [
"x86_64-linux"
"i686-linux"
];
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=nz&lang=en&prod=dcp1610w_eu_as&os=128";
};
}