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 v600 = stdenv.mkDerivation rec {
103 pname = "iscan-gt-x820-bundle";
106 nativeBuildInputs = [ autoPatchelfHook rpm ];
109 "https://download2.ebz.epson.net/iscan/plugin/gt-x820/rpm/x64/iscan-gt-x820-bundle-${version}.x64.rpm.tar.gz"
110 "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"
112 sha256 = "1vlba7dsgpk35nn3n7is8nwds3yzlk38q43mppjzwsz2d2n7sr33";
116 ${rpm}/bin/rpm2cpio iscan-plugin-gt-x820-*.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 0x013a "$plugin/lib/esci/libesintA1 $plugin/share/esci/esfwA1.bin"
127 hw = "Perfection V600 Photo";
129 meta = common_meta // { description = "iscan esci x820 plugin for " + passthru.hw; };
131 x770 = stdenv.mkDerivation rec {
132 pname = "iscan-gt-x770-bundle";
135 nativeBuildInputs = [ autoPatchelfHook rpm ];
138 "https://download2.ebz.epson.net/iscan/plugin/gt-x770/rpm/x64/iscan-gt-x770-bundle-${version}.x64.rpm.tar.gz"
139 "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"
141 sha256 = "1chxdm6smv2d14pn2jl9xyd0vr42diy7vpskd3b9a61gf5h3gj03";
145 ${rpm}/bin/rpm2cpio iscan-plugin-gt-x770-*.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 0x0130 "$plugin/lib/esci/libesint7C $plugin/share/esci/esfw7C.bin"
156 hw = "Perfection V500 Photo";
158 meta = common_meta // { description = "iscan esci x770 plugin for " + passthru.hw; };
160 f720 = stdenv.mkDerivation rec {
161 pname = "iscan-gt-f720-bundle";
164 nativeBuildInputs = [ autoPatchelfHook ];
165 buildInputs = [ gcc.cc.lib ];
168 "https://download2.ebz.epson.net/iscan/plugin/gt-f720/rpm/x64/iscan-gt-f720-bundle-${version}.x64.rpm.tar.gz"
169 "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"
171 sha256 = "1xnbmb2rn610kqpg1x6k1cc13zlmx2f3l2xnj6809rnhg96qqn20";
175 ${rpm}/bin/rpm2cpio esci-interpreter-gt-f720-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
178 cp -r usr/lib64 $out/lib
182 registrationCommand = ''
183 $registry --add interpreter usb 0x04b8 0x0131 "$plugin/lib/esci/libesci-interpreter-gt-f720 $plugin/share/esci/esfw8b.bin"
185 hw = "GT-F720, GT-S620, Perfection V30, Perfection V300 Photo";
188 meta = common_meta // { description = "iscan esci f720 plugin for " + passthru.hw; };
190 s80 = stdenv.mkDerivation rec {
191 pname = "iscan-gt-s80-bundle";
194 nativeBuildInputs = [ autoPatchelfHook ];
195 buildInputs = [ gcc.cc.lib libtool ];
198 "https://download2.ebz.epson.net/iscan/plugin/gt-s80/rpm/x64/iscan-gt-s80-bundle-${version}.x64.rpm.tar.gz"
199 "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"
201 sha256 = "00qfdgs03k7bbs67zjrk8hbxvlyinsmk890amp9cmpfjfzdxgg58";
205 ${rpm}/bin/rpm2cpio esci-interpreter-gt-s80-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
206 ${rpm}/bin/rpm2cpio iscan-plugin-esdip-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
209 cp -r usr/lib64 $out/lib
210 mkdir $out/share/esci
214 registrationCommand = ''
215 $registry --add interpreter usb 0x04b8 0x0136 "$plugin/lib/esci/libesci-interpreter-gt-s80.so"
216 $registry --add interpreter usb 0x04b8 0x0137 "$plugin/lib/esci/libesci-interpreter-gt-s50.so"
217 $registry --add interpreter usb 0x04b8 0x0143 "$plugin/lib/esci/libesci-interpreter-gt-s50.so"
218 $registry --add interpreter usb 0x04b8 0x0144 "$plugin/lib/esci/libesci-interpreter-gt-s80.so"
220 hw = "ES-D200, ED-D350, ES-D400, GT-S50, GT-S55, GT-S80, GT-S85";
223 meta = common_meta // { description = "iscan esci s80 plugin for " + passthru.hw; };
225 s650 = stdenv.mkDerivation rec {
226 name = "iscan-gt-s650-bundle";
231 "https://download2.ebz.epson.net/iscan/plugin/gt-s650/rpm/x64/iscan-gt-s650-bundle-${version}.x64.rpm.tar.gz"
232 "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"
234 sha256 = "0fn4lz4g0a8l301v6yv7fwl37wgwhz5y90nf681f655xxc91hqh7";
237 nativeBuildInputs = [ autoPatchelfHook rpm ];
241 ${rpm}/bin/rpm2cpio iscan-plugin-gt-s650-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
244 cp -r usr/lib64 $out/lib
245 mv $out/share/iscan $out/share/esci
246 mv $out/lib/iscan $out/lib/esci
250 registrationCommand = ''
251 $registry --add interpreter usb 0x04b8 0x013c "$plugin/lib/esci/libiscan-plugin-gt-s650 $plugin/share/esci/esfw010c.bin"
252 $registry --add interpreter usb 0x04b8 0x013d "$plugin/lib/esci/libiscan-plugin-gt-s650 $plugin/share/esci/esfw010c.bin"
254 hw = "GT-S650, Perfection V19, Perfection V39";
256 meta = common_meta // { description = "iscan GT-S650 for " + passthru.hw; };
258 network = stdenv.mkDerivation rec {
259 pname = "iscan-nt-bundle";
260 # for the version, look for the driver of XP-750 in the search page
263 buildInputs = [ stdenv.cc.cc.lib ];
264 nativeBuildInputs = [ autoPatchelfHook ];
268 "https://download2.ebz.epson.net/iscan/general/rpm/x64/iscan-bundle-${version}.x64.rpm.tar.gz"
269 "https://web.archive.org/web/https://download2.ebz.epson.net/iscan/general/rpm/x64/iscan-bundle-${version}.x64.rpm.tar.gz"
271 sha256 = "0jssigsgkxb9i7qa7db291a1gbvwl795i4ahvb7bnqp33czkj85k";
275 ${rpm}/bin/rpm2cpio iscan-network-nt-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
279 cp -r usr/lib64 $out/lib
280 mkdir $out/share/esci
283 registrationCommand = "";
287 meta = common_meta // { description = "iscan network plugin"; };
291 let fwdir = symlinkJoin {
292 name = "esci-firmware-dir";
293 paths = lib.mapAttrsToList (name: value: value + /share/esci) plugins;
296 let iscan-data = stdenv.mkDerivation rec {
297 pname = "iscan-data";
298 version = "1.39.2-1";
302 "http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"
303 "https://web.archive.org/web/http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"
305 sha256 = "092qhlnjjgz11ifx6mng7mz20i44gc0nlccrbmw18xr5hipbqqka";
315 stdenv.mkDerivation rec {
317 version = "2.30.4-2";
321 "http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"
322 "https://web.archive.org/web/http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"
324 sha256 = "1ma76jj0k3bz0fy06fiyl4di4y77rcryb0mwjmzs5ms2vq9rjysr";
327 nativeBuildInputs = [ pkg-config libtool makeWrapper ];
336 # Patch for compatibility with libpng versions greater than 10499
339 "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-2.28.1.3+libpng-1.5.patch?h=b6e4c805d53b49da79a0f64ef16bb82d6d800fcf"
340 "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"
342 sha256 = "04y70qjd220dpyh771fiq50lha16pms98mfigwjczdfmx6kpj1jd";
344 # Patch iscan to search appropriate folders for firmware files
345 ./firmware_location.patch
346 # Patch deprecated use of sscanf code to use a more modern C99 compatible version
349 patchFlags = [ "-p0" ];
351 configureFlags = [ "--enable-dependency-reduction" "--disable-frontend" ];
354 echo '#define NIX_ESCI_PREFIX "'${fwdir}'"' >> config.h
358 mkdir -p $out/etc/sane.d
359 cp backend/epkowa.conf $out/etc/sane.d
360 echo "epkowa" > $out/etc/sane.d/dll.conf
361 ln -s ${iscan-data}/share/iscan-data $out/share/iscan-data
362 mkdir -p $out/lib/iscan
363 ln -s ${plugins.network}/lib/iscan/network $out/lib/iscan/network
366 # iscan-registry is a shell script requiring getopt
367 wrapProgram $out/bin/iscan-registry --prefix PATH : ${getopt}/bin
368 registry=$out/bin/iscan-registry;
370 lib.concatStrings (lib.mapAttrsToList
373 ${value.passthru.registrationCommand}
376 meta = common_meta // {
377 description = "sane-epkowa backend for some epson scanners";
379 Includes gui-less iscan (aka. Image Scan! for Linux).
380 Supported hardware: at least :
382 lib.concatStringsSep ", " (lib.mapAttrsToList (name: value: value.passthru.hw) plugins);
383 maintainers = with lib.maintainers; [ symphorien dominikh ];