enchant.scm 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
  3. ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
  4. ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  5. ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
  6. ;;;
  7. ;;; This file is part of GNU Guix.
  8. ;;;
  9. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  10. ;;; under the terms of the GNU General Public License as published by
  11. ;;; the Free Software Foundation; either version 3 of the License, or (at
  12. ;;; your option) any later version.
  13. ;;;
  14. ;;; GNU Guix is distributed in the hope that it will be useful, but
  15. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;;; GNU General Public License for more details.
  18. ;;;
  19. ;;; You should have received a copy of the GNU General Public License
  20. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  21. (define-module (gnu packages enchant)
  22. #:use-module (gnu packages)
  23. #:use-module (gnu packages aspell)
  24. #:use-module (gnu packages boost)
  25. #:use-module (gnu packages check)
  26. #:use-module (gnu packages glib)
  27. #:use-module (gnu packages icu4c)
  28. #:use-module (gnu packages libreoffice)
  29. #:use-module (gnu packages man)
  30. #:use-module (gnu packages perl)
  31. #:use-module (gnu packages pkg-config)
  32. #:use-module (gnu packages version-control)
  33. #:use-module (guix packages)
  34. #:use-module (guix git-download)
  35. #:use-module (guix download)
  36. #:use-module (guix build-system cmake)
  37. #:use-module (guix build-system gnu)
  38. #:use-module (guix build-system python)
  39. #:use-module (guix licenses)
  40. #:use-module (srfi srfi-1))
  41. (define-public nuspell
  42. (package
  43. (name "nuspell")
  44. (version "3.1.2")
  45. (source
  46. (origin
  47. (method git-fetch)
  48. (uri
  49. (git-reference
  50. (url "https://github.com/nuspell/nuspell")
  51. (commit
  52. (string-append "v" version))))
  53. (file-name
  54. (git-file-name name version))
  55. (sha256
  56. (base32 "0wbb6dwmzlsyy224y0liis0azgzwbjdvcyzc31pw1aw6vbp36na6"))))
  57. (build-system cmake-build-system)
  58. (native-inputs
  59. `(("catch" ,catch-framework2)
  60. ("git" ,git-minimal)
  61. ("perl" ,perl)
  62. ;;FIX-ME: Building with ronn fails.
  63. ;;("ronn" ,ronn)
  64. ("pkg-config" ,pkg-config)))
  65. (inputs
  66. `(("boost" ,boost)))
  67. (propagated-inputs
  68. `(("icu4c" ,icu4c)))
  69. (synopsis "Fast and safe spellchecking C++ library")
  70. (description "Nuspell is a fast and safe spelling checker software
  71. program. It is designed for languages with rich morphology and complex word
  72. compounding. Nuspell is written in modern C++ and it supports Hunspell
  73. dictionaries.")
  74. (home-page "https://nuspell.github.io/")
  75. (license lgpl3+)))
  76. (define-public enchant
  77. (package
  78. (name "enchant")
  79. (version "2.2.15")
  80. (source (origin
  81. (method url-fetch)
  82. (uri (string-append "https://github.com/AbiWord/enchant/releases"
  83. "/download/v" version "/enchant-"
  84. version ".tar.gz"))
  85. (sha256
  86. (base32
  87. "00vcykbb7lxh51prvmsb62a06q18a6rlk9ba5a7g45c1awaj43rv"))))
  88. (build-system gnu-build-system)
  89. (arguments
  90. '(#:configure-flags '("--disable-static"
  91. ;; Tests require a relocatable build.
  92. "--enable-relocatable")))
  93. (inputs
  94. `(("aspell" ,aspell)
  95. ("hunspell" ,hunspell)))
  96. (propagated-inputs
  97. ;; Required by enchant.pc.
  98. `(("glib" ,glib)))
  99. (native-inputs
  100. `(("glib:bin" ,glib "bin")
  101. ("pkg-config" ,pkg-config)
  102. ("unittest-cpp" ,unittest-cpp)))
  103. (synopsis "Multi-backend spell-checking library wrapper")
  104. (description
  105. "On the surface, Enchant appears to be a generic spell checking library.
  106. Looking closer, you'll see the Enchant is more-or-less a fancy wrapper around
  107. the dlopen() system call.
  108. Enchant steps in to provide uniformity and conformity on top of these libraries,
  109. and implement certain features that may be lacking in any individual provider
  110. library. Everything should \"just work\" for any and every definition of \"just
  111. working\".")
  112. (home-page "https://abiword.github.io/enchant/")
  113. (license lgpl2.1+)))
  114. ;; Some packages are not ready for the 2.x API yet, so we keep this version
  115. ;; around. The library and executables of Enchant 2 have been designed not to
  116. ;; conflict with 1.x, so it's OK if both end up in the same profile.
  117. (define-public enchant-1.6
  118. (package
  119. (inherit enchant)
  120. (version "1.6.0")
  121. (arguments '(#:configure-flags '("--disable-static")))
  122. (native-inputs (alist-delete "unittest-cpp"
  123. (package-native-inputs enchant)))
  124. (source (origin
  125. (method url-fetch)
  126. (uri (string-append "http://www.abisource.com/downloads/enchant/"
  127. version "/enchant-" version ".tar.gz"))
  128. (sha256
  129. (base32
  130. "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g"))))))
  131. (define-public python-pyenchant
  132. (package
  133. (name "python-pyenchant")
  134. (version "2.0.0")
  135. (source (origin
  136. (method url-fetch)
  137. (uri (pypi-uri "pyenchant" version))
  138. (sha256
  139. (base32
  140. "1872ckgdip8nj9rnh167m0gsj5754qfg2hjxzsl1s06f5akwscgw"))))
  141. (build-system python-build-system)
  142. (arguments
  143. `(#:tests? #f; FIXME: Dictionary for language 'en_US' could not be found
  144. #:phases
  145. (modify-phases %standard-phases
  146. (add-before 'build 'setlib
  147. (lambda* (#:key inputs #:allow-other-keys)
  148. (substitute* "enchant/_enchant.py"
  149. (("/opt/local/lib/libenchant.dylib\"")
  150. (string-append "/opt/local/lib/libenchant.dylib\"\n"
  151. " yield \"" (assoc-ref inputs "enchant")
  152. "/lib/libenchant-2.so\""))))))))
  153. (inputs
  154. `(("enchant" ,enchant)))
  155. (home-page "https://github.com/pyenchant/pyenchant")
  156. (synopsis "Spellchecking library for Python")
  157. (description "PyEnchant is a spellchecking library for Python, based on the
  158. Enchant library. PyEnchant combines all the functionality of the underlying
  159. Enchant library with the flexibility of Python. It also provides some
  160. higher-level functionality than is available in the C API.")
  161. (license lgpl2.1+)))