2021-05-11 13:07:47 +00:00
|
|
|
{ lib, stdenv, fetchurl, foomatic-filters, bc, ghostscript, systemd, vim, time }:
|
2011-01-28 08:44:31 +00:00
|
|
|
|
2016-08-02 22:41:47 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-03-22 21:11:26 +00:00
|
|
|
pname = "foo2zjs";
|
|
|
|
version = "20210116";
|
2011-01-28 08:44:31 +00:00
|
|
|
|
2016-08-02 22:41:47 +00:00
|
|
|
src = fetchurl {
|
2021-03-22 21:11:26 +00:00
|
|
|
url = "http://www.loegria.net/mirrors/foo2zjs/foo2zjs-${version}.tar.gz";
|
|
|
|
sha256 = "14x3wizvncdy0xgvmcx541qanwb7bg76abygqy17bxycn1zh5r1x";
|
2016-08-02 22:41:47 +00:00
|
|
|
};
|
2011-01-28 08:44:31 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
buildInputs = [ foomatic-filters bc ghostscript systemd vim ];
|
2011-03-06 16:07:53 +00:00
|
|
|
|
2021-09-27 14:59:32 +00:00
|
|
|
patches = [
|
|
|
|
./no-hardcode-fw.diff
|
|
|
|
# Support HBPL1 printers https://www.dechifro.org/hbpl/
|
|
|
|
./hbpl1.patch
|
|
|
|
# Fix "Unimplemented paper code" error for hbpl1 printers
|
|
|
|
# https://github.com/mikerr/foo2zjs/pull/2
|
|
|
|
./papercode-format-fix.patch
|
|
|
|
];
|
2011-03-06 16:07:53 +00:00
|
|
|
|
2011-01-28 08:44:31 +00:00
|
|
|
makeFlags = [
|
2016-08-02 22:41:47 +00:00
|
|
|
"PREFIX=$(out)"
|
|
|
|
"APPL=$(out)/share/applications"
|
|
|
|
"PIXMAPS=$(out)/share/pixmaps"
|
|
|
|
"UDEVBIN=$(out)/bin"
|
|
|
|
"UDEVDIR=$(out)/etc/udev/rules.d"
|
2017-10-27 20:20:20 +00:00
|
|
|
"UDEVD=${systemd}/sbin/udevd"
|
2016-08-02 22:41:47 +00:00
|
|
|
"LIBUDEVDIR=$(out)/lib/udev/rules.d"
|
|
|
|
"USBDIR=$(out)/etc/hotplug/usb"
|
|
|
|
"FOODB=$(out)/share/foomatic/db/source"
|
|
|
|
"MODEL=$(out)/share/cups/model"
|
2011-01-28 08:44:31 +00:00
|
|
|
];
|
2011-03-06 16:07:53 +00:00
|
|
|
|
2011-03-06 16:07:43 +00:00
|
|
|
installFlags = [ "install-hotplug" ];
|
2011-03-06 16:07:53 +00:00
|
|
|
|
2016-08-02 22:41:47 +00:00
|
|
|
postPatch = ''
|
2011-01-28 08:44:31 +00:00
|
|
|
touch all-test
|
2011-01-28 10:22:30 +00:00
|
|
|
sed -e "/BASENAME=/iPATH=$out/bin:$PATH" -i *-wrapper *-wrapper.in
|
2011-03-15 23:08:59 +00:00
|
|
|
sed -e "s@PREFIX=/usr@PREFIX=$out@" -i *-wrapper{,.in}
|
|
|
|
sed -e "s@/usr/share@$out/share@" -i hplj10xx_gui.tcl
|
|
|
|
sed -e "s@\[.*-x.*/usr/bin/logger.*\]@type logger >/dev/null 2>\&1@" -i *wrapper{,.in}
|
2011-03-06 16:07:43 +00:00
|
|
|
sed -e '/install-usermap/d' -i Makefile
|
|
|
|
sed -e "s@/etc/hotplug/usb@$out&@" -i *rules*
|
2011-03-15 23:08:59 +00:00
|
|
|
sed -e "s@/usr@$out@g" -i hplj1020.desktop
|
2011-03-06 16:07:53 +00:00
|
|
|
sed -e "/PRINTERID=/s@=.*@=$out/bin/usb_printerid@" -i hplj1000
|
2016-08-02 22:41:47 +00:00
|
|
|
'';
|
2011-01-28 08:44:31 +00:00
|
|
|
|
2018-08-08 21:17:54 +00:00
|
|
|
checkInputs = [ time ];
|
|
|
|
doCheck = false; # fails to find its own binary. Also says "Tests will pass only if you are using ghostscript-8.71-16.fc14".
|
|
|
|
|
2016-08-02 22:41:47 +00:00
|
|
|
preInstall = ''
|
2011-03-06 16:07:43 +00:00
|
|
|
mkdir -pv $out/{etc/udev/rules.d,lib/udev/rules.d,etc/hotplug/usb}
|
|
|
|
mkdir -pv $out/share/foomatic/db/source/{opt,printer,driver}
|
|
|
|
mkdir -pv $out/share/cups/model
|
2011-03-15 23:08:59 +00:00
|
|
|
mkdir -pv $out/share/{applications,pixmaps}
|
2011-03-06 16:07:43 +00:00
|
|
|
|
2011-03-15 23:08:59 +00:00
|
|
|
mkdir -pv "$out/bin"
|
|
|
|
cp -v getweb arm2hpdl "$out/bin"
|
2016-08-02 22:41:47 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2011-01-28 08:44:31 +00:00
|
|
|
description = "ZjStream printer drivers";
|
2016-08-02 22:41:47 +00:00
|
|
|
maintainers = with maintainers;
|
2011-01-28 08:44:31 +00:00
|
|
|
[
|
2017-03-27 17:11:17 +00:00
|
|
|
raskin
|
2011-01-28 08:44:31 +00:00
|
|
|
];
|
2016-08-02 22:41:47 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2Plus;
|
2011-01-28 08:44:31 +00:00
|
|
|
};
|
2016-08-02 22:41:47 +00:00
|
|
|
}
|