1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018, 2020 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>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
27 (define-module (gnu packages dictionaries)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
34 #:use-module (guix build-system trivial)
35 #:use-module (guix build-system copy)
36 #:use-module (guix build-system cmake)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages emacs)
42 #:use-module (gnu packages flex)
43 #:use-module (gnu packages fribidi)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages pcre)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages readline)
52 #:use-module (gnu packages texinfo)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages tcl)
55 #:use-module (gnu packages xml))
64 (uri (string-append "mirror://gnu/vera/vera-" version
68 "1j5p679vw72bv766acbg6g89k31ynmrzlpg7s3wzy4krlwdf92xc"))))
69 (build-system trivial-build-system)
72 (use-modules (guix build utils))
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"))
82 (invoke (string-append tar "/bin/tar") "xvf" source)
84 (chdir (string-append "vera-" ,version))
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//)’.
92 (("320.480") "320x480"))
94 ;; XXX: Use '--force' because the document is unhappy
95 ;; with Texinfo 5 (yes, documents can be unhappy.)
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"))))
102 #:modules ((guix build utils))))
103 (native-inputs `(("texinfo" ,texinfo)
106 (home-page "https://savannah.gnu.org/projects/vera/")
107 (synopsis "List of acronyms")
109 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
110 acronyms distributed as an info document.")
111 (license license:fdl1.3+)))
120 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
123 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
124 (build-system copy-build-system)
127 '(("." "share/gcide/" #:exclude ("COPYING")))))
128 (synopsis "GNU Collaborative International Dictionary of English")
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/")
133 (home-page "https://gcide.gnu.org.ua/")
134 (license license:gpl3+)))
136 (define-public diction
137 ;; Not quite a dictionary, not quite a spell checker either…
144 (uri (string-append "http://www.moria.de/~michael/diction/diction-"
147 (base32 "1z6p5x3l1a00h4v4s33qa82fznzc1jdqdnlc4dnmd9nblnrjy0fs"))))
148 (build-system gnu-build-system)
149 (synopsis "Identifies wordy and commonly misused phrases")
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/")
156 (license license:gpl3+)))
164 (uri (string-append "http://ftp.tu-chemnitz.de/pub/Local/urz/" name
165 "/" name "-" version ".tar.gz"))
168 "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq"))))
169 (build-system gnu-build-system)
170 (inputs `(("tk" ,tk)))
173 (modify-phases %standard-phases
179 (let ((bindir (string-append
180 (assoc-ref %outputs "out") "/bin"))
182 (assoc-ref %build-inputs "tk")
184 (sharedir (string-append
185 (assoc-ref %outputs "out")
186 "/share/applications"))
187 (libdir (string-append
188 (assoc-ref %outputs "out") "/lib")))
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"
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)
209 (invoke "./install.sh")))))))
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.")
213 (home-page "https://www-user.tu-chemnitz.de/~fri/ding/")
214 (license license:gpl2+)))
216 (define-public grammalecte
222 (method url-fetch/zipbomb)
223 (uri (string-append "https://grammalecte.net/grammalecte/zip/"
224 "Grammalecte-fr-v" version ".zip"))
226 (base32 "076jv3ywdgqqzg92bfbagc7ypy08xjq5zn4vgna6j9350fkfqhzn"))))
227 (build-system python-build-system)
228 (home-page "https://grammalecte.net")
229 (synopsis "French spelling and grammar checker")
230 (description "Grammalecte is a grammar checker for the French language,
231 derived from Lightproof.
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.
238 The package provides the command line interface, along with a server
239 and a Python library.")
240 (license license:gpl3+)))
242 (define-public translate-shell
244 (name "translate-shell")
250 (url"https://github.com/soimort/translate-shell")
251 (commit (string-append "v" version))))
252 (file-name (git-file-name name version))
254 (base32 "075vqnha21rhr1b61dim7dqlfwm1yffyzcaa83s36rpk9r5sddzx"))))
255 (build-system gnu-build-system)
258 (modify-phases %standard-phases
259 (delete 'configure) ; no configure script
260 (add-after 'unpack 'remove-unnecessary-file
261 ;; This file gets generated during the build phase.
263 (delete-file "translate")
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")))
274 (,(string-append out "/bin:"
279 (add-after 'install 'emacs-install
280 (lambda* (#:key inputs outputs #:allow-other-keys)
281 (let* ((out (assoc-ref outputs "out"))
282 (dest (string-append out "/share/emacs/site-lisp"))
283 (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
284 (install-file "google-translate-mode.el" dest)
285 (emacs-generate-autoloads ,name dest)))))
286 #:make-flags (list (string-append "PREFIX=" %output)
287 "NETWORK_ACCESS=no test")
288 #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
289 #:modules ((guix build gnu-build-system)
290 (guix build emacs-utils)
292 #:test-target "test"))
298 `(("emacs" ,emacs-minimal)
299 ("util-linux" ,util-linux))) ; hexdump, for the test
300 (home-page "https://www.soimort.org/translate-shell/")
301 (synopsis "Translations from the command line")
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.")
307 (license license:public-domain)))
309 (define-public lttoolbox
317 "https://github.com/apertium/lttoolbox/releases/download/v"
318 version "/lttoolbox-" version ".tar.bz2"))
320 (base32 "109l91ailish1a3vya5zmfg3kb67cwyzl36ndnh8f59chsbm6n2f"))))
321 (build-system gnu-build-system)
324 (modify-phases %standard-phases
326 ;; The included ./autogen.sh unconditionally runs ./configure before
327 ;; its shebangs have been patched.
329 (invoke "autoreconf" "-vfi"))))))
331 `(("libxml2" ,libxml2)))
333 `(("autoconf" ,autoconf)
334 ("automake" ,automake)
336 ("pkg-config" ,pkg-config)))
337 (home-page "https://wiki.apertium.org/wiki/Lttoolbox")
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/*
346 (define-public apertium
354 "https://github.com/apertium/apertium/releases/download/v"
355 version "/apertium-" version ".tar.gz"))
358 "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
359 (file-name (string-append name "-" version ".tar.gz"))))
360 (build-system gnu-build-system)
362 `(("libxml2" ,libxml2)
364 ("lttoolbox" ,lttoolbox)
371 (url "https://github.com/apertium/apertium-get")
372 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
375 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
377 ("pkg-config" ,pkg-config)
378 ;; python is only required for running the test suite
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")
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/*
409 (url "https://github.com/Dushistov/sdcv/")
410 (commit (string-append "v" version))))
411 (file-name (git-file-name name version))
414 "144qpl9b8r2php0zhi9b7vg6flpvdgjy6yfaipydwwhxi4wy9600"))))
415 (build-system cmake-build-system)
417 `(#:configure-flags '("-DBUILD_TESTS=YES")
419 (modify-phases %standard-phases
420 (add-after 'build 'build-lang
422 (invoke "make" "lang")))
423 (add-before 'check 'pre-check
425 (setenv "HOME" (getcwd))
427 (add-after 'unpack 'remove-jq-requirement
429 ;; We don't want to bring in jq for one test.
430 (substitute* "tests/t_json"
434 `(("gettext" ,gettext-minimal)
435 ("pkg-config" ,pkg-config)))
439 ("readline" ,readline)
441 ;; If you use Guix to package and install dictionary data,
442 ;; you need this variable to load them.
444 (list (search-path-specification
445 (variable "STARDICT_DATA_DIR")
446 (files '("share/stardict/dic")))))
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+)))