1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages ocr)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system python)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages image))
39 (uri (string-append "mirror://gnu/ocrad/ocrad-"
43 "0divffvcaim89g4pvqs8kslbcxi475bcl3b4ynphf284k9zfdgx9"))))
44 (build-system gnu-build-system)
45 (native-inputs `(("lzip" ,lzip)))
46 (home-page "https://www.gnu.org/software/ocrad/")
47 (synopsis "Optical character recognition based on feature extraction")
49 "GNU Ocrad is an optical character recognition program based on a
50 feature extraction method. It can read images in PBM, PGM or PPM formats and
51 it produces text in 8-bit or UTF-8 formats.")
52 (license license:gpl3+)))
54 (define-public tesseract-ocr
56 (name "tesseract-ocr")
62 (url "https://github.com/tesseract-ocr/tesseract")
64 (file-name (git-file-name name version))
66 (base32 "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv"))))
67 (build-system gnu-build-system)
69 `(("leptonica" ,leptonica)))
72 (let ((leptonica (assoc-ref %build-inputs "leptonica")))
73 (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
74 (home-page "https://github.com/tesseract-ocr/tesseract")
75 (synopsis "Optical character recognition engine")
77 "Tesseract is an optical character recognition (OCR) engine with very
78 high accuracy. It supports many languages, output text formatting, hOCR
79 positional information and page layout analysis. Several image formats are
80 supported through the Leptonica library. It can also detect whether text is
81 monospaced or proportional.")
82 (license license:asl2.0)))
85 (let* ((commit "581faa8f6f15e4a7b21964be3a5ec36265c80e5b")
87 ;; version copied from 'configure.in'
88 (version (git-version "0.07" revision commit)))
96 (url "https://github.com/taku910/zinnia")
100 "1izjy5qw6swg0rs2ym2i72zndb90mwrfbd1iv8xbpwckbm4899lg"))
101 (file-name (git-file-name name version))
102 (modules '((guix build utils)
105 (snippet ; remove unnecessary files with potentially different license
107 (for-each delete-file-recursively
109 (negate (cut member <> '("zinnia"
112 (build-system gnu-build-system)
115 (modify-phases %standard-phases
119 (for-each make-file-writable
120 '("config.log" "config.status"))
122 (home-page "https://taku910.github.io/zinnia/")
123 (synopsis "Online hand recognition system with machine learning")
125 "Zinnia is a simple, customizable and portable online hand recognition
126 system based on Support Vector Machines. Zinnia simply receives user pen
127 strokes as a sequence of coordinate data and outputs n-best characters sorted
128 by SVM confidence. To keep portability, Zinnia doesn't have any rendering
129 functionality. In addition to recognition, Zinnia provides training module
130 that allows us to create any hand-written recognition systems with low-cost.")
131 (license (list license:bsd-3 ; all files except...
132 (license:non-copyleft ; some autotools related files
133 "file://zinnia/aclocal.m4")
134 license:x11 ; 'install-sh'
135 license:public-domain))))) ; 'install-sh'
137 ;;; python 2 bindings, license under the same terms as zinnia
138 (define-public python2-zinnia
141 (name "python2-zinnia")
142 (build-system python-build-system)
144 `(#:python ,python-2 ; CObject API is used, it was removed in Python 3.2
145 #:tests? #f ; avoid circular dependency on tegaki-zinnia-japanese
147 (modify-phases %standard-phases
148 (add-after 'unpack 'chdir
150 (chdir "zinnia/python")
153 `(("zinnia" ,zinnia)))))