2022-11-04 12:27:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, cups
|
|
|
|
, fetchzip
|
|
|
|
, patchPpdFilesHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
platform =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "64bit"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "32bit"
|
|
|
|
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
|
|
|
|
|
|
|
libPath = lib.makeLibraryPath [ cups ];
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "cups-kyocera";
|
|
|
|
version = "1.1203";
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
src = fetchzip {
|
2022-11-21 17:40:18 +00:00
|
|
|
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";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0z1pbgidkibv4j21z0ys8cq1lafc6687syqa07qij2qd8zp15wiz";
|
|
|
|
};
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
nativeBuildInputs = [ patchPpdFilesHook ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2022-11-04 12:27:35 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
tar -xvf ${platform}/Global/English.tar.gz
|
|
|
|
install -Dm755 English/rastertokpsl $out/lib/cups/filter/rastertokpsl
|
|
|
|
patchelf \
|
|
|
|
--set-rpath ${libPath} \
|
|
|
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
|
|
|
$out/lib/cups/filter/rastertokpsl
|
|
|
|
|
|
|
|
mkdir -p $out/share/cups/model/Kyocera
|
|
|
|
cd English
|
2022-11-04 12:27:35 +00:00
|
|
|
cp *.ppd $out/share/cups/model/Kyocera
|
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
ppdFileCommands = [ "rastertokpsl" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "CUPS drivers for several Kyocera FS-{1020,1025,1040,1060,1120,1125} printers";
|
|
|
|
homepage = "https://www.kyoceradocumentsolutions.ru/index/service_support/download_center.false.driver.FS1040._.EN.html#";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.vanzef ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|