tuicam: init at 0.0.2 (#377825)
[NixPkgs.git] / pkgs / by-name / cu / cups-kyocera / package.nix
blob3b2d3b6ba504cc83bd3dd90bf926bf2390125089
2   lib,
3   stdenv,
4   cups,
5   fetchzip,
6   patchPpdFilesHook,
7 }:
9 let
10   platform =
11     if stdenv.hostPlatform.system == "x86_64-linux" then
12       "64bit"
13     else if stdenv.hostPlatform.system == "i686-linux" then
14       "32bit"
15     else
16       throw "Unsupported system: ${stdenv.hostPlatform.system}";
18   libPath = lib.makeLibraryPath [ cups ];
21 stdenv.mkDerivation {
22   pname = "cups-kyocera";
23   version = "1.1203";
25   dontPatchELF = true;
26   dontStrip = true;
28   src = fetchzip {
29     url = "https://web.archive.org/web/20220709011705/https://cdn.kyostatics.net/dlc/ru/driver/all/linuxdrv_1_1203_fs-1x2xmfp.-downloadcenteritem-Single-File.downloadcenteritem.tmp/LinuxDrv_1.1203_FS-1x2xMFP.zip";
30     sha256 = "0z1pbgidkibv4j21z0ys8cq1lafc6687syqa07qij2qd8zp15wiz";
31   };
33   nativeBuildInputs = [ patchPpdFilesHook ];
35   installPhase = ''
36     runHook preInstall
38     tar -xvf ${platform}/Global/English.tar.gz
39     install -Dm755 English/rastertokpsl $out/lib/cups/filter/rastertokpsl
40     patchelf \
41       --set-rpath ${libPath} \
42       --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
43       $out/lib/cups/filter/rastertokpsl
45     mkdir -p $out/share/cups/model/Kyocera
46     cd English
47     cp *.ppd $out/share/cups/model/Kyocera
49     runHook postInstall
50   '';
52   ppdFileCommands = [ "rastertokpsl" ];
54   meta = with lib; {
55     description = "CUPS drivers for several Kyocera FS-{1020,1025,1040,1060,1120,1125} printers";
56     homepage = "https://www.kyoceradocumentsolutions.ru/index/service_support/download_center.false.driver.FS1040._.EN.html#";
57     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
58     license = licenses.unfree;
59     maintainers = [ maintainers.vanzef ];
60     platforms = platforms.linux;
61   };