From d4d4fcc35fbc56b3981407296196368273e3d7a9 Mon Sep 17 00:00:00 2001 From: Gavin John <> Date: Wed, 5 Jun 2024 10:14:29 -0500 Subject: [PATCH] cups-idprt-tspl: init at 1.4.7 --- pkgs/by-name/cu/cups-idprt-tspl/package.nix | 61 +++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pkgs/by-name/cu/cups-idprt-tspl/package.nix diff --git a/pkgs/by-name/cu/cups-idprt-tspl/package.nix b/pkgs/by-name/cu/cups-idprt-tspl/package.nix new file mode 100644 index 000000000000..60aa4c8c80d8 --- /dev/null +++ b/pkgs/by-name/cu/cups-idprt-tspl/package.nix @@ -0,0 +1,61 @@ +{ + 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 = builtins.getAttr stdenvNoCC.hostPlatform.system { + x86_64-linux = "x64"; + x86-linux = "x86"; + }; + 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 ]; + }; +}