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