btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / cu / cups-idprt-mt890 / package.nix
blob96ca74b35ee601772fcbc1181d9c1d231c3b2d3b
2   stdenvNoCC,
3   lib,
4   fetchurl,
5   autoPatchelfHook,
6   cups,
7   unzip,
8 }:
10 stdenvNoCC.mkDerivation {
11   pname = "cups-idprt-mt890";
12   version = "1.2.0";
14   src = fetchurl {
15     name = "idprt_mt890_printer_linux_driver.zip";
16     url = "https://www.idprt.com/prt_v2/files/down_file/id/320/fid/778.html"; # NOTE: This is NOT an HTML page, but a ZIP file
17     hash = "sha256-8yH+DSPRp4mjKOXw90TiGA4OzxJKHpBUMSLh3L2njw8=";
18   };
20   buildInputs = [ cups ];
21   nativeBuildInputs = [
22     autoPatchelfHook
23     unzip
24   ];
26   installPhase =
27     let
28       arch =
29         {
30           x86_64-linux = "x64";
31           x86-linux = "x86";
32         }
33         ."${stdenvNoCC.hostPlatform.system}"
34           or (throw "cups-idprt-mt890: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
35     in
36     ''
37       runHook preInstall
38       mkdir -p $out/share/cups/model $out/lib/cups/filter
39       cp -r filter/${arch}/. $out/lib/cups/filter
40       cp -r ppd/. $out/share/cups/model
41       rm $out/share/cups/model/*.ppd~
42       chmod +x $out/lib/cups/filter/*
43       runHook postInstall
44     '';
46   meta = {
47     description = "CUPS driver for the iDPRT MT890";
48     platforms = [
49       "x86_64-linux"
50       "x86-linux"
51     ];
52     license = lib.licenses.unfree;
53     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
54     maintainers = with lib.maintainers; [ pandapip1 ];
55   };