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 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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages dictionaries)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system python)
33 #:use-module (guix build-system trivial)
34 #:use-module (guix build-system copy)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages emacs)
40 #:use-module (gnu packages flex)
41 #:use-module (gnu packages fribidi)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages pcre)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages readline)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages tcl)
50 #:use-module (gnu packages xml))
59 (uri (string-append "mirror://gnu/vera/vera-" version
63 "1az0v563jja8xb4896jyr8yv7jd9zacqyfkjd7psb73v7clg1mzz"))))
64 (build-system trivial-build-system)
67 (use-modules (guix build utils))
69 (let* ((out (assoc-ref %outputs "out"))
70 (info (string-append out "/share/info"))
71 (html (string-append out "/share/html"))
72 (source (assoc-ref %build-inputs "source"))
73 (tar (assoc-ref %build-inputs "tar"))
74 (gz (assoc-ref %build-inputs "gzip"))
75 (texi (assoc-ref %build-inputs "texinfo")))
76 (setenv "PATH" (string-append gz "/bin"))
77 (invoke (string-append tar "/bin/tar") "xvf" source)
79 (chdir (string-append "vera-" ,version))
83 ;; XXX: Use '--force' because the document is unhappy
84 ;; with Texinfo 5 (yes, documents can be unhappy.)
85 (invoke (string-append texi "/bin/makeinfo")
86 "vera.texi" "--force" "-o"
87 (string-append info "/vera.info"))
88 (invoke (string-append texi "/bin/makeinfo")
89 "vera.texi" "--force" "--html" "-o"
90 (string-append html "/vera.html"))))
91 #:modules ((guix build utils))))
92 (native-inputs `(("texinfo" ,texinfo)
95 (home-page "https://savannah.gnu.org/projects/vera/")
96 (synopsis "List of acronyms")
98 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
99 acronyms distributed as an info document.")
100 (license license:fdl1.3+)))
109 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
112 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
113 (build-system copy-build-system)
116 '(("." "share/gcide/" #:exclude ("COPYING")))))
117 (synopsis "GNU Collaborative International Dictionary of English")
119 "GCIDE is a free dictionary based on a combination of sources. It can
120 be used via the GNU Dico program or accessed online at
121 http://gcide.gnu.org.ua/")
122 (home-page "https://gcide.gnu.org.ua/")
123 (license license:gpl3+)))
125 (define-public diction
126 ;; Not quite a dictionary, not quite a spell checker either…
133 (uri (string-append "http://www.moria.de/~michael/diction/diction-"
136 (base32 "1z6p5x3l1a00h4v4s33qa82fznzc1jdqdnlc4dnmd9nblnrjy0fs"))))
137 (build-system gnu-build-system)
138 (synopsis "Identifies wordy and commonly misused phrases")
140 "A package providing two classic Unix commands, style and diction.
141 Diction is used to identify wordy and commonly misused phrases in a
142 body of text. Style instead analyzes surface aspects of a written
143 work, such as sentence length and other readability measures.")
144 (home-page "https://www.gnu.org/software/diction/")
145 (license license:gpl3+)))
153 (uri (string-append "http://ftp.tu-chemnitz.de/pub/Local/urz/" name
154 "/" name "-" version ".tar.gz"))
157 "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq"))))
158 (build-system gnu-build-system)
159 (inputs `(("tk" ,tk)))
162 (modify-phases %standard-phases
168 (let ((bindir (string-append
169 (assoc-ref %outputs "out") "/bin"))
171 (assoc-ref %build-inputs "tk")
173 (sharedir (string-append
174 (assoc-ref %outputs "out")
175 "/share/applications"))
176 (libdir (string-append
177 (assoc-ref %outputs "out") "/lib")))
182 (substitute* "ding.desktop"
183 (("Exec=/usr/bin/ding")
184 (string-append "Exec=" bindir "/ding")))
185 (with-fluids ((%default-port-encoding "ISO-8859-1"))
186 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
187 (substitute* "install.sh"
190 (("NEEDPROG=\"wish\"")
191 (string-append "NEEDPROG=\"" wish "\""))
192 (("DEFBINDIR=\"/usr/local/bin\"")
193 (string-append "DEFBINDIR=\"" bindir "\""))
194 (("DEFLIBDIR=\"/usr/local/lib\"")
195 (string-append "DEFLIBDIR=\"" libdir "\"")))
196 (install-file "ding.desktop" sharedir)
197 (install-file "ding.png" sharedir)
198 (invoke "./install.sh")))))))
199 (synopsis "Dictionary lookup program with a German-English dictionary")
200 (description "Ding is a dictionary lookup program for the X window system.
201 It comes with a German-English dictionary with approximately 270,000 entries.")
202 (home-page "https://www-user.tu-chemnitz.de/~fri/ding/")
203 (license license:gpl2+)))
205 (define-public grammalecte
211 (method url-fetch/zipbomb)
212 (uri (string-append "https://grammalecte.net/grammalecte/zip/"
213 "Grammalecte-fr-v" version ".zip"))
215 (base32 "1aifa7rj8zyxgk5cgmlgcws2hip7a7y6sr7kddjdnpfgdgy4jjgh"))))
216 (build-system python-build-system)
217 (home-page "https://grammalecte.net")
218 (synopsis "French spelling and grammar checker")
219 (description "Grammalecte is a grammar checker for the French language,
220 derived from Lightproof.
222 Grammalecte helps writing a proper French, without distracting users with
223 false positives. This grammar checker follows the principle: the less false
224 positives, the better; if it cannot know with a good chance that a dubious
225 expression is wrong, it keeps silent.
227 The package provides the command line interface, along with a server
228 and a Python library.")
229 (license license:gpl3+)))
231 (define-public translate-shell
233 (name "translate-shell")
239 (url"https://github.com/soimort/translate-shell.git")
240 (commit (string-append "v" version))))
241 (file-name (git-file-name name version))
243 (base32 "075vqnha21rhr1b61dim7dqlfwm1yffyzcaa83s36rpk9r5sddzx"))))
244 (build-system gnu-build-system)
247 (modify-phases %standard-phases
248 (delete 'configure) ; no configure script
249 (add-after 'unpack 'remove-unnecessary-file
250 ;; This file gets generated during the build phase.
252 (delete-file "translate")
254 (add-after 'install 'wrap-binary
255 (lambda* (#:key inputs outputs #:allow-other-keys)
256 (let* ((out (assoc-ref outputs "out"))
257 (bin (string-append out "/bin/trans"))
258 (curl (assoc-ref inputs "curl"))
259 (fribidi (assoc-ref inputs "fribidi"))
260 (rlwrap (assoc-ref inputs "rlwrap")))
263 (,(string-append out "/bin:"
268 (add-after 'install 'emacs-install
269 (lambda* (#:key inputs outputs #:allow-other-keys)
270 (let* ((out (assoc-ref outputs "out"))
271 (dest (string-append out "/share/emacs/site-lisp"))
272 (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
273 (install-file "google-translate-mode.el" dest)
274 (emacs-generate-autoloads ,name dest)))))
275 #:make-flags (list (string-append "PREFIX=" %output)
276 "NETWORK_ACCESS=no test")
277 #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
278 #:modules ((guix build gnu-build-system)
279 (guix build emacs-utils)
281 #:test-target "test"))
287 `(("emacs" ,emacs-minimal)
288 ("util-linux" ,util-linux))) ; hexdump, for the test
289 (home-page "https://www.soimort.org/translate-shell/")
290 (synopsis "Translations from the command line")
292 "Translate Shell (formerly Google Translate CLI) is a command-line
293 translator powered by Google Translate (default), Bing Translator,
294 Yandex.Translate and Apertium. It gives you easy access to one of these
295 translation engines from your terminal.")
296 (license license:public-domain)))
298 (define-public lttoolbox
306 "https://github.com/apertium/lttoolbox/releases/download/v"
307 version "/lttoolbox-" version ".tar.gz"))
309 (base32 "14yyrkzyqlsrii3v3ggg4dyvwlrcqcqc0aprphz5781a44jsrcwz"))))
310 (build-system gnu-build-system)
313 (modify-phases %standard-phases
315 ;; The included ./autogen.sh unconditionally runs ./configure before
316 ;; its shebangs have been patched.
318 (invoke "autoreconf" "-vfi"))))))
320 `(("libxml2" ,libxml2)))
322 `(("autoconf" ,autoconf)
323 ("automake" ,automake)
325 ("pkg-config" ,pkg-config)))
326 (home-page "http://wiki.apertium.org/wiki/Lttoolbox")
327 (synopsis "Lexical processing toolbox")
328 (description "Lttoolbox is a toolbox for lexical processing, morphological
329 analysis and generation of words. Analysis is the process of splitting a
330 word (e.g. cats) into its lemma \"cat\" and the grammatical information
331 @code{<n><pl>}. Generation is the opposite process.")
332 (license (list license:gpl2 ; main license
333 license:expat)))) ; utf8/*
335 (define-public apertium
343 "https://github.com/apertium/apertium/releases/download/v"
344 version "/apertium-" version ".tar.gz"))
347 "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
348 (file-name (string-append name "-" version ".tar.gz"))))
349 (build-system gnu-build-system)
351 `(("libxml2" ,libxml2)
353 ("lttoolbox" ,lttoolbox)
360 (url "https://github.com/apertium/apertium-get")
361 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
364 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
366 ("pkg-config" ,pkg-config)
367 ;; python is only required for running the test suite
371 (modify-phases %standard-phases
372 ;; If apertium-get does not exist in the source tree, the build tries
373 ;; to download it using an svn checkout. To avoid this, copy
374 ;; apertium-get into the source tree.
375 (add-after 'unpack 'unpack-apertium-get
376 (lambda* (#:key inputs #:allow-other-keys)
377 (copy-recursively (assoc-ref inputs "apertium-get")
378 "apertium/apertium-get")
380 (home-page "https://www.apertium.org/")
381 (synopsis "Rule based machine translation system")
382 (description "Apertium is a rule based machine translation system
383 featuring a shallow-transfer machine translation engine. The design of the
384 system makes translations fast (translating tens of thousands of words per
385 second on ordinary desktop computers) and, in spite of the errors, reasonably
386 intelligible and easily correctable.")
387 (license (list license:gpl2 ; main license
388 license:expat)))) ; utf8/*