depot/pkgs/by-name/cu/cups-idprt-tspl/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

64 lines
1.6 KiB
Nix

{
stdenvNoCC,
lib,
fetchurl,
autoPatchelfHook,
cups,
e2fsprogs,
krb5,
libxcrypt-legacy,
unzip,
}:
stdenvNoCC.mkDerivation {
pname = "cups-idprt-tspl";
version = "1.4.7";
src = fetchurl {
name = "idprt_tspl_printer_linux_driver.zip"; # This is not the original name, but there was debate about whether rec or finalAttrs should be used, so I just renamed it
url = "https://www.idprt.com/prt_v2/files/down_file/id/283/fid/668.html"; # NOTE: This is NOT an HTML page, but a ZIP file
hash = "sha256-P3AKSqCh5onOv0itJayEJ6P5pmlkOwOh1OtUjg40BRw=";
};
buildInputs = [
cups
e2fsprogs
krb5
libxcrypt-legacy
];
nativeBuildInputs = [
autoPatchelfHook
unzip
];
installPhase =
let
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-tspl: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
mkdir -p $out/share/cups/model $out/lib/cups/filter
cp -r filter/${arch}/. $out/lib/cups/filter
cp -r ppd/. $out/share/cups/model
rm $out/share/cups/model/*.ppd~
chmod +x $out/lib/cups/filter/*
runHook postInstall
'';
meta = {
description = "CUPS drivers for TSPL-based iDPRT thermal label printers (SP210, SP310, SP320, SP320E, SP410, SP410BT, SP420, SP450, SP460BT)";
platforms = [
"x86_64-linux"
"x86-linux"
];
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ pandapip1 ];
};
}