diff options
Diffstat (limited to 'gnu/packages/dictionaries.scm')
-rw-r--r-- | gnu/packages/dictionaries.scm | 241 |
1 files changed, 210 insertions, 31 deletions
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm index f51ed24111..55cd6fbf40 100644 --- a/gnu/packages/dictionaries.scm +++ b/gnu/packages/dictionaries.scm @@ -1,15 +1,19 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014-2016, 2021, 2024 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014-2016, 2018, 2021, 2024, 2025 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016-2018, 2020-2023, 2025 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2017, 2018, 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr> -;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2018, 2019, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr> ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2020 Lu hux <luhux@outlook.com> +;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com> -;;; Copyright © 2022 Runciter <runciter@whispers-vpn.org> +;;; Copyright © 2022, 2024 Runciter <runciter@whispers-vpn.org> +;;; Copyright © 2022 Maxim Cournoyer <maxim@guixotic.coop> +;;; Copyright © 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> +;;; Copyright © 2025 Zhu Zihao <all_but_last@163.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,27 +45,168 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages bison) + #:use-module (gnu packages compression) + #:use-module (gnu packages compression) + #:use-module (gnu packages crypto) #:use-module (gnu packages curl) #:use-module (gnu packages emacs) #:use-module (gnu packages flex) #:use-module (gnu packages fribidi) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) + #:use-module (gnu packages groff) + #:use-module (gnu packages gsasl) + #:use-module (gnu packages guile) + #:use-module (gnu packages icu4c) #:use-module (gnu packages linux) + #:use-module (gnu packages m4) #:use-module (gnu packages ncurses) #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages readline) - #:use-module (gnu packages texinfo) - #:use-module (gnu packages compression) + #:use-module (gnu packages speech) #:use-module (gnu packages tcl) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages textutils) #:use-module (gnu packages web) - #:use-module (gnu packages xml) - #:use-module (gnu packages dictd) - #:use-module (gnu packages speech) - #:use-module (gnu packages perl)) + #:use-module (gnu packages wordnet) + #:use-module (gnu packages xml)) +(define-public dico + (package + (name "dico") + (version "2.12") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/dico/dico-" + version ".tar.xz")) + (sha256 + (base32 + "1xvahrav8aml90qcj4cj3a33y0n7nm1k0ywgks1zy2q91v2qk2vj")))) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags #~(list "--disable-static") + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'set-shell-file-name + (lambda* (#:key inputs #:allow-other-keys) + ;; This code invokes "/bin/sh -c 'm4 -s ...'". + (substitute* "grecs/src/grecs-lex.c" + (("\"/bin/sh\"") + (string-append "\"" + (search-input-file inputs "/bin/sh") + "\""))))) + (add-before 'check 'silence-guile + (lambda _ + ;; Guile is too talkative, which disturbs the test + ;; infrastructure. Gag it. + (setenv "GUILE_AUTO_COMPILE" "0") + (setenv "GUILE_WARN_DEPRECATED" "no")))))) + (native-inputs (list groff)) + (inputs + (list m4 ;used at run time + bash-minimal ;likewise + pcre + python-wrapper + guile-3.0 + gsasl + readline + zlib + wordnet + libxcrypt ;for 'crypt' + libltdl)) + (home-page "https://www.gnu.org.ua/software/dico/") + (synopsis "Implementation of DICT server (RFC 2229)") + (description + "GNU Dico implements a flexible dictionary server and client according to +RFC 2229 (DICT Server). It is able to access any database available, +regardless of format, thanks to its modular structure. New modules may be +written in C, Guile or Python. Dico also includes a command-line client, +which may be used to query remote dictionary databases.") + (license license:gpl3+))) + +(define-public libmaa + (package + (name "libmaa") + (version "1.3.2") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/dict/libmaa/" + "libmaa-" + version + "/libmaa-" + version + ".tar.gz")) + (sha256 + (base32 "1idi4c30pi79g5qfl7rr9s17krbjbg93bi8f2qrbsdlh78ga19ar")))) + (native-inputs (list libtool)) + (arguments + (list + ;; Change -Werror to -Wno-error, reproduce other default flags + ;; Do not error out on warnings related to snprintf function + #:make-flags #~'("CFLAGS=-DHAVE_CONFIG_H -Wall -Wno-error -g -O2 $(VERCFLAGS) -I. -I${srcdir}") + #:test-target "test")) + (build-system gnu-build-system) + (synopsis "Low-level data structures used by the dictd program") + (description + "The libmaa library provides many low-level +data structures which are helpful for writing compilers, including hash +tables, sets, lists, debugging support, and memory management. Although +libmaa was designed and implemented as a foundation for the Khepara +transformation system, the data structures are generally applicable to a +wide range of programming problems. + +The memory management routines are especially helpful for improving the +performance of memory-intensive applications.") + (home-page "https://sourceforge.net/projects/dict/") + (license license:gpl2+))) + +(define-public dictd + (package + (name "dictd") + (version "1.13.3") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/dict/dictd/" + "dictd-" + version + "/dictd-" + version + ".tar.gz")) + (sha256 + (base32 "0w8i7w3xs53kj5v72xf1zq24kz4qa6fcg1lmibs279wgnggjj88r")))) + (inputs (list libmaa zlib)) + (native-inputs (list libtool bison flex)) + (arguments + (list + #:test-target "test" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-configure + (lambda _ + ;; workaround for missing yylex in yywrap lex check + (substitute* "configure" + (("yywrap [(]void[)];") + "yywrap (void); int yylex () { return 0; }"))))))) + (build-system gnu-build-system) + (synopsis "@command{dict}, @command{dictd} and @command{dictfmt} programs") + (description + "The DICT Interchange Format (DICF) is a human-readable + format for the interchange of dictionary databases for the use with +DICT protocol client/server software. + +This package provides a client @command{dict} and a server program +@command{dictd} for the DICT protocol, as well as a utility +@command{dictfmt} to convert various dictionary formats into +dictionaries that can be served by @command{dictd} or Dico.") + (home-page "https://sourceforge.net/projects/dict/") + (license license:gpl2+))) (define-public vera (package @@ -307,18 +452,21 @@ Yandex.Translate and Apertium. It gives you easy access to one of these translation engines from your terminal.") (license license:public-domain))) + (define-public lttoolbox (package (name "lttoolbox") - (version "3.5.4") + (version "3.7.6") (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/apertium/lttoolbox/releases/download/v" - version "/lttoolbox-" version ".tar.xz")) + (method git-fetch) + (file-name (git-file-name "lttoolbox" version)) + (uri + (git-reference + (url "https://github.com/apertium/lttoolbox") + (commit (string-append "v" version)))) (sha256 - (base32 "0kn9xg9sc64amd6ah5gi4qij0bhfbmc2jjvxbjjrsdd8iq054cgm")))) + (base32 "03dm7sdrggqkqsgdnqldv7fh5kbw4g6ssggfy4bgdh6n38997pag")))) (build-system gnu-build-system) (arguments `(#:configure-flags @@ -331,7 +479,7 @@ translation engines from your terminal.") (lambda _ (invoke "autoreconf" "-vfi")))))) (inputs - (list libxml2)) + (list libxml2 icu4c utfcpp-2)) (native-inputs (list autoconf automake libtool pkg-config)) (home-page "https://wiki.apertium.org/wiki/Lttoolbox") @@ -346,20 +494,20 @@ word (e.g. cats) into its lemma \"cat\" and the grammatical information (define-public apertium (package (name "apertium") - (version "3.5.2") + (version "3.9.12") (source - (origin - (method url-fetch) - (uri (string-append - "https://github.com/apertium/apertium/releases/download/v" - version "/apertium-" version ".tar.gz")) - (sha256 - (base32 - "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h")) - (file-name (string-append name "-" version ".tar.gz")))) + (origin + (method git-fetch) + (file-name (git-file-name name version)) + (uri + (git-reference + (url "https://github.com/apertium/apertium") + (commit (string-append "v" version)))) + (sha256 (base32 "1wkb8dqcamk42y67plj77n8d27g5qlsnpkgxnkvm0wv2pr35gmzw")))) (build-system gnu-build-system) (inputs - (list libxml2 libxslt lttoolbox pcre)) + (list libxml2 libxslt lttoolbox pcre icu4c utfcpp-2 zip unzip + (libc-utf8-locales-for-target)));; tests require UTF-8 (native-inputs `(("apertium-get" ,(origin @@ -370,10 +518,15 @@ word (e.g. cats) into its lemma \"cat\" and the grammatical information (sha256 (base32 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav")))) + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) ("flex" ,flex) ("pkg-config" ,pkg-config) - ;; python is only required for running the test suite - ("python" ,python))) + ;; Only required for running the test suite: + ("python" ,python) + ("python-lxml" ,python-lxml) + ("libzip" ,libzip))) (arguments `(#:phases (modify-phases %standard-phases @@ -383,8 +536,34 @@ word (e.g. cats) into its lemma \"cat\" and the grammatical information (add-after 'unpack 'unpack-apertium-get (lambda* (#:key inputs #:allow-other-keys) (copy-recursively (assoc-ref inputs "apertium-get") - "apertium/apertium-get") - #t))))) + "apertium/apertium-get"))) + (add-after 'unpack 'reconf + (lambda _ + (invoke "autoreconf" "-vfi"))) + (add-after 'unpack 'fix-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "apertium/Makefile.am" + (("xmllint") (search-input-file inputs "/bin/xmllint"))) + (substitute* "apertium/apertium-header.sh" + (("locale -a") + (string-append (search-input-file inputs "/bin/locale") " -a")) + ;; 'locale -a' does not report properly in guix; + ;; a `guix shell -C glibc glibc-locales - locale -a` + ;; will still only list C and POSIX + ;; alternatively we could replace the `locale -a` invocations + ;; with something along the lines of `{ locale -a ; echo $LC_ALL }` + ;; or `{ locale -a; locale | grep LC_CTYPE | cut -d= -f2 | tr -d '"' }.` + (("^locale_utf8\n$") + "# locale_utf8 # disabled by guix \n" ) + ;; replace in everywhere but the shebang + (("bash([^\n])" _ suffix) + (string-append (search-input-file inputs "/bin/bash") suffix)) + (("\\b(grep|head|cat|rm|unzip|zip|gawk|awk|find|xmllint|lt-tmxproc)\\b" _ program) + (search-input-file inputs (format #f "/bin/~a" program)))))) + ;; We want the shebang to be patched so that the invocation during + ;; tests does not need /usr/bin/env + (add-after 'build 'patch-apertium-shebang + (lambda _ (patch-shebang "apertium/apertium")))))) (home-page "https://www.apertium.org/") (synopsis "Rule based machine translation system") (description "Apertium is a rule based machine translation system |