1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2017, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages dictionaries)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system python)
29 #:use-module (guix build-system trivial)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages curl)
33 #:use-module (gnu packages emacs)
34 #:use-module (gnu packages fribidi)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages readline)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages tcl))
48 (uri (string-append "mirror://gnu/vera/vera-" version
52 "1az0v563jja8xb4896jyr8yv7jd9zacqyfkjd7psb73v7clg1mzz"))))
53 (build-system trivial-build-system)
56 (use-modules (guix build utils))
58 (let* ((out (assoc-ref %outputs "out"))
59 (info (string-append out "/share/info"))
60 (html (string-append out "/share/html"))
61 (source (assoc-ref %build-inputs "source"))
62 (tar (assoc-ref %build-inputs "tar"))
63 (gz (assoc-ref %build-inputs "gzip"))
64 (texi (assoc-ref %build-inputs "texinfo")))
65 (setenv "PATH" (string-append gz "/bin"))
66 (system* (string-append tar "/bin/tar") "xvf" source)
68 (chdir (string-append "vera-" ,version))
72 ;; XXX: Use '--force' because the document is unhappy
73 ;; with Texinfo 5 (yes, documents can be unhappy.)
75 (system* (string-append texi "/bin/makeinfo")
76 "vera.texi" "--force" "-o"
77 (string-append info "/vera.info")))
79 (system* (string-append texi "/bin/makeinfo")
80 "vera.texi" "--force" "--html" "-o"
81 (string-append html "/vera.html"))))))
82 #:modules ((guix build utils))))
83 (native-inputs `(("texinfo" ,texinfo)
86 (home-page "https://savannah.gnu.org/projects/vera/")
87 (synopsis "List of acronyms")
89 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
90 acronyms distributed as an info document.")
100 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
103 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
104 (build-system trivial-build-system)
107 (use-modules (guix build utils))
108 (let* ((src (assoc-ref %build-inputs "source"))
109 (tar (assoc-ref %build-inputs "tar"))
110 (xz (assoc-ref %build-inputs "xz"))
111 (out (assoc-ref %outputs "out"))
112 (datadir (string-append out "/share/gcide")))
113 (set-path-environment-variable "PATH" '("bin")
116 (zero? (system* "tar" "-C" datadir
117 "--strip-components=1"
119 #:modules ((guix build utils))))
123 (synopsis "GNU Collaborative International Dictionary of English")
125 "GCIDE is a free dictionary based on a combination of sources. It can
126 be used via the GNU Dico program or accessed online at
127 http://gcide.gnu.org.ua/")
128 (home-page "http://gcide.gnu.org.ua/")
131 (define-public diction
132 ;; Not quite a dictionary, not quite a spell checker either…
138 (uri (string-append "mirror://gnu/diction/diction-"
142 "1xi4l1x1vvzmzmbhpx0ghmfnwwrhabjwizrpyylmy3fzinzz3him"))))
143 (build-system gnu-build-system)
144 (synopsis "Identifies wordy and commonly misused phrases")
146 "A package providing two classic Unix commands, style and diction.
147 Diction is used to identify wordy and commonly misused phrases in a
148 body of text. Style instead analyzes surface aspects of a written
149 work, such as sentence length and other readability measures.")
150 (home-page "https://www.gnu.org/software/diction/")
159 (uri (string-append "http://ftp.tu-chemnitz.de/pub/Local/urz/" name
160 "/" name "-" version ".tar.gz"))
163 "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq"))))
164 (build-system gnu-build-system)
165 (inputs `(("tk" ,tk)))
168 (modify-phases %standard-phases
175 (let ((bindir (string-append
176 (assoc-ref %outputs "out") "/bin"))
178 (assoc-ref %build-inputs "tk")
180 (sharedir (string-append
181 (assoc-ref %outputs "out")
182 "/share/applications"))
183 (libdir (string-append
184 (assoc-ref %outputs "out") "/lib")))
189 (substitute* "ding.desktop"
190 (("Exec=/usr/bin/ding")
191 (string-append "Exec=" bindir "/ding")))
192 (with-fluids ((%default-port-encoding "ISO-8859-1"))
193 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
194 (substitute* "install.sh"
197 (("NEEDPROG=\"wish\"")
198 (string-append "NEEDPROG=\"" wish "\""))
199 (("DEFBINDIR=\"/usr/local/bin\"")
200 (string-append "DEFBINDIR=\"" bindir "\""))
201 (("DEFLIBDIR=\"/usr/local/lib\"")
202 (string-append "DEFLIBDIR=\"" libdir "\"")))
203 (install-file "ding.desktop" sharedir)
204 (install-file "ding.png" sharedir)
206 (system* "./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 "http://www-user.tu-chemnitz.de/~fri/ding/")
213 (define-public grammalecte
219 (method url-fetch/zipbomb)
220 (uri (string-append "https://www.dicollecte.org/grammalecte/zip/"
221 "Grammalecte-fr-v" version ".zip"))
224 "13var1gi3gb2bwi7k21bn2pla0rs17cd7kc3mc5a2nsyqgsrzxfw"))))
225 (build-system python-build-system)
226 (home-page "https://www.dicollecte.org")
227 (synopsis "French spelling and grammar checker")
228 (description "Grammalecte is a grammar checker dedicated to the French
229 language, derived from Lightproof.
231 Grammalecte aims at helping to write a proper French without distracting users
232 with false positives. This grammar checker follows the principle: the less
233 false positives, the better; if it cannot know with a good chance if
234 a dubious expression is wrong, it will keep silent.
236 The package provides the command line interface, along with a server
237 and a Python library.")
240 (define-public translate-shell
242 (name "translate-shell")
247 (uri (string-append "https://github.com/soimort/" name "/archive/v"
251 "0inv6r3qbihn2ff1sgcly89r04k4vgcbvvyl50ln0mxlapbhpy95"))
252 (patches (search-patches "translate-shell-fix-curl-tests.patch"))
253 (file-name (string-append name "-" version ".tar.gz"))))
254 (build-system gnu-build-system)
257 (modify-phases %standard-phases
258 (delete 'configure) ; no configure phase
259 (add-after 'install 'emacs-install
260 (lambda* (#:key inputs outputs #:allow-other-keys)
261 (let* ((out (assoc-ref outputs "out"))
262 (dest (string-append out "/share/emacs/site-lisp"))
263 (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
264 (install-file "google-translate-mode.el" dest)
265 (emacs-generate-autoloads ,name dest)))))
266 #:make-flags (list (string-append "PREFIX=" %output)
267 "NETWORK_ACCESS=no test")
268 #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
269 #:modules ((guix build gnu-build-system)
270 (guix build emacs-utils)
272 #:test-target "test"))
278 `(("emacs" ,emacs-minimal)
279 ("util-linux" ,util-linux))) ; hexdump, for the test
280 (home-page "https://www.soimort.org/translate-shell/")
281 (synopsis "Translations from the command line")
283 "Translate Shell (formerly Google Translate CLI) is a command-line
284 translator powered by Google Translate (default), Bing Translator,
285 Yandex.Translate and Apertium. It gives you easy access to one of these
286 translation engines from your terminal.")
287 (license public-domain)))