Skip to content

Commit e07cb67

Browse files
authored
epson-inkjet-printer-workforce-840-series: init at 1.0.0 (#428670)
2 parents 15e7a89 + 19502c0 commit e07cb67

File tree

4 files changed

+181
-0
lines changed

4 files changed

+181
-0
lines changed

maintainers/maintainer-list.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10083,6 +10083,12 @@
1008310083
githubId = 665472;
1008410084
matrix = "@hehongbo:matrix.org";
1008510085
};
10086+
heichro = {
10087+
github = "heichro";
10088+
githubId = 76887148;
10089+
keys = [ { fingerprint = "BBA7 9E8E 17FE 9C3F BFEA 61E8 30D0 186F 4E19 7E48"; } ];
10090+
name = "heichro";
10091+
};
1008610092
heijligen = {
1008710093
email = "[email protected]";
1008810094
github = "heijligen";
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/src/raster_to_epson.c b/src/raster_to_epson.c
2+
index 6e621c8..a5ca797 100644
3+
--- a/src/raster_to_epson.c
4+
+++ b/src/raster_to_epson.c
5+
@@ -438,14 +438,14 @@ static int print_page (void)
6+
break;
7+
}
8+
9+
- if (eps_raster_print(raster_h, image_raw, pageRegion.bytesPerLine, pageRegion.width, &nraster)) {
10+
+ if (eps_raster_print(raster_h, image_raw, pageRegion.bytesPerLine, pageRegion.width, (int *) &nraster)) {
11+
error = 1;
12+
break;
13+
}
14+
}
15+
16+
// flushing page
17+
- eps_raster_print(raster_h, NULL, 0, 0, &nraster);
18+
+ eps_raster_print(raster_h, NULL, 0, 0, (int *) &nraster);
19+
20+
bAbort = (error) ? TRUE : FALSE;
21+
if (epcgEndPage (bAbort)) {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/src/pagemanager/pagemanager.c b/src/pagemanager/pagemanager.c
2+
index 029e6d3..2881585 100644
3+
--- a/src/pagemanager/pagemanager.c
4+
+++ b/src/pagemanager/pagemanager.c
5+
@@ -23,6 +23,7 @@
6+
#include "debuglog.h"
7+
#include "memory.h"
8+
#include "raster.h"
9+
+#include "raster-helper.h"
10+
#include "pagemanager.h"
11+
12+
extern int JobCanceled;
13+
diff --git a/src/raster_to_epson.c b/src/raster_to_epson.c
14+
index 6e621c8..6eea77c 100644
15+
--- a/src/raster_to_epson.c
16+
+++ b/src/raster_to_epson.c
17+
@@ -36,6 +36,7 @@
18+
#include "raster.h"
19+
#include "memory.h"
20+
#include "raster_to_epson.h"
21+
+#include "raster-helper.h"
22+
#include "pagemanager.h"
23+
#include "filter_option.h"
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
autoreconfHook,
3+
cups,
4+
libjpeg,
5+
rpmextract,
6+
fetchurl,
7+
lib,
8+
stdenv,
9+
}:
10+
11+
let
12+
srcdirs = {
13+
filter = "epson-inkjet-printer-filter-1.0.0";
14+
driver = "epson-inkjet-printer-workforce-840-series-1.0.0";
15+
};
16+
in
17+
stdenv.mkDerivation (finalAttrs: {
18+
pname = "epson-inkjet-printer-workforce-840-series";
19+
version = "1.0.0";
20+
21+
# The Epson may be unreliable, and it has been since sometime in
22+
# 2024. Non-browser requests using commands like fetchurl receive a
23+
# 403 error, an access denied response -- last checked on
24+
# 2025-08-21.
25+
#
26+
# Therefore, an archive.org link has been added as a fallback
27+
# option just in case.
28+
src = fetchurl {
29+
# NOTE: Don't forget to update the webarchive link too!
30+
urls = [
31+
"https://download.ebz.epson.net/dsc/op/stable/SRPMS/epson-inkjet-printer-workforce-840-series-${finalAttrs.version}-1lsb3.2.src.rpm"
32+
"https://web.archive.org/web/https://download.ebz.epson.net/dsc/op/stable/SRPMS/epson-inkjet-printer-workforce-840-series-${finalAttrs.version}-1lsb3.2.src.rpm"
33+
];
34+
hash = "sha256-rTYnEmgzqR/wOZYYIe2rO9x2cX8s2qDyTuRaTjzJjbg=";
35+
};
36+
sourceRoot = srcdirs.filter;
37+
38+
nativeBuildInputs = [
39+
autoreconfHook
40+
rpmextract
41+
];
42+
buildInputs = [
43+
cups
44+
libjpeg
45+
];
46+
47+
unpackPhase = ''
48+
runHook preUnpack
49+
50+
rpmextract "$src"
51+
for i in ${lib.concatStringsSep " " (builtins.attrValues srcdirs)}; do
52+
tar xvf "$i".tar.gz
53+
done
54+
55+
runHook postUnpack
56+
'';
57+
58+
# Both patches fix errors that occur when building with GCC 14.
59+
#
60+
# eps_raster_print-cast.patch fixes 'error: passing argument 5 of
61+
# ‘eps_raster_print’ from incompatible pointer type' in file
62+
# raster_to_epson.c
63+
#
64+
# include-raster-helper.patch fixes 'error: implicit declaration of
65+
# function' in files pagemanager.c and raster_to_epson.c
66+
patches = [
67+
./eps_raster_print-cast.patch
68+
./include-raster-helper.patch
69+
];
70+
71+
installPhase =
72+
let
73+
filterdir = "$out/lib/cups/filter";
74+
docdir = "$out/share/doc/epson-inkjet-printer-workforce-840-series";
75+
ppddir = "$out/share/cups/model/epson-inkjet-printer-workforce-840-series";
76+
libdir =
77+
if stdenv.hostPlatform.isx86_64 then
78+
"lib64"
79+
else
80+
throw "Platforms other than x86_64-linux are not (yet) supported.";
81+
in
82+
''
83+
runHook preInstall
84+
85+
mkdir -p "$out" "${docdir}" "${filterdir}" "${ppddir}"
86+
cp src/epson_inkjet_printer_filter "${filterdir}"
87+
88+
cp AUTHORS COPYING COPYING.EPSON COPYING.LIB "${docdir}"
89+
90+
cd ../${srcdirs.driver}
91+
cp Manual.txt README "${docdir}"
92+
for ppd in ppds/*; do
93+
substituteInPlace "$ppd" --replace-fail '/opt/epson-inkjet-printer-workforce-840-series/cups/lib' "$out/lib/cups"
94+
gzip -c "$ppd" > "${ppddir}/''${ppd#*/}"
95+
done
96+
cp -r resource watermark ${libdir} "$out"
97+
98+
runHook postInstall
99+
'';
100+
101+
meta = {
102+
description = "Proprietary CUPS drivers for Epson inkjet printers";
103+
longDescription = ''
104+
This software is a filter program used with the Common UNIX Printing
105+
System (CUPS) under Linux. It supplies high quality printing with
106+
Seiko Epson Color Ink Jet Printers.
107+
108+
This printer driver is supporting the following printers.
109+
110+
Epson Stylus Office BX925
111+
Epson WorkForce 840
112+
113+
To use the driver adjust your configuration.nix file:
114+
```nix
115+
{
116+
services.printing = {
117+
enable = true;
118+
drivers = [ pkgs.epson-inkjet-printer-workforce-840-series ];
119+
};
120+
}
121+
```
122+
'';
123+
downloadPage = "http://download.ebz.epson.net/dsc/du/02/DriverDownloadInfo.do?LG2=EN&CN2=&DSCMI=16839&DSCCHK=3d7bc6bdfca08006abfb859fb1967183156a7252";
124+
license = with lib.licenses; [
125+
lgpl21
126+
epson
127+
];
128+
maintainers = with lib.maintainers; [ heichro ];
129+
platforms = [ "x86_64-linux" ];
130+
};
131+
})

0 commit comments

Comments
 (0)