gnu: Remove python2-pyaudio.
[jackhill/guix/guix.git] / gnu / packages / enchant.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
3 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
4 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
22 (define-module (gnu packages enchant)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages aspell)
25 #:use-module (gnu packages boost)
26 #:use-module (gnu packages check)
27 #:use-module (gnu packages glib)
28 #:use-module (gnu packages icu4c)
29 #:use-module (gnu packages libreoffice)
30 #:use-module (gnu packages man)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages version-control)
34 #:use-module (guix packages)
35 #:use-module (guix git-download)
36 #:use-module (guix download)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system python)
40 #:use-module (guix licenses)
41 #:use-module (srfi srfi-1))
42
43 (define-public nuspell
44 (package
45 (name "nuspell")
46 (version "3.1.2")
47 (source
48 (origin
49 (method git-fetch)
50 (uri
51 (git-reference
52 (url "https://github.com/nuspell/nuspell")
53 (commit
54 (string-append "v" version))))
55 (file-name
56 (git-file-name name version))
57 (sha256
58 (base32 "0wbb6dwmzlsyy224y0liis0azgzwbjdvcyzc31pw1aw6vbp36na6"))))
59 (build-system cmake-build-system)
60 (native-inputs
61 (list catch-framework2
62 git-minimal
63 perl
64 ;;FIX-ME: Building with ronn fails.
65 ;;("ronn" ,ronn)
66 pkg-config))
67 (inputs
68 (list boost))
69 (propagated-inputs
70 (list icu4c))
71 (synopsis "Fast and safe spellchecking C++ library")
72 (description "Nuspell is a fast and safe spelling checker software
73 program. It is designed for languages with rich morphology and complex word
74 compounding. Nuspell is written in modern C++ and it supports Hunspell
75 dictionaries.")
76 (home-page "https://nuspell.github.io/")
77 (license lgpl3+)))
78
79 (define-public enchant
80 (package
81 (name "enchant")
82 (version "2.2.15")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append "https://github.com/AbiWord/enchant/releases"
86 "/download/v" version "/enchant-"
87 version ".tar.gz"))
88 (sha256
89 (base32
90 "00vcykbb7lxh51prvmsb62a06q18a6rlk9ba5a7g45c1awaj43rv"))))
91 (build-system gnu-build-system)
92 (arguments
93 '(#:configure-flags '("--disable-static"
94 ;; Tests require a relocatable build.
95 "--enable-relocatable")))
96 (inputs
97 (list aspell hunspell))
98 (propagated-inputs
99 ;; Required by enchant.pc.
100 (list glib))
101 (native-inputs
102 `(("glib:bin" ,glib "bin")
103 ("pkg-config" ,pkg-config)
104 ("unittest-cpp" ,unittest-cpp)))
105 (synopsis "Multi-backend spell-checking library wrapper")
106 (description
107 "On the surface, Enchant appears to be a generic spell checking library.
108 Looking closer, you'll see the Enchant is more-or-less a fancy wrapper around
109 the dlopen() system call.
110
111 Enchant steps in to provide uniformity and conformity on top of these libraries,
112 and implement certain features that may be lacking in any individual provider
113 library. Everything should \"just work\" for any and every definition of \"just
114 working\".")
115 (home-page "https://abiword.github.io/enchant/")
116 (license lgpl2.1+)))
117
118 ;; Some packages are not ready for the 2.x API yet, so we keep this version
119 ;; around. The library and executables of Enchant 2 have been designed not to
120 ;; conflict with 1.x, so it's OK if both end up in the same profile.
121 (define-public enchant-1.6
122 (package
123 (inherit enchant)
124 (version "1.6.0")
125 (arguments '(#:configure-flags '("--disable-static")))
126 (native-inputs (alist-delete "unittest-cpp"
127 (package-native-inputs enchant)))
128 (source (origin
129 (method url-fetch)
130 (uri (string-append "http://www.abisource.com/downloads/enchant/"
131 version "/enchant-" version ".tar.gz"))
132 (sha256
133 (base32
134 "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g"))))))
135
136 (define-public python-pyenchant
137 (package
138 (name "python-pyenchant")
139 (version "2.0.0")
140 (source (origin
141 (method url-fetch)
142 (uri (pypi-uri "pyenchant" version))
143 (sha256
144 (base32
145 "1872ckgdip8nj9rnh167m0gsj5754qfg2hjxzsl1s06f5akwscgw"))))
146 (build-system python-build-system)
147 (arguments
148 `(#:tests? #f; FIXME: Dictionary for language 'en_US' could not be found
149 #:phases
150 (modify-phases %standard-phases
151 (add-before 'build 'setlib
152 (lambda* (#:key inputs #:allow-other-keys)
153 (substitute* "enchant/_enchant.py"
154 (("/opt/local/lib/libenchant.dylib\"")
155 (string-append "/opt/local/lib/libenchant.dylib\"\n"
156 " yield \"" (assoc-ref inputs "enchant")
157 "/lib/libenchant-2.so\""))))))))
158 (inputs
159 (list enchant))
160 (home-page "https://github.com/pyenchant/pyenchant")
161 (synopsis "Spellchecking library for Python")
162 (description "PyEnchant is a spellchecking library for Python, based on the
163 Enchant library. PyEnchant combines all the functionality of the underlying
164 Enchant library with the flexibility of Python. It also provides some
165 higher-level functionality than is available in the C API.")
166 (license lgpl2.1+)))