nixpkgs/pkgs/by-name/mf/mfc5890cnlpr/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

76 lines
1.6 KiB
Nix

{ stdenv
, a2ps
, lib
, fetchurl
, dpkg
, makeWrapper
, coreutils
, file
, gawk
, ghostscript
, gnused
, pkgsi686Linux
}:
stdenv.mkDerivation rec {
pname = "mfc5890cnlpr";
version = "1.1.2-2";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf006168/${pname}-${version}.i386.deb";
sha256 = "119h3s1p9pv83mrfv6cmxpc0v33xf8c9nw5clj9yafv3aizxy6dp";
};
unpackPhase = ''
dpkg-deb -x $src $out
'';
nativeBuildInputs = [
dpkg
makeWrapper
];
dontBuild = true;
installPhase = ''
dir=$out/usr/local/Brother/Printer/mfc5890cn
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc5890cnfilter
wrapProgram $dir/inf/setupPrintcapij \
--prefix PATH : ${lib.makeBinPath [
coreutils
]}
substituteInPlace $dir/lpd/filtermfc5890cn \
--replace "/usr/" "$out/usr/"
wrapProgram $dir/lpd/filtermfc5890cn \
--prefix PATH : ${lib.makeBinPath [
a2ps
coreutils
file
ghostscript
gnused
]}
substituteInPlace $dir/lpd/psconvertij2 \
--replace '`which gs`' "${ghostscript}/bin/gs"
wrapProgram $dir/lpd/psconvertij2 \
--prefix PATH : ${lib.makeBinPath [
gnused
gawk
]}
'';
meta = with lib; {
description = "Brother MFC-5890CN LPR printer driver";
homepage = "http://www.brother.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ martinramm ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}