gnu: libretro-lowresnx: Update to 1.2.
[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 `(("catch" ,catch-framework2)
62 ("git" ,git-minimal)
63 ("perl" ,perl)
64 ;;FIX-ME: Building with ronn fails.
65 ;;("ronn" ,ronn)
66 ("pkg-config" ,pkg-config)))
67 (inputs
68 `(("boost" ,boost)))
69 (propagated-inputs
70 `(("icu4c" ,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 `(("aspell" ,aspell)
98 ("hunspell" ,hunspell)))
99 (propagated-inputs
100 ;; Required by enchant.pc.
101 `(("glib" ,glib)))
102 (native-inputs
103 `(("glib:bin" ,glib "bin")
104 ("pkg-config" ,pkg-config)
105 ("unittest-cpp" ,unittest-cpp)))
106 (synopsis "Multi-backend spell-checking library wrapper")
107 (description
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.
111
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
115 working\".")
116 (home-page "https://abiword.github.io/enchant/")
117 (license lgpl2.1+)))
118
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
123 (package
124 (inherit enchant)
125 (version "1.6.0")
126 (arguments '(#:configure-flags '("--disable-static")))
127 (native-inputs (alist-delete "unittest-cpp"
128 (package-native-inputs enchant)))
129 (source (origin
130 (method url-fetch)
131 (uri (string-append "http://www.abisource.com/downloads/enchant/"
132 version "/enchant-" version ".tar.gz"))
133 (sha256
134 (base32
135 "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g"))))))
136
137 (define-public python-pyenchant
138 (package
139 (name "python-pyenchant")
140 (version "2.0.0")
141 (source (origin
142 (method url-fetch)
143 (uri (pypi-uri "pyenchant" version))
144 (sha256
145 (base32
146 "1872ckgdip8nj9rnh167m0gsj5754qfg2hjxzsl1s06f5akwscgw"))))
147 (build-system python-build-system)
148 (arguments
149 `(#:tests? #f; FIXME: Dictionary for language 'en_US' could not be found
150 #:phases
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\""))))))))
159 (inputs
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.")
167 (license lgpl2.1+)))