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