18 withNetworkScan ? false,
23 fakegit = writeScriptBin "git" ''
25 if [ "$1" = "describe" ]; then
26 [ -r .rev ] && cat .rev || true
31 stdenv.mkDerivation rec {
35 src = fetchFromGitLab {
39 hash = "sha256-CrN9F/WJKmlDN7eozEHtKgGUQBWVwTqwjnrfiATk7lI=";
44 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-3.63.0-autoconf-2.70.patch?id=4fe8a9e6c60f9163cadad830ba4935c069c67b10";
45 sha256 = "sha256-2V4cextjcEQrywe4tvvD5KaVYdXnwdNhTiY/aSNx3mM=";
48 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-3.61.0-imagemagick-7.patch?id=985c92af4730d864e86fa87746185b0246e9db93";
49 sha256 = "sha256-dfdVMp3ZfclYeRxYjMIvl+ZdlLn9S+IwQ+OmlHW8318=";
52 url = "https://raw.githubusercontent.com/archlinux/svntogit-community/b3046e0e78b95440f135fcadb19a9eb531729a58/trunk/boost-1.74.patch";
53 sha256 = "sha256-W8R1l7ZPcsfiIy1QBJvh0M8du0w1cnTg3PyAz65v4rE=";
56 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-3.65.0-sane-backends-1.1.patch?id=dec60bb6900d6ebdaaa6aa1dcb845b30b739f9b5";
57 sha256 = "sha256-AmMZ+/lrUMR7IU+S8MEn0Ji5pqOiD6izFJBsJ0tCCCw=";
78 env.NIX_CFLAGS_COMPILE = toString [
79 "-Wno-error=deprecated-declarations"
80 "-Wno-error=parentheses"
81 "-Wno-error=unused-variable"
85 # create fake udev and sane config
86 mkdir -p $out/etc/{sane.d,udev/rules.d}
87 touch $out/etc/sane.d/dll.conf
89 # absolute paths to convert & tesseract
90 sed -i '/\[AC_DEFINE(\[HAVE_IMAGE_MAGICK\], \[1\])/a \ MAGICK_CONVERT="${imagemagick}/bin/convert"' configure.ac
91 substituteInPlace filters/magick.cpp \
92 --replace 'convert ' '${imagemagick}/bin/convert '
93 substituteInPlace filters/reorient.cpp \
94 --replace '"tesseract' '"${tesseract4}/bin/tesseract'
95 substituteInPlace filters/get-text-orientation \
96 --replace '=tesseract' '=${tesseract4}/bin/tesseract'
100 "--with-boost-libdir=${boost}/lib"
101 "--with-sane-confdir=${placeholder "out"}/etc/sane.d"
102 "--with-udev-confdir=${placeholder "out"}/etc/udev"
111 installFlags = [ "SANE_BACKENDDIR=${placeholder "out"}/lib/sane" ];
113 enableParallelBuilding = true;
115 doInstallCheck = false;
117 postInstall = lib.optionalString withNetworkScan ''
118 ln -s ${utsushi-networkscan}/libexec/utsushi/networkscan $out/libexec/utsushi
122 description = "SANE utsushi backend for some Epson scanners";
123 mainProgram = "utsushi";
125 ImageScanV3 (aka utsushi) scanner driver. Non-free plugins are not
126 included, so no network support. To use the SANE backend, in
127 <literal>/etc/nixos/configuration.nix</literal>:
132 extraBackends = [ pkgs.utsushi ];
134 services.udev.packages = [ pkgs.utsushi ];
138 DS-1610, DS-1630, DS-1660W, DS-310, DS-320, DS-360W, DS-40, DS-410,
139 DS-50000, DS-510, DS-520, DS-530, DS-535, DS-535H, DS-5500, DS-560,
140 DS-570W, DS-575W, DS-60000, DS-6500, DS-70, DS-70000, DS-7500, DS-760,
141 DS-770, DS-775, DS-780N, DS-80W, DS-860, EC-4020 Series, EC-4030 Series,
142 EC-4040 Series, EP-10VA Series, EP-30VA Series, EP-708A Series, EP-709A
143 Series, EP-710A Series, EP-711A Series, EP-712A Series, EP-808A Series,
144 EP-810A Series, EP-811A Series, EP-812A Series, EP-879A Series, EP-880A
145 Series, EP-881A Series, EP-882A Series, EP-978A3 Series, EP-979A3 Series,
146 EP-982A3 Series, EP-M570T Series, ES-200, ES-300W, ES-300WR, ES-400,
147 ES-50, ES-50, ES-500W, ES-500WR, ES-55R, ES-60W, ES-60WB, ES-60WW,
148 ES-65WR, ET-16500 Series, ET-2500 Series, ET-2550 Series, ET-2600 Series,
149 ET-2610 Series, ET-2650 Series, ET-2700 Series, ET-2710 Series, ET-2720
150 Series, ET-2750 Series, ET-2760 Series, ET-3600 Series, ET-3700 Series,
151 ET-3710 Series, ET-3750 Series, ET-3760 Series, ET-4500 Series, ET-4550
152 Series, ET-4700 Series, ET-4750 Series, ET-4760 Series, ET-7700 Series,
153 ET-7750 Series, ET-8700 Series, ET-M2140 Series, ET-M2170 Series,
154 ET-M3140 Series, ET-M3170 Series, ET-M3180 Series, EW-052A Series,
155 EW-452A Series, EW-M5071FT Series, EW-M571T Series, EW-M630T Series,
156 EW-M660FT Series, EW-M670FT Series, EW-M770T Series, EW-M970A3T Series,
157 FF-640, FF-680W, GT-S650, L1455 Series, L220 Series, L222 Series, L3050
158 Series, L3060 Series, L3070 Series, L3100 Series, L3110 Series, L3150
159 Series, L3160 Series, L360 Series, L362 Series, L364 Series, L365 Series,
160 L366 Series, L375 Series, L380 Series, L382 Series, L385 Series, L386
161 Series, L395 Series, L396 Series, L405 Series, L4150 Series, L4160
162 Series, L455 Series, L475 Series, L485 Series, L486 Series, L495 Series,
163 L5190 Series, L565 Series, L566 Series, L575 Series, L605 Series, L6160
164 Series, L6170 Series, L6190 Series, L655 Series, L7160 Series, L7180
165 Series, LX-10000F, LX-10000FK, LX-10010MF, LX-7000F, M2140 Series, M2170
166 Series, M3140 Series, M3170 Series, M3180 Series, PX-048A Series, PX-049A
167 Series, PX-M160T Series, PX-M270FT Series, PX-M270T Series, PX-M380F,
168 PX-M381FL, PX-M5080F Series, PX-M5081F Series, PX-M680F Series, PX-M7050
169 Series, PX-M7050FP, PX-M7050FX, PX-M7070FX, PX-M7110F, PX-M7110FP,
170 PX-M780F Series, PX-M781F Series, PX-M840FX, PX-M860F, PX-M880FX,
171 PX-M884F, PX-M885F, PX-M886FL, Perfection V19, Perfection V39, ST-2000
172 Series, ST-3000 Series, ST-4000 Series, ST-M3000 Series, WF-2750 Series,
173 WF-2760 Series, WF-2810 Series, WF-2830 Series, WF-2850 Series, WF-2860
174 Series, WF-3720 Series, WF-3730 Series, WF-4720 Series, WF-4730 Series,
175 WF-4740 Series, WF-6530 Series, WF-6590 Series, WF-7710 Series, WF-7720
176 Series, WF-8510 Series, WF-8590 Series, WF-C17590 Series, WF-C20590
177 Series, WF-C5710 Series, WF-C5790 Series, WF-C5790BA, WF-C579R Series,
178 WF-C579RB, WF-C8610 Series, WF-C8690 Series, WF-C8690B, WF-C869R Series,
179 WF-M20590 Series, WF-M5799 Series, WF-R8590 Series, XP-2100 Series,
180 XP-220 Series, XP-230 Series, XP-235 Series, XP-240 Series, XP-243 245
181 247 Series, XP-255 257 Series, XP-3100 Series, XP-332 335 Series, XP-340
182 Series, XP-342 343 345 Series, XP-352 355 Series, XP-4100 Series, XP-430
183 Series, XP-432 435 Series, XP-440 Series, XP-442 445 Series, XP-452 455
184 Series, XP-5100 Series, XP-530 Series, XP-540 Series, XP-6000 Series,
185 XP-6100 Series, XP-630 Series, XP-640 Series, XP-7100 Series, XP-830
186 Series, XP-8500 Series, XP-8600 Series, XP-900 Series, XP-960 Series,
189 homepage = "https://gitlab.com/utsushi/imagescan";
190 license = licenses.gpl3Plus;
191 maintainers = with maintainers; [
195 platforms = platforms.linux;