projects/guix·blob python-team · refs

175 lines · 6.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Marek Benc <[email protected]>
3;;; Copyright © 2018 Marius Bakke <[email protected]>
4;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2020 Julien Lepiller <[email protected]>
6;;; Copyright © 2025 Zheng Junjie <[email protected]>
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages enchant)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages aspell)
26 #:use-module (gnu packages boost)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages groff)
30 #:use-module (gnu packages hunspell)
31 #:use-module (gnu packages icu4c)
32 #:use-module (gnu packages man)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages python-build)
36 #:use-module (gnu packages version-control)
37 #:use-module (guix gexp)
38 #:use-module (guix packages)
39 #:use-module (guix git-download)
40 #:use-module (guix download)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system pyproject)
44 #:use-module (guix licenses)
45 #:use-module (srfi srfi-1))
46
47(define-public nuspell
48 (package
49 (name "nuspell")
50 (version "5.1.4")
51 (source
52 (origin
53 (method git-fetch)
54 (uri
55 (git-reference
56 (url "https://github.com/nuspell/nuspell")
57 (commit (string-append "v" version))))
58 (file-name (git-file-name name version))
59 (sha256
60 (base32 "05j1hmczy6v9dyxp77vxhgyl7y5hff3v45vlp86gyh7m9lgqpmra"))))
61 (build-system cmake-build-system)
62 (arguments
63 (if (%current-target-system)
64 (list #:configure-flags #~(list "-DBUILD_TESTING=OFF"))
65 '()))
66 (native-inputs (list catch2-3.5 pkg-config))
67 (propagated-inputs (list icu4c))
68 (native-search-paths (list (search-path-specification
69 (variable "DICPATH")
70 (files '("share/hunspell")))))
71 (synopsis "Fast and safe spellchecking C++ library")
72 (description "Nuspell is a fast and safe spelling checker software
73program. It is designed for languages with rich morphology and complex word
74compounding. Nuspell is written in modern C++ and it supports Hunspell
75dictionaries.")
76 (home-page "https://nuspell.github.io/")
77 (license lgpl3+)))
78
79(define-public enchant
80 (package
81 (name "enchant")
82 (version "2.6.9")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append "https://github.com/AbiWord/enchant/releases"
86 "/download/v" version "/enchant-"
87 version ".tar.gz"))
88 (sha256
89 (base32
90 "0szzxx0bvkdgahlzdbrmnngf1dzbsrpcf8psl2rl72mkr46s39fr"))))
91 (build-system gnu-build-system)
92 (arguments
93 (list
94 #:configure-flags
95 #~(list"--disable-static"
96 ;; Tests require a relocatable build.
97 "--enable-relocatable")))
98 (inputs
99 (list aspell hunspell nuspell))
100 (propagated-inputs
101 ;; Required by enchant.pc.
102 (list glib))
103 (native-inputs
104 (list `(,glib "bin") groff pkg-config unittest-cpp))
105 (synopsis "Multi-backend spell-checking library wrapper")
106 (description
107 "Enchant is a library---and command-line program---that wraps a number of
108different spelling libraries and programs with a consistent interface. By
109using Enchant, you can use a wide range of spelling libraries, including some
110specialized for particular languages, without needing to program to each
111library's interface. If it's not convenient to call a C library, you can
112access most of Enchant's functionality via the @command{enchant} program,
113which communicates over a pipe, like Ispell, and is indeed
114Ispell-compatible.")
115 (home-page "https://abiword.github.io/enchant/")
116 (license lgpl2.1+)))
117
118;; Some packages are not ready for the 2.x API yet, so we keep this version
119;; around. The library and executables of Enchant 2 have been designed not to
120;; conflict with 1.x, so it's OK if both end up in the same profile.
121(define-public enchant-1.6
122 (package
123 (inherit enchant)
124 (version "1.6.0")
125 (arguments
126 (list #:configure-flags
127 #~(list
128 ;; Add CFLAGS to relax gcc-14's strictness.
129 (string-append
130 "CFLAGS=-g -O2"
131 " -Wno-error=incompatible-pointer-types")
132 "--disable-static")))
133 (native-inputs (alist-delete "unittest-cpp"
134 (package-native-inputs enchant)))
135 (source (origin
136 (method url-fetch)
137 (uri (string-append "http://www.abisource.com/downloads/enchant/"
138 version "/enchant-" version ".tar.gz"))
139 (sha256
140 (base32
141 "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g"))))))
142
143(define-public python-pyenchant
144 (package
145 (name "python-pyenchant")
146 (version "2.0.0")
147 (source (origin
148 (method url-fetch)
149 (uri (pypi-uri "pyenchant" version))
150 (sha256
151 (base32
152 "1872ckgdip8nj9rnh167m0gsj5754qfg2hjxzsl1s06f5akwscgw"))))
153 (build-system pyproject-build-system)
154 (arguments
155 `(#:tests? #f; FIXME: Dictionary for language 'en_US' could not be found
156 #:phases
157 (modify-phases %standard-phases
158 (add-before 'build 'setlib
159 (lambda* (#:key inputs #:allow-other-keys)
160 (substitute* "enchant/_enchant.py"
161 (("/opt/local/lib/libenchant.dylib\"")
162 (string-append "/opt/local/lib/libenchant.dylib\"\n"
163 " yield \"" (assoc-ref inputs "enchant")
164 "/lib/libenchant-2.so\""))))))))
165 (inputs
166 (list enchant))
167 (native-inputs
168 (list python-setuptools python-wheel))
169 (home-page "https://github.com/pyenchant/pyenchant")
170 (synopsis "Spellchecking library for Python")
171 (description "PyEnchant is a spellchecking library for Python, based on the
172Enchant library. PyEnchant combines all the functionality of the underlying
173Enchant library with the flexibility of Python. It also provides some
174higher-level functionality than is available in the C API.")
175 (license lgpl2.1+)))