projects/guix·blob python-team · refs

976 lines · 39.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014-2016, 2018, 2021, 2024, 2025 Ludovic Courtès <[email protected]>
3;;; Copyright © 2016-2018, 2020-2023, 2025 Efraim Flashner <[email protected]>
4;;; Copyright © 2016 Sou Bunnbu <[email protected]>
5;;; Copyright © 2017-2019, 2021, 2025 Nicolas Goaziou <[email protected]>
6;;; Copyright © 2018, 2019, 2020, 2021 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2018 Pierre-Antoine Rouby <[email protected]>
8;;; Copyright © 2018 Arun Isaac <[email protected]>
9;;; Copyright © 2019 Pierre Langlois <[email protected]>
10;;; Copyright © 2020 Lu hux <[email protected]>
11;;; Copyright © 2020 Vincent Legoll <[email protected]>
12;;; Copyright © 2022 ROCKTAKEY <[email protected]>
13;;; Copyright © 2022, 2024 Runciter <[email protected]>
14;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
15;;; Copyright © 2025 Artyom V. Poptsov <[email protected]>
16;;; Copyright © 2025 Zhu Zihao <[email protected]>
17;;; Copyright © 2025 Nigko Yerden <[email protected]>
18;;;
19;;; This file is part of GNU Guix.
20;;;
21;;; GNU Guix is free software; you can redistribute it and/or modify it
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
26;;; GNU Guix is distributed in the hope that it will be useful, but
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34(define-module (gnu packages dictionaries)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix packages)
37 #:use-module (guix gexp)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system copy)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system pyproject)
44 #:use-module (guix build-system qt)
45 #:use-module (guix build-system trivial)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages base)
49 #:use-module (gnu packages bash)
50 #:use-module (gnu packages bison)
51 #:use-module (gnu packages build-tools)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages cpp)
55 #:use-module (gnu packages crypto)
56 #:use-module (gnu packages curl)
57 #:use-module (gnu packages education)
58 #:use-module (gnu packages emacs)
59 #:use-module (gnu packages compiler-tools)
60 #:use-module (gnu packages fribidi)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages groff)
64 #:use-module (gnu packages gsasl)
65 #:use-module (gnu packages guile)
66 #:use-module (gnu packages hunspell)
67 #:use-module (gnu packages icu4c)
68 #:use-module (gnu packages linux)
69 #:use-module (gnu packages m4)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages pcre)
72 #:use-module (gnu packages perl)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages pretty-print)
75 #:use-module (gnu packages python)
76 #:use-module (gnu packages python-build)
77 #:use-module (gnu packages qt)
78 #:use-module (gnu packages readline)
79 #:use-module (gnu packages search)
80 #:use-module (gnu packages speech)
81 #:use-module (gnu packages tcl)
82 #:use-module (gnu packages texinfo)
83 #:use-module (gnu packages textutils)
84 #:use-module (gnu packages video)
85 #:use-module (gnu packages web)
86 #:use-module (gnu packages wordnet)
87 #:use-module (gnu packages xiph)
88 #:use-module (gnu packages xml)
89 #:use-module (gnu packages xorg))
90
91(define-public cmudict
92 (package
93 (name "cmudict")
94 (properties '((commit . "0f8072f814306c5ee4fbf992ed853601b12c01f9")
95 (revision . "0")))
96 (version (git-version "0"
97 (assoc-ref properties 'revision)
98 (assoc-ref properties 'commit)))
99 (source
100 (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url "https://github.com/cmusphinx/cmudict")
104 (commit (assoc-ref properties 'commit))))
105 (file-name (git-file-name name version))
106 (sha256
107 (base32 "0ri9r9ljbwv282lmv9cp3gmbwlanf99nhzvw83fjf12bc4nxl0qd"))))
108 (build-system copy-build-system)
109 (arguments
110 (list
111 #:phases
112 #~(modify-phases %standard-phases
113 (delete 'install-license-files))))
114 (home-page "https://github.com/cmusphinx/cmudict")
115 (synopsis "Pronouncing English dictionary")
116 (description
117 "CMUdict (the Carnegie Mellon Pronouncing Dictionary) is a free
118pronouncing dictionary of English, suitable for uses in speech technology and
119is maintained by the Speech Group in the School of Computer Science at
120Carnegie Mellon University.")
121 (license (license:fsdg-compatible
122 "https://github.com/cmusphinx/cmudict/blob/master/LICENSE"))))
123
124(define-public dico
125 (let ((commit "05da4bc9e613834fdb065e38c7181044d8889575")
126 (revision "0"))
127 (package
128 (name "dico")
129 (version (git-version "2.12" revision commit))
130 (source
131 (origin
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://git.gnu.org.ua/dico.git")
135 (commit commit)
136 (recursive? #t)))
137 (file-name (git-file-name name version))
138 (sha256
139 (base32 "1fmr01gpvvb1p6p9ylr67nqx8ymmmkqjhsi9y5zvp2nc32cgxvah"))))
140 (build-system gnu-build-system)
141 (arguments
142 (list
143 #:configure-flags #~(list "--disable-static")
144 #:phases
145 #~(modify-phases %standard-phases
146 (replace 'bootstrap
147 (lambda* (#:key inputs #:allow-other-keys)
148 (substitute* "grecs/bootstrap"
149 (("/bin/sh")
150 (which "bash"))
151 ((" GRECS_GIT_ID=.*")
152 " GRECS_GIT_ID=v1.0-25-g51b12be\n"))
153 (invoke "perl" "./bootstrap" "--force" "--skip-po")))
154 (add-before 'build 'post-configure
155 (lambda* (#:key inputs #:allow-other-keys)
156 ;; For some reason, this file is missing.
157 (install-file "gnulib/lib/getopt.c"
158 "xdico/gnu")
159 ;; This code invokes "/bin/sh -c 'm4 -s ...'".
160 (substitute* "grecs/src/grecs-lex.l"
161 (("\"/bin/sh")
162 (string-append "\""
163 (search-input-file inputs "/bin/sh"))))))
164
165 (add-before 'check 'silence-guile
166 (lambda _
167 ;; Guile is too talkative, which disturbs the test
168 ;; infrastructure. Gag it.
169 (setenv "GUILE_AUTO_COMPILE" "0")
170 (setenv "GUILE_WARN_DEPRECATED" "no"))))))
171 (native-inputs
172 (list autoconf-2.71
173 automake
174 bison
175 flex
176 gettext-minimal
177 groff
178 libtool
179 perl
180 texinfo))
181 (inputs
182 (list m4 ;used at run time
183 bash-minimal ;likewise
184 pcre
185 python-wrapper
186 guile-3.0
187 gsasl
188 readline
189 zlib
190 wordnet
191 libxcrypt ;for 'crypt'
192 libltdl))
193 (home-page "https://www.gnu.org.ua/software/dico/")
194 (synopsis "Implementation of DICT server (RFC 2229)")
195 (description
196 "GNU Dico implements a flexible dictionary server and client according
197to RFC 2229 (DICT Server). It is able to access any database available,
198regardless of format, thanks to its modular structure. New modules may be
199written in C, Guile or Python. Dico also includes a command-line client,
200which may be used to query remote dictionary databases.")
201 (license license:gpl3+))))
202
203(define-public libmaa
204 (package
205 (name "libmaa")
206 (version "1.3.2")
207 (source
208 (origin
209 (method url-fetch)
210 (uri (string-append "mirror://sourceforge/dict/libmaa/"
211 "libmaa-"
212 version
213 "/libmaa-"
214 version
215 ".tar.gz"))
216 (sha256
217 (base32 "1idi4c30pi79g5qfl7rr9s17krbjbg93bi8f2qrbsdlh78ga19ar"))))
218 (native-inputs (list libtool))
219 (arguments
220 (list
221 ;; Change -Werror to -Wno-error, reproduce other default flags
222 ;; Do not error out on warnings related to snprintf function
223 #:make-flags #~'("CFLAGS=-DHAVE_CONFIG_H -Wall -Wno-error -g -O2 $(VERCFLAGS) -I. -I${srcdir}")
224 #:test-target "test"))
225 (build-system gnu-build-system)
226 (synopsis "Low-level data structures used by the dictd program")
227 (description
228 "The libmaa library provides many low-level
229data structures which are helpful for writing compilers, including hash
230tables, sets, lists, debugging support, and memory management. Although
231libmaa was designed and implemented as a foundation for the Khepara
232transformation system, the data structures are generally applicable to a
233wide range of programming problems.
234
235The memory management routines are especially helpful for improving the
236performance of memory-intensive applications.")
237 (home-page "https://sourceforge.net/projects/dict/")
238 (license license:gpl2+)))
239
240(define-public dictd
241 (package
242 (name "dictd")
243 (version "1.13.3")
244 (source
245 (origin
246 (method url-fetch)
247 (uri (string-append "mirror://sourceforge/dict/dictd/"
248 "dictd-"
249 version
250 "/dictd-"
251 version
252 ".tar.gz"))
253 (sha256
254 (base32 "0w8i7w3xs53kj5v72xf1zq24kz4qa6fcg1lmibs279wgnggjj88r"))))
255 (inputs (list libmaa zlib))
256 (native-inputs (list libtool bison flex))
257 (arguments
258 (list
259 #:test-target "test"
260 #:phases
261 #~(modify-phases %standard-phases
262 (add-after 'unpack 'patch-configure
263 (lambda _
264 ;; workaround for missing yylex in yywrap lex check
265 (substitute* "configure"
266 (("yywrap [(]void[)];")
267 "yywrap (void); int yylex () { return 0; }")))))))
268 (build-system gnu-build-system)
269 (synopsis "@command{dict}, @command{dictd} and @command{dictfmt} programs")
270 (description
271 "The DICT Interchange Format (DICF) is a human-readable
272 format for the interchange of dictionary databases for the use with
273DICT protocol client/server software.
274
275This package provides a client @command{dict} and a server program
276@command{dictd} for the DICT protocol, as well as a utility
277@command{dictfmt} to convert various dictionary formats into
278dictionaries that can be served by @command{dictd} or Dico.")
279 (home-page "https://sourceforge.net/projects/dict/")
280 (license license:gpl2+)))
281
282(define-public vera
283 (package
284 (name "vera")
285 (version "1.24")
286 (source (origin
287 (method url-fetch)
288 (uri (string-append "mirror://gnu/vera/vera-" version
289 ".tar.gz"))
290 (sha256
291 (base32
292 "1j5p679vw72bv766acbg6g89k31ynmrzlpg7s3wzy4krlwdf92xc"))))
293 (build-system trivial-build-system)
294 (arguments
295 `(#:builder (begin
296 (use-modules (guix build utils))
297
298 (let* ((out (assoc-ref %outputs "out"))
299 (info (string-append out "/share/info"))
300 (html (string-append out "/share/html"))
301 (source (assoc-ref %build-inputs "source"))
302 (tar (assoc-ref %build-inputs "tar"))
303 (gz (assoc-ref %build-inputs "gzip"))
304 (texi (assoc-ref %build-inputs "texinfo")))
305 (setenv "PATH" (string-append gz "/bin"))
306 (invoke (string-append tar "/bin/tar") "xvf" source)
307
308 (chdir (string-append "vera-" ,version))
309 (mkdir-p info)
310 (mkdir-p html)
311
312 ;; Change a ‘Malformed UTF-8 character: \xd7\x34 (unexpected
313 ;; non-continuation byte 0x34, immediately after start byte
314 ;; 0xd7; need 2 bytes, got 1) in pattern match (m//)’.
315 (substitute* "vera.h"
316 (("320.480") "320x480"))
317
318 ;; XXX: Use '--force' because the document is unhappy
319 ;; with Texinfo 5 (yes, documents can be unhappy.)
320 (invoke (string-append texi "/bin/makeinfo")
321 "vera.texi" "--force" "-o"
322 (string-append info "/vera.info"))
323 (invoke (string-append texi "/bin/makeinfo")
324 "vera.texi" "--force" "--html" "-o"
325 (string-append html "/vera.html"))))
326 #:modules ((guix build utils))))
327 (native-inputs (list texinfo tar gzip))
328 (home-page "https://savannah.gnu.org/projects/vera/")
329 (synopsis "List of acronyms")
330 (description
331 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
332acronyms distributed as an info document.")
333 (license license:fdl1.3+)))
334
335(define-public gcide
336 (package
337 (name "gcide")
338 (version "0.54")
339 (source (origin
340 (method url-fetch)
341 (uri (string-append
342 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
343 (sha256
344 (base32
345 "0hhxqlkgp3kkin4pqzfgfd24ckai29sm9dw8qc6icnqp6rpnyh92"))))
346 (build-system copy-build-system)
347 (arguments
348 '(#:install-plan
349 '(("." "share/gcide/" #:exclude ("COPYING")))))
350 (synopsis "GNU Collaborative International Dictionary of English")
351 (description
352 "GCIDE is a free dictionary based on a combination of sources. It can
353be used via the GNU Dico program or accessed online at
354http://gcide.gnu.org.ua/")
355 (home-page "https://gcide.gnu.org.ua/")
356 (license license:gpl3+)))
357
358(define-public diction
359 ;; Not quite a dictionary, not quite a spell checker either…
360 (package
361 (name "diction")
362 (version "1.14")
363 (source
364 (origin
365 (method url-fetch)
366 (uri (string-append "http://www.moria.de/~michael/diction/diction-"
367 version ".tar.gz"))
368 (sha256
369 (base32 "1z6p5x3l1a00h4v4s33qa82fznzc1jdqdnlc4dnmd9nblnrjy0fs"))))
370 (build-system gnu-build-system)
371 (synopsis "Identifies wordy and commonly misused phrases")
372 (description
373 "A package providing two classic Unix commands, style and diction.
374Diction is used to identify wordy and commonly misused phrases in a
375body of text. Style instead analyzes surface aspects of a written
376work, such as sentence length and other readability measures.")
377 (home-page "https://www.gnu.org/software/diction/")
378 (license license:gpl3+)))
379
380(define-public ding
381 (package
382 (name "ding")
383 (version "1.9")
384 (source (origin
385 (method url-fetch)
386 (uri (string-append "https://ftp.tu-chemnitz.de/pub/Local/urz/" name
387 "/" name "-" version ".tar.gz"))
388 (sha256
389 (base32
390 "1rcqn04l6hvsf15mqqai533p31nc04r2yd9s0mn2hnkqrwgwi9k9"))))
391 (build-system gnu-build-system)
392 (inputs (list tk))
393 (arguments
394 `(#:phases
395 (modify-phases %standard-phases
396 (delete 'configure)
397 (delete 'build)
398 (delete 'check)
399 (replace 'install
400 (lambda* (#:key inputs #:allow-other-keys)
401 (let ((bindir (string-append
402 (assoc-ref %outputs "out") "/bin"))
403 (wish (search-input-file inputs "/bin/wish8.6"))
404 (sharedir (string-append
405 (assoc-ref %outputs "out")
406 "/share/applications"))
407 (libdir (string-append
408 (assoc-ref %outputs "out") "/lib")))
409 (mkdir-p bindir)
410 (mkdir-p libdir)
411 (mkdir-p sharedir)
412
413 (substitute* "ding.desktop"
414 (("Exec=/usr/bin/ding")
415 (string-append "Exec=" bindir "/ding")))
416 (with-fluids ((%default-port-encoding "ISO-8859-1"))
417 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
418 (substitute* "install.sh"
419 (("/bin/cp") "cp")
420 (("/bin/mv") "mv")
421 (("NEEDPROG=\"wish\"")
422 (string-append "NEEDPROG=\"" wish "\""))
423 (("DEFBINDIR=\"/usr/local/bin\"")
424 (string-append "DEFBINDIR=\"" bindir "\""))
425 (("DEFLIBDIR=\"/usr/local/lib\"")
426 (string-append "DEFLIBDIR=\"" libdir "\"")))
427 (install-file "ding.desktop" sharedir)
428 (install-file "ding.png" sharedir)
429 (invoke "./install.sh")))))))
430 (synopsis "Dictionary lookup program with a German-English dictionary")
431 (description "Ding is a dictionary lookup program for the X window system.
432It comes with a German-English dictionary with approximately 270,000 entries.")
433 (home-page "https://www-user.tu-chemnitz.de/~fri/ding/")
434 (license license:gpl2+)))
435
436(define-public grammalecte
437 (package
438 (name "grammalecte")
439 (version "2.3.0")
440 (source
441 (origin
442 (method url-fetch/zipbomb)
443 (uri (string-append "https://grammalecte.net/zip/"
444 "Grammalecte-fr-v" version ".zip"))
445 (sha256
446 (base32 "0kv8h0116sfcrqnpd3jv2b098ychda7v27fciq1phxw50jbj395a"))))
447 (build-system pyproject-build-system)
448 (arguments
449 (list #:test-backend #~'unittest))
450 (native-inputs
451 (list python-setuptools))
452 (home-page "https://grammalecte.net")
453 (synopsis "French spelling and grammar checker")
454 (description "Grammalecte is a grammar checker for the French language,
455derived from Lightproof.
456
457Grammalecte helps writing a proper French, without distracting users with
458false positives. This grammar checker follows the principle: the less false
459positives, the better; if it cannot know with a good chance that a dubious
460expression is wrong, it keeps silent.
461
462The package provides the command line interface, along with a server
463and a Python library.")
464 (license license:gpl3+)))
465
466(define-public translate-shell
467 (package
468 (name "translate-shell")
469 (version "0.9.7.1")
470 (source
471 (origin
472 (method git-fetch)
473 (uri (git-reference
474 (url"https://github.com/soimort/translate-shell")
475 (commit (string-append "v" version))))
476 (file-name (git-file-name name version))
477 (sha256
478 (base32 "0jfrypcz963pfvwwaz2i0xvwp2909ldzp15v68mgd2mbqkqw9d90"))))
479 (build-system gnu-build-system)
480 (arguments
481 `(#:phases
482 (modify-phases %standard-phases
483 (delete 'configure) ; no configure script
484 (add-after 'unpack 'remove-unnecessary-file
485 ;; This file gets generated during the build phase.
486 (lambda _
487 (delete-file "translate")))
488 (add-after 'install 'wrap-binary
489 (lambda* (#:key inputs outputs #:allow-other-keys)
490 (let* ((out (assoc-ref outputs "out"))
491 (bin (string-append out "/bin/trans"))
492 (curl (assoc-ref inputs "curl"))
493 (fribidi (assoc-ref inputs "fribidi"))
494 (rlwrap (assoc-ref inputs "rlwrap")))
495 (wrap-program bin
496 `("PATH" ":" prefix
497 (,(string-append out "/bin:"
498 curl "/bin:"
499 fribidi "/bin:"
500 rlwrap "/bin")))))))
501 (add-after 'unpack 'emacs-make-autoloads
502 (assoc-ref emacs:%standard-phases 'make-autoloads))
503 (add-after 'install 'emacs-install
504 (assoc-ref emacs:%standard-phases 'install))
505 (add-after 'emacs-install 'emacs-build
506 (assoc-ref emacs:%standard-phases 'build)))
507 #:make-flags (list (string-append "PREFIX=" %output)
508 "NETWORK_ACCESS=no test")
509 #:imported-modules (,@%default-gnu-imported-modules
510 (guix build emacs-build-system)
511 (guix build emacs-utils))
512 #:modules ((guix build gnu-build-system)
513 ((guix build emacs-build-system) #:prefix emacs:)
514 (guix build utils))
515 #:test-target "test"))
516 (inputs
517 (list bash-minimal curl fribidi rlwrap))
518 (native-inputs
519 (list emacs-minimal
520 util-linux)) ; hexdump, for the test
521 (home-page "https://www.soimort.org/translate-shell/")
522 (synopsis "Translations from the command line")
523 (description
524 "Translate Shell (formerly Google Translate CLI) is a command-line
525translator powered by Google Translate (default), Bing Translator,
526Yandex.Translate and Apertium. It gives you easy access to one of these
527translation engines from your terminal.")
528 (license license:public-domain)))
529
530
531(define-public lttoolbox
532 (package
533 (name "lttoolbox")
534 (version "3.7.6")
535 (source
536 (origin
537 (method git-fetch)
538 (file-name (git-file-name "lttoolbox" version))
539 (uri
540 (git-reference
541 (url "https://github.com/apertium/lttoolbox")
542 (commit (string-append "v" version))))
543 (sha256
544 (base32 "03dm7sdrggqkqsgdnqldv7fh5kbw4g6ssggfy4bgdh6n38997pag"))))
545 (build-system gnu-build-system)
546 (arguments
547 `(#:configure-flags
548 (list "--disable-static")
549 #:phases
550 (modify-phases %standard-phases
551 (replace 'bootstrap
552 ;; The included ./autogen.sh unconditionally runs ./configure before
553 ;; its shebangs have been patched.
554 (lambda _
555 (invoke "autoreconf" "-vfi"))))))
556 (inputs
557 (list libxml2 icu4c utfcpp-2))
558 (native-inputs
559 (list autoconf automake libtool pkg-config))
560 (home-page "https://wiki.apertium.org/wiki/Lttoolbox")
561 (synopsis "Lexical processing toolbox")
562 (description "Lttoolbox is a toolbox for lexical processing, morphological
563analysis and generation of words. Analysis is the process of splitting a
564word (e.g. cats) into its lemma \"cat\" and the grammatical information
565@code{<n><pl>}. Generation is the opposite process.")
566 (license (list license:gpl2 ; main license
567 license:expat)))) ; utf8/*
568
569(define-public apertium
570 (package
571 (name "apertium")
572 (version "3.9.12")
573 (source
574 (origin
575 (method git-fetch)
576 (file-name (git-file-name name version))
577 (uri
578 (git-reference
579 (url "https://github.com/apertium/apertium")
580 (commit (string-append "v" version))))
581 (sha256 (base32 "1wkb8dqcamk42y67plj77n8d27g5qlsnpkgxnkvm0wv2pr35gmzw"))))
582 (build-system gnu-build-system)
583 (inputs
584 (list libxml2 libxslt lttoolbox pcre icu4c utfcpp-2 zip unzip
585 (libc-utf8-locales-for-target)));; tests require UTF-8
586 (native-inputs
587 `(("apertium-get"
588 ,(origin
589 (method git-fetch)
590 (uri (git-reference
591 (url "https://github.com/apertium/apertium-get")
592 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
593 (sha256
594 (base32
595 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
596 ("autoconf" ,autoconf)
597 ("automake" ,automake)
598 ("libtool" ,libtool)
599 ("flex" ,flex)
600 ("pkg-config" ,pkg-config)
601 ;; Only required for running the test suite:
602 ("python" ,python)
603 ("python-lxml" ,python-lxml)
604 ("libzip" ,libzip)))
605 (arguments
606 `(#:phases
607 (modify-phases %standard-phases
608 ;; If apertium-get does not exist in the source tree, the build tries
609 ;; to download it using an svn checkout. To avoid this, copy
610 ;; apertium-get into the source tree.
611 (add-after 'unpack 'unpack-apertium-get
612 (lambda* (#:key inputs #:allow-other-keys)
613 (copy-recursively (assoc-ref inputs "apertium-get")
614 "apertium/apertium-get")))
615 (add-after 'unpack 'reconf
616 (lambda _
617 (invoke "autoreconf" "-vfi")))
618 (add-after 'unpack 'fix-paths
619 (lambda* (#:key inputs outputs #:allow-other-keys)
620 (substitute* "apertium/Makefile.am"
621 (("xmllint") (search-input-file inputs "/bin/xmllint")))
622 (substitute* "apertium/apertium-header.sh"
623 (("locale -a")
624 (string-append (search-input-file inputs "/bin/locale") " -a"))
625 ;; 'locale -a' does not report properly in guix;
626 ;; a `guix shell -C glibc glibc-locales - locale -a`
627 ;; will still only list C and POSIX
628 ;; alternatively we could replace the `locale -a` invocations
629 ;; with something along the lines of `{ locale -a ; echo $LC_ALL }`
630 ;; or `{ locale -a; locale | grep LC_CTYPE | cut -d= -f2 | tr -d '"' }.`
631 (("^locale_utf8\n$")
632 "# locale_utf8 # disabled by guix \n" )
633 ;; replace in everywhere but the shebang
634 (("bash([^\n])" _ suffix)
635 (string-append (search-input-file inputs "/bin/bash") suffix))
636 (("\\b(grep|head|cat|rm|unzip|zip|gawk|awk|find|xmllint|lt-tmxproc)\\b" _ program)
637 (search-input-file inputs (format #f "/bin/~a" program))))))
638 ;; We want the shebang to be patched so that the invocation during
639 ;; tests does not need /usr/bin/env
640 (add-after 'build 'patch-apertium-shebang
641 (lambda _ (patch-shebang "apertium/apertium"))))))
642 (home-page "https://www.apertium.org/")
643 (synopsis "Rule based machine translation system")
644 (description "Apertium is a rule based machine translation system
645featuring a shallow-transfer machine translation engine. The design of the
646system makes translations fast (translating tens of thousands of words per
647second on ordinary desktop computers) and, in spite of the errors, reasonably
648intelligible and easily correctable.")
649 (license (list license:gpl2 ; main license
650 license:expat)))) ; utf8/*
651
652(define-public sdcv
653 (package
654 (name "sdcv")
655 (version "0.5.5")
656 (source
657 (origin
658 (method git-fetch)
659 (uri (git-reference
660 (url "https://github.com/Dushistov/sdcv/")
661 (commit (string-append "v" version))))
662 (file-name (git-file-name name version))
663 (sha256
664 (base32 "17jwcgc3jdp41rvxqi7zdsysfpjgzqq4z1l345qwffp1an6yaaqk"))))
665 (build-system cmake-build-system)
666 (arguments
667 (list
668 #:configure-flags
669 #~(list "-DBUILD_TESTS=YES"
670 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078404
671 "-DCMAKE_CXX_FLAGS=-fpermissive")
672 #:phases
673 #~(modify-phases %standard-phases
674 (add-after 'build 'build-lang
675 (lambda _
676 (invoke "make" "lang")))
677 (add-before 'check 'pre-check
678 (lambda _
679 (setenv "HOME" (getcwd)))))))
680 (native-inputs
681 (list gettext-minimal
682 pkg-config
683 ;; For tests.
684 jq))
685 (inputs
686 (list glib ncurses readline zlib))
687 (home-page "https://dushistov.github.io/sdcv/")
688 (synopsis "Console version of StarDict")
689 (description "sdcv is simple text-based utility for work with dictionaries
690in StarDict's format.")
691 (license license:gpl2+)))
692
693(define-public skk-jisyo
694 (let ((commit "38c81dbc74cdbdead843364023dea837f239a48c")
695 (revision "0"))
696 (package
697 (name "skk-jisyo")
698 (version (git-version "0" revision commit))
699 (source (origin
700 (method git-fetch)
701 (uri (git-reference
702 (url "https://github.com/skk-dev/dict")
703 (commit commit)))
704 (file-name (git-file-name name version))
705 (sha256
706 (base32
707 "121j73bgd7fvj7zvaidqvgzfdvimig3f0vsyfv4vndwfgskh2r7z"))))
708 (build-system copy-build-system)
709 (arguments
710 '(#:install-plan '(("./" "share/skk"
711 #:include-regexp ("SKK-JISYO\\.*")
712 #:exclude-regexp ("\\.gz$" "\\.md5$")
713 #:exclude ("SKK-JISYO.pubdic+"
714 "SKK-JISYO.wrong.annotated"
715 "SKK-JISYO.wrong")))
716 #:phases (modify-phases %standard-phases
717 (add-before 'install 'decompress
718 (lambda* (#:key outputs #:allow-other-keys)
719 (map (lambda (arg)
720 (invoke "gzip" "-v" "-d" arg))
721 (find-files "." "SKK-JISYO\\..*\\.gz$"))
722 (invoke "tar" "xvf" "zipcode.tar.gz"))))))
723 (home-page "https://skk-dev.github.io/dict/")
724 (synopsis "Jisyo (dictionary) files for the SKK Japanese-input software")
725 (description
726 "This package provides @file{SKK-JISYO.L}, the standard dictionary file
727for SKK Japanese input systems, and various dictionary files.
728@file{SKK-JISYO.L} can be used with @code{emacs-ddskk} or @code{uim} package.")
729 (license license:gpl2+))))
730
731(define-public freedict-tools
732 (package
733 (name "freedict-tools")
734 (version "0.6.0")
735 (source
736 (origin
737 (method git-fetch)
738 (uri (git-reference
739 (url "https://github.com/freedict/tools")
740 (commit "3596640e6e0582cc5fb76a342e5d8e7413aa4b34"))) ;"0.6.0" tag
741 (file-name (git-file-name name version))
742 (sha256
743 (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))
744 (patches (search-patches "freedict-tools-fix-determinism.patch"))))
745 (inputs (list espeak-ng
746 python
747 perl
748 gzip
749 tar
750 libxslt
751 dictd
752 perl-libxml))
753 (arguments
754 (list
755 #:tests? #f
756 #:phases #~(modify-phases %standard-phases
757 (delete 'configure)
758 (add-before 'build 'set-prefix-in-makefile
759 (lambda* (#:key inputs #:allow-other-keys)
760 (substitute* "Makefile"
761 (("PREFIX \\?=.*")
762 (string-append "PREFIX = "
763 #$output "\n")))
764 (substitute* "mk/dicts.mk"
765 (("available_platforms := src dictd slob")
766 "available_platforms := dictd")))))))
767 (build-system gnu-build-system)
768 (synopsis "Build and manage FreeDict dictionaries")
769 (description
770 "FreeDict is a project that offers over 140 free
771dictionaries in about 45 languages, with the right to study, change and
772modify them. You can use them offline on your computer or mobile phone
773and export them to any format and application.
774
775In order to limit store size and build complexity, only the build
776targets that build dictionaries in dictd format are retained when this
777Guix package is installed.")
778 (home-page "https://freedict.org")
779 (license license:gpl2+)))
780
781(define-public freedict-dictionaries
782 (let ((commit "914b5f754b695e9422bf951837b0682a077e244e")
783 (revision "0"))
784 (package
785 (name "freedict-dictionaries")
786 (version (git-version "0.0.0" revision commit))
787 (source
788 (origin
789 (method git-fetch)
790 (uri (git-reference
791 (url "https://github.com/freedict/fd-dictionaries")
792 (commit commit)))
793 (file-name (git-file-name name version))
794 (sha256
795 (base32 "0a8k5rq94rl1nmz0354sx2gmyqica0yjavirh5v5wdybkfq8nv83"))))
796 (inputs (list espeak-ng libxslt dictd perl-libxml freedict-tools))
797 (native-inputs (list python perl))
798 (arguments
799 (list
800 ;; "validation" target fails because of hardcoded
801 ;; path /usr/bin/xmllint in freedict-tools
802 #:tests? #f
803 #:make-flags #~(list (string-append "PREFIX="
804 #$output))
805 #:phases #~(modify-phases %standard-phases
806 (delete 'configure)
807 (add-before 'build 'set-tools-prefix-in-makefile
808 (lambda* (#:key inputs #:allow-other-keys)
809 (substitute* "Makefile"
810 (("FREEDICT_TOOLS \\?= ../tools")
811 (string-append "export FREEDICT_TOOLS = "
812 #$(file-append
813 (this-package-input "freedict-tools")
814 "/share/freedict")))))))))
815 (build-system gnu-build-system)
816 (synopsis "Multilingual dictionaries compiled to the DICT format")
817 (description
818 "FreeDict is a project that offers over 140 free
819 dictionaries in about 45 languages, with the right to study, change and
820 modify them. You can use them offline on your computer or mobile phone
821 and export them to any format and application.")
822 (home-page "https://freedict.org")
823 (license license:gpl2+))))
824
825(define-public python-cmudict
826 (package
827 (name "python-cmudict")
828 (version "1.1.1")
829 (source
830 (origin
831 (method git-fetch)
832 (uri (git-reference
833 (url "https://github.com/prosegrinder/python-cmudict")
834 (commit (string-append "v" version))))
835 (file-name (git-file-name name version))
836 (sha256
837 (base32 "0ia9flqchgr975zjc9l1p379sglg9b56q9m09n05sag8368409k4"))))
838 (build-system pyproject-build-system)
839 (arguments
840 (list
841 #:phases
842 #~(modify-phases %standard-phases
843 (add-after 'unpack 'relax-requirements
844 (lambda _
845 (substitute* "pyproject.toml"
846 ((".*importlib-(metadata|resources).*")
847 ""))))
848 (add-after 'ensure-no-mtimes-pre-1980 'inject-data
849 (lambda* (#:key inputs #:allow-other-keys)
850 (let ((cmudict (search-input-file inputs "cmudict.dict")))
851 (rmdir "src/cmudict/data")
852 (copy-recursively (dirname cmudict) "src/cmudict/data"))))
853 (add-after 'install 'replace-by-symlink
854 (lambda* (#:key inputs outputs #:allow-other-keys)
855 (let ((cmudict (search-input-file inputs "cmudict.dict"))
856 (target (string-append (site-packages inputs outputs)
857 "/cmudict/data")))
858 (delete-file-recursively target)
859 (symlink (dirname cmudict) target)))))))
860 (native-inputs (list python-poetry-core python-pytest python-setuptools))
861 (inputs (list cmudict))
862 (home-page "https://github.com/prosegrinder/python-cmudict")
863 (synopsis "Python wrapper for The CMU Pronouncing Dictionary data files")
864 (description
865 "This package provides a versioned python wrapper package for The CMU
866Pronouncing Dictionary data files.")
867 (license license:gpl3+)))
868
869(define-public dict-jargon
870 (package
871 (name "dict-jargon")
872 (version "4.4.7")
873 (source
874 (origin
875 (method url-fetch)
876 (uri (string-append "http://www.catb.org/~esr/jargon/oldversions/jarg"
877 (string-delete #\. version) ".txt"))
878 (sha256
879 (base32 "098319mp4mjagx9bvr94jns16qcdh82xiyw7ipqx1blkn77w0xjm"))))
880 (build-system copy-build-system)
881 (native-inputs (list dictd libfaketime))
882 (arguments
883 (list
884 #:phases
885 #~(modify-phases %standard-phases
886 (replace 'unpack
887 (lambda* (#:key source #:allow-other-keys)
888 (with-input-from-file source
889 (lambda _
890 (invoke "faketime"
891 "1970-01-01 00:00:00"
892 "dictfmt"
893 "-j"
894 "-s"
895 (string-append "The Jargon File (version "
896 #$(package-version this-package) ")")
897 "jargon")))
898 ;; dictzip includes the compressed file's mtime as part of the
899 ;; compressed file (also see freedict-tools-fix-determinism.patch)
900 (set-file-time "jargon.dict"
901 (stat source))
902 (invoke "dictzip" "jargon.dict"))))
903 #:install-plan ''(("./jargon.dict.dz" "share/jargon/")
904 ("./jargon.index" "share/jargon/"))))
905 (home-page "http://www.catb.org/jargon/")
906 (synopsis "Compendium of hacker slang")
907 (description
908 "The Jargon File is a comprehensive compendium of hacker slang, originating in
909the early days of computing history. This package puts the Jargon File in a
910format compatible with dicod and similar programs.")
911 (license license:unlicense)))
912
913(define-public goldendict-ng
914 (let ((commit "673d1b905e4844375125d6e0dda99342636662ac")
915 (revision "0"))
916 (package
917 (name "goldendict-ng")
918 (version (git-version "25.10.2" revision commit))
919 (source
920 (origin
921 (method git-fetch)
922 (uri (git-reference
923 (url "https://github.com/xiaoyifang/goldendict-ng")
924 (commit commit)))
925 (file-name (git-file-name name version))
926 (sha256
927 (base32 "0g6l4652q6v208fqa2h4yi9db1wdzj3b5fpv8akg3xil999crz39"))
928 (modules '((guix build utils)))
929 (snippet #~(for-each delete-file-recursively
930 (list "thirdparty/eb"
931 "thirdparty/fmt"
932 "thirdparty/tomlplusplus")))))
933 (build-system qt-build-system)
934 (arguments
935 (list #:qtbase qtbase
936 #:configure-flags
937 #~(list
938 ;; use system fmt and toml++ instead of the bundled ones
939 "-DUSE_SYSTEM_FMT=ON"
940 "-DUSE_SYSTEM_TOML=ON")
941 ;; no tests
942 #:tests? #f))
943 (native-inputs (list pkg-config qttools))
944 (inputs (list `(,zstd "lib")
945 bzip2
946 ffmpeg
947 fmt
948 hunspell
949 icu4c
950 libeb
951 libvorbis
952 libx11
953 libxtst
954 libzim
955 lzo
956 opencc
957 qt5compat
958 qtmultimedia
959 qtsvg
960 qtwebchannel
961 qtwebengine
962 tomlplusplus
963 xapian
964 xz
965 zlib))
966 (synopsis "Advanced dictionary lookup program")
967 (description "GoldenDict-ng is an advanced dictionary lookup program
968that supports many dictionary formats, such as MDX, DSL, StarDict, Zim, etc.,
969as well as special types of \"dictionaries\", such as external programs,
970websites and audio files. Among other features are full text search,
971Anki integration, transliteration for some languages, word stemming and
972spelling correction via Hunspell's morphology analysis, unicode case,
973diacritics, punctuation and whitespace folding. It is forked from the
974original GoldenDict which was developed at @url{http://goldendict.org/}.")
975 (home-page "https://xiaoyifang.github.io/goldendict-ng/")
976 (license license:gpl3+))))