| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 |
|
| 24 | (define-module (gnu packages scanner)
|
| 25 | #:use-module (gnu packages)
|
| 26 | #:use-module (gnu packages autotools)
|
| 27 | #:use-module (gnu packages base)
|
| 28 | #:use-module (gnu packages bash)
|
| 29 | #:use-module (gnu packages boost)
|
| 30 | #:use-module (gnu packages compression)
|
| 31 | #:use-module (gnu packages dns)
|
| 32 | #:use-module (gnu packages freedesktop)
|
| 33 | #:use-module (gnu packages gettext)
|
| 34 | #:use-module (gnu packages ghostscript)
|
| 35 | #:use-module (gnu packages glib)
|
| 36 | #:use-module (gnu packages gtk)
|
| 37 | #:use-module (gnu packages image)
|
| 38 | #:use-module (gnu packages imagemagick)
|
| 39 | #:use-module (gnu packages libusb)
|
| 40 | #:use-module (gnu packages linux)
|
| 41 | #:use-module (gnu packages ocr)
|
| 42 | #:use-module (gnu packages pkg-config)
|
| 43 | #:use-module (gnu packages python)
|
| 44 | #:use-module (gnu packages textutils)
|
| 45 | #:use-module (gnu packages tls)
|
| 46 | #:use-module (gnu packages xml)
|
| 47 | #:use-module (guix build-system gnu)
|
| 48 | #:use-module (guix deprecation)
|
| 49 | #:use-module (guix download)
|
| 50 | #:use-module (guix gexp)
|
| 51 | #:use-module (guix git-download)
|
| 52 | #:use-module ((guix licenses) #:prefix license:)
|
| 53 | #:use-module (guix packages)
|
| 54 | #:use-module (guix search-paths)
|
| 55 | #:use-module (guix utils))
|
| 56 |
|
| 57 | (define-public sane-airscan
|
| 58 | (package
|
| 59 | (name "sane-airscan")
|
| 60 | (version "0.99.36")
|
| 61 | (source
|
| 62 | (origin
|
| 63 | (method git-fetch)
|
| 64 | (uri (git-reference
|
| 65 | (url "https://github.com/alexpevzner/sane-airscan")
|
| 66 | (commit version)))
|
| 67 | (file-name (git-file-name name version))
|
| 68 | (sha256
|
| 69 | (base32 "1dh7rq1g120gqhkr7ac3p7yizm330dj3xqrrg08dff7ra1jx955y"))))
|
| 70 | (build-system gnu-build-system)
|
| 71 | (arguments
|
| 72 | (list #:make-flags
|
| 73 | #~(list (string-append "prefix=" #$output)
|
| 74 | (string-append "libdir=$(prefix)/lib"))
|
| 75 | #:phases
|
| 76 | #~(modify-phases %standard-phases
|
| 77 | (delete 'configure )))) |
| 78 | (native-inputs
|
| 79 | (list pkg-config))
|
| 80 | (inputs
|
| 81 | (list avahi
|
| 82 | gnutls
|
| 83 | libjpeg-turbo
|
| 84 | libpng
|
| 85 | libtiff
|
| 86 | libxml2
|
| 87 | sane))
|
| 88 | (home-page "https://github.com/alexpevzner/sane-airscan")
|
| 89 | (synopsis "SANE backend for eSCL (AirScan) and WSD document scanners")
|
| 90 | (description |
| 91 | "This SANE backend lets you scan documents and images from scanners and
|
| 92 | multi-function printers that speak eSCL (marketed as ``AirScan'') or
|
| 93 | @acronym{WSD, Web Services for Devices} (or ``WS-Scan'').
|
| 94 |
|
| 95 | Both are vendor-neutral protocols that allow ``driverless'' scanning over IPv4
|
| 96 | and IPv6 networks without the vendor-specific drivers that make up most of the
|
| 97 | sane-backends collection. This is similar to how most contemporary printers
|
| 98 | speak the universal @acronym{IPP, Internet Printing Protocol}.
|
| 99 |
|
| 100 | Only scanners that support eSCL will also work over USB. This requires a
|
| 101 | suitable IPP-over-USB daemon like ipp-usb to be installed and configured.
|
| 102 |
|
| 103 | Any eSCL or WSD-capable scanner should just work. sane-airscan automatically
|
| 104 | discovers and configures devices, including which protocol to use. It was
|
| 105 | successfully tested with many devices from Brother, Canon, Dell, Kyocera,
|
| 106 | Lexmark, Epson, HP, OKI, Panasonic, Pantum, Ricoh, Samsung, and Xerox, with
|
| 107 | both WSD and eSCL.")
|
| 108 | (license (list license:gpl2+ |
| 109 | license:expat)))) |
| 110 |
|
| 111 | (define-deprecated/public-alias sane-backends-minimal sane)
|
| 112 | (define-public sane
|
| 113 | (package
|
| 114 | (name "sane")
|
| 115 | (version "1.4.0")
|
| 116 | (source (origin
|
| 117 | (method git-fetch)
|
| 118 | (uri (git-reference
|
| 119 | (url "https://gitlab.com/sane-project/backends")
|
| 120 | (commit version)))
|
| 121 | (file-name (git-file-name name version))
|
| 122 | (sha256
|
| 123 | (base32 "09hcqrli127amdxjlj6xd9lvc0rhlhhm8vxrnldbd8c2mxss7dbv"))
|
| 124 | (patches (search-patches
|
| 125 | "sane-look-for-plugins-in-SANE_BACKEND_LIB_PATH.patch"))
|
| 126 | (modules '((guix build utils)))
|
| 127 | (snippet
|
| 128 | |
| 129 | |
| 130 | '(begin
|
| 131 | (substitute* "tools/sane-desc.c"
|
| 132 | (("asctime \\(localtime \\(¤t_time\\)\\)")
|
| 133 | "\"1970-01-01\""))))))
|
| 134 | (build-system gnu-build-system)
|
| 135 | (arguments
|
| 136 | (list
|
| 137 | #:phases
|
| 138 | #~(modify-phases %standard-phases
|
| 139 | (add-before 'bootstrap 'zap-unnecessary-git-dependency
|
| 140 | (lambda _
|
| 141 | |
| 142 | (substitute* "tools/git-version-gen"
|
| 143 | (("/bin/sh")
|
| 144 | (which "sh")))
|
| 145 | (with-output-to-file ".tarball-version"
|
| 146 | (lambda _
|
| 147 | (format #t #$version)))))
|
| 148 | (add-before 'configure 'disable-backends
|
| 149 | (lambda _
|
| 150 | (setenv "BACKENDS" " ")
|
| 151 |
|
| 152 | |
| 153 | (substitute* "testsuite/Makefile.in"
|
| 154 | ((" backend ")
|
| 155 | " "))))
|
| 156 | (add-before 'configure 'disable-failing-tests
|
| 157 | (lambda _
|
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | (for-each (lambda (pattern)
|
| 165 | (substitute* "testsuite/tools/Makefile.in"
|
| 166 | (((string-append " " pattern " "))
|
| 167 | " ")))
|
| 168 | (list "usermap"
|
| 169 | "db"
|
| 170 | "udev"
|
| 171 | "udev\\+acl"
|
| 172 | "udev\\+hwdb"
|
| 173 | "hwdb"))
|
| 174 |
|
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | (substitute* "testsuite/sanei/Makefile.in"
|
| 181 | (("sanei_usb_test\\$\\(EXEEXT\\) ")
|
| 182 | ""))))
|
| 183 | (add-before 'build 'build-pixma_sane_options.c
|
| 184 | |
| 185 | |
| 186 | (lambda _
|
| 187 | (invoke "make" "-C" "backend" "pixma/pixma_sane_options.c")))
|
| 188 | (add-after 'install 'install-udev-rules
|
| 189 | (lambda _
|
| 190 | (let ((dest (string-append #$output "/lib/udev/rules.d/"
|
| 191 | "60-libsane.rules")))
|
| 192 | (mkdir-p (dirname dest))
|
| 193 | (copy-file "tools/udev/libsane.rules" dest))))
|
| 194 | (add-after 'install 'remove-dll.conf
|
| 195 | (lambda _
|
| 196 | |
| 197 | |
| 198 | (delete-file (string-append #$output "/etc/sane.d/dll.conf"))))
|
| 199 | (add-after 'install 'make-reproducible
|
| 200 | |
| 201 | |
| 202 | (lambda _
|
| 203 | (with-directory-excursion (string-append #$output "/share/locale")
|
| 204 | (for-each (lambda (file)
|
| 205 | (invoke "sed" "-i" "/^PO-Revision-Date:/d" file))
|
| 206 | (list "en@boldquot/LC_MESSAGES/sane-backends.mo"
|
| 207 | "en@quot/LC_MESSAGES/sane-backends.mo"))))))))
|
| 208 | (native-inputs
|
| 209 | (list autoconf
|
| 210 | autoconf-archive
|
| 211 | automake
|
| 212 | gettext-minimal
|
| 213 | libtool
|
| 214 | pkg-config
|
| 215 | |
| 216 | python-wrapper))
|
| 217 | (inputs (list libusb))
|
| 218 | (native-search-paths
|
| 219 | (list (search-path-specification
|
| 220 | (variable "SANE_CONFIG_DIR")
|
| 221 | (files '("etc/sane.d")))
|
| 222 | (search-path-specification
|
| 223 | (variable "SANE_BACKEND_LIB_PATH")
|
| 224 | (files '("lib/sane")))))
|
| 225 | (home-page "http://www.sane-project.org")
|
| 226 | (synopsis
|
| 227 | "Raster image scanner library and drivers, without scanner support")
|
| 228 | (description
|
| 229 | "SANE stands for \"Scanner Access Now Easy\" and is an API proving access
|
| 230 | to any raster image scanner hardware (flatbed scanner, hand-held scanner,
|
| 231 | video- and still-cameras, frame-grabbers, etc.). The package contains the
|
| 232 | library, but no drivers.")
|
| 233 | (license license:gpl2+))) |
| 234 |
|
| 235 | (define-public sane-backends
|
| 236 | (package/inherit sane
|
| 237 | (name "sane-backends")
|
| 238 | (arguments
|
| 239 | (substitute-keyword-arguments arguments
|
| 240 | ((#:phases phases)
|
| 241 | #~(modify-phases #$phases
|
| 242 | (delete 'disable-backends)
|
| 243 | (delete 'remove-dll.conf)
|
| 244 | (add-after 'disable-failing-tests 'disable-failing-backend-tests
|
| 245 | (lambda _
|
| 246 | |
| 247 | |
| 248 | (substitute* "testsuite/backend/genesys/Makefile.in"
|
| 249 | ((" genesys_unit_tests\\$\\(EXEEXT\\)") ""))))))))
|
| 250 | (inputs (modify-inputs inputs
|
| 251 | (prepend libjpeg-turbo |
| 252 | libpng |
| 253 | libxml2))) |
| 254 | (synopsis "Raster image scanner library and drivers, with scanner support")
|
| 255 | (description "SANE stands for \"Scanner Access Now Easy\" and is an API
|
| 256 | proving access to any raster image scanner hardware (flatbed scanner,
|
| 257 | hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The
|
| 258 | package contains the library and drivers.")))
|
| 259 |
|
| 260 | (define-public utsushi
|
| 261 | (let ((commit "b296671703ea3317ae1621f8ae67f7086208369d")
|
| 262 | (revision "2"))
|
| 263 | (package
|
| 264 | (name "utsushi")
|
| 265 | (version (git-version "0.65.0" revision commit))
|
| 266 | (source
|
| 267 | (origin
|
| 268 | (method git-fetch)
|
| 269 | (uri (git-reference
|
| 270 | (url "https://gitlab.com/utsushi/utsushi")
|
| 271 | (commit commit)))
|
| 272 | (file-name (git-file-name name version))
|
| 273 | (sha256
|
| 274 | (base32 "0sa2im75ymrkhxhhm93g81vv02yjwg3wn9myrjzlrfl2xnwk3bzb"))))
|
| 275 | (build-system gnu-build-system)
|
| 276 | (arguments
|
| 277 | (list
|
| 278 | #:configure-flags
|
| 279 | #~(list (string-append "--with-boost-libdir="
|
| 280 | #$(this-package-input "boost") "/lib")
|
| 281 | "CXXFLAGS=-Wno-error")
|
| 282 | #:phases
|
| 283 | #~(modify-phases %standard-phases
|
| 284 | (add-after 'unpack 'patch-bootstrap-fail-on-error
|
| 285 | (lambda _
|
| 286 | (substitute* "bootstrap"
|
| 287 | |
| 288 | (("^usage") "set -e\n\nusage"))))
|
| 289 | (add-after 'unpack 'fix-escaped-comment-marker
|
| 290 | (lambda _
|
| 291 | (substitute* "drivers/esci/Makefile.am"
|
| 292 | |
| 293 | |
| 294 | (("\\\\#") "\\x23"))))
|
| 295 | (add-after 'unpack 'zap-unnecessary-git-dependency
|
| 296 | (lambda _
|
| 297 | (substitute* "configure.ac"
|
| 298 | (("-m4_esyscmd_s\\(\\[git describe --always\\]\\)")
|
| 299 | ""))))
|
| 300 | (add-after 'unpack 'update-gettext-version
|
| 301 | (lambda _
|
| 302 | (substitute* "configure.ac"
|
| 303 | (("AM_GNU_GETTEXT_VERSION\\(.*\\)")
|
| 304 | (format #f "AM_GNU_GETTEXT_VERSION([~a])"
|
| 305 | #$(package-version (this-package-native-input
|
| 306 | "gettext-minimal")))))))
|
| 307 | (add-after 'unpack 'fix-newer-sane-support
|
| 308 | (lambda _
|
| 309 | (substitute* "sane/version.hpp"
|
| 310 | (("#error \"SANE.*violates.*versioning.*\"" all)
|
| 311 | (string-append "//" all)))))
|
| 312 | (add-after 'unpack 'patch-shell-paths
|
| 313 | (lambda _
|
| 314 | (for-each (lambda (file)
|
| 315 | (substitute* file
|
| 316 | (("/bin/sh") (which "sh"))))
|
| 317 | '("filters/shell-pipe.cpp"
|
| 318 | "lib/run-time.cpp"
|
| 319 | "utsushi/test/command-line.hpp"))))
|
| 320 | (add-after 'install 'install-udev-rules
|
| 321 | (lambda _
|
| 322 | (install-file "drivers/esci/utsushi-esci.rules"
|
| 323 | (string-append #$output "/lib/udev/rules.d")))))))
|
| 324 | (inputs
|
| 325 | (list bash-minimal
|
| 326 | boost
|
| 327 | eudev
|
| 328 | gtkmm-2
|
| 329 | imagemagick
|
| 330 | libjpeg-turbo
|
| 331 | libtiff
|
| 332 | libusb
|
| 333 | sane
|
| 334 | zlib))
|
| 335 | (native-inputs
|
| 336 | (list autoconf
|
| 337 | autoconf-archive
|
| 338 | automake
|
| 339 | gettext-minimal
|
| 340 | libtool
|
| 341 | libxslt
|
| 342 | pkg-config
|
| 343 | util-linux
|
| 344 | |
| 345 | coreutils
|
| 346 | tesseract-ocr-tessdata-fast tesseract-ocr)) |
| 347 | (home-page "https://gitlab.com/utsushi/utsushi")
|
| 348 | (synopsis "Image scanning software for EPSON devices")
|
| 349 | (description
|
| 350 | "Utsushi is a set of applications for image scanning with support for a
|
| 351 | number of EPSON scanners, including a compatibility driver to interface with
|
| 352 | software built around the @acronym{SANE, Scanner Access Now Easy} standard.
|
| 353 |
|
| 354 | To enable auto-rotation functionality, install the @code{tesseract-ocr} and
|
| 355 | @code{tesseract-ocr-tessdata-fast} packages.")
|
| 356 | (license license:gpl3+))))
|
| 357 |
|
| 358 | (define-public scanbd
|
| 359 | (package
|
| 360 | (name "scanbd")
|
| 361 | (version "1.5.1")
|
| 362 | (source
|
| 363 | (origin
|
| 364 | (method url-fetch)
|
| 365 | (uri (string-append "mirror://sourceforge/scanbd/releases/"
|
| 366 | "scanbd-" version ".tgz"))
|
| 367 | (sha256
|
| 368 | (base32 "0pvy4qirfjdfm8aj6x5rkbgl7hk3jfa2s21qkk8ic5dqfjjab75n"))))
|
| 369 | (build-system gnu-build-system)
|
| 370 | (arguments
|
| 371 | (list #:configure-flags
|
| 372 | #~(list "--disable-debug"
|
| 373 | "--sysconfdir=/etc"
|
| 374 | "CFLAGS=-Wno-error") |
| 375 | #:phases
|
| 376 | #~(modify-phases %standard-phases
|
| 377 | (replace 'install
|
| 378 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 379 | (let ((conf (string-append #$output "/etc/scanbd")))
|
| 380 | (apply invoke "make" "install"
|
| 381 | |
| 382 | |
| 383 | |
| 384 | (string-append "scanbdconfdir=" conf)
|
| 385 | (string-append "scannerconfdir=" conf "/scanner.d")
|
| 386 | make-flags))))
|
| 387 | (add-after 'install 'install-extra-documentation
|
| 388 | |
| 389 | |
| 390 | (lambda _
|
| 391 | (let ((doc (string-append #$output "/share/doc/"
|
| 392 | #$name "-" #$version)))
|
| 393 | (install-file "doc/README.txt" doc)))))))
|
| 394 | (native-inputs
|
| 395 | (list pkg-config))
|
| 396 | (inputs
|
| 397 | (list dbus libconfuse sane eudev zlib))
|
| 398 | (home-page "https://scanbd.sourceforge.io")
|
| 399 | (synopsis "Configurable scanner button monitor")
|
| 400 | (description "Scanbd stands for scanner button daemon. It regularly polls
|
| 401 | scanners for pressed buttons, function knob changes, or other events such
|
| 402 | as (un)plugging the scanner or inserting and removing paper. Then it performs
|
| 403 | the desired action(s) such as saving, copying, or e-mailing the image.
|
| 404 |
|
| 405 | Actions can be fully customized through scripts, based on any combination of
|
| 406 | switch or knob settings. Events are also signaled over D-Bus and scans can
|
| 407 | even be triggered over D-Bus from foreign applications.
|
| 408 |
|
| 409 | Scanbd talks to scanners through the @acronym{SANE, Scanner Access Now Easy}
|
| 410 | back-end library. This means that it supports almost all existing scanners,
|
| 411 | provided the driver also exposes the buttons.")
|
| 412 | (license license:gpl2+)))
|
| 413 |
|
| 414 | (define-public xsane
|
| 415 | (let ((commit "87edc38e6886ad8f31c2b7b289ddf162c88099c8")
|
| 416 | (revision "0"))
|
| 417 | (package
|
| 418 | (name "xsane")
|
| 419 | (version (git-version "0.0.0" revision commit))
|
| 420 | (source
|
| 421 | (origin
|
| 422 | (method git-fetch)
|
| 423 | (uri (git-reference
|
| 424 | (url "https://gitlab.com/sane-project/frontend/xsane.git")
|
| 425 | (commit commit)))
|
| 426 | (file-name (git-file-name name version))
|
| 427 | (sha256
|
| 428 | (base32 "0hgkpb5dfiwrhprsslahrkjfrkg8fgc8f8ssmqng1aywq3sqpd5l"))
|
| 429 | (modules '((guix build utils)))
|
| 430 | (snippet
|
| 431 | #~(begin
|
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | (delete-file "lib/snprintf.c")
|
| 437 | (substitute* "lib/Makefile.am"
|
| 438 | (("snprintf\\.c ") ""))
|
| 439 | (substitute* "po/POTFILES.in"
|
| 440 | (("lib/snprintf\\.c") ""))))))
|
| 441 | (build-system gnu-build-system)
|
| 442 | (arguments
|
| 443 | (list
|
| 444 | #:tests? #f |
| 445 | #:phases
|
| 446 | #~(modify-phases %standard-phases
|
| 447 | (add-after 'unpack 'use-sane-help-browser
|
| 448 | (lambda* (#:key inputs #:allow-other-keys)
|
| 449 | (substitute* "src/xsane.h"
|
| 450 | (("netscape")
|
| 451 | (search-input-file inputs "bin/xdg-open"))))))))
|
| 452 | (native-inputs
|
| 453 | (list autoconf-2.71
|
| 454 | automake
|
| 455 | gettext-minimal
|
| 456 | pkg-config))
|
| 457 | (inputs
|
| 458 | (list gtk+
|
| 459 | lcms
|
| 460 | libjpeg-turbo
|
| 461 | libtiff
|
| 462 | sane
|
| 463 | xdg-utils)) |
| 464 | (home-page "https://gitlab.com/sane-project/frontend/xsane")
|
| 465 | (synopsis "Featureful graphical interface for document and image scanners")
|
| 466 | (description
|
| 467 | "XSane is a graphical interface for controlling a scanner and acquiring
|
| 468 | images from it. You can photocopy multi-page documents and save, fax, print,
|
| 469 | or e-mail your scanned images. It is highly configurable and exposes all
|
| 470 | device settings, letting you fine-tune the final result. It can also be used
|
| 471 | as a GIMP plugin to acquire images directly from a scanner.
|
| 472 |
|
| 473 | XSane talks to scanners through the @acronym{SANE, Scanner Access Now Easy}
|
| 474 | back-end library, which supports almost all existing scanners.")
|
| 475 | (license license:gpl2+))))
|