1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016, 2021 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018, 2020-2022 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>
11 ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages dictionaries)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (guix build-system trivial)
36 #:use-module (guix build-system copy)
37 #:use-module (guix build-system cmake)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages emacs)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages fribidi)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages pcre)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages texinfo)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages tcl)
56 #:use-module (gnu packages xml))
65 (uri (string-append "mirror://gnu/vera/vera-" version
69 "1j5p679vw72bv766acbg6g89k31ynmrzlpg7s3wzy4krlwdf92xc"))))
70 (build-system trivial-build-system)
73 (use-modules (guix build utils))
75 (let* ((out (assoc-ref %outputs "out"))
76 (info (string-append out "/share/info"))
77 (html (string-append out "/share/html"))
78 (source (assoc-ref %build-inputs "source"))
79 (tar (assoc-ref %build-inputs "tar"))
80 (gz (assoc-ref %build-inputs "gzip"))
81 (texi (assoc-ref %build-inputs "texinfo")))
82 (setenv "PATH" (string-append gz "/bin"))
83 (invoke (string-append tar "/bin/tar") "xvf" source)
85 (chdir (string-append "vera-" ,version))
89 ;; Change a ‘Malformed UTF-8 character: \xd7\x34 (unexpected
90 ;; non-continuation byte 0x34, immediately after start byte
91 ;; 0xd7; need 2 bytes, got 1) in pattern match (m//)’.
93 (("320.480") "320x480"))
95 ;; XXX: Use '--force' because the document is unhappy
96 ;; with Texinfo 5 (yes, documents can be unhappy.)
97 (invoke (string-append texi "/bin/makeinfo")
98 "vera.texi" "--force" "-o"
99 (string-append info "/vera.info"))
100 (invoke (string-append texi "/bin/makeinfo")
101 "vera.texi" "--force" "--html" "-o"
102 (string-append html "/vera.html"))))
103 #:modules ((guix build utils))))
104 (native-inputs (list texinfo tar gzip))
105 (home-page "https://savannah.gnu.org/projects/vera/")
106 (synopsis "List of acronyms")
108 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
109 acronyms distributed as an info document.")
110 (license license:fdl1.3+)))
119 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
122 "17rigzfmih5i1z5s5v1hdr1jw8rngf40768kblnh5kp19ncbvb6k"))))
123 (build-system copy-build-system)
126 '(("." "share/gcide/" #:exclude ("COPYING")))))
127 (synopsis "GNU Collaborative International Dictionary of English")
129 "GCIDE is a free dictionary based on a combination of sources. It can
130 be used via the GNU Dico program or accessed online at
131 http://gcide.gnu.org.ua/")
132 (home-page "https://gcide.gnu.org.ua/")
133 (license license:gpl3+)))
135 (define-public diction
136 ;; Not quite a dictionary, not quite a spell checker either…
143 (uri (string-append "http://www.moria.de/~michael/diction/diction-"
146 (base32 "1z6p5x3l1a00h4v4s33qa82fznzc1jdqdnlc4dnmd9nblnrjy0fs"))))
147 (build-system gnu-build-system)
148 (synopsis "Identifies wordy and commonly misused phrases")
150 "A package providing two classic Unix commands, style and diction.
151 Diction is used to identify wordy and commonly misused phrases in a
152 body of text. Style instead analyzes surface aspects of a written
153 work, such as sentence length and other readability measures.")
154 (home-page "https://www.gnu.org/software/diction/")
155 (license license:gpl3+)))
163 (uri (string-append "https://ftp.tu-chemnitz.de/pub/Local/urz/" name
164 "/" name "-" version ".tar.gz"))
167 "1rcqn04l6hvsf15mqqai533p31nc04r2yd9s0mn2hnkqrwgwi9k9"))))
168 (build-system gnu-build-system)
172 (modify-phases %standard-phases
177 (lambda* (#:key inputs #:allow-other-keys)
178 (let ((bindir (string-append
179 (assoc-ref %outputs "out") "/bin"))
180 (wish (search-input-file inputs "/bin/wish8.6"))
181 (sharedir (string-append
182 (assoc-ref %outputs "out")
183 "/share/applications"))
184 (libdir (string-append
185 (assoc-ref %outputs "out") "/lib")))
190 (substitute* "ding.desktop"
191 (("Exec=/usr/bin/ding")
192 (string-append "Exec=" bindir "/ding")))
193 (with-fluids ((%default-port-encoding "ISO-8859-1"))
194 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
195 (substitute* "install.sh"
198 (("NEEDPROG=\"wish\"")
199 (string-append "NEEDPROG=\"" wish "\""))
200 (("DEFBINDIR=\"/usr/local/bin\"")
201 (string-append "DEFBINDIR=\"" bindir "\""))
202 (("DEFLIBDIR=\"/usr/local/lib\"")
203 (string-append "DEFLIBDIR=\"" libdir "\"")))
204 (install-file "ding.desktop" sharedir)
205 (install-file "ding.png" sharedir)
206 (invoke "./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 "https://www-user.tu-chemnitz.de/~fri/ding/")
211 (license license:gpl2+)))
213 (define-public grammalecte
219 (method url-fetch/zipbomb)
220 (uri (string-append "https://grammalecte.net/grammalecte/zip/"
221 "Grammalecte-fr-v" version ".zip"))
223 (base32 "076jv3ywdgqqzg92bfbagc7ypy08xjq5zn4vgna6j9350fkfqhzn"))))
224 (build-system python-build-system)
225 (home-page "https://grammalecte.net")
226 (synopsis "French spelling and grammar checker")
227 (description "Grammalecte is a grammar checker for the French language,
228 derived from Lightproof.
230 Grammalecte helps writing a proper French, without distracting users with
231 false positives. This grammar checker follows the principle: the less false
232 positives, the better; if it cannot know with a good chance that a dubious
233 expression is wrong, it keeps silent.
235 The package provides the command line interface, along with a server
236 and a Python library.")
237 (license license:gpl3+)))
239 (define-public translate-shell
241 (name "translate-shell")
247 (url"https://github.com/soimort/translate-shell")
248 (commit (string-append "v" version))))
249 (file-name (git-file-name name version))
251 (base32 "03p00v8g0y2xs3sza2r2kmhwiajaz9viab6xk9snw7chzw2cddiq"))))
252 (build-system gnu-build-system)
255 (modify-phases %standard-phases
256 (delete 'configure) ; no configure script
257 (add-after 'unpack 'remove-unnecessary-file
258 ;; This file gets generated during the build phase.
260 (delete-file "translate")))
261 (add-after 'install 'wrap-binary
262 (lambda* (#:key inputs outputs #:allow-other-keys)
263 (let* ((out (assoc-ref outputs "out"))
264 (bin (string-append out "/bin/trans"))
265 (curl (assoc-ref inputs "curl"))
266 (fribidi (assoc-ref inputs "fribidi"))
267 (rlwrap (assoc-ref inputs "rlwrap")))
270 (,(string-append out "/bin:"
274 (add-after 'install 'emacs-install
275 (assoc-ref emacs:%standard-phases 'install))
276 (add-after 'emacs-install 'emacs-make-autoloads
277 (assoc-ref emacs:%standard-phases 'make-autoloads))
278 (add-after 'emacs-make-autoloads 'emacs-autoloads-compilation
279 (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation)))
280 #:make-flags (list (string-append "PREFIX=" %output)
281 "NETWORK_ACCESS=no test")
282 #:imported-modules (,@%gnu-build-system-modules
283 (guix build emacs-build-system)
284 (guix build emacs-utils))
285 #:modules ((guix build gnu-build-system)
286 ((guix build emacs-build-system) #:prefix emacs:)
288 #:test-target "test"))
290 (list curl fribidi rlwrap))
292 `(("emacs" ,emacs-minimal)
293 ("util-linux" ,util-linux))) ; hexdump, for the test
294 (home-page "https://www.soimort.org/translate-shell/")
295 (synopsis "Translations from the command line")
297 "Translate Shell (formerly Google Translate CLI) is a command-line
298 translator powered by Google Translate (default), Bing Translator,
299 Yandex.Translate and Apertium. It gives you easy access to one of these
300 translation engines from your terminal.")
301 (license license:public-domain)))
303 (define-public lttoolbox
311 "https://github.com/apertium/lttoolbox/releases/download/v"
312 version "/lttoolbox-" version ".tar.xz"))
314 (base32 "0kn9xg9sc64amd6ah5gi4qij0bhfbmc2jjvxbjjrsdd8iq054cgm"))))
315 (build-system gnu-build-system)
318 (list "--disable-static")
320 (modify-phases %standard-phases
322 ;; The included ./autogen.sh unconditionally runs ./configure before
323 ;; its shebangs have been patched.
325 (invoke "autoreconf" "-vfi"))))))
329 (list autoconf automake libtool pkg-config))
330 (home-page "https://wiki.apertium.org/wiki/Lttoolbox")
331 (synopsis "Lexical processing toolbox")
332 (description "Lttoolbox is a toolbox for lexical processing, morphological
333 analysis and generation of words. Analysis is the process of splitting a
334 word (e.g. cats) into its lemma \"cat\" and the grammatical information
335 @code{<n><pl>}. Generation is the opposite process.")
336 (license (list license:gpl2 ; main license
337 license:expat)))) ; utf8/*
339 (define-public apertium
347 "https://github.com/apertium/apertium/releases/download/v"
348 version "/apertium-" version ".tar.gz"))
351 "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
352 (file-name (string-append name "-" version ".tar.gz"))))
353 (build-system gnu-build-system)
355 (list libxml2 libxslt lttoolbox pcre))
361 (url "https://github.com/apertium/apertium-get")
362 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
365 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
367 ("pkg-config" ,pkg-config)
368 ;; python is only required for running the test suite
372 (modify-phases %standard-phases
373 ;; If apertium-get does not exist in the source tree, the build tries
374 ;; to download it using an svn checkout. To avoid this, copy
375 ;; apertium-get into the source tree.
376 (add-after 'unpack 'unpack-apertium-get
377 (lambda* (#:key inputs #:allow-other-keys)
378 (copy-recursively (assoc-ref inputs "apertium-get")
379 "apertium/apertium-get")
381 (home-page "https://www.apertium.org/")
382 (synopsis "Rule based machine translation system")
383 (description "Apertium is a rule based machine translation system
384 featuring a shallow-transfer machine translation engine. The design of the
385 system makes translations fast (translating tens of thousands of words per
386 second on ordinary desktop computers) and, in spite of the errors, reasonably
387 intelligible and easily correctable.")
388 (license (list license:gpl2 ; main license
389 license:expat)))) ; utf8/*
399 (url "https://github.com/Dushistov/sdcv/")
400 (commit (string-append "v" version))))
401 (file-name (git-file-name name version))
404 "144qpl9b8r2php0zhi9b7vg6flpvdgjy6yfaipydwwhxi4wy9600"))))
405 (build-system cmake-build-system)
407 `(#:configure-flags '("-DBUILD_TESTS=YES")
409 (modify-phases %standard-phases
410 (add-after 'build 'build-lang
412 (invoke "make" "lang")))
413 (add-before 'check 'pre-check
415 (setenv "HOME" (getcwd))
417 (add-after 'unpack 'remove-jq-requirement
419 ;; We don't want to bring in jq for one test.
420 (substitute* "tests/t_json"
424 `(("gettext" ,gettext-minimal)
425 ("pkg-config" ,pkg-config)))
427 (list glib ncurses readline zlib))
428 (home-page "https://dushistov.github.io/sdcv/")
429 (synopsis "Console version of StarDict")
430 (description "sdcv is simple text-based utility for work with dictionaries
431 in StarDict's format.")
432 (license license:gpl2+)))
434 (define-public skk-jisyo
435 (let ((commit "38c81dbc74cdbdead843364023dea837f239a48c")
439 (version (git-version "0" revision commit))
443 (url "https://github.com/skk-dev/dict")
445 (file-name (git-file-name name version))
448 "121j73bgd7fvj7zvaidqvgzfdvimig3f0vsyfv4vndwfgskh2r7z"))))
449 (build-system copy-build-system)
451 '(#:install-plan '(("./" "share/skk"
452 #:include-regexp ("SKK-JISYO\\.*")
453 #:exclude-regexp ("\\.gz$" "\\.md5$")
454 #:exclude ("SKK-JISYO.pubdic+"
455 "SKK-JISYO.wrong.annotated"
457 #:phases (modify-phases %standard-phases
458 (add-before 'install 'decompress
459 (lambda* (#:key outputs #:allow-other-keys)
461 (invoke "gzip" "-v" "-d" arg))
462 (find-files "." "SKK-JISYO\\..*\\.gz$"))
463 (invoke "tar" "xvf" "zipcode.tar.gz"))))))
464 (home-page "https://skk-dev.github.io/dict/")
465 (synopsis "Jisyo (dictionary) files for the SKK Japanese-input software")
467 "This package provides @file{SKK-JISYO.L}, the standard dictionary file
468 for SKK Japanese input systems, and various dictionary files.
469 @file{SKK-JISYO.L} can be used with @code{emacs-ddskk} or @code{uim} package.")
470 (license license:gpl2+))))