dictionaries.scm 16 KB

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