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