gnu: python-babel: Update to 2.7.0.
[guix.git] / gnu / packages / dictionaries.scm
blob9f4dc59cc8ff588949bfd61e5295791aed887e65
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, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
6 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
8 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages dictionaries)
26   #:use-module ((guix licenses) #:prefix license:)
27   #:use-module (guix packages)
28   #:use-module (guix download)
29   #:use-module (guix git-download)
30   #:use-module (guix build-system gnu)
31   #:use-module (guix build-system python)
32   #:use-module (guix build-system trivial)
33   #:use-module (gnu packages)
34   #:use-module (gnu packages autotools)
35   #:use-module (gnu packages base)
36   #:use-module (gnu packages curl)
37   #:use-module (gnu packages emacs)
38   #:use-module (gnu packages flex)
39   #:use-module (gnu packages fribidi)
40   #:use-module (gnu packages linux)
41   #:use-module (gnu packages pcre)
42   #:use-module (gnu packages pkg-config)
43   #:use-module (gnu packages python)
44   #:use-module (gnu packages readline)
45   #:use-module (gnu packages texinfo)
46   #:use-module (gnu packages compression)
47   #:use-module (gnu packages tcl)
48   #:use-module (gnu packages xml))
51 (define-public vera
52   (package
53     (name "vera")
54     (version "1.23")
55     (source (origin
56               (method url-fetch)
57               (uri (string-append "mirror://gnu/vera/vera-" version
58                                   ".tar.gz"))
59               (sha256
60                (base32
61                 "1az0v563jja8xb4896jyr8yv7jd9zacqyfkjd7psb73v7clg1mzz"))))
62     (build-system trivial-build-system)
63     (arguments
64      `(#:builder (begin
65                    (use-modules (guix build utils))
67                    (let* ((out    (assoc-ref %outputs "out"))
68                           (info   (string-append out "/share/info"))
69                           (html   (string-append out "/share/html"))
70                           (source (assoc-ref %build-inputs "source"))
71                           (tar    (assoc-ref %build-inputs "tar"))
72                           (gz     (assoc-ref %build-inputs "gzip"))
73                           (texi   (assoc-ref %build-inputs "texinfo")))
74                      (setenv "PATH" (string-append gz "/bin"))
75                      (invoke (string-append tar "/bin/tar") "xvf" source)
77                      (chdir (string-append "vera-" ,version))
78                      (mkdir-p info)
79                      (mkdir-p html)
81                      ;; XXX: Use '--force' because the document is unhappy
82                      ;; with Texinfo 5 (yes, documents can be unhappy.)
83                      (invoke (string-append texi "/bin/makeinfo")
84                              "vera.texi" "--force" "-o"
85                              (string-append info "/vera.info"))
86                      (invoke (string-append texi "/bin/makeinfo")
87                              "vera.texi" "--force" "--html" "-o"
88                              (string-append html "/vera.html"))))
89       #:modules ((guix build utils))))
90     (native-inputs `(("texinfo" ,texinfo)
91                      ("tar" ,tar)
92                      ("gzip" ,gzip)))
93     (home-page "https://savannah.gnu.org/projects/vera/")
94     (synopsis "List of acronyms")
95     (description
96      "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
97 acronyms distributed as an info document.")
98     (license license:fdl1.3+)))
100 (define-public gcide
101   (package
102     (name "gcide")
103     (version "0.52")
104     (source (origin
105               (method url-fetch)
106               (uri (string-append
107                     "mirror://gnu/gcide/gcide-" version ".tar.xz"))
108               (sha256
109                (base32
110                 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
111     (build-system trivial-build-system)
112     (arguments
113      '(#:builder (begin
114                    (use-modules (guix build utils))
115                    (let* ((src     (assoc-ref %build-inputs "source"))
116                           (tar     (assoc-ref %build-inputs "tar"))
117                           (xz      (assoc-ref %build-inputs "xz"))
118                           (out     (assoc-ref %outputs "out"))
119                           (datadir (string-append out "/share/gcide")))
120                      (set-path-environment-variable "PATH" '("bin")
121                                                     (list tar xz))
122                      (mkdir-p datadir)
123                      (invoke "tar" "-C" datadir
124                              "--strip-components=1"
125                              "-xvf" src)))
126        #:modules ((guix build utils))))
127     (native-inputs
128      `(("tar" ,tar)
129        ("xz" ,xz)))
130     (synopsis "GNU Collaborative International Dictionary of English")
131     (description
132      "GCIDE is a free dictionary based on a combination of sources.  It can
133 be used via the GNU Dico program or accessed online at
134 http://gcide.gnu.org.ua/")
135     (home-page "http://gcide.gnu.org.ua/")
136     (license license:gpl3+)))
138 (define-public diction
139   ;; Not quite a dictionary, not quite a spell checker either…
140   (package
141     (name "diction")
142     (version "1.11")
143     (source (origin
144               (method url-fetch)
145               (uri (string-append "mirror://gnu/diction/diction-"
146                                   version ".tar.gz"))
147               (sha256
148                (base32
149                 "1xi4l1x1vvzmzmbhpx0ghmfnwwrhabjwizrpyylmy3fzinzz3him"))))
150     (build-system gnu-build-system)
151     (synopsis "Identifies wordy and commonly misused phrases")
152     (description
153      "A package providing two classic Unix commands, style and diction.
154 Diction is used to identify wordy and commonly misused phrases in a
155 body of text.  Style instead analyzes surface aspects of a written
156 work, such as sentence length and other readability measures.")
157     (home-page "https://www.gnu.org/software/diction/")
158     (license license:gpl3+)))
160 (define-public ding
161   (package
162     (name "ding")
163     (version "1.8.1")
164     (source (origin
165               (method url-fetch)
166               (uri (string-append "http://ftp.tu-chemnitz.de/pub/Local/urz/" name
167                                   "/" name "-" version ".tar.gz"))
168               (sha256
169                (base32
170                 "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq"))))
171     (build-system gnu-build-system)
172     (inputs `(("tk" ,tk)))
173     (arguments
174      `(#:phases
175        (modify-phases %standard-phases
176          (delete 'configure)
177          (delete 'build)
178          (delete 'check)
179          (replace 'install
180            (lambda _
181              (let ((bindir (string-append
182                             (assoc-ref %outputs "out") "/bin"))
183                    (wish (string-append
184                           (assoc-ref %build-inputs "tk")
185                           "/bin/wish8.6"))
186                    (sharedir (string-append
187                               (assoc-ref %outputs "out")
188                               "/share/applications"))
189                    (libdir (string-append
190                             (assoc-ref %outputs "out") "/lib")))
191                (mkdir-p bindir)
192                (mkdir-p libdir)
193                (mkdir-p sharedir)
195                (substitute* "ding.desktop"
196                  (("Exec=/usr/bin/ding")
197                   (string-append "Exec=" bindir "/ding")))
198                (with-fluids ((%default-port-encoding "ISO-8859-1"))
199                  (substitute* "ding" (("exec wish") (string-append "exec " wish))))
200                (substitute* "install.sh"
201                  (("/bin/cp") "cp")
202                  (("/bin/mv") "mv")
203                  (("NEEDPROG=\"wish\"")
204                   (string-append "NEEDPROG=\"" wish "\""))
205                  (("DEFBINDIR=\"/usr/local/bin\"")
206                   (string-append "DEFBINDIR=\"" bindir "\""))
207                  (("DEFLIBDIR=\"/usr/local/lib\"")
208                   (string-append "DEFLIBDIR=\"" libdir "\"")))
209                (install-file "ding.desktop" sharedir)
210                (install-file "ding.png" sharedir)
211                (invoke "./install.sh")))))))
212     (synopsis "Dictionary lookup program with a German-English dictionary")
213     (description "Ding is a dictionary lookup program for the X window system.
214 It comes with a German-English dictionary with approximately 270,000 entries.")
215     (home-page  "http://www-user.tu-chemnitz.de/~fri/ding/")
216     (license license:gpl2+)))
218 (define-public grammalecte
219   (package
220     (name "grammalecte")
221     (version "1.1.1")
222     (source
223      (origin
224        (method url-fetch/zipbomb)
225        (uri (string-append "https://grammalecte.net/grammalecte/zip/"
226                            "Grammalecte-fr-v" version ".zip"))
227        (sha256
228         (base32
229          "1al4c3976wgxijxghxqb1banarj82hwad51kln87xj2r5kwcfm05"))))
230     (build-system python-build-system)
231     (home-page "https://grammalecte.net")
232     (synopsis  "French spelling and grammar checker")
233     (description "Grammalecte is a grammar checker dedicated to the French
234 language, derived from Lightproof.
236 Grammalecte aims at helping to write a proper French without distracting users
237 with false positives.  This grammar checker follows the principle: the less
238 false positives, the better; if it cannot know with a good chance if
239 a dubious expression is wrong, it will keep silent.
241 The package provides the command line interface, along with a server
242 and a Python library.")
243     (license license:gpl3+)))
245 (define-public translate-shell
246   (package
247     (name "translate-shell")
248     (version "0.9.6.10")
249     (source
250       (origin
251         (method git-fetch)
252         (uri (git-reference
253                (url"https://github.com/soimort/translate-shell.git")
254                (commit (string-append "v" version))))
255         (file-name (git-file-name name version))
256         (sha256
257          (base32 "1dmh3flldfhnqfay3a6c5hanqcjwrmbly1bq8mlk022qfi1fv33y"))))
258     (build-system gnu-build-system)
259     (arguments
260      `(#:phases
261        (modify-phases %standard-phases
262          (delete 'configure)            ; no configure script
263          (add-after 'unpack 'remove-unnecessary-file
264            ;; This file gets generated during the build phase.
265            (lambda _
266              (delete-file "translate")
267              #t))
268          (add-after 'install 'wrap-binary
269            (lambda* (#:key inputs outputs #:allow-other-keys)
270              (let* ((out     (assoc-ref outputs "out"))
271                     (bin     (string-append out "/bin/trans"))
272                     (curl    (assoc-ref inputs "curl"))
273                     (fribidi (assoc-ref inputs "fribidi"))
274                     (rlwrap  (assoc-ref inputs "rlwrap")))
275                (wrap-program bin
276                              `("PATH" ":" prefix
277                                (,(string-append out "/bin:"
278                                                 curl "/bin:"
279                                                 fribidi "/bin:"
280                                                 rlwrap "/bin")))))
281              #t))
282          (add-after 'install 'emacs-install
283            (lambda* (#:key inputs outputs #:allow-other-keys)
284              (let* ((out   (assoc-ref outputs "out"))
285                     (dest  (string-append out "/share/emacs/site-lisp/guix.d/"
286                                           ,name "-" ,version))
287                     (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
288                (install-file "google-translate-mode.el" dest)
289                (emacs-generate-autoloads ,name dest)))))
290        #:make-flags (list (string-append "PREFIX=" %output)
291                           "NETWORK_ACCESS=no test")
292        #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
293        #:modules ((guix build gnu-build-system)
294                   (guix build emacs-utils)
295                   (guix build utils))
296        #:test-target "test"))
297     (inputs
298      `(("curl" ,curl)
299        ("fribidi" ,fribidi)
300        ("rlwrap" ,rlwrap)))
301     (native-inputs
302      `(("emacs" ,emacs-minimal)
303        ("util-linux" ,util-linux)))     ; hexdump, for the test
304     (home-page "https://www.soimort.org/translate-shell/")
305     (synopsis "Translations from the command line")
306     (description
307      "Translate Shell (formerly Google Translate CLI) is a command-line
308 translator powered by Google Translate (default), Bing Translator,
309 Yandex.Translate and Apertium.  It gives you easy access to one of these
310 translation engines from your terminal.")
311     (license license:public-domain)))
313 (define-public lttoolbox
314   (package
315     (name "lttoolbox")
316     (version "3.5.0")
317     (source
318      (origin
319        (method url-fetch)
320        (uri (string-append
321              "https://github.com/apertium/lttoolbox/releases/download/v"
322              version "/lttoolbox-" version ".tar.gz"))
323        (sha256
324         (base32
325          "08y6pf1hl7prwygy1g8h6ndqww18pmb9f3r5988q0pcrp8w6xz6b"))
326        (file-name (string-append name "-" version ".tar.gz"))))
327     (build-system gnu-build-system)
328     (inputs
329      `(("libxml2" ,libxml2)))
330     (native-inputs
331      `(("pkg-config" ,pkg-config)))
332     (home-page "http://wiki.apertium.org/wiki/Lttoolbox")
333     (synopsis "Lexical processing toolbox")
334     (description "Lttoolbox is a toolbox for lexical processing, morphological
335 analysis and generation of words.  Analysis is the process of splitting a
336 word (e.g. cats) into its lemma \"cat\" and the grammatical information
337 @code{<n><pl>}.  Generation is the opposite process.")
338     (license (list license:gpl2 ; main license
339                    license:expat)))) ; utf8/*
341 (define-public apertium
342   (package
343     (name "apertium")
344     (version "3.5.2")
345     (source
346      (origin
347        (method url-fetch)
348        (uri (string-append
349              "https://github.com/apertium/apertium/releases/download/v"
350              version "/apertium-" version ".tar.gz"))
351        (sha256
352         (base32
353          "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
354        (file-name (string-append name "-" version ".tar.gz"))))
355     (build-system gnu-build-system)
356     (inputs
357      `(("libxml2" ,libxml2)
358        ("libxslt" ,libxslt)
359        ("lttoolbox" ,lttoolbox)
360        ("pcre" ,pcre)))
361     (native-inputs
362      `(("apertium-get"
363         ,(origin
364            (method git-fetch)
365            (uri (git-reference
366                  (url "https://github.com/apertium/apertium-get")
367                  (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
368            (sha256
369             (base32
370              "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
371        ("flex" ,flex)
372        ("pkg-config" ,pkg-config)
373        ;; python is only required for running the test suite
374        ("python" ,python)))
375     (arguments
376      `(#:phases
377        (modify-phases %standard-phases
378          ;; If apertium-get does not exist in the source tree, the build tries
379          ;; to download it using an svn checkout. To avoid this, copy
380          ;; apertium-get into the source tree.
381          (add-after 'unpack 'unpack-apertium-get
382            (lambda* (#:key inputs #:allow-other-keys)
383              (copy-recursively (assoc-ref inputs "apertium-get")
384                                "apertium/apertium-get")
385              #t)))))
386     (home-page "https://www.apertium.org/")
387     (synopsis "Rule based machine translation system")
388     (description "Apertium is a rule based machine translation system
389 featuring a shallow-transfer machine translation engine.  The design of the
390 system makes translations fast (translating tens of thousands of words per
391 second on ordinary desktop computers) and, in spite of the errors, reasonably
392 intelligible and easily correctable.")
393     (license (list license:gpl2 ; main license
394                    license:expat)))) ; utf8/*