summary refs log tree commit diff
path: root/pkgs/misc/drivers/utsushi/default.nix
blob: 328e8ce456250891f3a3b72470082635e415ac1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{ stdenv, fetchurl, autoreconfHook, boost, gtkmm2
, pkg-config, libtool, udev, libjpeg, file, texlive
, libusb, libtiff, imagemagick, sane-backends, tesseract }:

/*
Alternatively, this package could use the "community source" at 
https://gitlab.com/utsushi/utsushi/
Epson provides proprietary plugins for networking, ocr and some more
scanner models. Those are not (yet ?) packaged here.
*/

stdenv.mkDerivation rec {
  pname = "utsushi";
  version = "3.57.0";

  src = fetchurl {
    url = "http://support.epson.net/linux/src/scanner/imagescanv3/common/imagescan_${version}.orig.tar.gz";
    sha256 = "0qy6n6nbisbvy0q3idj7hpmj9i85cd0a18klfd8nsqsa2nkg57ny";
  };

  nativeBuildInputs = [
    pkg-config
    autoreconfHook
    libtool
  ];

  buildInputs = [
    boost
    libusb
    libtiff
    libjpeg
    udev
    imagemagick
    sane-backends
    gtkmm2
    file
    tesseract
  ];

  patches = [
    ./patches/absolute-path-to-convert.patch
    ./patches/print-errors.patch
    ./patches/absolute_path_for_tesseract.patch
  ];

  postPatch = ''
    # remove vendored dependencies
    rm -r upstream/boost
    # create fake udev and sane config
    mkdir -p $out/etc/{sane.d,udev/rules.d}
    touch $out/etc/sane.d/dll.conf
  '';

  configureFlags = [
    "--with-boost-libdir=${boost}/lib"
    "--with-sane-confdir=${placeholder "out"}/etc/sane.d"
    "--with-udev-confdir=${placeholder "out"}/etc/udev"
    "--with-sane"
    "--with-gtkmm"
    "--with-jpeg"
    "--with-magick"
    "--with-sane"
    "--with-tiff"
  ];

  installFlags = [ "SANE_BACKENDDIR=${placeholder "out"}/lib/sane" ];

  enableParallelBuilding = true;

  meta = {
    description = "SANE utsushi backend for some Epson scanners";
    longDescription = ''
        ImageScanV3 (aka utsushi) scanner driver.
        Non-free plugins are not included so no network support.
        To use the SANE backend, in /etc/nixos/configuration.nix:

        hardware.sane = {
          enable = true;
          extraBackends = [ pkgs.utsushi ];
        };
        services.udev.packages = [ pkgs.utsushi ];

        Supported hardware: 
        - DS-40
        - DS-70
        - DS-80W
        - DS-410
        - DS-510
        - DS-520
        - DS-530
        - DS-535
        - DS-535H
        - DS-560
        - DS-575W
        - DS-760
        - DS-775
        - DS-780N
        - DS-860
        - DS-1630
        - DS-5500
        - DS-6500
        - DS-7500
        - DS-50000
        - DS-60000
        - DS-70000
        - EP-10VA Series
        - EP-808A Series
        - EP-978A3 Series
        - ES-50
        - ES-55R
        - ES-60W
        - ES-65WR
        - ES-300WR
        - ES-400
        - ES-500WR
        - ES-8500
        - ET-2500 Series
        - ET-2550 Series
        - ET-4500 Series
        - ET-4550 Series
        - Expression 1640XL
        - FF-680W
        - L220/L360 Series
        - L365/L366 Series
        - L380 Series
        - L455 Series
        - L565/L566 Series
        - L655 Series
        - PX-M840FX
        - PX-M860F
        - PX-M884F
        - PX-M7050 Series
        - PX-M7050FX Series
        - WF-4720
        - WF-6530 Series
        - WF-6590 Series
        - WF-8510/8590 Series
        - WF-R8590 Series
        - XP-220 Series
        - XP-230 Series
        - XP-235 Series
        - XP-332 335 Series
        - XP-430 Series
        - XP-432 435 Series
        - XP-530 Series
        - XP-540
        - XP-630 Series
        - XP-640
        - XP-830 Series
        - XP-960 Series
      '';
      license = stdenv.lib.licenses.gpl3Plus;
  };
}