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>
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 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))
43 (define-public nuspell
52 (url "https://github.com/nuspell/nuspell.git")
54 (string-append "v" version))))
56 (git-file-name name version))
58 (base32 "0wbb6dwmzlsyy224y0liis0azgzwbjdvcyzc31pw1aw6vbp36na6"))))
59 (build-system cmake-build-system)
61 `(("catch" ,catch-framework2)
64 ;;FIX-ME: Building with ronn fails.
66 ("pkg-config" ,pkg-config)))
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
76 (home-page "https://nuspell.github.io/")
79 (define-public enchant
85 (uri (string-append "https://github.com/AbiWord/enchant/releases"
86 "/download/v" version "/enchant-"
90 "0m9m564qqwbssvvf7y3dlz1yxzqsjiqy1yd2zsmb3l0d7y2y5df7"))))
91 (build-system gnu-build-system)
93 '(#:configure-flags '("--disable-static"
94 ;; Tests require a relocatable build.
95 "--enable-relocatable")))
98 ("hunspell" ,hunspell)))
100 ;; Required by enchant.pc.
103 `(("glib:bin" ,glib "bin")
104 ("pkg-config" ,pkg-config)
105 ("unittest-cpp" ,unittest-cpp)))
106 (synopsis "Multi-backend spell-checking library wrapper")
108 "On the surface, Enchant appears to be a generic spell checking library.
109 Looking closer, you'll see the Enchant is more-or-less a fancy wrapper around
110 the dlopen() system call.
112 Enchant steps in to provide uniformity and conformity on top of these libraries,
113 and implement certain features that may be lacking in any individual provider
114 library. Everything should \"just work\" for any and every definition of \"just
116 (home-page "https://abiword.github.io/enchant/")
119 ;; Some packages are not ready for the 2.x API yet, so we keep this version
120 ;; around. The library and executables of Enchant 2 have been designed not to
121 ;; conflict with 1.x, so it's OK if both end up in the same profile.
122 (define-public enchant-1.6
126 (arguments '(#:configure-flags '("--disable-static")))
127 (native-inputs (alist-delete "unittest-cpp"
128 (package-native-inputs enchant)))
131 (uri (string-append "http://www.abisource.com/downloads/enchant/"
132 version "/enchant-" version ".tar.gz"))
135 "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g"))))))
137 (define-public python-pyenchant
139 (name "python-pyenchant")
143 (uri (pypi-uri "pyenchant" version))
146 "1872ckgdip8nj9rnh167m0gsj5754qfg2hjxzsl1s06f5akwscgw"))))
147 (build-system python-build-system)
149 `(#:tests? #f; FIXME: Dictionary for language 'en_US' could not be found
151 (modify-phases %standard-phases
152 (add-before 'build 'setlib
153 (lambda* (#:key inputs #:allow-other-keys)
154 (substitute* "enchant/_enchant.py"
155 (("/opt/local/lib/libenchant.dylib\"")
156 (string-append "/opt/local/lib/libenchant.dylib\"\n"
157 " yield \"" (assoc-ref inputs "enchant")
158 "/lib/libenchant-2.so\""))))))))
160 `(("enchant" ,enchant)))
161 (home-page "https://github.com/pyenchant/pyenchant")
162 (synopsis "Spellchecking library for Python")
163 (description "PyEnchant is a spellchecking library for Python, based on the
164 Enchant library. PyEnchant combines all the functionality of the underlying
165 Enchant library with the flexibility of Python. It also provides some
166 higher-level functionality than is available in the C API.")