1 { lib, stdenv, fetchurl, foomatic-filters, bc, ghostscript, systemd, vim, time }:
3 stdenv.mkDerivation rec {
8 url = "http://www.loegria.net/mirrors/foo2zjs/foo2zjs-${version}.tar.gz";
9 sha256 = "14x3wizvncdy0xgvmcx541qanwb7bg76abygqy17bxycn1zh5r1x";
12 buildInputs = [ foomatic-filters bc ghostscript systemd vim ];
16 # Support HBPL1 printers. Updated patch based on
17 # https://www.dechifro.org/hbpl/
19 # Fix "Unimplemented paper code" error for hbpl1 printers
20 # https://github.com/mikerr/foo2zjs/pull/2
21 ./papercode-format-fix.patch
22 # Fix AirPrint color printing for Dell 1250c
23 # See https://github.com/OpenPrinting/cups/issues/272
24 ./dell1250c-color-fix.patch
29 "APPL=$(out)/share/applications"
30 "PIXMAPS=$(out)/share/pixmaps"
32 "UDEVDIR=$(out)/etc/udev/rules.d"
33 "UDEVD=${systemd}/sbin/udevd"
34 "LIBUDEVDIR=$(out)/lib/udev/rules.d"
35 "USBDIR=$(out)/etc/hotplug/usb"
36 "FOODB=$(out)/share/foomatic/db/source"
37 "MODEL=$(out)/share/cups/model"
40 installFlags = [ "install-hotplug" ];
44 sed -e "/BASENAME=/iPATH=$out/bin:$PATH" -i *-wrapper *-wrapper.in
45 sed -e "s@PREFIX=/usr@PREFIX=$out@" -i *-wrapper{,.in}
46 sed -e "s@/usr/share@$out/share@" -i hplj10xx_gui.tcl
47 sed -e "s@\[.*-x.*/usr/bin/logger.*\]@type logger >/dev/null 2>\&1@" -i *wrapper{,.in}
48 sed -e '/install-usermap/d' -i Makefile
49 sed -e "s@/etc/hotplug/usb@$out&@" -i *rules*
50 sed -e "s@/usr@$out@g" -i hplj1020.desktop
51 sed -e "/PRINTERID=/s@=.*@=$out/bin/usb_printerid@" -i hplj1000
54 nativeCheckInputs = [ time ];
55 doCheck = false; # fails to find its own binary. Also says "Tests will pass only if you are using ghostscript-8.71-16.fc14".
58 mkdir -pv $out/{etc/udev/rules.d,lib/udev/rules.d,etc/hotplug/usb}
59 mkdir -pv $out/share/foomatic/db/source/{opt,printer,driver}
60 mkdir -pv $out/share/cups/model
61 mkdir -pv $out/share/{applications,pixmaps}
64 cp -v getweb arm2hpdl "$out/bin"
68 description = "ZjStream printer drivers";
69 maintainers = with maintainers;
73 platforms = platforms.linux;
74 license = licenses.gpl2Plus;