diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 52c2616fab..6275ea01fc 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -args: { +{ pkgs, ... }@args: { bazel-run = import ./bazel-run.nix args; crane = import ./crane.nix args; javaws-env = import ./javaws-env.nix args; @@ -13,4 +13,5 @@ args: { erbium = import ./erbium args; python-emv = import ./python-emv.nix args; sheepshaver = import ./sheepshaver.nix args; + intermec-cups-driver = pkgs.callPackage ./intermec-cups-driver.nix {}; } // (import ./heptapod-runner.nix args) diff --git a/nix/pkgs/intermec-cups-driver.nix b/nix/pkgs/intermec-cups-driver.nix new file mode 100644 index 0000000000..cbf05992e8 --- /dev/null +++ b/nix/pkgs/intermec-cups-driver.nix @@ -0,0 +1,63 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ stdenv +, fetchFromGitHub +, autoreconfHook +, makeWrapper +, coreutils +, gnugrep +, ghostscript +, poppler_utils +, netpbm +}: + +stdenv.mkDerivation rec { + pname = "intermec-cups-driver"; + version = "v1.2-56"; + + src = fetchFromGitHub { + owner = "lukegb"; + repo = "intermec-cupsdriver"; + rev = version; + sha256 = "sha256:1pk3qj05w2y891n5hayaw9a9g5w83fbm2kz5f7v74dsg8kcx365i"; + + # Downloaded from + # https://support.honeywellaidc.com/s/article/OVERVIEW-The-Honeywell-InterDriver-package-for-CUPS-on-Linux-UNIX + # (their SSL serving is broken and can't be used directly with fetchurl, and the URL itself doesn't look stable) + + # sha256sum ./CUPS-driver_v1.2-56.tgz + # 70c7305ca791e40c0d8cf458d4cd8fed7a2ad0558039b9e118a3a82b12e55f05 ./CUPS-driver_v1.2-56.tgz + }; + + nativeBuildInputs = [ makeWrapper autoreconfHook ]; + + postInstall = '' + for f in $out/share/cups/model/intermec/*.ppd; do + substituteInPlace "$f" \ + --replace /usr/bin/ "$out/bin/" + done + + substituteInPlace $out/bin/intermec-dp-drv \ + --replace pbmtodp "$out/bin/pbmtodp" + + wrapProgram $out/bin/intermec-dp-drv \ + --prefix PATH ":" ${stdenv.lib.makeBinPath [ + # cat cp cut head + coreutils + + # grep + gnugrep + + # ps2pdf + ghostscript + + # pdf2ppm + poppler_utils + + # pgmtopbm pnmtoplainpnm + netpbm + ]} + ''; +}