nixpkgs/pkgs/by-name/mf/mfcl8690cdwlpr/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

47 lines
1.4 KiB
Nix

{ coreutils, dpkg, fetchurl, file, ghostscript, gnugrep, gnused,
makeWrapper, perl, pkgs, lib, stdenv, which }:
stdenv.mkDerivation rec {
pname = "mfcl8690cdwlpr";
version = "1.3.0-0";
src = fetchurl {
url = "http://download.brother.com/welcome/dlf103241/${pname}-${version}.i386.deb";
sha256 = "0x8zd4b1psmw1znp2ibncs37xm5mljcy9yza2rx8jm8lp0a3l85v";
};
nativeBuildInputs = [ dpkg makeWrapper ];
dontUnpack = true;
installPhase = ''
dpkg-deb -x $src $out
dir=$out/opt/brother/Printers/mfcl8690cdw
filter=$dir/lpd/filter_mfcl8690cdw
substituteInPlace $filter \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir/\"; #" \
--replace "PRINTER =~" "PRINTER = \"mfcl8690cdw\"; #"
wrapProgram $filter \
--prefix PATH : ${lib.makeBinPath [
coreutils file ghostscript gnugrep gnused which
]}
# need to use i686 glibc here, these are 32bit proprietary binaries
interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2
patchelf --set-interpreter "$interpreter" $dir/lpd/brmfcl8690cdwfilter
'';
meta = {
description = "Brother MFC-L8690CDW LPR printer driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = [ ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}