mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 01:43:15 +00:00
5176f640ee
`getAttr` has a slightly better performance but it's not possible to throw with it so one would have to do `builtins.hasAttr` first which makes that methods performance worse than string interpolation and `or throw`
65 lines
1.5 KiB
Nix
65 lines
1.5 KiB
Nix
{
|
|
stdenvNoCC,
|
|
lib,
|
|
fetchurl,
|
|
autoPatchelfHook,
|
|
cups,
|
|
e2fsprogs,
|
|
krb5,
|
|
libxcrypt-legacy,
|
|
unzip,
|
|
}:
|
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
pname = "cups-idprt-sp900";
|
|
version = "1.4.0";
|
|
|
|
src = fetchurl {
|
|
name = "idprt_sp900_printer_linux_driver.zip";
|
|
url = "https://www.idprt.com/prt_v2/files/down_file/id/176/fid/498.html"; # NOTE: This is NOT an HTML page, but a ZIP file
|
|
hash = "sha256-+YVQTrqpi16xX+d/ulMtffpA9X7hwtWRiS/mIAw13n8=";
|
|
};
|
|
sourceRoot = "idprt_sp900_printer_linux_driver_v${finalAttrs.version}/idprt_sp900_printer_linux_driver_v${finalAttrs.version}"; # >:|
|
|
|
|
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-sp900: 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
|
|
chmod +x $out/lib/cups/filter/*
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "CUPS driver for the iDPRT SP900";
|
|
platforms = [
|
|
"x86_64-linux"
|
|
"x86-linux"
|
|
];
|
|
license = lib.licenses.unfree;
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
maintainers = with lib.maintainers; [ pandapip1 ];
|
|
};
|
|
})
|