gnu: nnn: Don't use NAME in source URI.
[jackhill/guix/guix.git] / gnu / packages / ocr.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages ocr)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages image))
28
29 (define-public ocrad
30 (package
31 (name "ocrad")
32 (version "0.27")
33 (source (origin
34 (method url-fetch)
35 (uri (string-append "mirror://gnu/ocrad/ocrad-"
36 version ".tar.lz"))
37 (sha256
38 (base32
39 "0divffvcaim89g4pvqs8kslbcxi475bcl3b4ynphf284k9zfdgx9"))))
40 (build-system gnu-build-system)
41 (native-inputs `(("lzip" ,lzip)))
42 (home-page "https://www.gnu.org/software/ocrad/")
43 (synopsis "Optical character recognition based on feature extraction")
44 (description
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+)))
49
50 (define-public tesseract-ocr
51 (package
52 (name "tesseract-ocr")
53 (version "3.04.01")
54 (source
55 (origin
56 (method url-fetch)
57 (uri (string-append
58 "https://github.com/tesseract-ocr/tesseract/archive/"
59 version ".tar.gz"))
60 (file-name (string-append name "-" version ".tar.gz"))
61 (sha256
62 (base32 "0snwd8as5i8vx7zkimpd2yg898jl96zf90r65a9w615f2hdkxxjp"))))
63 (build-system gnu-build-system)
64 (inputs
65 `(("leptonica" ,leptonica)))
66 (arguments
67 '(#:configure-flags
68 (let ((leptonica (assoc-ref %build-inputs "leptonica")))
69 (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
70 (home-page "https://github.com/tesseract-ocr")
71 (synopsis "Optical character recognition engine")
72 (description
73 "Tesseract is an optical character recognition (OCR) engine with very
74 high accuracy. It supports many languages, output text formatting, hOCR
75 positional information and page layout analysis. Several image formats are
76 supported through the Leptonica library. It can also detect whether text is
77 monospaced or proportional.")
78 (license license:asl2.0)))