nixpkgs/pkgs/by-name/mf/mfcl2740dwlpr/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

70 lines
1.6 KiB
Nix

{
pkgsi686Linux,
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
ghostscript,
gnugrep,
gnused,
which,
perl,
}:
stdenv.mkDerivation rec {
pname = "mfcl2740dwlpr";
version = "3.2.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf101727/${pname}-${version}.i386.deb";
sha256 = "10a2bc672bd54e718b478f3afc7e47d451557f7d5513167d3ad349a3d00bffaf";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
dir=$out/opt/brother/Printers/MFCL2740DW
substituteInPlace $dir/lpd/filter_MFCL2740DW \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
wrapProgram $dir/lpd/filter_MFCL2740DW \
--prefix PATH : ${
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/inf/braddprinter
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
'';
meta = {
description = "Brother MFC-L2740DW lpr driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ ];
};
}