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")
54 (string-append "v" version))))
56 (git-file-name name version))
58 (base32 "0wbb6dwmzlsyy224y0liis0azgzwbjdvcyzc31pw1aw6vbp36na6"))))
59 (build-system cmake-build-system)
61 (list catch-framework2
64 ;;FIX-ME: Building with ronn fails.
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 "00vcykbb7lxh51prvmsb62a06q18a6rlk9ba5a7g45c1awaj43rv"))))
91 (build-system gnu-build-system)
93 '(#:configure-flags '("--disable-static"
94 ;; Tests require a relocatable build.
95 "--enable-relocatable")))
97 (list aspell hunspell))
99 ;; Required by enchant.pc.
102 `(("glib:bin" ,glib "bin")
103 ("pkg-config" ,pkg-config)
104 ("unittest-cpp" ,unittest-cpp)))
105 (synopsis "Multi-backend spell-checking library wrapper")
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.
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
115 (home-page "https://abiword.github.io/enchant/")
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
125 (arguments '(#:configure-flags '("--disable-static")))
126 (native-inputs (alist-delete "unittest-cpp"
127 (package-native-inputs enchant)))
130 (uri (string-append "http://www.abisource.com/downloads/enchant/"
131 version "/enchant-" version ".tar.gz"))
134 "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g"))))))
136 (define-public python-pyenchant
138 (name "python-pyenchant")
142 (uri (pypi-uri "pyenchant" version))
145 "1872ckgdip8nj9rnh167m0gsj5754qfg2hjxzsl1s06f5akwscgw"))))
146 (build-system python-build-system)
148 `(#:tests? #f; FIXME: Dictionary for language 'en_US' could not be found
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\""))))))))
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.")