20 homepage = "http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX";
21 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
22 license = with lib.licenses; epson;
23 platforms = with lib.platforms; linux;
26 ############################
30 ############################
32 # adding a plugin for another printer shouldn't be too difficult, but you need the firmware to test...
34 v330 = stdenv.mkDerivation rec {
35 name = "iscan-v330-bundle";
39 # To find new versions, visit
40 # http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX and search for
41 # some printer like for instance "WF-7210" to get to the most recent
43 # NOTE: Don't forget to update the webarchive link too!
45 "https://download2.ebz.epson.net/iscan/plugin/perfection-v330/rpm/x64/iscan-perfection-v330-bundle-${version}.x64.rpm.tar.gz"
46 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/perfection-v330/rpm/x64/iscan-perfection-v330-bundle-${version}.x64.rpm.tar.gz"
48 sha256 = "056c04pfsf98nnknphg28l489isqb6y4l2c8g7wqhclwgj7m338i";
51 nativeBuildInputs = [ autoPatchelfHook rpm ];
54 ${rpm}/bin/rpm2cpio plugins/esci-interpreter-perfection-v330-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
55 mkdir $out{,/share,/lib}
56 cp -r ./usr/share/{iscan-data,esci}/ $out/share/
57 cp -r ./usr/lib64/esci $out/lib
61 registrationCommand = ''
62 $registry --add interpreter usb 0x04b8 0x0142 "$plugin/lib/esci/libesci-interpreter-perfection-v330 $plugin/share/esci/esfwad.bin"
64 hw = "Perfection V330 Photo";
66 meta = common_meta // { description = "Plugin to support " + passthru.hw + " scanner in sane"; };
68 v370 = stdenv.mkDerivation rec {
69 name = "iscan-v370-bundle";
74 "https://download2.ebz.epson.net/iscan/plugin/perfection-v370/rpm/x64/iscan-perfection-v370-bundle-${version}.x64.rpm.tar.gz"
75 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/perfection-v370/rpm/x64/iscan-perfection-v370-bundle-${version}.x64.rpm.tar.gz"
77 sha256 = "1ff7adp9mha1i2ibllz540xkagpy8r757h4s3h60bgxbyzv2yggr";
80 nativeBuildInputs = [ autoPatchelfHook rpm ];
84 ${rpm}/bin/rpm2cpio iscan-plugin-perfection-v370-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
87 mkdir -p $out/share $out/lib
88 cp -r usr/share/{iscan-data,iscan}/ $out/share
89 cp -r usr/lib64/iscan $out/lib
90 mv $out/share/iscan $out/share/esci
91 mv $out/lib/iscan $out/lib/esci
95 registrationCommand = ''
96 $registry --add interpreter usb 0x04b8 0x014a "$plugin/lib/esci/libiscan-plugin-perfection-v370 $plugin/share/esci/esfwdd.bin"
98 hw = "Perfection V37/V370";
100 meta = common_meta // { description = "Plugin to support " + passthru.hw + " scanner in sane"; };
102 v550 = stdenv.mkDerivation rec {
103 pname = "iscan-perfection-v550-bundle";
106 nativeBuildInputs = [ autoPatchelfHook rpm ];
109 "https://download2.ebz.epson.net/iscan/plugin/perfection-v550/rpm/x64/iscan-perfection-v550-bundle-${version}.x64.rpm.tar.gz"
110 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/perfection-v550/rpm/x64/iscan-perfection-v550-bundle-${version}.x64.rpm.tar.gz"
112 sha256 = "f8b3abf21354fc5b9bc87753cef950b6c0f07bf322a94aaff2c163bafcf50cd9";
116 ${rpm}/bin/rpm2cpio iscan-plugin-perfection-v550-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
119 cp -r usr/lib64 $out/lib
120 mv $out/share/iscan $out/share/esci
121 mv $out/lib/iscan $out/lib/esci
124 registrationCommand = ''
125 $registry --add interpreter usb 0x04b8 0x013b "$plugin/lib/esci/libiscan-plugin-perfection-v550 $plugin/share/esci/esfweb.bin"
127 hw = "Perfection V550 Photo";
129 meta = common_meta // { description = "Plugin to support " + passthru.hw + " scanner in sane"; };
131 v600 = stdenv.mkDerivation rec {
132 pname = "iscan-gt-x820-bundle";
135 nativeBuildInputs = [ autoPatchelfHook rpm ];
138 "https://download2.ebz.epson.net/iscan/plugin/gt-x820/rpm/x64/iscan-gt-x820-bundle-${version}.x64.rpm.tar.gz"
139 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-x820/rpm/x64/iscan-gt-x820-bundle-${version}.x64.rpm.tar.gz"
141 sha256 = "1vlba7dsgpk35nn3n7is8nwds3yzlk38q43mppjzwsz2d2n7sr33";
145 ${rpm}/bin/rpm2cpio iscan-plugin-gt-x820-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
148 cp -r usr/lib64 $out/lib
149 mv $out/share/iscan $out/share/esci
150 mv $out/lib/iscan $out/lib/esci
153 registrationCommand = ''
154 $registry --add interpreter usb 0x04b8 0x013a "$plugin/lib/esci/libesintA1 $plugin/share/esci/esfwA1.bin"
156 hw = "Perfection V600 Photo";
158 meta = common_meta // { description = "iscan esci x820 plugin for " + passthru.hw; };
160 x770 = stdenv.mkDerivation rec {
161 pname = "iscan-gt-x770-bundle";
164 nativeBuildInputs = [ autoPatchelfHook rpm ];
167 "https://download2.ebz.epson.net/iscan/plugin/gt-x770/rpm/x64/iscan-gt-x770-bundle-${version}.x64.rpm.tar.gz"
168 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-x770/rpm/x64/iscan-gt-x770-bundle-${version}.x64.rpm.tar.gz"
170 sha256 = "1chxdm6smv2d14pn2jl9xyd0vr42diy7vpskd3b9a61gf5h3gj03";
174 ${rpm}/bin/rpm2cpio iscan-plugin-gt-x770-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
177 cp -r usr/lib64 $out/lib
178 mv $out/share/iscan $out/share/esci
179 mv $out/lib/iscan $out/lib/esci
182 registrationCommand = ''
183 $registry --add interpreter usb 0x04b8 0x0130 "$plugin/lib/esci/libesint7C $plugin/share/esci/esfw7C.bin"
185 hw = "Perfection V500 Photo";
187 meta = common_meta // { description = "iscan esci x770 plugin for " + passthru.hw; };
189 f720 = stdenv.mkDerivation rec {
190 pname = "iscan-gt-f720-bundle";
193 nativeBuildInputs = [ autoPatchelfHook ];
194 buildInputs = [ gcc.cc.lib ];
197 "https://download2.ebz.epson.net/iscan/plugin/gt-f720/rpm/x64/iscan-gt-f720-bundle-${version}.x64.rpm.tar.gz"
198 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-f720/rpm/x64/iscan-gt-f720-bundle-${version}.x64.rpm.tar.gz"
200 sha256 = "1xnbmb2rn610kqpg1x6k1cc13zlmx2f3l2xnj6809rnhg96qqn20";
204 ${rpm}/bin/rpm2cpio esci-interpreter-gt-f720-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
207 cp -r usr/lib64 $out/lib
211 registrationCommand = ''
212 $registry --add interpreter usb 0x04b8 0x0131 "$plugin/lib/esci/libesci-interpreter-gt-f720 $plugin/share/esci/esfw8b.bin"
214 hw = "GT-F720, GT-S620, Perfection V30, Perfection V300 Photo";
217 meta = common_meta // { description = "iscan esci f720 plugin for " + passthru.hw; };
219 s80 = stdenv.mkDerivation rec {
220 pname = "iscan-gt-s80-bundle";
223 nativeBuildInputs = [ autoPatchelfHook ];
224 buildInputs = [ gcc.cc.lib libtool ];
227 "https://download2.ebz.epson.net/iscan/plugin/gt-s80/rpm/x64/iscan-gt-s80-bundle-${version}.x64.rpm.tar.gz"
228 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-s80/rpm/x64/iscan-gt-s80-bundle-${version}.x64.rpm.tar.gz"
230 sha256 = "00qfdgs03k7bbs67zjrk8hbxvlyinsmk890amp9cmpfjfzdxgg58";
234 ${rpm}/bin/rpm2cpio esci-interpreter-gt-s80-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
235 ${rpm}/bin/rpm2cpio iscan-plugin-esdip-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
238 cp -r usr/lib64 $out/lib
239 mkdir $out/share/esci
243 registrationCommand = ''
244 $registry --add interpreter usb 0x04b8 0x0136 "$plugin/lib/esci/libesci-interpreter-gt-s80.so"
245 $registry --add interpreter usb 0x04b8 0x0137 "$plugin/lib/esci/libesci-interpreter-gt-s50.so"
246 $registry --add interpreter usb 0x04b8 0x0143 "$plugin/lib/esci/libesci-interpreter-gt-s50.so"
247 $registry --add interpreter usb 0x04b8 0x0144 "$plugin/lib/esci/libesci-interpreter-gt-s80.so"
249 hw = "ES-D200, ED-D350, ES-D400, GT-S50, GT-S55, GT-S80, GT-S85";
252 meta = common_meta // { description = "iscan esci s80 plugin for " + passthru.hw; };
254 s600 = stdenv.mkDerivation rec {
255 name = "iscan-gt-s600-bundle";
260 "https://download2.ebz.epson.net/iscan/plugin/gt-s600/rpm/x64/iscan-gt-s600-bundle-${version}.x64.rpm.tar.gz"
261 "https://web.archive.org/web/20240614120113/https://download2.ebz.epson.net/iscan/plugin/gt-s600/rpm/x64/iscan-gt-s600-bundle-${version}.x64.rpm.tar.gz"
263 sha256 = "fe1356b1d5c40bc5ac985a5693166efb9e5049a78b412f49c385eb503eadf2c6";
266 nativeBuildInputs = [ autoPatchelfHook rpm ];
270 ${rpm}/bin/rpm2cpio iscan-plugin-gt-s600-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
273 cp -r usr/lib64 $out/lib
274 mv $out/share/iscan $out/share/esci
275 mv $out/lib/iscan $out/lib/esci
279 registrationCommand = ''
280 $registry --add interpreter usb 0x04b8 0x012d "$plugin/lib/esci/libesint66 $plugin/share/esci/esfw66.bin"
282 hw = "GT-F650, GT-S600, Perfection V10, Perfection V100 Photo";
284 meta = common_meta // { description = "iscan gt-s600 plugin for " + passthru.hw; };
286 s650 = stdenv.mkDerivation rec {
287 name = "iscan-gt-s650-bundle";
292 "https://download2.ebz.epson.net/iscan/plugin/gt-s650/rpm/x64/iscan-gt-s650-bundle-${version}.x64.rpm.tar.gz"
293 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-s650/rpm/x64/iscan-gt-s650-bundle-${version}.x64.rpm.tar.gz"
295 sha256 = "0fn4lz4g0a8l301v6yv7fwl37wgwhz5y90nf681f655xxc91hqh7";
298 nativeBuildInputs = [ autoPatchelfHook rpm ];
302 ${rpm}/bin/rpm2cpio iscan-plugin-gt-s650-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
305 cp -r usr/lib64 $out/lib
306 mv $out/share/iscan $out/share/esci
307 mv $out/lib/iscan $out/lib/esci
311 registrationCommand = ''
312 $registry --add interpreter usb 0x04b8 0x013c "$plugin/lib/esci/libiscan-plugin-gt-s650 $plugin/share/esci/esfw010c.bin"
313 $registry --add interpreter usb 0x04b8 0x013d "$plugin/lib/esci/libiscan-plugin-gt-s650 $plugin/share/esci/esfw010c.bin"
315 hw = "GT-S650, Perfection V19, Perfection V39";
317 meta = common_meta // { description = "iscan GT-S650 for " + passthru.hw; };
319 x750 = stdenv.mkDerivation rec {
320 name = "iscan-gt-x750-bundle";
325 "https://download2.ebz.epson.net/iscan/plugin/gt-x750/rpm/x64/iscan-gt-x750-bundle-${version}.x64.rpm.tar.gz"
326 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-x750/rpm/x64/iscan-gt-x750-bundle-${version}.x64.rpm.tar.gz"
328 sha256 = "sha256-9EeBHmh1nwSxnTnevPP8RZ4WBdyY+itR3VXo2I7f5N0=";
331 nativeBuildInputs = [ autoPatchelfHook rpm ];
335 ${rpm}/bin/rpm2cpio iscan-plugin-gt-x750-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
338 cp -r usr/lib64 $out/lib
339 mv $out/share/iscan $out/share/esci
340 mv $out/lib/iscan $out/lib/esci
344 registrationCommand = ''
345 $registry --add interpreter usb 0x04b8 0x0119 "$plugin/lib/esci/libesint54 $plugin/share/esci/esfw54.bin"
347 hw = "GT-X750, Perfection 4490";
349 meta = common_meta // { description = "iscan GT-X750 for " + passthru.hw; };
351 gt1500 = stdenv.mkDerivation rec {
352 name = "iscan-gt-1500-bundle";
357 "https://download2.ebz.epson.net/iscan/plugin/gt-1500/rpm/x64/iscan-gt-1500-bundle-${version}.x64.rpm.tar.gz"
358 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-1500/rpm/x64/iscan-gt-1500-bundle-${version}.x64.rpm.tar.gz"
360 sha256 = "sha256-1rVsbBsb+QtCOT1FsyhgvCbZIN6IeQH7rZXNmsD7cl8=";
363 nativeBuildInputs = [ autoPatchelfHook rpm ];
367 ${rpm}/bin/rpm2cpio iscan-plugin-gt-1500-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
370 cp -r usr/lib64 $out/lib
371 mv $out/share/iscan $out/share/esci
372 mv $out/lib/iscan $out/lib/esci
376 registrationCommand = ''
377 $registry --add interpreter usb 0x04b8 0x0133 "$plugin/lib/esci/libesint86 $plugin/share/esci/esfw86.bin"
381 meta = common_meta // { description = "iscan GT-1500 for " + passthru.hw; };
383 network = stdenv.mkDerivation rec {
384 pname = "iscan-nt-bundle";
385 # for the version, look for the driver of XP-750 in the search page
388 buildInputs = [ (lib.getLib stdenv.cc.cc) ];
389 nativeBuildInputs = [ autoPatchelfHook ];
393 "https://download2.ebz.epson.net/iscan/general/rpm/x64/iscan-bundle-${version}.x64.rpm.tar.gz"
394 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/general/rpm/x64/iscan-bundle-${version}.x64.rpm.tar.gz"
396 sha256 = "0jssigsgkxb9i7qa7db291a1gbvwl795i4ahvb7bnqp33czkj85k";
400 ${rpm}/bin/rpm2cpio iscan-network-nt-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
404 cp -r usr/lib64 $out/lib
405 mkdir $out/share/esci
408 registrationCommand = "";
412 meta = common_meta // { description = "iscan network plugin"; };
416 let fwdir = symlinkJoin {
417 name = "esci-firmware-dir";
418 paths = lib.mapAttrsToList (name: value: value + /share/esci) plugins;
421 let iscan-data = stdenv.mkDerivation rec {
422 pname = "iscan-data";
423 version = "1.39.2-1";
427 "http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"
428 "https://web.archive.org/web/http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"
430 sha256 = "092qhlnjjgz11ifx6mng7mz20i44gc0nlccrbmw18xr5hipbqqka";
440 stdenv.mkDerivation rec {
442 version = "2.30.4-2";
446 "http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"
447 "https://web.archive.org/web/http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"
449 sha256 = "1ma76jj0k3bz0fy06fiyl4di4y77rcryb0mwjmzs5ms2vq9rjysr";
452 nativeBuildInputs = [ pkg-config libtool makeWrapper ];
461 # Patch for compatibility with libpng versions greater than 10499
464 "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-2.28.1.3+libpng-1.5.patch?h=b6e4c805d53b49da79a0f64ef16bb82d6d800fcf"
465 "https://web.archive.org/web/https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-2.28.1.3+libpng-1.5.patch?h=b6e4c805d53b49da79a0f64ef16bb82d6d800fcf"
467 sha256 = "04y70qjd220dpyh771fiq50lha16pms98mfigwjczdfmx6kpj1jd";
469 # Patch iscan to search appropriate folders for firmware files
470 ./firmware_location.patch
471 # Patch deprecated use of sscanf code to use a more modern C99 compatible version
474 patchFlags = [ "-p0" ];
476 configureFlags = [ "--enable-dependency-reduction" "--disable-frontend" ];
479 echo '#define NIX_ESCI_PREFIX "'${fwdir}'"' >> config.h
483 mkdir -p $out/etc/sane.d
484 cp backend/epkowa.conf $out/etc/sane.d
485 echo "epkowa" > $out/etc/sane.d/dll.conf
486 ln -s ${iscan-data}/share/iscan-data $out/share/iscan-data
487 mkdir -p $out/lib/iscan
488 ln -s ${plugins.network}/lib/iscan/network $out/lib/iscan/network
491 # iscan-registry is a shell script requiring getopt
492 wrapProgram $out/bin/iscan-registry --prefix PATH : ${getopt}/bin
493 registry=$out/bin/iscan-registry;
495 lib.concatStrings (lib.mapAttrsToList
498 ${value.passthru.registrationCommand}
501 meta = common_meta // {
502 description = "sane-epkowa backend for some epson scanners";
504 Includes gui-less iscan (aka. Image Scan! for Linux).
505 Supported hardware: at least :
507 lib.concatStringsSep ", " (lib.mapAttrsToList (name: value: value.passthru.hw) plugins);
508 maintainers = with lib.maintainers; [ symphorien dominikh ];