1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages ocr)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages autotools)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages image)
27 #:use-module (gnu packages pkg-config))
35 (uri (string-append "mirror://gnu/ocrad/ocrad-"
39 "1m2dblgvvjs48rsglfdwq0ib9zk8h9n34xsh67ibrg0g0ffbw477"))))
40 (build-system gnu-build-system)
41 (native-inputs `(("lzip" ,lzip)))
42 (home-page "http://www.gnu.org/software/ocrad/")
43 (synopsis "Optical character recognition based on feature extraction")
45 "GNU Ocrad is an optical character recognition program based on a
46 feature extraction method. It can read images in PBM, PGM or PPM formats and
47 it produces text in 8-bit or UTF-8 formats.")
48 (license license:gpl3+)))
50 (define-public tesseract-ocr
52 (name "tesseract-ocr")
58 "https://tesseract-ocr.googlecode.com/files/tesseract-ocr-"
61 (base32 "0g81m9y4iydp7kgr56mlkvjdwpp3mb01q385yhdnyvra7z5kkk96"))
62 (modules '((guix build utils)))
63 ;; Leptonica added a pkg-config file in the meanwhile.
65 '(substitute* "tesseract.pc.in"
66 (("^# Requires: lept ## .*")
67 "Requires: lept\n")))))
68 (build-system gnu-build-system)
70 `(("autoconf" ,autoconf)
71 ("automake" ,automake)
72 ("libtool" ,libtool)))
74 `(("leptonica" ,leptonica)))
77 (modify-phases %standard-phases
81 (zero? (system* "sh" "autogen.sh")))))
83 (let ((leptonica (assoc-ref %build-inputs "leptonica")))
84 (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
85 (home-page "https://code.google.com/p/tesseract-ocr/")
86 (synopsis "Optical character recognition engine")
88 "Tesseract is an optical character recognition (OCR) engine with very
89 high accuracy. It supports many languages, output text formatting, hOCR
90 positional information and page layout analysis. Several image formats are
91 supported through the Leptonica library. It can also detect whether text is
92 monospaced or proportional.")
93 (license license:asl2.0)))