Correct name and Email for ng0.
[jackhill/guix/guix.git] / gnu / packages / textutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
5 ;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
6 ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
7 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
10 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
11 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
12 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
13 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
16 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages textutils)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix build-system ant)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system go)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages java)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages slang))
54
55 (define-public dos2unix
56 (package
57 (name "dos2unix")
58 (version "7.4.0")
59 (source
60 (origin
61 (method url-fetch)
62 (uri (string-append "https://waterlan.home.xs4all.nl/" name "/"
63 name "-" version ".tar.gz"))
64 (sha256
65 (base32 "12h4c61g376bhq03y5g2xszkrkrj5hwd928rly3xsp6rvfmnbixs"))))
66 (build-system gnu-build-system)
67 (arguments
68 '(#:make-flags (list "CC=gcc"
69 (string-append "prefix=" (assoc-ref %outputs "out")))
70 #:phases
71 (modify-phases %standard-phases
72 (delete 'configure)))) ; no configure script
73 (native-inputs
74 `(("gettext" ,gettext-minimal)
75 ("perl" ,perl)))
76 (home-page "https://waterlan.home.xs4all.nl/dos2unix.html")
77 (synopsis "DOS/Mac to Unix and vice versa text file format converter")
78 (description
79 "dos2unix is a tool to convert line breaks in a text file from Unix format
80 to DOS format and vice versa.")
81 (license license:bsd-2)))
82
83 (define-public recode
84 (package
85 (name "recode")
86 (version "3.7")
87 (source
88 (origin
89 (method url-fetch)
90 (uri (string-append "https://github.com/rrthomas/recode/releases/"
91 "download/v" version "/" name "-" version ".tar.gz"))
92 (sha256
93 (base32
94 "0r4yhf7i7zp2nl2apyzz7r3i2in12n385hmr8zcfr18ly0ly530q"))
95 (modules '((guix build utils)))
96 (snippet
97 `(begin
98 (delete-file "tests/Recode.c")
99 #t))))
100 (build-system gnu-build-system)
101 (native-inputs
102 `(("python" ,python-2)
103 ("python2-cython" ,python2-cython)))
104 (home-page "https://github.com/rrthomas/recode")
105 (synopsis "Text encoding converter")
106 (description "The Recode library converts files between character sets and
107 usages. It recognises or produces over 200 different character sets (or about
108 300 if combined with an iconv library) and transliterates files between almost
109 any pair. When exact transliteration are not possible, it gets rid of
110 offending characters or falls back on approximations. The recode program is a
111 handy front-end to the library.")
112 (license license:gpl3+)))
113
114 (define-public enca
115 (package
116 (name "enca")
117 (version "1.19")
118 (source
119 (origin
120 (method url-fetch)
121 (uri (string-append
122 "https://github.com/nijel/enca/archive/" version ".tar.gz"))
123 (sha256
124 (base32 "099z526i7qgij7q1w3lvhl88iv3jc3nqxca2i09h6s08ghyrmzf4"))
125 (file-name (string-append name "-" version ".tar.gz"))))
126 (build-system gnu-build-system)
127 ;; enca-1.19 tests fail with recent recode.
128 ;(inputs `(("recode" ,recode)))
129 (home-page "https://github.com/nijel/enca")
130 (synopsis "Text encoding detection tool")
131 (description "Enca (Extremely Naive Charset Analyser) consists of libenca,
132 an encoding detection library, and enca, a command line frontend, integrating
133 libenca and several charset conversion libraries and tools.")
134 (license license:gpl2)))
135
136 (define-public utf8proc
137 (package
138 (name "utf8proc")
139 (version "2.1.0")
140 (source
141 (origin
142 (method url-fetch)
143 (uri (string-append
144 "https://github.com/JuliaLang/utf8proc/archive/v"
145 version ".tar.gz"))
146 (file-name (string-append name "-" version ".tar.gz"))
147 (sha256
148 (base32 "0q1jhdkk4f9b0zb8s2ql3sba3br5nvjsmbsaybmgj064k9hwbk15"))))
149 (build-system gnu-build-system)
150 (inputs ;test data that is otherwise downloaded with curl
151 `(("NormalizationTest.txt"
152 ,(origin
153 (method url-fetch)
154 (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
155 "NormalizationTest.txt"))
156 (sha256
157 (base32 "1fxrz0bilsbwl685336aqi88k62i6nqhm62rvy4zhg3bcm4dhj1d"))))
158 ("GraphemeBreakTest.txt"
159 ,(origin
160 (method url-fetch)
161 (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
162 "auxiliary/GraphemeBreakTest.txt"))
163 (sha256
164 (base32 "0qbhyhmf0778lc2hcwlpizrvmdxwpk959v2q2wb8abv09ba7wvn7"))))))
165 (arguments
166 '(#:make-flags (list "CC=gcc"
167 (string-append "prefix=" (assoc-ref %outputs "out")))
168 #:phases
169 (modify-phases %standard-phases
170 (delete 'configure)
171 (add-before 'check 'check-data
172 (lambda* (#:key inputs #:allow-other-keys)
173 (for-each (lambda (i)
174 (copy-file (assoc-ref inputs i)
175 (string-append "data/" i)))
176 '("NormalizationTest.txt" "GraphemeBreakTest.txt"))
177 (substitute* "data/GraphemeBreakTest.txt"
178 (("÷") "/")
179 (("×") "+")))))))
180 (home-page "http://julialang.org/utf8proc/")
181 (synopsis "C library for processing UTF-8 Unicode data")
182 (description "utf8proc is a small C library that provides Unicode
183 normalization, case-folding, and other operations for data in the UTF-8
184 encoding, supporting Unicode version 9.0.0.")
185 (license license:expat)))
186
187 (define-public libgtextutils
188 (package
189 (name "libgtextutils")
190 (version "0.7")
191 (source
192 (origin
193 (method url-fetch)
194 (uri (string-append
195 "https://github.com/agordon/libgtextutils/releases/download/"
196 version "/libgtextutils-" version ".tar.gz"))
197 (sha256
198 (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
199 (build-system gnu-build-system)
200 (arguments
201 '(#:phases
202 (modify-phases %standard-phases
203 (add-after 'unpack 'autoreconf
204 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
205 (native-inputs
206 `(("autoconf" ,autoconf)
207 ("automake" ,automake)
208 ("libtool" ,libtool)))
209 (home-page "https://github.com/agordon/libgtextutils")
210 (synopsis "Gordon's text utils library")
211 (description
212 "libgtextutils is a text utilities library used by the fastx toolkit from
213 the Hannon Lab.")
214 (license license:agpl3+)))
215
216 (define-public cityhash
217 (let ((commit "8af9b8c"))
218 (package
219 (name "cityhash")
220 (version (string-append "1.1-2." commit))
221 (source (origin
222 (method git-fetch)
223 (uri (git-reference
224 (url "https://github.com/google/cityhash.git")
225 (commit commit)))
226 (file-name (string-append name "-" version ".tar.gz"))
227 (sha256
228 (base32
229 "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
230 (build-system gnu-build-system)
231 (arguments
232 '(#:make-flags (list "CXXFLAGS=-g -O3")
233 #:phases
234 (modify-phases %standard-phases
235 ;; citycrc is not installed by default but is used by some
236 ;; programs.
237 (add-after 'install 'install-citycrc
238 (lambda* (#:key outputs #:allow-other-keys)
239 (let* ((out (assoc-ref outputs "out"))
240 (include (string-append out "/include")))
241 (install-file "src/citycrc.h" include))
242 #t)))))
243 (home-page "https://github.com/google/cityhash")
244 (synopsis "C++ hash functions for strings")
245 (description
246 "CityHash provides hash functions for strings. The functions mix the
247 input bits thoroughly but are not suitable for cryptography.")
248 (license license:expat))))
249
250 (define-public ustr
251 (package
252 (name "ustr")
253 (version "1.0.4")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append "http://www.and.org/ustr/" version
257 "/ustr-" version ".tar.bz2"))
258 (sha256
259 (base32
260 "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))
261 (patches (search-patches "ustr-fix-build-with-gcc-5.patch"))))
262 (build-system gnu-build-system)
263 (arguments
264 `(#:make-flags
265 (list "CC=gcc"
266 "HIDE="
267 ;; Override "/sbin/ldconfig" with "echo" because we don't need
268 ;; "ldconfig".
269 "LDCONFIG=echo"
270 (string-append "prefix=" (assoc-ref %outputs "out"))
271 "all-shared")
272 #:phases
273 (modify-phases %standard-phases
274 (add-after 'unpack 'disable-check-for-stdint
275 (lambda _
276 ;; Of course we have stdint.h, just not in /usr/include
277 (substitute* '("Makefile"
278 "ustr-import.in")
279 (("-f \"/usr/include/stdint.h\"") "-z \"\""))
280 #t))
281 ;; No configure script
282 (delete 'configure))))
283 (home-page "http://www.and.org/ustr/")
284 (synopsis "String library with very low memory overhead")
285 (description
286 "Ustr is a string library for C with very low memory overhead.")
287 ;; Quoted from the home page: "The License for the code is MIT, new-BSD,
288 ;; LGPL, etc. ... if you need another license to help compatibility, just
289 ;; ask for it. It's basically public domain, without all the legal
290 ;; problems for everyone that trying to make something public domain
291 ;; entails."
292 (license license:public-domain)))
293
294 (define-public libconfig
295 (package
296 (name "libconfig")
297 (version "1.5")
298 (source (origin
299 (method url-fetch)
300 (uri (string-append "http://www.hyperrealm.com/libconfig/"
301 "libconfig-" version ".tar.gz"))
302 (sha256
303 (base32
304 "1xh3hzk63v4y8815lc5209m3s6ms2cpgw4h5hg462i4f1lwsl7g3"))))
305 (build-system gnu-build-system)
306 (home-page "http://www.hyperrealm.com/libconfig/")
307 (synopsis "C/C++ configuration file library")
308 (description
309 "Libconfig is a simple library for manipulating structured configuration
310 files. This file format is more compact and more readable than XML. And
311 unlike XML, it is type-aware, so it is not necessary to do string parsing in
312 application code.")
313 (license license:lgpl2.1+)))
314
315 (define-public pfff
316 (package
317 (name "pfff")
318 (version "1.0")
319 (source (origin
320 (method url-fetch)
321 (uri (string-append "https://github.com/pfff/pfff/archive/v"
322 version ".tar.gz"))
323 (file-name (string-append name "-" version ".tar.gz"))
324 (sha256
325 (base32
326 "00m553aa277iarxj6dalmklyb64r7ias49bfwzbacsfg8h3kar8m"))))
327 (build-system cmake-build-system)
328 (home-page "http://biit.cs.ut.ee/pfff/")
329 (synopsis "Probabilistic fast file fingerprinting tool")
330 (description
331 "pfff is a tool for calculating a compact digital fingerprint of a file
332 by sampling randomly from the file instead of reading it in full.
333 Consequently, the computation has a flat performance characteristic,
334 correlated with data variation rather than file size. pfff can be as reliable
335 as existing hashing techniques, with provably negligible risk of collisions.")
336 (license license:bsd-3)))
337
338 (define-public oniguruma
339 (package
340 (name "oniguruma")
341 (version "5.9.6")
342 (source (origin
343 (method url-fetch)
344 (uri (string-append "https://github.com/kkos/"
345 "oniguruma/releases/download/v" version
346 "/onig-" version ".tar.gz"))
347 (sha256
348 (base32
349 "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m"))))
350 (build-system gnu-build-system)
351 (home-page "https://github.com/kkos/oniguruma")
352 (synopsis "Regular expression library")
353 (description "Oniguruma is a regular expressions library. The special
354 characteristic of this library is that different character encoding for every
355 regular expression object can be specified.")
356 (license license:bsd-2)))
357
358 (define-public antiword
359 (package
360 (name "antiword")
361 (version "0.37")
362 (source (origin
363 (method url-fetch)
364 (uri (string-append "http://www.winfield.demon.nl/linux"
365 "/antiword-" version ".tar.gz"))
366 (sha256
367 (base32
368 "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))
369 (patches (search-patches "antiword-CVE-2014-8123.patch"))))
370 (build-system gnu-build-system)
371 (arguments
372 `(#:tests? #f ; There are no tests
373 #:make-flags
374 (list "-f" "Makefile.Linux"
375 (string-append "GLOBAL_INSTALL_DIR="
376 (assoc-ref %outputs "out") "/bin")
377 (string-append "GLOBAL_RESOURCES_DIR="
378 (assoc-ref %outputs "out") "/share/antiword"))
379 #:phases
380 (modify-phases %standard-phases
381 (replace 'configure
382 (lambda* (#:key outputs #:allow-other-keys)
383 ;; Ensure that mapping files can be found in the actual package
384 ;; data directory.
385 (substitute* "antiword.h"
386 (("/usr/share/antiword")
387 (string-append (assoc-ref outputs "out") "/share/antiword")))
388 #t))
389 (replace 'install
390 (lambda* (#:key make-flags #:allow-other-keys)
391 (zero? (apply system* "make" `("global_install" ,@make-flags))))))))
392 (home-page "http://www.winfield.demon.nl/")
393 (synopsis "Microsoft Word document reader")
394 (description "Antiword is an application for displaying Microsoft Word
395 documents. It can also convert the document to PostScript or XML. Only
396 documents made by MS Word version 2 and version 6 or later are supported. The
397 name comes from: \"The antidote against people who send Microsoft Word files
398 to everybody, because they believe that everybody runs Windows and therefore
399 runs Word\".")
400 (license license:gpl2+)))
401
402 (define-public catdoc
403 (package
404 (name "catdoc")
405 (version "0.95")
406 (source (origin
407 (method url-fetch)
408 (uri (string-append "http://ftp.wagner.pp.ru/pub/catdoc/"
409 "catdoc-" version ".tar.gz"))
410 (patches (search-patches "catdoc-CVE-2017-11110.patch"))
411 (sha256
412 (base32
413 "15h7v3bmwfk4z8r78xs5ih6vd0pskn0rj90xghvbzdjj0cc88jji"))))
414 (build-system gnu-build-system)
415 ;; TODO: Also build `wordview` which requires `tk` – make a separate
416 ;; package for this.
417 (arguments
418 '(#:tests? #f ; There are no tests
419 #:configure-flags '("--disable-wordview")
420 #:phases
421 (modify-phases %standard-phases
422 (add-before 'install 'fix-install
423 (lambda* (#:key outputs #:allow-other-keys)
424 (let ((out (assoc-ref outputs "out")))
425 (mkdir-p (string-append out "/share/man/man1"))))))))
426 (home-page "http://www.wagner.pp.ru/~vitus/software/catdoc/")
427 (synopsis "MS-Word to TeX or plain text converter")
428 (description "@command{catdoc} extracts text from MS-Word files, trying to
429 preserve as many special printable characters as possible. It supports
430 everything up to Word-97. Also supported are MS Write documents and RTF files.
431
432 @command{catdoc} does not preserve complex word formatting, but it can
433 translate some non-ASCII characters into TeX escape codes. It's goal is to
434 extract plain text and allow you to read it and, probably, reformat with TeX,
435 according to TeXnical rules.
436
437 This package also provides @command{xls2csv}, which extracts data from Excel
438 spreadsheets and outputs it in comma-separated-value format, and
439 @command{catppt}, which extracts data from PowerPoint presentations.")
440 (license license:gpl2+)))
441
442 (define-public utfcpp
443 (package
444 (name "utfcpp")
445 (version "2.3.5")
446 (source (origin
447 (method url-fetch)
448 (uri
449 (string-append "https://github.com/nemtrif/utfcpp/archive/v"
450 version ".tar.gz"))
451 (file-name (string-append name "-" version ".tar.gz"))
452 (sha256
453 (base32
454 "0gcqcfw19kfim8xw29xdp91l310yfjyrqdj2zsx8xx02dkpy1zzk"))))
455 (build-system cmake-build-system)
456 (arguments
457 `(#:out-of-source? #f
458 #:phases
459 (modify-phases %standard-phases
460 (replace 'install ; no install target
461 (lambda* (#:key outputs #:allow-other-keys)
462 (let* ((out (assoc-ref outputs "out"))
463 (include (string-append out "/include"))
464 (doc (string-append out "/share/doc/" ,name)))
465 (copy-recursively "source" include)
466 (install-file "README.md" doc)
467 #t))))))
468 (home-page "https://github.com/nemtrif/utfcpp")
469 (synopsis "Portable C++ library for handling UTF-8")
470 (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
471 in a portable way.")
472 (license license:boost1.0)))
473
474 (define-public dbacl
475 (package
476 (name "dbacl")
477 (version "1.14")
478 (source
479 (origin
480 (method url-fetch)
481 (uri (string-append "http://www.lbreyer.com/gpl/"
482 name "-" version ".tar.gz"))
483 (sha256
484 (base32
485 "0224g6x71hyvy7jikfxmgcwww1r5lvk0jx36cva319cb9nmrbrq7"))))
486 (build-system gnu-build-system)
487 (arguments
488 `(#:make-flags
489 (list
490 (string-append "-I" (assoc-ref %build-inputs "slang")
491 "/include/slang")
492 (string-append "-I" (assoc-ref %build-inputs "ncurses")
493 "/include/ncurses"))
494 #:phases
495 (modify-phases %standard-phases
496 (add-after 'unpack 'delete-sample6-and-japanese
497 (lambda _
498 (substitute* "doc/Makefile.am"
499 (("sample6.txt") "")
500 (("japanese.txt") ""))
501 (delete-file "doc/sample6.txt")
502 (delete-file "doc/japanese.txt")
503 (substitute* (list "src/tests/Makefile.am"
504 "src/tests/Makefile.in")
505 (("dbacl-jap.shin") "")
506 (("dbacl-jap.sh") ""))
507 #t))
508 (add-after 'unpack 'delete-test
509 ;; See comments about the license.
510 (lambda _
511 (delete-file "src/tests/dbacl-jap.shin")
512 #t))
513 (add-after 'delete-sample6-and-japanese 'autoreconf
514 (lambda _
515 (invoke "autoreconf" "-vif")
516 #t))
517 (add-after 'unpack 'fix-test-files
518 (lambda* (#:key inputs outputs #:allow-other-keys)
519 (let* ((out (assoc-ref outputs "out"))
520 (bin (string-append out "/bin")))
521 (substitute* (find-files "src/tests/" "\\.shin$")
522 (("PATH=/bin:/usr/bin")
523 "#PATH=/bin:/usr/bin")
524 (("diff") (string-append (which "diff")))
525 (("tr") (string-append (which "tr"))))
526 #t))))))
527 (inputs
528 `(("ncurses" ,ncurses)
529 ("perl" ,perl)
530 ("readline" ,readline)
531 ("slang" ,slang)))
532 (native-inputs
533 `(("libtool" ,libtool)
534 ("autoconf" ,autoconf)
535 ("automake" ,automake)
536 ("pkg-config" ,pkg-config)))
537 (home-page "https://www.lbreyer.com/dbacl.html")
538 (synopsis "Bayesian text and email classifier")
539 (description
540 "dbacl is a fast Bayesian text and email classifier. It builds a variety
541 of language models using maximum entropy (minimum divergence) principles, and
542 these can then be used to categorize input data automatically among multiple
543 categories.")
544 ;; The software is licensed as GPLv3 or later, but
545 ;; includes various sample texts in the doc dir:
546 ;; - sample1.txt, sample3 and sampe5.txt are in the public domain,
547 ;; by Mark Twain.
548 ;; - sample2.txt, sample4.txt are in the public domain, by Aristotle.
549 ;; - sample6.txt is a forwarded email, copyright unknown.
550 ;; Guix does exclude sample6.txt.
551 ;; - japanese.txt is a Japanese unoffical translation of the
552 ;; GNU General Public License, (c) by the Free Software Foundation.
553 ;; Guix excludes this file.
554 (license (list license:gpl3+ license:public-domain))))
555
556 (define-public dotconf
557 (package
558 (name "dotconf")
559 (version "1.3")
560 (source (origin
561 (method url-fetch)
562 (uri (string-append
563 "https://github.com/williamh/dotconf/archive/v"
564 version ".tar.gz"))
565 (file-name (string-append name "-" version ".tar.gz"))
566 (sha256
567 (base32
568 "0lsnh0yaw44psmx59hq94cj1932gscp5h8d3cnh05l0svr0cy7kz"))))
569 (build-system gnu-build-system)
570 (arguments
571 `(#:tests? #f ; FIXME maketest.sh does not work.
572 #:phases
573 (modify-phases %standard-phases
574 (add-after 'unpack 'autoreconf
575 (lambda _
576 (zero? (system* "autoreconf" "-vif")))))))
577 (native-inputs
578 `(("autoconf" ,autoconf)
579 ("automake" ,automake)
580 ("libtool" ,libtool)))
581 (home-page "https://github.com/williamh/dotconf")
582 (synopsis "Configuration file parser library")
583 (description
584 "C library for creating and parsing configuration files.")
585 (license (list license:lgpl2.1 ; Main distribution.
586 license:asl1.1)))) ; src/readdir.{c,h}
587
588 (define-public java-rsyntaxtextarea
589 (package
590 (name "java-rsyntaxtextarea")
591 (version "2.6.1")
592 (source (origin
593 (method url-fetch)
594 (uri (string-append "https://github.com/bobbylight/"
595 "RSyntaxTextArea/archive/"
596 version ".tar.gz"))
597 (file-name (string-append name "-" version ".tar.gz"))
598 (sha256
599 (base32
600 "0c5mqg2klj5rvf8fhycrli8rf6s37l9p7a8knw9gpp65r1c120q2"))))
601 (build-system ant-build-system)
602 (arguments
603 `(;; FIXME: some tests fail because locale resources cannot be found.
604 ;; Even when I add them to the class path,
605 ;; RSyntaxTextAreaEditorKitDumbCompleteWordActionTest fails.
606 #:tests? #f
607 #:jar-name "rsyntaxtextarea.jar"))
608 (native-inputs
609 `(("java-junit" ,java-junit)
610 ("java-hamcrest-core" ,java-hamcrest-core)))
611 (home-page "https://bobbylight.github.io/RSyntaxTextArea/")
612 (synopsis "Syntax highlighting text component for Java Swing")
613 (description "RSyntaxTextArea is a syntax highlighting, code folding text
614 component for Java Swing. It extends @code{JTextComponent} so it integrates
615 completely with the standard @code{javax.swing.text} package. It is fast and
616 efficient, and can be used in any application that needs to edit or view
617 source code.")
618 (license license:bsd-3)))
619
620 ;; We use the sources from git instead of the tarball from pypi, because the
621 ;; latter does not include the Cython source file from which bycython.cpp is
622 ;; generated.
623 (define-public python-editdistance
624 (let ((commit "3ea84a7dd3258c76aa3be851ef3d50e59c886846")
625 (revision "1"))
626 (package
627 (name "python-editdistance")
628 (version (string-append "0.3.1-" revision "." (string-take commit 7)))
629 (source
630 (origin
631 (method git-fetch)
632 (uri (git-reference
633 (url "https://github.com/aflc/editdistance.git")
634 (commit commit)))
635 (file-name (git-file-name name version))
636 (sha256
637 (base32
638 "1l43svsv12crvzphrgi6x435z6xg8m086c64armp8wzb4l8ccm7g"))))
639 (build-system python-build-system)
640 (arguments
641 `(#:phases
642 (modify-phases %standard-phases
643 (add-after 'unpack 'build-cython-code
644 (lambda _
645 (with-directory-excursion "editdistance"
646 (delete-file "bycython.cpp")
647 (invoke "cython" "--cplus" "bycython.pyx")))))))
648 (native-inputs
649 `(("python-cython" ,python-cython)))
650 (home-page "https://www.github.com/aflc/editdistance")
651 (synopsis "Fast implementation of the edit distance (Levenshtein distance)")
652 (description
653 "This library simply implements Levenshtein distance algorithm with C++
654 and Cython.")
655 (license license:expat))))
656
657 (define-public go-github.com-mattn-go-runewidth
658 (package
659 (name "go-github.com-mattn-go-runewidth")
660 (version "0.0.2")
661 (source (origin
662 (method git-fetch)
663 (uri (git-reference
664 (url "https://github.com/mattn/go-runewidth")
665 (commit (string-append "v" version))))
666 (file-name (git-file-name name version))
667 (sha256
668 (base32
669 "0vkrfrz3fzn5n6ix4k8s0cg0b448459sldq8bp4riavsxm932jzb"))))
670 (build-system go-build-system)
671 (arguments
672 '(#:import-path "github.com/mattn/go-runewidth"))
673 (synopsis "@code{runewidth} provides Go functions to work with string widths")
674 (description
675 "The @code{runewidth} library provides Go functions for padding,
676 measuring and checking the width of strings, with support east asian text.")
677 (home-page "https://github.com/jessevdk/go-flags")
678 (license license:expat)))