gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / dictionaries.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016, 2021 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018, 2020-2022 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2017, 2018, 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
6 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
8 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
9 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
10 ;;; Copyright © 2020 Lu hux <luhux@outlook.com>
11 ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages dictionaries)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (guix build-system trivial)
36 #:use-module (guix build-system copy)
37 #:use-module (guix build-system cmake)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages emacs)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages fribidi)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages pcre)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages texinfo)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages tcl)
56 #:use-module (gnu packages xml))
57
58
59 (define-public vera
60 (package
61 (name "vera")
62 (version "1.24")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "mirror://gnu/vera/vera-" version
66 ".tar.gz"))
67 (sha256
68 (base32
69 "1j5p679vw72bv766acbg6g89k31ynmrzlpg7s3wzy4krlwdf92xc"))))
70 (build-system trivial-build-system)
71 (arguments
72 `(#:builder (begin
73 (use-modules (guix build utils))
74
75 (let* ((out (assoc-ref %outputs "out"))
76 (info (string-append out "/share/info"))
77 (html (string-append out "/share/html"))
78 (source (assoc-ref %build-inputs "source"))
79 (tar (assoc-ref %build-inputs "tar"))
80 (gz (assoc-ref %build-inputs "gzip"))
81 (texi (assoc-ref %build-inputs "texinfo")))
82 (setenv "PATH" (string-append gz "/bin"))
83 (invoke (string-append tar "/bin/tar") "xvf" source)
84
85 (chdir (string-append "vera-" ,version))
86 (mkdir-p info)
87 (mkdir-p html)
88
89 ;; Change a ‘Malformed UTF-8 character: \xd7\x34 (unexpected
90 ;; non-continuation byte 0x34, immediately after start byte
91 ;; 0xd7; need 2 bytes, got 1) in pattern match (m//)’.
92 (substitute* "vera.h"
93 (("320.480") "320x480"))
94
95 ;; XXX: Use '--force' because the document is unhappy
96 ;; with Texinfo 5 (yes, documents can be unhappy.)
97 (invoke (string-append texi "/bin/makeinfo")
98 "vera.texi" "--force" "-o"
99 (string-append info "/vera.info"))
100 (invoke (string-append texi "/bin/makeinfo")
101 "vera.texi" "--force" "--html" "-o"
102 (string-append html "/vera.html"))))
103 #:modules ((guix build utils))))
104 (native-inputs (list texinfo tar gzip))
105 (home-page "https://savannah.gnu.org/projects/vera/")
106 (synopsis "List of acronyms")
107 (description
108 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
109 acronyms distributed as an info document.")
110 (license license:fdl1.3+)))
111
112 (define-public gcide
113 (package
114 (name "gcide")
115 (version "0.53")
116 (source (origin
117 (method url-fetch)
118 (uri (string-append
119 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
120 (sha256
121 (base32
122 "17rigzfmih5i1z5s5v1hdr1jw8rngf40768kblnh5kp19ncbvb6k"))))
123 (build-system copy-build-system)
124 (arguments
125 '(#:install-plan
126 '(("." "share/gcide/" #:exclude ("COPYING")))))
127 (synopsis "GNU Collaborative International Dictionary of English")
128 (description
129 "GCIDE is a free dictionary based on a combination of sources. It can
130 be used via the GNU Dico program or accessed online at
131 http://gcide.gnu.org.ua/")
132 (home-page "https://gcide.gnu.org.ua/")
133 (license license:gpl3+)))
134
135 (define-public diction
136 ;; Not quite a dictionary, not quite a spell checker either…
137 (package
138 (name "diction")
139 (version "1.14")
140 (source
141 (origin
142 (method url-fetch)
143 (uri (string-append "http://www.moria.de/~michael/diction/diction-"
144 version ".tar.gz"))
145 (sha256
146 (base32 "1z6p5x3l1a00h4v4s33qa82fznzc1jdqdnlc4dnmd9nblnrjy0fs"))))
147 (build-system gnu-build-system)
148 (synopsis "Identifies wordy and commonly misused phrases")
149 (description
150 "A package providing two classic Unix commands, style and diction.
151 Diction is used to identify wordy and commonly misused phrases in a
152 body of text. Style instead analyzes surface aspects of a written
153 work, such as sentence length and other readability measures.")
154 (home-page "https://www.gnu.org/software/diction/")
155 (license license:gpl3+)))
156
157 (define-public ding
158 (package
159 (name "ding")
160 (version "1.9")
161 (source (origin
162 (method url-fetch)
163 (uri (string-append "https://ftp.tu-chemnitz.de/pub/Local/urz/" name
164 "/" name "-" version ".tar.gz"))
165 (sha256
166 (base32
167 "1rcqn04l6hvsf15mqqai533p31nc04r2yd9s0mn2hnkqrwgwi9k9"))))
168 (build-system gnu-build-system)
169 (inputs (list tk))
170 (arguments
171 `(#:phases
172 (modify-phases %standard-phases
173 (delete 'configure)
174 (delete 'build)
175 (delete 'check)
176 (replace 'install
177 (lambda* (#:key inputs #:allow-other-keys)
178 (let ((bindir (string-append
179 (assoc-ref %outputs "out") "/bin"))
180 (wish (search-input-file inputs "/bin/wish8.6"))
181 (sharedir (string-append
182 (assoc-ref %outputs "out")
183 "/share/applications"))
184 (libdir (string-append
185 (assoc-ref %outputs "out") "/lib")))
186 (mkdir-p bindir)
187 (mkdir-p libdir)
188 (mkdir-p sharedir)
189
190 (substitute* "ding.desktop"
191 (("Exec=/usr/bin/ding")
192 (string-append "Exec=" bindir "/ding")))
193 (with-fluids ((%default-port-encoding "ISO-8859-1"))
194 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
195 (substitute* "install.sh"
196 (("/bin/cp") "cp")
197 (("/bin/mv") "mv")
198 (("NEEDPROG=\"wish\"")
199 (string-append "NEEDPROG=\"" wish "\""))
200 (("DEFBINDIR=\"/usr/local/bin\"")
201 (string-append "DEFBINDIR=\"" bindir "\""))
202 (("DEFLIBDIR=\"/usr/local/lib\"")
203 (string-append "DEFLIBDIR=\"" libdir "\"")))
204 (install-file "ding.desktop" sharedir)
205 (install-file "ding.png" sharedir)
206 (invoke "./install.sh")))))))
207 (synopsis "Dictionary lookup program with a German-English dictionary")
208 (description "Ding is a dictionary lookup program for the X window system.
209 It comes with a German-English dictionary with approximately 270,000 entries.")
210 (home-page "https://www-user.tu-chemnitz.de/~fri/ding/")
211 (license license:gpl2+)))
212
213 (define-public grammalecte
214 (package
215 (name "grammalecte")
216 (version "2.1.1")
217 (source
218 (origin
219 (method url-fetch/zipbomb)
220 (uri (string-append "https://grammalecte.net/grammalecte/zip/"
221 "Grammalecte-fr-v" version ".zip"))
222 (sha256
223 (base32 "076jv3ywdgqqzg92bfbagc7ypy08xjq5zn4vgna6j9350fkfqhzn"))))
224 (build-system python-build-system)
225 (home-page "https://grammalecte.net")
226 (synopsis "French spelling and grammar checker")
227 (description "Grammalecte is a grammar checker for the French language,
228 derived from Lightproof.
229
230 Grammalecte helps writing a proper French, without distracting users with
231 false positives. This grammar checker follows the principle: the less false
232 positives, the better; if it cannot know with a good chance that a dubious
233 expression is wrong, it keeps silent.
234
235 The package provides the command line interface, along with a server
236 and a Python library.")
237 (license license:gpl3+)))
238
239 (define-public translate-shell
240 (package
241 (name "translate-shell")
242 (version "0.9.7")
243 (source
244 (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url"https://github.com/soimort/translate-shell")
248 (commit (string-append "v" version))))
249 (file-name (git-file-name name version))
250 (sha256
251 (base32 "03p00v8g0y2xs3sza2r2kmhwiajaz9viab6xk9snw7chzw2cddiq"))))
252 (build-system gnu-build-system)
253 (arguments
254 `(#:phases
255 (modify-phases %standard-phases
256 (delete 'configure) ; no configure script
257 (add-after 'unpack 'remove-unnecessary-file
258 ;; This file gets generated during the build phase.
259 (lambda _
260 (delete-file "translate")))
261 (add-after 'install 'wrap-binary
262 (lambda* (#:key inputs outputs #:allow-other-keys)
263 (let* ((out (assoc-ref outputs "out"))
264 (bin (string-append out "/bin/trans"))
265 (curl (assoc-ref inputs "curl"))
266 (fribidi (assoc-ref inputs "fribidi"))
267 (rlwrap (assoc-ref inputs "rlwrap")))
268 (wrap-program bin
269 `("PATH" ":" prefix
270 (,(string-append out "/bin:"
271 curl "/bin:"
272 fribidi "/bin:"
273 rlwrap "/bin")))))))
274 (add-after 'install 'emacs-install
275 (assoc-ref emacs:%standard-phases 'install))
276 (add-after 'emacs-install 'emacs-make-autoloads
277 (assoc-ref emacs:%standard-phases 'make-autoloads))
278 (add-after 'emacs-make-autoloads 'emacs-autoloads-compilation
279 (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation)))
280 #:make-flags (list (string-append "PREFIX=" %output)
281 "NETWORK_ACCESS=no test")
282 #:imported-modules (,@%gnu-build-system-modules
283 (guix build emacs-build-system)
284 (guix build emacs-utils))
285 #:modules ((guix build gnu-build-system)
286 ((guix build emacs-build-system) #:prefix emacs:)
287 (guix build utils))
288 #:test-target "test"))
289 (inputs
290 (list curl fribidi rlwrap))
291 (native-inputs
292 `(("emacs" ,emacs-minimal)
293 ("util-linux" ,util-linux))) ; hexdump, for the test
294 (home-page "https://www.soimort.org/translate-shell/")
295 (synopsis "Translations from the command line")
296 (description
297 "Translate Shell (formerly Google Translate CLI) is a command-line
298 translator powered by Google Translate (default), Bing Translator,
299 Yandex.Translate and Apertium. It gives you easy access to one of these
300 translation engines from your terminal.")
301 (license license:public-domain)))
302
303 (define-public lttoolbox
304 (package
305 (name "lttoolbox")
306 (version "3.5.4")
307 (source
308 (origin
309 (method url-fetch)
310 (uri (string-append
311 "https://github.com/apertium/lttoolbox/releases/download/v"
312 version "/lttoolbox-" version ".tar.xz"))
313 (sha256
314 (base32 "0kn9xg9sc64amd6ah5gi4qij0bhfbmc2jjvxbjjrsdd8iq054cgm"))))
315 (build-system gnu-build-system)
316 (arguments
317 `(#:configure-flags
318 (list "--disable-static")
319 #:phases
320 (modify-phases %standard-phases
321 (replace 'bootstrap
322 ;; The included ./autogen.sh unconditionally runs ./configure before
323 ;; its shebangs have been patched.
324 (lambda _
325 (invoke "autoreconf" "-vfi"))))))
326 (inputs
327 (list libxml2))
328 (native-inputs
329 (list autoconf automake libtool pkg-config))
330 (home-page "https://wiki.apertium.org/wiki/Lttoolbox")
331 (synopsis "Lexical processing toolbox")
332 (description "Lttoolbox is a toolbox for lexical processing, morphological
333 analysis and generation of words. Analysis is the process of splitting a
334 word (e.g. cats) into its lemma \"cat\" and the grammatical information
335 @code{<n><pl>}. Generation is the opposite process.")
336 (license (list license:gpl2 ; main license
337 license:expat)))) ; utf8/*
338
339 (define-public apertium
340 (package
341 (name "apertium")
342 (version "3.5.2")
343 (source
344 (origin
345 (method url-fetch)
346 (uri (string-append
347 "https://github.com/apertium/apertium/releases/download/v"
348 version "/apertium-" version ".tar.gz"))
349 (sha256
350 (base32
351 "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
352 (file-name (string-append name "-" version ".tar.gz"))))
353 (build-system gnu-build-system)
354 (inputs
355 (list libxml2 libxslt lttoolbox pcre))
356 (native-inputs
357 `(("apertium-get"
358 ,(origin
359 (method git-fetch)
360 (uri (git-reference
361 (url "https://github.com/apertium/apertium-get")
362 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
363 (sha256
364 (base32
365 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
366 ("flex" ,flex)
367 ("pkg-config" ,pkg-config)
368 ;; python is only required for running the test suite
369 ("python" ,python)))
370 (arguments
371 `(#:phases
372 (modify-phases %standard-phases
373 ;; If apertium-get does not exist in the source tree, the build tries
374 ;; to download it using an svn checkout. To avoid this, copy
375 ;; apertium-get into the source tree.
376 (add-after 'unpack 'unpack-apertium-get
377 (lambda* (#:key inputs #:allow-other-keys)
378 (copy-recursively (assoc-ref inputs "apertium-get")
379 "apertium/apertium-get")
380 #t)))))
381 (home-page "https://www.apertium.org/")
382 (synopsis "Rule based machine translation system")
383 (description "Apertium is a rule based machine translation system
384 featuring a shallow-transfer machine translation engine. The design of the
385 system makes translations fast (translating tens of thousands of words per
386 second on ordinary desktop computers) and, in spite of the errors, reasonably
387 intelligible and easily correctable.")
388 (license (list license:gpl2 ; main license
389 license:expat)))) ; utf8/*
390
391 (define-public sdcv
392 (package
393 (name "sdcv")
394 (version "0.5.3")
395 (source
396 (origin
397 (method git-fetch)
398 (uri (git-reference
399 (url "https://github.com/Dushistov/sdcv/")
400 (commit (string-append "v" version))))
401 (file-name (git-file-name name version))
402 (sha256
403 (base32
404 "144qpl9b8r2php0zhi9b7vg6flpvdgjy6yfaipydwwhxi4wy9600"))))
405 (build-system cmake-build-system)
406 (arguments
407 `(#:configure-flags '("-DBUILD_TESTS=YES")
408 #:phases
409 (modify-phases %standard-phases
410 (add-after 'build 'build-lang
411 (lambda _
412 (invoke "make" "lang")))
413 (add-before 'check 'pre-check
414 (lambda _
415 (setenv "HOME" (getcwd))
416 #t))
417 (add-after 'unpack 'remove-jq-requirement
418 (lambda _
419 ;; We don't want to bring in jq for one test.
420 (substitute* "tests/t_json"
421 (("jq") "echo"))
422 #t)))))
423 (native-inputs
424 `(("gettext" ,gettext-minimal)
425 ("pkg-config" ,pkg-config)))
426 (inputs
427 (list glib ncurses readline zlib))
428 (home-page "https://dushistov.github.io/sdcv/")
429 (synopsis "Console version of StarDict")
430 (description "sdcv is simple text-based utility for work with dictionaries
431 in StarDict's format.")
432 (license license:gpl2+)))
433
434 (define-public skk-jisyo
435 (let ((commit "38c81dbc74cdbdead843364023dea837f239a48c")
436 (revision "0"))
437 (package
438 (name "skk-jisyo")
439 (version (git-version "0" revision commit))
440 (source (origin
441 (method git-fetch)
442 (uri (git-reference
443 (url "https://github.com/skk-dev/dict")
444 (commit commit)))
445 (file-name (git-file-name name version))
446 (sha256
447 (base32
448 "121j73bgd7fvj7zvaidqvgzfdvimig3f0vsyfv4vndwfgskh2r7z"))))
449 (build-system copy-build-system)
450 (arguments
451 '(#:install-plan '(("./" "share/skk"
452 #:include-regexp ("SKK-JISYO\\.*")
453 #:exclude-regexp ("\\.gz$" "\\.md5$")
454 #:exclude ("SKK-JISYO.pubdic+"
455 "SKK-JISYO.wrong.annotated"
456 "SKK-JISYO.wrong")))
457 #:phases (modify-phases %standard-phases
458 (add-before 'install 'decompress
459 (lambda* (#:key outputs #:allow-other-keys)
460 (map (lambda (arg)
461 (invoke "gzip" "-v" "-d" arg))
462 (find-files "." "SKK-JISYO\\..*\\.gz$"))
463 (invoke "tar" "xvf" "zipcode.tar.gz"))))))
464 (home-page "https://skk-dev.github.io/dict/")
465 (synopsis "Jisyo (dictionary) files for the SKK Japanese-input software")
466 (description
467 "This package provides @file{SKK-JISYO.L}, the standard dictionary file
468 for SKK Japanese input systems, and various dictionary files.
469 @file{SKK-JISYO.L} can be used with @code{emacs-ddskk} or @code{uim} package.")
470 (license license:gpl2+))))