Commit | Line | Data |
---|---|---|
f99f6fd6 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
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. | |
10 | ;;; | |
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. | |
15 | ;;; | |
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/>. | |
18 | ||
9e617a54 | 19 | (define-module (gnu packages ocr) |
d814be32 | 20 | #:use-module ((guix licenses) #:prefix license:) |
f99f6fd6 LC |
21 | #:use-module (guix packages) |
22 | #:use-module (guix download) | |
23 | #:use-module (guix build-system gnu) | |
d814be32 TUBK |
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)) | |
f99f6fd6 LC |
28 | |
29 | (define-public ocrad | |
30 | (package | |
31 | (name "ocrad") | |
8185519d | 32 | (version "0.25") |
f99f6fd6 LC |
33 | (source (origin |
34 | (method url-fetch) | |
35 | (uri (string-append "mirror://gnu/ocrad/ocrad-" | |
36 | version ".tar.lz")) | |
37 | (sha256 | |
38 | (base32 | |
8185519d | 39 | "1m2dblgvvjs48rsglfdwq0ib9zk8h9n34xsh67ibrg0g0ffbw477")))) |
f99f6fd6 LC |
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") | |
44 | (description | |
79c311b8 LC |
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.") | |
d814be32 TUBK |
48 | (license license:gpl3+))) |
49 | ||
50 | (define-public tesseract-ocr | |
51 | (package | |
52 | (name "tesseract-ocr") | |
53 | (version "3.02.02") | |
54 | (source | |
55 | (origin | |
56 | (method url-fetch) | |
57 | (uri (string-append | |
58 | "https://tesseract-ocr.googlecode.com/files/tesseract-ocr-" | |
59 | version ".tar.gz")) | |
60 | (sha256 | |
61 | (base32 "0g81m9y4iydp7kgr56mlkvjdwpp3mb01q385yhdnyvra7z5kkk96")) | |
62 | (modules '((guix build utils))) | |
63 | ;; Leptonica added a pkg-config file in the meanwhile. | |
64 | (snippet | |
65 | '(substitute* "tesseract.pc.in" | |
66 | (("^# Requires: lept ## .*") | |
67 | "Requires: lept\n"))))) | |
68 | (build-system gnu-build-system) | |
69 | (native-inputs | |
70 | `(("autoconf" ,autoconf) | |
71 | ("automake" ,automake) | |
72 | ("libtool" ,libtool))) | |
73 | (propagated-inputs | |
74 | `(("leptonica" ,leptonica))) | |
75 | (arguments | |
76 | '(#:phases | |
77 | (modify-phases %standard-phases | |
78 | (add-after | |
f8503e2b | 79 | 'unpack 'autogen |
d814be32 TUBK |
80 | (lambda _ |
81 | (zero? (system* "sh" "autogen.sh"))))) | |
82 | #:configure-flags | |
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") | |
87 | (description | |
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))) |