Commit | Line | Data |
---|---|---|
708d0ceb | 1 | ;;; GNU Guix --- Functional package management for GNU |
22c334fa | 2 | ;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org> |
0833d0c0 | 3 | ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com> |
8553fe57 | 4 | ;;; Copyright © 2016 John Darrington <jmd@gnu.org> |
210e43c7 | 5 | ;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il> |
4cf9f57b | 6 | ;;; Copyright © 2016 Christopher Andersson <christopher@8bits.nu> |
d109b1e8 | 7 | ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org> |
8dbd8e42 | 8 | ;;; Copyright © 2016, 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
964595dd | 9 | ;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk> |
5e8a7edc | 10 | ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si> |
708d0ceb LC |
11 | ;;; |
12 | ;;; This file is part of GNU Guix. | |
13 | ;;; | |
14 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
15 | ;;; under the terms of the GNU General Public License as published by | |
16 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
17 | ;;; your option) any later version. | |
18 | ;;; | |
19 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
20 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;;; GNU General Public License for more details. | |
23 | ;;; | |
24 | ;;; You should have received a copy of the GNU General Public License | |
25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
26 | ||
1ffa7090 | 27 | (define-module (gnu packages aspell) |
708d0ceb LC |
28 | #:use-module (guix packages) |
29 | #:use-module (guix download) | |
30 | #:use-module (guix build-system gnu) | |
31 | #:use-module (guix licenses) | |
a2908f5a | 32 | #:use-module (guix utils) |
6d35b1c9 | 33 | #:use-module (gnu packages) |
085bcca3 LC |
34 | #:use-module (gnu packages base) |
35 | #:use-module (gnu packages compression) | |
cd37b144 JM |
36 | #:use-module (gnu packages perl) |
37 | #:use-module (ice-9 match)) | |
708d0ceb LC |
38 | |
39 | (define-public aspell | |
40 | (package | |
41 | (name "aspell") | |
4a822462 | 42 | (version "0.60.6.1") |
708d0ceb LC |
43 | (source |
44 | (origin | |
45 | (method url-fetch) | |
46 | (uri (string-append "mirror://gnu/aspell/aspell-" | |
47 | version ".tar.gz")) | |
48 | (sha256 | |
49 | (base32 | |
4a822462 EF |
50 | "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm")) |
51 | (patches (search-patches "aspell-default-dict-dir.patch" | |
52 | "aspell-gcc-compat.patch")))) | |
708d0ceb | 53 | (build-system gnu-build-system) |
81fc64da FB |
54 | (arguments |
55 | `(#:phases | |
56 | (modify-phases %standard-phases | |
a2908f5a LC |
57 | (add-before 'build 'set-filter-path |
58 | (lambda* (#:key outputs #:allow-other-keys) | |
59 | ;; Change the default value of 'filter-path' so that filters such | |
60 | ;; as 'tex-filter.so' can be found. By default none of the | |
61 | ;; filters would be found. | |
62 | (let* ((out (assoc-ref outputs "out")) | |
63 | (libdir (string-append out "/lib/aspell-" | |
64 | ,(version-major+minor version)))) | |
65 | (substitute* "common/config.cpp" | |
66 | (("\"filter-path(.*)DICT_DIR" _ middle) | |
67 | (string-append "\"filter-path" middle | |
68 | "\"" libdir "\""))) | |
69 | #t))) | |
81fc64da FB |
70 | (add-after 'install 'wrap-aspell |
71 | (lambda* (#:key outputs #:allow-other-keys) | |
72 | (let ((bin/aspell (string-append (assoc-ref outputs "out") | |
73 | "/bin/aspell"))) | |
74 | (wrap-program bin/aspell | |
75 | '("ASPELL_CONF" "" = | |
d3da21d2 MW |
76 | ("${ASPELL_CONF:-\"dict-dir ${GUIX_PROFILE:-$HOME/.guix-profile}/lib/aspell\"}"))) |
77 | #t)))))) | |
708d0ceb | 78 | (inputs `(("perl" ,perl))) |
6d35b1c9 LC |
79 | |
80 | (native-search-paths | |
81 | ;; This is a Guix-specific environment variable that takes a single | |
82 | ;; entry, not an actual search path. | |
83 | (list (search-path-specification | |
84 | (variable "ASPELL_DICT_DIR") | |
85 | (separator #f) | |
86 | (files '("lib/aspell"))))) | |
87 | ||
708d0ceb | 88 | (home-page "http://aspell.net/") |
f50d2669 | 89 | (synopsis "Spell checker") |
708d0ceb | 90 | (description |
a22dc0c4 LC |
91 | "Aspell is a spell-checker which can be used either as a library or as |
92 | a standalone program. Notable features of Aspell include its full support of | |
93 | documents written in the UTF-8 encoding and its ability to use multiple | |
94 | dictionaries, including personal ones.") | |
708d0ceb | 95 | (license lgpl2.1+))) |
15756a7a | 96 | |
15756a7a LC |
97 | ;;; |
98 | ;;; Dictionaries. | |
99 | ;;; | |
707ee324 | 100 | ;;; Use 'export ASPELL_CONF="dict-dir $HOME/.guix-profile/lib/aspell"' to use |
6d35b1c9 LC |
101 | ;;; them, or set the Guix-specific 'ASPELL_DICT_DIR', or just do nothing (as |
102 | ;;; long as 'HOME' is set, that's fine!). | |
15756a7a LC |
103 | ;;; |
104 | ||
105 | (define* (aspell-dictionary dict-name full-name | |
106 | #:key version sha256 (prefix "aspell6-")) | |
107 | (package | |
cd37b144 JM |
108 | (name (string-append |
109 | "aspell-dict-" | |
110 | ;; Downcase and replace underscore in package names | |
111 | ;; to follow Guix naming conventions. | |
112 | (string-map (match-lambda | |
113 | (#\_ #\-) | |
114 | (chr chr)) | |
115 | (string-downcase dict-name)))) | |
15756a7a LC |
116 | (version version) |
117 | (source (origin | |
118 | (method url-fetch) | |
119 | (uri (string-append "mirror://gnu/aspell/dict/" dict-name | |
120 | "/" prefix dict-name "-" | |
121 | version ".tar.bz2")) | |
122 | (sha256 sha256))) | |
123 | (build-system gnu-build-system) | |
124 | (arguments | |
707ee324 TGR |
125 | `(#:phases |
126 | (modify-phases %standard-phases | |
127 | (replace 'configure | |
128 | (lambda* (#:key outputs #:allow-other-keys) | |
129 | (let ((out (assoc-ref outputs "out"))) | |
5f55ca21 | 130 | (invoke "./configure"))))) |
707ee324 TGR |
131 | #:make-flags |
132 | (let ((out (assoc-ref %outputs "out"))) | |
133 | (list (string-append "dictdir=" out "/lib/aspell") | |
134 | (string-append "datadir=" out "/lib/aspell"))) | |
135 | #:tests? #f)) | |
15756a7a LC |
136 | (native-inputs `(("aspell" ,aspell) |
137 | ("which" ,which))) | |
138 | (synopsis (string-append full-name " dictionary for GNU Aspell")) ; XXX: i18n | |
139 | (description | |
140 | "This package provides a dictionary for the GNU Aspell spell checker.") | |
141 | (license gpl2+) | |
142 | (home-page "http://aspell.net/"))) | |
143 | ||
99b9857b | 144 | |
964595dd JM |
145 | (define-public aspell-dict-ar |
146 | (aspell-dictionary "ar" "Arabic" | |
147 | #:version "1.2-0" | |
4a822462 | 148 | #:prefix "aspell6-" |
964595dd JM |
149 | #:sha256 |
150 | (base32 | |
151 | "1avw40bp8yi5bnkq64ihm2rldgw34lk89yz281q9bmndh95a47h4"))) | |
152 | ||
8ac3476d JM |
153 | (define-public aspell-dict-be |
154 | (aspell-dictionary "be" "Belarusian" | |
155 | #:version "0.01" | |
156 | #:prefix "aspell5-" | |
157 | #:sha256 | |
158 | (base32 | |
159 | "1svls9p7rsfi3hs0afh0cssj006qb4v1ik2yzqgj8hm10c6as2sm"))) | |
160 | ||
99b9857b | 161 | (define-public aspell-dict-ca |
9b451091 TGR |
162 | (let ((version "2.5.0") |
163 | (sha256 | |
164 | (base32 "0kbi8fi7a1bys31kfqrlh332gyik0cfdmxgl7n15sa9c305rkgwq"))) | |
165 | (package | |
166 | (inherit (aspell-dictionary "ca" "Catalan" | |
167 | #:version version | |
168 | #:sha256 sha256)) | |
169 | (source | |
170 | (origin | |
171 | (method url-fetch) | |
172 | (uri (string-append "https://www.softcatala.org/pub/softcatala/aspell/" | |
173 | version "/aspell6-ca-" version ".tar.bz2")) | |
174 | (sha256 sha256))) | |
175 | (home-page "https://www.softcatala.org/pub/softcatala/aspell/")))) | |
15756a7a | 176 | |
06550e07 JD |
177 | (define-public aspell-dict-de |
178 | (aspell-dictionary "de" "German" | |
4dfc7369 | 179 | #:version "20161207-7-0" |
06550e07 JD |
180 | #:sha256 |
181 | (base32 | |
4dfc7369 | 182 | "0wamclvp66xfmv5wff96v6gdlnfv4y8lx3f8wvxyzm5imwgms4n2"))) |
06550e07 | 183 | |
4bb9528c JM |
184 | (define-public aspell-dict-da |
185 | (aspell-dictionary "da" "Danish" | |
ecc8c5d4 | 186 | #:version "1.6.36-11-0" |
4bb9528c JM |
187 | #:sha256 |
188 | (base32 | |
ecc8c5d4 | 189 | "1xz2haayvwlxgss9jf1x2311a1ixbk75q2vgfprjhibsmb7cpinv"))) |
4bb9528c | 190 | |
74a40ddd EF |
191 | (define-public aspell-dict-el |
192 | (aspell-dictionary "el" "Greek" | |
193 | #:version "0.08-0" | |
194 | #:prefix "aspell6-" | |
195 | #:sha256 | |
196 | (base32 | |
197 | "1ljcc30zg2v2h3w5h5jr5im41mw8jbsgvvhdd2cii2yzi8d0zxja"))) | |
198 | ||
15756a7a LC |
199 | (define-public aspell-dict-en |
200 | (aspell-dictionary "en" "English" | |
9d0abf0f | 201 | #:version "2019.10.06-0" |
15756a7a LC |
202 | #:sha256 |
203 | (base32 | |
9d0abf0f | 204 | "1zai9wrqwgb9z9vfgb22qhrvxvg73jg0ix44j1khm2f6m96lncr4"))) |
15756a7a LC |
205 | |
206 | (define-public aspell-dict-eo | |
207 | (aspell-dictionary "eo" "Esperanto" | |
208 | #:version "2.1.20000225a-2" | |
209 | #:sha256 | |
210 | (base32 | |
211 | "09vf0mbiicbmyb4bwb7v7lgpabnylg0wy7m3hlhl5rjdda6x3lj1"))) | |
212 | ||
213 | (define-public aspell-dict-es | |
214 | (aspell-dictionary "es" "Spanish" | |
215 | #:version "1.11-2" | |
216 | #:sha256 | |
217 | (base32 | |
218 | "1k5g328ac1hdpp6fsg57d8md6i0aqcwlszp3gbmp5706wyhpydmd"))) | |
219 | ||
c066a050 JM |
220 | (define-public aspell-dict-fi |
221 | (aspell-dictionary "fi" "Finnish" | |
222 | #:version "0.7-0" | |
223 | #:prefix "aspell6-" | |
224 | #:sha256 | |
225 | (base32 | |
226 | "07d5s08ba4dd89cmwy9icc01i6fjdykxlb9ravmhdrhi8mxz1mzq"))) | |
227 | ||
15756a7a LC |
228 | (define-public aspell-dict-fr |
229 | (aspell-dictionary "fr" "French" | |
230 | #:version "0.50-3" | |
231 | #:prefix "aspell-" | |
232 | #:sha256 | |
233 | (base32 | |
234 | "14ffy9mn5jqqpp437kannc3559bfdrpk7r36ljkzjalxa53i0hpr"))) | |
5d9ecd15 | 235 | |
74a40ddd EF |
236 | (define-public aspell-dict-grc |
237 | (aspell-dictionary "grc" "Ancient Greek" | |
238 | #:version "0.02-0" | |
5d9ecd15 AK |
239 | #:sha256 |
240 | (base32 | |
74a40ddd EF |
241 | "1zxr8958v37v260fkqd4pg37ns5h5kyqm54hn1hg70wq5cz8h512"))) |
242 | ||
243 | (define-public aspell-dict-he | |
244 | (aspell-dictionary "he" "Hebrew" | |
245 | #:version "1.0-0" | |
246 | #:sha256 | |
247 | (base32 | |
248 | "13bhbghx5b8g0119g3wxd4n8mlf707y41vlf59irxjj0kynankfn"))) | |
3a6a0f60 | 249 | |
77fe5258 JM |
250 | (define-public aspell-dict-hi |
251 | (aspell-dictionary "hi" "Hindi" | |
252 | #:version "0.02-0" | |
253 | #:prefix "aspell6-" | |
254 | #:sha256 | |
255 | (base32 | |
256 | "0drs374qz4419zx1lf2k281ydxf2750jk5ailafj1x0ncz27h1ys"))) | |
257 | ||
3a6a0f60 | 258 | (define-public aspell-dict-it |
8dbd8e42 TGR |
259 | (let ((version "2.4-20070901-0") |
260 | (sha256 | |
261 | (base32 "0d6ypii3jblprpibazb6ypady536jz62rwxlss1x1raq07rhvvqn"))) | |
262 | (package | |
263 | (inherit (aspell-dictionary "it" "Italian" | |
264 | #:version version | |
265 | #:sha256 sha256)) | |
266 | ||
267 | ;; The version hosted at <https://ftp.gnu.org/gnu/aspell/dict> is even | |
268 | ;; more out of date. | |
269 | (source | |
270 | (origin | |
271 | (method url-fetch) | |
272 | (uri (string-append "mirror://sourceforge/linguistico/" | |
273 | "Dizionario%20italiano%20per%20Aspell/" version "/" | |
274 | "aspell6-it-" version ".tar.bz2")) | |
275 | (sha256 sha256))) | |
276 | (home-page | |
277 | "http://linguistico.sourceforge.net/pages/dizionario_italiano.html")))) | |
467c498b | 278 | |
c5a88aa0 JM |
279 | (define-public aspell-dict-mi |
280 | (aspell-dictionary "mi" "Maori" | |
281 | #:version "0.50-0" | |
282 | #:sha256 | |
283 | (base32 | |
284 | "12bxplpd348yx8d2q8qvahi9dlp7qf28qmanzhziwc7np8rixvmy"))) | |
285 | ||
467c498b JR |
286 | (define-public aspell-dict-nl |
287 | (aspell-dictionary "nl" "Dutch" | |
288 | #:version "0.50-2" | |
289 | #:prefix "aspell-" | |
290 | #:sha256 | |
291 | (base32 | |
292 | "0ffb87yjsh211hllpc4b9khqqrblial4pzi1h9r3v465z1yhn3j4"))) | |
8553fe57 | 293 | |
c9400f03 JM |
294 | (define-public aspell-dict-nn |
295 | (aspell-dictionary "nn" "Norwegian Nynorsk" | |
296 | #:version "0.50.1-1" | |
297 | #:sha256 | |
298 | (base32 | |
299 | "0w2k5l5rbqpliripgqwiqixz5ghnjf7i9ggbrc4ly4vy1ia10rmc"))) | |
300 | ||
74a40ddd | 301 | (define-public aspell-dict-pt-br |
cd37b144 | 302 | (aspell-dictionary "pt_BR" "Brazilian Portuguese" |
947141fd | 303 | #:version "20131030-12-0" |
8553fe57 EF |
304 | #:sha256 |
305 | (base32 | |
947141fd | 306 | "1xqlpk21s93c6blkdnpk7l62q9fxjvzdv2x86chl8p2x1gdrj3gb"))) |
74a40ddd | 307 | |
a1fa54f0 | 308 | (define-public aspell-dict-pt-pt |
cd37b144 | 309 | (aspell-dictionary "pt_PT" "Portuguese" |
9eb6d712 | 310 | #:version "20190329-1-0" |
a1fa54f0 JM |
311 | #:sha256 |
312 | (base32 | |
9eb6d712 | 313 | "0ld0d0ily4jqifjfsxfv4shbicz6ymm2gk56fq9gbzra1j4qnw75"))) |
a1fa54f0 | 314 | |
74a40ddd EF |
315 | (define-public aspell-dict-ru |
316 | (aspell-dictionary "ru" "Russian" | |
317 | #:version "0.99f7-1" | |
318 | #:sha256 | |
319 | (base32 | |
320 | "0ip6nq43hcr7vvzbv4lwwmlwgfa60hrhsldh9xy3zg2prv6bcaaw"))) | |
4cf9f57b | 321 | |
5e8a7edc TL |
322 | (define-public aspell-dict-sl |
323 | (aspell-dictionary "sl" "Slovenian" | |
324 | #:version "0.50-0" | |
325 | #:prefix "aspell-" | |
326 | #:sha256 | |
327 | (base32 | |
328 | "1l9kc5g35flq8kw9jhn2n0bjb4sipjs4qkqzgggs438kywkx2rp5"))) | |
329 | ||
4cf9f57b CA |
330 | (define-public aspell-dict-sv |
331 | (aspell-dictionary "sv" "Swedish" | |
332 | #:version "0.51-0" | |
333 | #:prefix "aspell-" | |
334 | #:sha256 | |
335 | (base32 | |
336 | "02jwkjhr32kvyibnyzgx3smbnm576jwdzg3avdf6zxwckhy5fw4v"))) | |
850812de | 337 | |
e77dd15a JM |
338 | (define-public aspell-dict-uk |
339 | (aspell-dictionary "uk" "Ukrainian" | |
340 | #:version "1.4.0-0" | |
341 | #:sha256 | |
342 | (base32 | |
343 | "137i4njvnslab6l4s291s11xijr5jsy75lbdph32f9y183lagy9m"))) | |
344 | ||
085bcca3 LC |
345 | \f |
346 | ;;; | |
347 | ;;; Hunspell packages made from the Aspell word lists. | |
348 | ;;; | |
349 | ||
350 | (define* (aspell-word-list language synopsis | |
351 | #:optional | |
352 | (nick (string-map (lambda (chr) | |
353 | (if (char=? #\_ chr) | |
354 | #\- | |
355 | chr)) | |
356 | (string-downcase language)))) | |
357 | (package | |
358 | (name (string-append "hunspell-dict-" nick)) | |
210e43c7 | 359 | (version "2018.04.16") |
085bcca3 LC |
360 | (source (origin |
361 | (method url-fetch) | |
362 | (uri (string-append | |
363 | "http://downloads.sourceforge.net/wordlist/scowl-" | |
364 | version ".tar.gz")) | |
365 | (sha256 | |
366 | (base32 | |
210e43c7 | 367 | "11lkrnhwrf5mvrrq45k4mads3n9aswgac8dc25ba61c75alxb5rs")))) |
085bcca3 LC |
368 | (native-inputs |
369 | `(("tar" ,tar) | |
370 | ("gzip" ,gzip) | |
371 | ("perl" ,perl) | |
372 | ("aspell" ,aspell))) | |
373 | (build-system gnu-build-system) | |
374 | (arguments | |
375 | `(#:phases | |
376 | (modify-phases %standard-phases | |
377 | (delete 'configure) | |
378 | (delete 'check) | |
379 | (replace 'build | |
380 | (lambda _ | |
381 | (substitute* "speller/make-hunspell-dict" | |
382 | (("zip -9 .*$") | |
383 | "return\n")) | |
384 | (mkdir "speller/hunspell") | |
385 | ||
386 | ;; XXX: This actually builds all the dictionary variants. | |
210e43c7 | 387 | (invoke "make" "-C" "speller" "hunspell"))) |
085bcca3 LC |
388 | (replace 'install |
389 | (lambda* (#:key outputs #:allow-other-keys) | |
390 | (let* ((out (assoc-ref %outputs "out")) | |
391 | (hunspell (string-append out "/share/hunspell")) | |
392 | (myspell (string-append out "/share/myspell")) | |
393 | (doc (string-append out "/share/doc/" | |
22c334fa LC |
394 | ,name)) |
395 | (dot-dic ,(string-append "speller/" language ".dic"))) | |
085bcca3 | 396 | (mkdir-p myspell) |
22c334fa LC |
397 | |
398 | ;; Usually there's only a 'LANGUAGE.dic' file, but for the "en" | |
399 | ;; dictionary, there no 'en.dic'. Instead, there's a set of | |
400 | ;; 'en*.dic' files, hence the 'find-files' call below. | |
401 | (if (file-exists? dot-dic) | |
402 | (install-file dot-dic hunspell) | |
403 | (for-each (lambda (dic) | |
404 | (install-file dic hunspell)) | |
405 | (find-files "speller" | |
406 | ,(string-append language ".*\\.dic$")))) | |
407 | ||
085bcca3 LC |
408 | (install-file ,(string-append "speller/" language ".aff") |
409 | hunspell) | |
410 | (symlink hunspell (string-append myspell "/dicts")) | |
411 | (for-each (lambda (file) | |
412 | (install-file file doc)) | |
413 | (find-files "." | |
414 | "^(Copyright|.*\\.(txt|org|md))$")) | |
415 | #t)))))) | |
416 | (synopsis synopsis) | |
417 | (description | |
418 | "This package provides a dictionary for the Hunspell spell-checking | |
419 | library.") | |
420 | (home-page "http://wordlist.aspell.net/") | |
421 | (license (non-copyleft "file://Copyright" | |
422 | "Word lists come from several sources, all | |
423 | under permissive licensing terms. See the 'Copyright' file.")))) | |
424 | ||
425 | (define-syntax define-word-list-dictionary | |
426 | (syntax-rules (synopsis) | |
427 | ((_ name language (synopsis text)) | |
428 | (define-public name | |
429 | (aspell-word-list language text))) | |
430 | ((_ name language nick (synopsis text)) | |
431 | (define-public name | |
432 | (aspell-word-list language text nick))))) | |
433 | ||
434 | (define-word-list-dictionary hunspell-dict-en | |
435 | "en" | |
436 | (synopsis "Hunspell dictionary for English")) | |
437 | ||
438 | (define-word-list-dictionary hunspell-dict-en-au | |
439 | "en_AU" | |
440 | (synopsis "Hunspell dictionary for Australian English")) | |
441 | ||
442 | (define-word-list-dictionary hunspell-dict-en-ca | |
443 | "en_CA" | |
444 | (synopsis "Hunspell dictionary for Canadian English")) | |
445 | ||
446 | (define-word-list-dictionary hunspell-dict-en-gb | |
447 | "en_GB-ise" "en-gb" | |
448 | (synopsis "Hunspell dictionary for British English, with -ise endings")) | |
449 | ||
450 | (define-word-list-dictionary hunspell-dict-en-gb-ize | |
451 | "en_GB-ize" | |
452 | (synopsis "Hunspell dictionary for British English, with -ize endings")) | |
453 | ||
454 | (define-word-list-dictionary hunspell-dict-en-us | |
455 | "en_US" | |
456 | (synopsis "Hunspell dictionary for United States English")) |